summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@qt.io>2020-06-05 09:24:37 +0200
committerLiang Qi <liang.qi@qt.io>2020-06-06 20:25:49 +0200
commit45b0f1be686cfba8dcecb9be5c875cae59c69276 (patch)
tree363dfd46575d147206267d854ce14747157f432e
parentaa81b90738ce9faee5e433617c8bd243cb238729 (diff)
Remove winrt
Macros and the await helper function from qfunctions_winrt(_p).h are needed in other Qt modules which use UWP APIs on desktop windows. Task-number: QTBUG-84434 Change-Id: Ice09c11436ad151c17bdccd2c7defadd08c13925 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
-rw-r--r--.gitignore2
-rw-r--r--config_help.txt4
-rw-r--r--configure.cmake8
-rw-r--r--configure.json8
-rw-r--r--configure.pri4
-rw-r--r--mkspecs/common/msvc-version.conf2
-rw-r--r--mkspecs/common/winrt_winphone/assets/logo_150x150.pngbin2638 -> 0 bytes
-rw-r--r--mkspecs/common/winrt_winphone/assets/logo_30x30.pngbin737 -> 0 bytes
-rw-r--r--mkspecs/common/winrt_winphone/assets/logo_310x150.pngbin2655 -> 0 bytes
-rw-r--r--mkspecs/common/winrt_winphone/assets/logo_310x310.pngbin2903 -> 0 bytes
-rw-r--r--mkspecs/common/winrt_winphone/assets/logo_44x44.pngbin1066 -> 0 bytes
-rw-r--r--mkspecs/common/winrt_winphone/assets/logo_480x800.pngbin6820 -> 0 bytes
-rw-r--r--mkspecs/common/winrt_winphone/assets/logo_620x300.pngbin5752 -> 0 bytes
-rw-r--r--mkspecs/common/winrt_winphone/assets/logo_70x70.pngbin2024 -> 0 bytes
-rw-r--r--mkspecs/common/winrt_winphone/assets/logo_71x71.pngbin1060 -> 0 bytes
-rw-r--r--mkspecs/common/winrt_winphone/assets/logo_store.pngbin1159 -> 0 bytes
-rw-r--r--mkspecs/common/winrt_winphone/manifests/10.0/AppxManifest.xml.in52
-rw-r--r--mkspecs/common/winrt_winphone/qmake.conf103
-rw-r--r--mkspecs/common/winrt_winphone/qplatformdefs.h139
-rw-r--r--mkspecs/features/configure.prf6
-rw-r--r--mkspecs/features/qt.prf9
-rw-r--r--mkspecs/features/qt_build_config.prf2
-rw-r--r--mkspecs/features/qt_configure.prf5
-rw-r--r--mkspecs/features/qt_module_pris.prf4
-rw-r--r--mkspecs/features/toolchain.prf5
-rw-r--r--mkspecs/features/winrt/console.prf5
-rw-r--r--mkspecs/features/winrt/default_pre.prf14
-rw-r--r--mkspecs/features/winrt/package_manifest.prf200
-rw-r--r--mkspecs/winrt-arm-msvc2015/qmake.conf19
-rw-r--r--mkspecs/winrt-arm-msvc2015/qplatformdefs.h40
-rw-r--r--mkspecs/winrt-arm-msvc2017/qmake.conf19
-rw-r--r--mkspecs/winrt-arm-msvc2017/qplatformdefs.h40
-rw-r--r--mkspecs/winrt-arm-msvc2019/qmake.conf19
-rw-r--r--mkspecs/winrt-arm-msvc2019/qplatformdefs.h40
-rw-r--r--mkspecs/winrt-arm64-msvc2017/qmake.conf19
-rw-r--r--mkspecs/winrt-arm64-msvc2017/qplatformdefs.h40
-rw-r--r--mkspecs/winrt-arm64-msvc2019/qmake.conf19
-rw-r--r--mkspecs/winrt-arm64-msvc2019/qplatformdefs.h40
-rw-r--r--mkspecs/winrt-x64-msvc2015/qmake.conf19
-rw-r--r--mkspecs/winrt-x64-msvc2015/qplatformdefs.h40
-rw-r--r--mkspecs/winrt-x64-msvc2017/qmake.conf19
-rw-r--r--mkspecs/winrt-x64-msvc2017/qplatformdefs.h40
-rw-r--r--mkspecs/winrt-x64-msvc2019/qmake.conf19
-rw-r--r--mkspecs/winrt-x64-msvc2019/qplatformdefs.h40
-rw-r--r--mkspecs/winrt-x86-msvc2015/qmake.conf18
-rw-r--r--mkspecs/winrt-x86-msvc2015/qplatformdefs.h40
-rw-r--r--mkspecs/winrt-x86-msvc2017/qmake.conf18
-rw-r--r--mkspecs/winrt-x86-msvc2017/qplatformdefs.h40
-rw-r--r--mkspecs/winrt-x86-msvc2019/qmake.conf18
-rw-r--r--mkspecs/winrt-x86-msvc2019/qplatformdefs.h40
-rw-r--r--qmake/doc/src/qmake-manual.qdoc169
-rw-r--r--qmake/generators/win32/msbuild_objectmodel.cpp52
-rw-r--r--qmake/generators/win32/msvc_objectmodel.cpp3
-rw-r--r--qmake/generators/win32/msvc_objectmodel.h1
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp148
-rw-r--r--src/3rdparty/libjpeg.pri2
-rw-r--r--src/3rdparty/libpng/pngpriv.h5
-rw-r--r--src/3rdparty/libpng/qtpatches.diff5
-rw-r--r--src/3rdparty/pcre2/CMakeLists.txt2
-rw-r--r--src/3rdparty/pcre2/pcre2.pro2
-rw-r--r--src/3rdparty/sqlite.pri6
-rw-r--r--src/corelib/.prev_CMakeLists.txt76
-rw-r--r--src/corelib/CMakeLists.txt76
-rw-r--r--src/corelib/configure.cmake5
-rw-r--r--src/corelib/configure.json5
-rw-r--r--src/corelib/corelib.pro2
-rw-r--r--src/corelib/global/archdetect.cpp2
-rw-r--r--src/corelib/global/qglobal.cpp37
-rw-r--r--src/corelib/global/qlibraryinfo.cpp8
-rw-r--r--src/corelib/global/qlogging.cpp11
-rw-r--r--src/corelib/global/qoperatingsystemversion_win.cpp33
-rw-r--r--src/corelib/global/qprocessordetection.h3
-rw-r--r--src/corelib/global/qrandom.cpp10
-rw-r--r--src/corelib/global/qsystemdetection.h16
-rw-r--r--src/corelib/io/io.pri46
-rw-r--r--src/corelib/io/qdir.cpp15
-rw-r--r--src/corelib/io/qfileinfo.cpp2
-rw-r--r--src/corelib/io/qfileselector.cpp3
-rw-r--r--src/corelib/io/qfilesystemengine_win.cpp185
-rw-r--r--src/corelib/io/qfilesystementry.cpp14
-rw-r--r--src/corelib/io/qfilesystemmetadata_p.h4
-rw-r--r--src/corelib/io/qfilesystemwatcher.cpp8
-rw-r--r--src/corelib/io/qfilesystemwatcher_p.h4
-rw-r--r--src/corelib/io/qfilesystemwatcher_win.cpp10
-rw-r--r--src/corelib/io/qfilesystemwatcher_win_p.h2
-rw-r--r--src/corelib/io/qfsfileengine_win.cpp59
-rw-r--r--src/corelib/io/qlockfile_win.cpp21
-rw-r--r--src/corelib/io/qprocess.cpp3
-rw-r--r--src/corelib/io/qsettings.cpp63
-rw-r--r--src/corelib/io/qsettings_p.h4
-rw-r--r--src/corelib/io/qsettings_winrt.cpp690
-rw-r--r--src/corelib/io/qstandardpaths_winrt.cpp138
-rw-r--r--src/corelib/io/qstorageinfo_p.h2
-rw-r--r--src/corelib/io/qstorageinfo_stub.cpp67
-rw-r--r--src/corelib/io/qtemporaryfile.cpp9
-rw-r--r--src/corelib/kernel/kernel.pri28
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp38
-rw-r--r--src/corelib/kernel/qcoreapplication_p.h2
-rw-r--r--src/corelib/kernel/qcoreapplication_win.cpp42
-rw-r--r--src/corelib/kernel/qcorecmdlineargs_p.h12
-rw-r--r--src/corelib/kernel/qeventdispatcher_winrt.cpp656
-rw-r--r--src/corelib/kernel/qeventdispatcher_winrt_p.h113
-rw-r--r--src/corelib/kernel/qfunctions_fake_env_p.h130
-rw-r--r--src/corelib/kernel/qfunctions_p.h2
-rw-r--r--src/corelib/kernel/qfunctions_winrt.cpp58
-rw-r--r--src/corelib/kernel/qfunctions_winrt_p.h (renamed from src/corelib/kernel/qfunctions_winrt.h)110
-rw-r--r--src/corelib/kernel/qsharedmemory_win.cpp13
-rw-r--r--src/corelib/kernel/qsystemerror.cpp12
-rw-r--r--src/corelib/kernel/qsystemsemaphore_win.cpp6
-rw-r--r--src/corelib/kernel/qtestsupport_core.cpp4
-rw-r--r--src/corelib/kernel/qwineventnotifier.cpp21
-rw-r--r--src/corelib/plugin/qlibrary_win.cpp17
-rw-r--r--src/corelib/plugin/qsystemlibrary.cpp10
-rw-r--r--src/corelib/text/qcollator_p.h3
-rw-r--r--src/corelib/text/qlocale_win.cpp121
-rw-r--r--src/corelib/text/qstringconverter.cpp16
-rw-r--r--src/corelib/thread/qmutex_win.cpp4
-rw-r--r--src/corelib/thread/qthread.cpp2
-rw-r--r--src/corelib/thread/qthread_p.h13
-rw-r--r--src/corelib/thread/qthread_win.cpp121
-rw-r--r--src/corelib/thread/qwaitcondition_win.cpp6
-rw-r--r--src/corelib/time/qdatetime.cpp3
-rw-r--r--src/corelib/time/qtimezoneprivate_win.cpp132
-rw-r--r--src/corelib/tools/qcommandlineparser.cpp14
-rw-r--r--src/gui/.prev_CMakeLists.txt8
-rw-r--r--src/gui/CMakeLists.txt12
-rw-r--r--src/gui/accessible/accessible.pri2
-rw-r--r--src/gui/configure.cmake6
-rw-r--r--src/gui/configure.json6
-rw-r--r--src/gui/configure.pri1
-rw-r--r--src/gui/image/image.pri2
-rw-r--r--src/gui/kernel/qclipboard.cpp11
-rw-r--r--src/gui/kernel/qguiapplication.cpp4
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp4
-rw-r--r--src/gui/rhi/qrhid3d11.cpp4
-rw-r--r--src/network/.prev_CMakeLists.txt44
-rw-r--r--src/network/CMakeLists.txt44
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp8
-rw-r--r--src/network/configure.cmake10
-rw-r--r--src/network/configure.json10
-rw-r--r--src/network/kernel/kernel.pri16
-rw-r--r--src/network/kernel/qdnslookup_winrt.cpp157
-rw-r--r--src/network/kernel/qhostaddress.cpp8
-rw-r--r--src/network/kernel/qnetworkinterface_winrt.cpp245
-rw-r--r--src/network/kernel/qnetworkproxy_win.cpp8
-rw-r--r--src/network/network.pro5
-rw-r--r--src/network/socket/qabstractsocket.cpp9
-rw-r--r--src/network/socket/qabstractsocketengine.cpp4
-rw-r--r--src/network/socket/qlocalserver.cpp2
-rw-r--r--src/network/socket/qlocalsocket.cpp2
-rw-r--r--src/network/socket/qnativesocketengine.cpp2
-rw-r--r--src/network/socket/qnativesocketengine_winrt.cpp1815
-rw-r--r--src/network/socket/qnativesocketengine_winrt_p.h243
-rw-r--r--src/network/socket/socket.pri17
-rw-r--r--src/network/ssl/qssl.cpp10
-rw-r--r--src/network/ssl/qsslcertificate.cpp3
-rw-r--r--src/network/ssl/qsslcertificate_p.h11
-rw-r--r--src/network/ssl/qsslcertificate_qt.cpp2
-rw-r--r--src/network/ssl/qsslcertificate_winrt.cpp113
-rw-r--r--src/network/ssl/qsslkey_qt.cpp5
-rw-r--r--src/network/ssl/qsslkey_winrt.cpp169
-rw-r--r--src/network/ssl/qsslsocket.cpp3
-rw-r--r--src/network/ssl/qsslsocket.h2
-rw-r--r--src/network/ssl/qsslsocket_p.h4
-rw-r--r--src/network/ssl/qsslsocket_winrt.cpp682
-rw-r--r--src/network/ssl/qsslsocket_winrt_p.h110
-rw-r--r--src/network/ssl/ssl.pri10
-rw-r--r--src/platformsupport/fontdatabases/.prev_CMakeLists.txt28
-rw-r--r--src/platformsupport/fontdatabases/CMakeLists.txt28
-rw-r--r--src/platformsupport/fontdatabases/fontdatabases.pro6
-rw-r--r--src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase.cpp507
-rw-r--r--src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase_p.h92
-rw-r--r--src/platformsupport/fontdatabases/winrt/winrt.pri11
-rw-r--r--src/plugins/CMakeLists.txt2
-rw-r--r--src/plugins/imageformats/jpeg/.prev_CMakeLists.txt7
-rw-r--r--src/plugins/imageformats/jpeg/CMakeLists.txt7
-rw-r--r--src/plugins/platforms/.prev_CMakeLists.txt5
-rw-r--r--src/plugins/platforms/CMakeLists.txt5
-rw-r--r--src/plugins/platforms/minimal/qminimalintegration.cpp14
-rw-r--r--src/plugins/platforms/minimalegl/qminimaleglintegration.cpp28
-rw-r--r--src/plugins/platforms/offscreen/qoffscreenintegration.cpp8
-rw-r--r--src/plugins/platforms/platforms.pro3
-rw-r--r--src/plugins/platforms/winrt/main.cpp66
-rw-r--r--src/plugins/platforms/winrt/qwinrtbackingstore.cpp194
-rw-r--r--src/plugins/platforms/winrt/qwinrtbackingstore.h74
-rw-r--r--src/plugins/platforms/winrt/qwinrtcanvas.cpp142
-rw-r--r--src/plugins/platforms/winrt/qwinrtcanvas.h75
-rw-r--r--src/plugins/platforms/winrt/qwinrtclipboard.cpp188
-rw-r--r--src/plugins/platforms/winrt/qwinrtclipboard.h77
-rw-r--r--src/plugins/platforms/winrt/qwinrtcursor.cpp230
-rw-r--r--src/plugins/platforms/winrt/qwinrtcursor.h66
-rw-r--r--src/plugins/platforms/winrt/qwinrtdrag.cpp889
-rw-r--r--src/plugins/platforms/winrt/qwinrtdrag.h116
-rw-r--r--src/plugins/platforms/winrt/qwinrteglcontext.cpp371
-rw-r--r--src/plugins/platforms/winrt/qwinrteglcontext.h73
-rw-r--r--src/plugins/platforms/winrt/qwinrteventdispatcher.cpp66
-rw-r--r--src/plugins/platforms/winrt/qwinrteventdispatcher.h60
-rw-r--r--src/plugins/platforms/winrt/qwinrtfiledialoghelper.cpp596
-rw-r--r--src/plugins/platforms/winrt/qwinrtfiledialoghelper.h107
-rw-r--r--src/plugins/platforms/winrt/qwinrtfileengine.cpp554
-rw-r--r--src/plugins/platforms/winrt/qwinrtfileengine.h104
-rw-r--r--src/plugins/platforms/winrt/qwinrtinputcontext.cpp222
-rw-r--r--src/plugins/platforms/winrt/qwinrtinputcontext.h99
-rw-r--r--src/plugins/platforms/winrt/qwinrtintegration.cpp313
-rw-r--r--src/plugins/platforms/winrt/qwinrtintegration.h113
-rw-r--r--src/plugins/platforms/winrt/qwinrtmessagedialoghelper.cpp247
-rw-r--r--src/plugins/platforms/winrt/qwinrtmessagedialoghelper.h88
-rw-r--r--src/plugins/platforms/winrt/qwinrtscreen.cpp1543
-rw-r--r--src/plugins/platforms/winrt/qwinrtscreen.h168
-rw-r--r--src/plugins/platforms/winrt/qwinrtservices.cpp154
-rw-r--r--src/plugins/platforms/winrt/qwinrtservices.h65
-rw-r--r--src/plugins/platforms/winrt/qwinrttheme.cpp342
-rw-r--r--src/plugins/platforms/winrt/qwinrttheme.h72
-rw-r--r--src/plugins/platforms/winrt/qwinrtwindow.cpp438
-rw-r--r--src/plugins/platforms/winrt/qwinrtwindow.h86
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiaaccessibility.cpp113
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiaaccessibility.h64
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiabaseprovider.cpp76
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiabaseprovider.h72
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiacontrolmetadata.cpp182
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiacontrolmetadata.h117
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiaemptypropertyvalue.h108
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiagriditemprovider.cpp160
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiagriditemprovider.h78
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiagridprovider.cpp135
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiagridprovider.h76
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiainvokeprovider.cpp88
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiainvokeprovider.h74
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiamainprovider.cpp787
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiamainprovider.h125
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiametadatacache.cpp112
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiametadatacache.h76
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiapeervector.cpp149
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiapeervector.h80
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiaprovidercache.cpp99
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiaprovidercache.h77
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiarangevalueprovider.cpp167
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiarangevalueprovider.h80
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiaselectionitemprovider.cpp214
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiaselectionitemprovider.h78
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiaselectionprovider.cpp156
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiaselectionprovider.h76
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiatableitemprovider.cpp139
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiatableitemprovider.h75
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiatableprovider.cpp165
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiatableprovider.h76
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiatextprovider.cpp234
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiatextprovider.h83
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiatextrangeprovider.cpp498
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiatextrangeprovider.h95
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiatoggleprovider.cpp104
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiatoggleprovider.h75
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiautils.cpp182
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiautils.h83
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiavalueprovider.cpp133
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiavalueprovider.h77
-rw-r--r--src/plugins/platforms/winrt/uiautomation/uiautomation.pri45
-rw-r--r--src/plugins/platforms/winrt/winrt.json3
-rw-r--r--src/plugins/platforms/winrt/winrt.pro68
-rw-r--r--src/plugins/plugins.pro2
-rw-r--r--src/plugins/sqldrivers/sqlite/.prev_CMakeLists.txt12
-rw-r--r--src/plugins/sqldrivers/sqlite/CMakeLists.txt12
-rw-r--r--src/printsupport/CMakeLists.txt3
-rw-r--r--src/printsupport/configure.cmake2
-rw-r--r--src/printsupport/configure.json2
-rw-r--r--src/printsupport/kernel/kernel.pri6
-rw-r--r--src/printsupport/kernel/qprinter.cpp4
-rw-r--r--src/testlib/qtestblacklist.cpp5
-rw-r--r--src/testlib/qtestcase.cpp16
-rw-r--r--src/widgets/.prev_CMakeLists.txt2
-rw-r--r--src/widgets/CMakeLists.txt2
-rw-r--r--src/widgets/configure.cmake2
-rw-r--r--src/widgets/configure.json2
-rw-r--r--src/widgets/dialogs/qcolordialog.cpp2
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp3
-rw-r--r--src/widgets/dialogs/qfileinfogatherer.cpp4
-rw-r--r--src/widgets/dialogs/qfilesystemmodel.cpp10
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp4
-rw-r--r--src/widgets/itemviews/qfileiconprovider.cpp8
-rw-r--r--src/widgets/kernel/qtooltip.cpp7
-rw-r--r--src/widgets/kernel/qwidget.cpp2
-rw-r--r--src/widgets/kernel/win.pri6
-rw-r--r--src/widgets/styles/qwindowsstyle.cpp18
-rw-r--r--src/widgets/widgets/qsplashscreen.cpp4
-rw-r--r--src/winmain/.prev_CMakeLists.txt7
-rw-r--r--src/winmain/CMakeLists.txt6
-rw-r--r--src/winmain/qtmain_winrt.cpp430
-rw-r--r--src/winmain/winmain.pro10
-rw-r--r--tests/auto/.prev_CMakeLists.txt6
-rw-r--r--tests/auto/CMakeLists.txt4
-rw-r--r--tests/auto/auto.pro4
-rw-r--r--tests/auto/corelib/global/global.pro2
-rw-r--r--tests/auto/corelib/global/qgetputenv/tst_qgetputenv.cpp4
-rw-r--r--tests/auto/corelib/global/qlogging/CMakeLists.txt26
-rw-r--r--tests/auto/corelib/global/qlogging/qlogging.pro6
-rw-r--r--tests/auto/corelib/global/qlogging/test/test.pro6
-rw-r--r--tests/auto/corelib/io/.prev_CMakeLists.txt4
-rw-r--r--tests/auto/corelib/io/CMakeLists.txt4
-rw-r--r--tests/auto/corelib/io/io.pro3
-rw-r--r--tests/auto/corelib/io/largefile/tst_largefile.cpp2
-rw-r--r--tests/auto/corelib/io/qdir/tst_qdir.cpp40
-rw-r--r--tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp7
-rw-r--r--tests/auto/corelib/io/qfile/.prev_CMakeLists.txt6
-rw-r--r--tests/auto/corelib/io/qfile/CMakeLists.txt6
-rw-r--r--tests/auto/corelib/io/qfile/qfile.pro4
-rw-r--r--tests/auto/corelib/io/qfile/test.pro2
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp40
-rw-r--r--tests/auto/corelib/io/qfileinfo/CMakeLists.txt2
-rw-r--r--tests/auto/corelib/io/qfileinfo/qfileinfo.pro2
-rw-r--r--tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp63
-rw-r--r--tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp2
-rw-r--r--tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp6
-rw-r--r--tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp6
-rw-r--r--tests/auto/corelib/io/qlockfile/CMakeLists.txt2
-rw-r--r--tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp8
-rw-r--r--tests/auto/corelib/io/qlockfile/tst_qlockfile.pro2
-rw-r--r--tests/auto/corelib/io/qsettings/tst_qsettings.cpp45
-rw-r--r--tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp17
-rw-r--r--tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp4
-rw-r--r--tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp4
-rw-r--r--tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp4
-rw-r--r--tests/auto/corelib/io/qurl/tst_qurl.cpp2
-rw-r--r--tests/auto/corelib/kernel/.prev_CMakeLists.txt23
-rw-r--r--tests/auto/corelib/kernel/CMakeLists.txt20
-rw-r--r--tests/auto/corelib/kernel/kernel.pro2
-rw-r--r--tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp7
-rw-r--r--tests/auto/corelib/kernel/qeventloop/CMakeLists.txt2
-rw-r--r--tests/auto/corelib/kernel/qeventloop/qeventloop.pro2
-rw-r--r--tests/auto/corelib/kernel/qmetatype/.prev_CMakeLists.txt8
-rw-r--r--tests/auto/corelib/kernel/qmetatype/CMakeLists.txt8
-rw-r--r--tests/auto/corelib/kernel/qmetatype/qmetatype.pro7
-rw-r--r--tests/auto/corelib/kernel/qobject/CMakeLists.txt14
-rw-r--r--tests/auto/corelib/kernel/qobject/qobject.pro4
-rw-r--r--tests/auto/corelib/kernel/qobject/tst_qobject.cpp3
-rw-r--r--tests/auto/corelib/kernel/qsharedmemory/.prev_CMakeLists.txt23
-rw-r--r--tests/auto/corelib/kernel/qsharedmemory/CMakeLists.txt14
-rw-r--r--tests/auto/corelib/kernel/qsharedmemory/qsharedmemory.pro4
-rw-r--r--tests/auto/corelib/kernel/qsocketnotifier/tst_qsocketnotifier.cpp17
-rw-r--r--tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp6
-rw-r--r--tests/auto/corelib/plugin/qfactoryloader/plugin1/CMakeLists.txt6
-rw-r--r--tests/auto/corelib/plugin/qfactoryloader/plugin1/plugin1.pro1
-rw-r--r--tests/auto/corelib/plugin/qfactoryloader/plugin2/CMakeLists.txt6
-rw-r--r--tests/auto/corelib/plugin/qfactoryloader/plugin2/plugin2.pro1
-rw-r--r--tests/auto/corelib/plugin/qfactoryloader/winrt.pri9
-rw-r--r--tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp8
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/lib/.prev_CMakeLists.txt6
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/lib/CMakeLists.txt6
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/lib/lib.pro1
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/theplugin/CMakeLists.txt9
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/theplugin/theplugin.pro1
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/winrt.pri9
-rw-r--r--tests/auto/corelib/serialization/qtextstream/BLACKLIST1
-rw-r--r--tests/auto/corelib/text/qlocale/CMakeLists.txt4
-rw-r--r--tests/auto/corelib/text/qlocale/qlocale.pro4
-rw-r--r--tests/auto/corelib/text/qlocale/test/CMakeLists.txt2
-rw-r--r--tests/auto/corelib/text/qlocale/test/test.pro2
-rw-r--r--tests/auto/corelib/text/qlocale/tst_qlocale.cpp6
-rw-r--r--tests/auto/corelib/text/qregularexpression/tst_qregularexpression.cpp4
-rw-r--r--tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp6
-rw-r--r--tests/auto/corelib/thread/qthread/tst_qthread.cpp10
-rw-r--r--tests/auto/corelib/thread/qthreadstorage/CMakeLists.txt2
-rw-r--r--tests/auto/corelib/thread/qthreadstorage/qthreadstorage.pro2
-rw-r--r--tests/auto/corelib/thread/qthreadstorage/test/test.pro6
-rw-r--r--tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp12
-rw-r--r--tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp3
-rw-r--r--tests/auto/gui/.prev_CMakeLists.txt2
-rw-r--r--tests/auto/gui/CMakeLists.txt6
-rw-r--r--tests/auto/gui/gui.pro2
-rw-r--r--tests/auto/gui/image/qimage/CMakeLists.txt2
-rw-r--r--tests/auto/gui/image/qimage/qimage.pro2
-rw-r--r--tests/auto/gui/image/qimage/tst_qimage.cpp10
-rw-r--r--tests/auto/gui/image/qpixmap/CMakeLists.txt2
-rw-r--r--tests/auto/gui/image/qpixmap/qpixmap.pro2
-rw-r--r--tests/auto/gui/image/qpixmap/tst_qpixmap.cpp6
-rw-r--r--tests/auto/gui/kernel/CMakeLists.txt2
-rw-r--r--tests/auto/gui/kernel/kernel.pro2
-rw-r--r--tests/auto/gui/kernel/noqteventloop/CMakeLists.txt2
-rw-r--r--tests/auto/gui/kernel/noqteventloop/noqteventloop.pro2
-rw-r--r--tests/auto/gui/kernel/qclipboard/CMakeLists.txt6
-rw-r--r--tests/auto/gui/kernel/qclipboard/qclipboard.pro2
-rw-r--r--tests/auto/gui/kernel/qclipboard/test/.prev_CMakeLists.txt2
-rw-r--r--tests/auto/gui/kernel/qclipboard/test/CMakeLists.txt2
-rw-r--r--tests/auto/gui/kernel/qclipboard/test/test.pro2
-rw-r--r--tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp6
-rw-r--r--tests/auto/gui/kernel/qguieventdispatcher/BLACKLIST3
-rw-r--r--tests/auto/gui/kernel/qguieventloop/.prev_CMakeLists.txt2
-rw-r--r--tests/auto/gui/kernel/qguieventloop/CMakeLists.txt2
-rw-r--r--tests/auto/gui/kernel/qopenglwindow/BLACKLIST6
-rw-r--r--tests/auto/gui/kernel/qwindow/BLACKLIST1
-rw-r--r--tests/auto/gui/kernel/qwindow/CMakeLists.txt2
-rw-r--r--tests/auto/gui/kernel/qwindow/qwindow.pro2
-rw-r--r--tests/auto/gui/kernel/qwindow/tst_qwindow.cpp39
-rw-r--r--tests/auto/gui/rhi/qrhi/data/buildshaders.bat3
-rw-r--r--tests/auto/gui/rhi/qrhi/tst_qrhi.cpp10
-rw-r--r--tests/auto/gui/text/qcssparser/tst_qcssparser.cpp2
-rw-r--r--tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp3
-rw-r--r--tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp12
-rw-r--r--tests/auto/gui/text/qtextdocumentlayout/tst_qtextdocumentlayout.cpp4
-rw-r--r--tests/auto/gui/text/qtextmarkdownwriter/BLACKLIST1
-rw-r--r--tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp2
-rw-r--r--tests/auto/network/access/qnetworkreply/BLACKLIST2
-rw-r--r--tests/auto/network/access/qnetworkreply/CMakeLists.txt5
-rw-r--r--tests/auto/network/access/qnetworkreply/qnetworkreply.pro2
-rw-r--r--tests/auto/network/access/qnetworkreply/test/.prev_CMakeLists.txt2
-rw-r--r--tests/auto/network/access/qnetworkreply/test/CMakeLists.txt2
-rw-r--r--tests/auto/network/access/qnetworkreply/test/test.pro2
-rw-r--r--tests/auto/network/kernel/CMakeLists.txt5
-rw-r--r--tests/auto/network/kernel/kernel.pro4
-rw-r--r--tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp6
-rw-r--r--tests/auto/network/kernel/qhostinfo/CMakeLists.txt3
-rw-r--r--tests/auto/network/kernel/qhostinfo/qhostinfo.pro2
-rw-r--r--tests/auto/network/socket/.prev_CMakeLists.txt15
-rw-r--r--tests/auto/network/socket/CMakeLists.txt19
-rw-r--r--tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp14
-rw-r--r--tests/auto/network/socket/qtcpserver/crashingServer/main.cpp4
-rw-r--r--tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp6
-rw-r--r--tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp4
-rw-r--r--tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp18
-rw-r--r--tests/auto/network/socket/socket.pro4
-rw-r--r--tests/auto/network/ssl/CMakeLists.txt38
-rw-r--r--tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp10
-rw-r--r--tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp14
-rw-r--r--tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp54
-rw-r--r--tests/auto/network/ssl/ssl.pro4
-rw-r--r--tests/auto/other/.prev_CMakeLists.txt6
-rw-r--r--tests/auto/other/CMakeLists.txt6
-rw-r--r--tests/auto/other/languagechange/tst_languagechange.cpp2
-rw-r--r--tests/auto/other/other.pro4
-rw-r--r--tests/auto/other/qaccessibility/.prev_CMakeLists.txt6
-rw-r--r--tests/auto/other/qaccessibility/CMakeLists.txt6
-rw-r--r--tests/auto/other/qaccessibility/tst_qaccessibility.cpp4
-rw-r--r--tests/auto/other/qfocusevent/tst_qfocusevent.cpp5
-rw-r--r--tests/auto/testlib/selftests/CMakeLists.txt130
-rw-r--r--tests/auto/testlib/selftests/catch_p_p.h8
-rw-r--r--tests/auto/testlib/selftests/crashes/tst_crashes.cpp2
-rw-r--r--tests/auto/testlib/selftests/selftest.pro2
-rw-r--r--tests/auto/testlib/selftests/selftests.pro2
-rw-r--r--tests/auto/widgets/dialogs/CMakeLists.txt21
-rw-r--r--tests/auto/widgets/dialogs/dialogs.pro1
-rw-r--r--tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp7
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp2
-rw-r--r--tests/auto/widgets/dialogs/qfilesystemmodel/BLACKLIST7
-rw-r--r--tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp7
-rw-r--r--tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp2
-rw-r--r--tests/auto/widgets/dialogs/qsidebar/tst_qsidebar.cpp9
-rw-r--r--tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp3
-rw-r--r--tests/auto/widgets/graphicsview/.prev_CMakeLists.txt24
-rw-r--r--tests/auto/widgets/graphicsview/CMakeLists.txt4
-rw-r--r--tests/auto/widgets/graphicsview/graphicsview.pro2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitem/CMakeLists.txt2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp12
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsscene/CMakeLists.txt2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp4
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicssceneindex/tst_qgraphicssceneindex.cpp3
-rw-r--r--tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp9
-rw-r--r--tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp3
-rw-r--r--tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp11
-rw-r--r--tests/auto/widgets/itemviews/qitemdelegate/CMakeLists.txt2
-rw-r--r--tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro2
-rw-r--r--tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qitemview/BLACKLIST2
-rw-r--r--tests/auto/widgets/itemviews/qlistview/CMakeLists.txt2
-rw-r--r--tests/auto/widgets/itemviews/qlistview/qlistview.pro2
-rw-r--r--tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp15
-rw-r--r--tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp15
-rw-r--r--tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp7
-rw-r--r--tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp5
-rw-r--r--tests/auto/widgets/kernel/qapplication/CMakeLists.txt6
-rw-r--r--tests/auto/widgets/kernel/qapplication/qapplication.pro2
-rw-r--r--tests/auto/widgets/kernel/qapplication/test/.prev_CMakeLists.txt8
-rw-r--r--tests/auto/widgets/kernel/qapplication/test/CMakeLists.txt8
-rw-r--r--tests/auto/widgets/kernel/qapplication/test/test.pro8
-rw-r--r--tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp15
-rw-r--r--tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp3
-rw-r--r--tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp2
-rw-r--r--tests/auto/widgets/kernel/qwidget/BLACKLIST3
-rw-r--r--tests/auto/widgets/kernel/qwidget/CMakeLists.txt2
-rw-r--r--tests/auto/widgets/kernel/qwidget/qwidget.pro2
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp104
-rw-r--r--tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp20
-rw-r--r--tests/auto/widgets/kernel/qwindowcontainer/tst_qwindowcontainer.cpp12
-rw-r--r--tests/auto/widgets/styles/qstyle/tst_qstyle.cpp10
-rw-r--r--tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp6
-rw-r--r--tests/auto/widgets/widgets/CMakeLists.txt8
-rw-r--r--tests/auto/widgets/widgets/qabstractscrollarea/tst_qabstractscrollarea.cpp4
-rw-r--r--tests/auto/widgets/widgets/qcalendarwidget/tst_qcalendarwidget.cpp7
-rw-r--r--tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp9
-rw-r--r--tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp2
-rw-r--r--tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp6
-rw-r--r--tests/auto/widgets/widgets/qlineedit/BLACKLIST31
-rw-r--r--tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp3
-rw-r--r--tests/auto/widgets/widgets/qmainwindow/BLACKLIST2
-rw-r--r--tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp6
-rw-r--r--tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp29
-rw-r--r--tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp35
-rw-r--r--tests/auto/widgets/widgets/qmenu/BLACKLIST2
-rw-r--r--tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp27
-rw-r--r--tests/auto/widgets/widgets/qmenubar/BLACKLIST2
-rw-r--r--tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp6
-rw-r--r--tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp3
-rw-r--r--tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp3
-rw-r--r--tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp2
-rw-r--r--tests/auto/widgets/widgets/qsizegrip/tst_qsizegrip.cpp9
-rw-r--r--tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp4
-rw-r--r--tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp6
-rw-r--r--tests/auto/widgets/widgets/qstatusbar/tst_qstatusbar.cpp3
-rw-r--r--tests/auto/widgets/widgets/qtabwidget/CMakeLists.txt2
-rw-r--r--tests/auto/widgets/widgets/qtabwidget/qtabwidget.pro2
-rw-r--r--tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp2
-rw-r--r--tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp6
-rw-r--r--tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp6
-rw-r--r--tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp3
-rw-r--r--tests/auto/widgets/widgets/widgets.pro2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/tst_qxmlsimplereader.cpp3
-rw-r--r--tests/baselineserver/shared/baselineprotocol.cpp4
-rw-r--r--tests/benchmarks/corelib/io/qdir/10000/bench_qdir_10000.cpp5
-rw-r--r--tests/benchmarks/corelib/io/qdiriterator/main.cpp5
-rw-r--r--tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp5
-rw-r--r--tests/benchmarks/corelib/io/qfile/main.cpp26
-rw-r--r--tests/benchmarks/corelib/io/qfileinfo/main.cpp4
-rw-r--r--tests/benchmarks/corelib/io/qprocess/testProcessLoopback/.prev_CMakeLists.txt13
-rw-r--r--tests/benchmarks/corelib/io/qprocess/testProcessLoopback/CMakeLists.txt11
-rw-r--r--tests/benchmarks/corelib/io/qprocess/testProcessLoopback/testProcessLoopback.pro1
-rw-r--r--tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp8
-rw-r--r--tests/manual/diaglib/diaglib.pri2
-rw-r--r--tests/manual/embeddedintoforeignwindow/CMakeLists.txt4
-rw-r--r--tests/manual/foreignwindows/CMakeLists.txt4
-rw-r--r--tests/shared/filesystem.h2
530 files changed, 898 insertions, 24933 deletions
diff --git a/.gitignore b/.gitignore
index 394d405dbf..e1731c9a86 100644
--- a/.gitignore
+++ b/.gitignore
@@ -274,8 +274,6 @@ tags
*.exe.embed.manifest
*.exe_manifest.rc
*.exe_manifest.res
-*.appxmanifest
-.qmake.winrt_uuid_*
# Visual Studio Code generated files
.vscode
diff --git a/config_help.txt b/config_help.txt
index f42a8ddd90..6a3e0c7eef 100644
--- a/config_help.txt
+++ b/config_help.txt
@@ -117,7 +117,7 @@ Build options:
-appstore-compliant .. Disable code that is not allowed in platform app stores.
This is on by default for platforms which require distribution
through an app store by default, in particular Android,
- iOS, tvOS, watchOS, and Universal Windows Platform. [auto]
+ iOS, tvOS, and watchOS. [auto]
-qtnamespace <name> .. Wrap all Qt library code in 'namespace <name> {...}'.
-qtlibinfix <infix> .. Rename all libQt5*.so to libQt5*<infix>.so.
@@ -254,7 +254,7 @@ Core options:
Network options:
-ssl ................. Enable either SSL support method [auto]
- -no-openssl .......... Do not use OpenSSL [default on Apple and WinRT]
+ -no-openssl .......... Do not use OpenSSL [default on Apple]
-openssl-linked ...... Use OpenSSL and link to libssl [no]
-openssl-runtime ..... Use OpenSSL and dynamically load libssl [auto]
-schannel ............ Use Secure Channel [no] (Windows only)
diff --git a/configure.cmake b/configure.cmake
index b1ff2ba5b2..fa20b94333 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -419,7 +419,7 @@ qt_feature_config("separate_debug_info" QMAKE_PUBLIC_QT_CONFIG)
qt_feature("appstore-compliant" PUBLIC
LABEL "App store compliance"
PURPOSE "Disables code that is not allowed in platform app stores"
- AUTODETECT UIKIT OR ANDROID OR WINRT
+ AUTODETECT UIKIT OR ANDROID
)
qt_feature("simulator_and_device" PUBLIC
LABEL "Build for both simulator and device"
@@ -455,7 +455,7 @@ qt_feature_config("framework" QMAKE_PUBLIC_CONFIG
)
qt_feature("largefile"
LABEL "Large file support"
- CONDITION NOT ANDROID AND NOT INTEGRITY AND NOT WINRT AND NOT rtems
+ CONDITION NOT ANDROID AND NOT INTEGRITY AND NOT rtems
)
qt_feature_definition("largefile" "QT_LARGEFILE_SUPPORT" VALUE "64")
qt_feature_config("largefile" QMAKE_PRIVATE_CONFIG)
@@ -756,7 +756,7 @@ qt_feature("concurrent" PUBLIC
qt_feature_definition("concurrent" "QT_NO_CONCURRENT" NEGATE VALUE "1")
qt_feature("dbus" PUBLIC PRIVATE
LABEL "Qt D-Bus"
- AUTODETECT NOT UIKIT AND NOT ANDROID AND NOT WINRT
+ AUTODETECT NOT UIKIT AND NOT ANDROID
CONDITION QT_FEATURE_thread
)
qt_feature_definition("dbus" "QT_NO_DBUS" NEGATE VALUE "1")
@@ -930,7 +930,7 @@ qt_configure_add_summary_entry(
qt_configure_add_summary_build_parts("Build parts")
qt_configure_add_summary_entry(
ARGS "appstore-compliant"
- CONDITION APPLE OR ANDROID OR WINRT OR WIN32
+ CONDITION APPLE OR ANDROID OR WIN32
)
qt_configure_end_summary_section() # end of "Build options" section
qt_configure_add_summary_section(NAME "Qt modules and options")
diff --git a/configure.json b/configure.json
index c174b45262..fee86ede81 100644
--- a/configure.json
+++ b/configure.json
@@ -807,7 +807,7 @@
"appstore-compliant": {
"label": "App store compliance",
"purpose": "Disables code that is not allowed in platform app stores",
- "autoDetect": "config.uikit || config.android || config.winrt",
+ "autoDetect": "config.uikit || config.android",
"output": [ "publicFeature" ]
},
"simulator_and_device": {
@@ -859,7 +859,7 @@
},
"largefile": {
"label": "Large file support",
- "condition": "!config.android && !config.integrity && !config.winrt && !config.rtems",
+ "condition": "!config.android && !config.integrity && !config.rtems",
"output": [
"privateConfig",
{ "type": "define", "name": "QT_LARGEFILE_SUPPORT", "value": 64 }
@@ -1302,7 +1302,7 @@
},
"dbus": {
"label": "Qt D-Bus",
- "autoDetect": "!config.uikit && !config.android && !config.winrt",
+ "autoDetect": "!config.uikit && !config.android",
"condition": "features.thread",
"output": [ "privateFeature", "feature" ]
},
@@ -1628,7 +1628,7 @@
{
"type": "feature",
"args": "appstore-compliant",
- "condition": "config.darwin || config.android || config.winrt || config.win32"
+ "condition": "config.darwin || config.android || config.win32"
}
]
}, {
diff --git a/configure.pri b/configure.pri
index cba250f7b6..41d0bb81f5 100644
--- a/configure.pri
+++ b/configure.pri
@@ -211,9 +211,7 @@ defineReplace(qtConfFunc_licenseCheck) {
showWhat = "Type 'L' to view the GNU Lesser General Public License version 3 (LGPLv3)."
gpl2Ok = false
gpl3Ok = false
- winrt {
- notTheLicense = "Note: GPL version 2 is not available on WinRT."
- } else: wasm {
+ wasm {
gpl3Ok = true
theLicense = "GNU General Public License (GPL) version 3"
showWhat = "Type 'G' to view the GNU General Public License version 3 (GPLv3)."
diff --git a/mkspecs/common/msvc-version.conf b/mkspecs/common/msvc-version.conf
index adb45582c7..046f803b75 100644
--- a/mkspecs/common/msvc-version.conf
+++ b/mkspecs/common/msvc-version.conf
@@ -1,6 +1,6 @@
#
# qmake configuration for Microsoft Visual Studio C/C++ Compiler
-# This file is used by win32-msvc and all winrt-XXX-msvcXXX specs
+# This file is used by win32-msvc
#
#
diff --git a/mkspecs/common/winrt_winphone/assets/logo_150x150.png b/mkspecs/common/winrt_winphone/assets/logo_150x150.png
deleted file mode 100644
index 069171ca4d..0000000000
--- a/mkspecs/common/winrt_winphone/assets/logo_150x150.png
+++ /dev/null
Binary files differ
diff --git a/mkspecs/common/winrt_winphone/assets/logo_30x30.png b/mkspecs/common/winrt_winphone/assets/logo_30x30.png
deleted file mode 100644
index 2acac59e73..0000000000
--- a/mkspecs/common/winrt_winphone/assets/logo_30x30.png
+++ /dev/null
Binary files differ
diff --git a/mkspecs/common/winrt_winphone/assets/logo_310x150.png b/mkspecs/common/winrt_winphone/assets/logo_310x150.png
deleted file mode 100644
index 1a79482947..0000000000
--- a/mkspecs/common/winrt_winphone/assets/logo_310x150.png
+++ /dev/null
Binary files differ
diff --git a/mkspecs/common/winrt_winphone/assets/logo_310x310.png b/mkspecs/common/winrt_winphone/assets/logo_310x310.png
deleted file mode 100644
index 02144a9f39..0000000000
--- a/mkspecs/common/winrt_winphone/assets/logo_310x310.png
+++ /dev/null
Binary files differ
diff --git a/mkspecs/common/winrt_winphone/assets/logo_44x44.png b/mkspecs/common/winrt_winphone/assets/logo_44x44.png
deleted file mode 100644
index 3cc5bec19f..0000000000
--- a/mkspecs/common/winrt_winphone/assets/logo_44x44.png
+++ /dev/null
Binary files differ
diff --git a/mkspecs/common/winrt_winphone/assets/logo_480x800.png b/mkspecs/common/winrt_winphone/assets/logo_480x800.png
deleted file mode 100644
index 39a37dac5b..0000000000
--- a/mkspecs/common/winrt_winphone/assets/logo_480x800.png
+++ /dev/null
Binary files differ
diff --git a/mkspecs/common/winrt_winphone/assets/logo_620x300.png b/mkspecs/common/winrt_winphone/assets/logo_620x300.png
deleted file mode 100644
index a2be79f5d7..0000000000
--- a/mkspecs/common/winrt_winphone/assets/logo_620x300.png
+++ /dev/null
Binary files differ
diff --git a/mkspecs/common/winrt_winphone/assets/logo_70x70.png b/mkspecs/common/winrt_winphone/assets/logo_70x70.png
deleted file mode 100644
index 334b2722b5..0000000000
--- a/mkspecs/common/winrt_winphone/assets/logo_70x70.png
+++ /dev/null
Binary files differ
diff --git a/mkspecs/common/winrt_winphone/assets/logo_71x71.png b/mkspecs/common/winrt_winphone/assets/logo_71x71.png
deleted file mode 100644
index 16d0808759..0000000000
--- a/mkspecs/common/winrt_winphone/assets/logo_71x71.png
+++ /dev/null
Binary files differ
diff --git a/mkspecs/common/winrt_winphone/assets/logo_store.png b/mkspecs/common/winrt_winphone/assets/logo_store.png
deleted file mode 100644
index 417ccdcb5f..0000000000
--- a/mkspecs/common/winrt_winphone/assets/logo_store.png
+++ /dev/null
Binary files differ
diff --git a/mkspecs/common/winrt_winphone/manifests/10.0/AppxManifest.xml.in b/mkspecs/common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
deleted file mode 100644
index fe9ddaf8f1..0000000000
--- a/mkspecs/common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version=\"1.0\" encoding=\"utf-8\"?>
-
-<Package
- xmlns=\"http://schemas.microsoft.com/appx/manifest/foundation/windows10\"
- xmlns:mp=\"http://schemas.microsoft.com/appx/2014/phone/manifest\"
- xmlns:uap=\"http://schemas.microsoft.com/appx/manifest/uap/windows10\"
- xmlns:uap3=\"http://schemas.microsoft.com/appx/manifest/uap/windows10/3\"
- xmlns:mobile=\"http://schemas.microsoft.com/appx/manifest/mobile/windows10\"
- xmlns:iot=\"http://schemas.microsoft.com/appx/manifest/iot/windows10\"
- IgnorableNamespaces=\"uap uap3 mp mobile iot\">
-
- <Identity
- Name=\"$${WINRT_MANIFEST.identity}\"
- Publisher=\"$${WINRT_MANIFEST.publisherid}\"
- Version=\"$${WINRT_MANIFEST.version}\"
- ProcessorArchitecture=\"$${WINRT_MANIFEST.architecture}\" />
-
- <mp:PhoneIdentity PhoneProductId=\"$${WINRT_MANIFEST.identity}\" PhonePublisherId=\"$${WINRT_MANIFEST.phone_publisher_id}\"/>
-
- <Properties>
- <DisplayName>$${WINRT_MANIFEST.name}</DisplayName>
- <PublisherDisplayName>$${WINRT_MANIFEST.publisher}</PublisherDisplayName>
- <Logo>$${WINRT_MANIFEST.logo_store}</Logo>
- </Properties>
-
- <Dependencies>
- <TargetDeviceFamily Name=\"Windows.Universal\"
- MinVersion=\"$${WINRT_MANIFEST.minVersion}\"
- MaxVersionTested=\"$${WINRT_MANIFEST.maxVersionTested}\" />$${WINRT_MANIFEST.dependencies}
- </Dependencies>
-
- <Resources>
- <Resource Language=\"en\"/>
- </Resources>
-
- <Applications>
- <Application Id=\"App\"
- Executable=\"$${WINRT_MANIFEST.target}.exe\"
- EntryPoint=\"$${WINRT_MANIFEST.target}.App\">
- <uap:VisualElements
- DisplayName=\"$${WINRT_MANIFEST.name}\"
- Description=\"$${WINRT_MANIFEST.description}\"
- BackgroundColor=\"$${WINRT_MANIFEST.background}\"
- Square150x150Logo=\"$${WINRT_MANIFEST.logo_150x150}\"
- Square44x44Logo=\"$${WINRT_MANIFEST.logo_44x44}\">
-
- <uap:SplashScreen Image=\"$${WINRT_MANIFEST.logo_620x300}\" />
- </uap:VisualElements>
- </Application>
- </Applications>
- $${WINRT_MANIFEST.capabilities}
-</Package>
diff --git a/mkspecs/common/winrt_winphone/qmake.conf b/mkspecs/common/winrt_winphone/qmake.conf
deleted file mode 100644
index 55fcbe5ab3..0000000000
--- a/mkspecs/common/winrt_winphone/qmake.conf
+++ /dev/null
@@ -1,103 +0,0 @@
-#
-# qmake configuration for winrt and windows phone 8.1
-#
-# Written for Microsoft Visual C++
-#
-
-MAKEFILE_GENERATOR = MSBUILD
-QMAKE_COMPILER = msvc
-QMAKE_PLATFORM = winrt win32
-CONFIG = package_manifest $$CONFIG incremental flat precompile_header autogen_precompile_source debug_and_release debug_and_release_target rtti
-# MSVC 2017 15.8+ fixed std::aligned_storage but compilation fails without
-# _ENABLE_EXTENDED_ALIGNED_STORAGE flag since the fix breaks binary compatibility.
-DEFINES += UNICODE WIN32 QT_LARGEFILE_SUPPORT Q_BYTE_ORDER=Q_LITTLE_ENDIAN _ENABLE_EXTENDED_ALIGNED_STORAGE
-DEFINES_RELEASE += NDEBUG
-QMAKE_COMPILER_DEFINES += _WIN32
-
-DEPLOYMENT_PLUGIN += qwinrt
-
-QMAKE_CC = cl
-QMAKE_LEX = flex
-QMAKE_LEXFLAGS =
-QMAKE_YACC = bison -y
-QMAKE_YACCFLAGS = -d
-QMAKE_CFLAGS = -nologo
-QMAKE_CFLAGS_WARN_ON = -W3
-QMAKE_CFLAGS_WARN_OFF = -W0
-QMAKE_CFLAGS_RELEASE = -O2 -MD
-QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MD -Zi
-QMAKE_CFLAGS_DEBUG = -Zi -MDd
-QMAKE_CFLAGS_YACC =
-QMAKE_CFLAGS_LTCG = -GL
-QMAKE_CFLAGS_MP = -MP
-QMAKE_CFLAGS_SSE2 = -arch:SSE2
-QMAKE_CFLAGS_SSE3 = -arch:SSE2
-QMAKE_CFLAGS_SSSE3 = -arch:SSE2
-QMAKE_CFLAGS_SSE4_1 = -arch:SSE2
-QMAKE_CFLAGS_SSE4_2 = -arch:SSE2
-QMAKE_CFLAGS_AVX = -arch:AVX
-QMAKE_CFLAGS_AVX2 = -arch:AVX
-QMAKE_CFLAGS_AESNI = -arch:SSE2
-QMAKE_CFLAGS_SHANI = -arch:SSE2
-
-QMAKE_CXX = $$QMAKE_CC
-QMAKE_CXXFLAGS = $$QMAKE_CFLAGS
-QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON -w34100 -w34189 -w44996
-QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
-QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE
-QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
-QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG
-QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
-QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG
-QMAKE_CXXFLAGS_MP = $$QMAKE_CFLAGS_MP
-QMAKE_CXXFLAGS_STL_ON = -EHsc
-QMAKE_CXXFLAGS_STL_OFF =
-QMAKE_CXXFLAGS_RTTI_ON = -GR
-QMAKE_CXXFLAGS_RTTI_OFF =
-QMAKE_CXXFLAGS_EXCEPTIONS_ON = -EHsc
-QMAKE_CXXFLAGS_EXCEPTIONS_OFF = /wd4530 /wd4577
-
-QMAKE_INCDIR =
-
-QMAKE_RUN_CC = $(CC) -c $(CFLAGS) $(INCPATH) -Fo$obj $src
-QMAKE_RUN_CC_IMP = $(CC) -c $(CFLAGS) $(INCPATH) -Fo$@ $<
-QMAKE_RUN_CC_IMP_BATCH = $(CC) -c $(CFLAGS) $(INCPATH) -Fo$@ @<<
-QMAKE_RUN_CXX = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$obj $src
-QMAKE_RUN_CXX_IMP = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ $<
-QMAKE_RUN_CXX_IMP_BATCH = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ @<<
-
-QMAKE_LINK = link
-QMAKE_LFLAGS = /NOLOGO /DYNAMICBASE /NXCOMPAT /NODEFAULTLIB:ole32.lib /APPCONTAINER
-QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO
-QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF /INCREMENTAL:NO
-QMAKE_LFLAGS_DEBUG = /DEBUG
-QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS
-QMAKE_LFLAGS_EXE = /MANIFEST:NO
-QMAKE_LFLAGS_DLL = /MANIFEST:NO /DLL
-QMAKE_LFLAGS_LTCG = /LTCG
-QMAKE_PREFIX_SHLIB =
-QMAKE_EXTENSION_SHLIB = dll
-QMAKE_PREFIX_STATICLIB =
-QMAKE_EXTENSION_STATICLIB = lib
-
-QMAKE_LIBS += runtimeobject.lib
-QMAKE_LIBS_GUI =
-QMAKE_LIBS_NETWORK += ws2_32.lib
-
-QMAKE_LIBS_QT_ENTRY = -lqtmain
-
-QMAKE_IDL = midl
-QMAKE_LIB = lib /NOLOGO
-QMAKE_RC = rc
-
-VCPROJ_EXTENSION = .vcxproj
-VCSOLUTION_EXTENSION = .sln
-VCPROJ_KEYWORD = Qt4VSv1.0
-WINRT_ASSETS_PATH = $$PWD/assets
-
-WINRT_MANIFEST.capabilities = defaults
-WINRT_MANIFEST.capabilities_device = defaults
-
-WINDOWS_TARGET_PLATFORM_VERSION = $$(UCRTVERSION)
-
-load(qt_config)
diff --git a/mkspecs/common/winrt_winphone/qplatformdefs.h b/mkspecs/common/winrt_winphone/qplatformdefs.h
deleted file mode 100644
index c561e41668..0000000000
--- a/mkspecs/common/winrt_winphone/qplatformdefs.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the qmake spec of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QPLATFORMDEFS_H
-#define QPLATFORMDEFS_H
-
-#ifdef UNICODE
-#ifndef _UNICODE
-#define _UNICODE
-#endif
-#endif
-
-// Get Qt defines/settings
-
-#include "qglobal.h"
-#include "qfunctions_winrt.h"
-
-#define _POSIX_
-#include <limits.h>
-#undef _POSIX_
-
-#include <tchar.h>
-#include <io.h>
-#include <direct.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <stdlib.h>
-
-#ifdef QT_LARGEFILE_SUPPORT
-#define QT_STATBUF struct _stati64 // non-ANSI defs
-#define QT_STATBUF4TSTAT struct _stati64 // non-ANSI defs
-#define QT_STAT ::_stati64
-#define QT_FSTAT ::_fstati64
-#else
-#define QT_STATBUF struct _stat // non-ANSI defs
-#define QT_STATBUF4TSTAT struct _stat // non-ANSI defs
-#define QT_STAT ::_stat
-#define QT_FSTAT ::_fstat
-#endif
-#define QT_STAT_REG _S_IFREG
-#define QT_STAT_DIR _S_IFDIR
-#define QT_STAT_MASK _S_IFMT
-#if defined(_S_IFLNK)
-# define QT_STAT_LNK _S_IFLNK
-#endif
-#define QT_FILENO _fileno
-#define QT_OPEN ::_open
-#define QT_CLOSE ::_close
-#ifdef QT_LARGEFILE_SUPPORT
-#define QT_LSEEK ::_lseeki64
-#define QT_TSTAT ::_tstati64
-#else
-#define QT_LSEEK ::_lseek
-#define QT_TSTAT ::_tstat
-#endif
-#define QT_READ ::_read
-#define QT_WRITE ::_write
-#define QT_ACCESS ::_access
-#define QT_GETCWD ::_getcwd
-#define QT_CHDIR ::_chdir
-#define QT_MKDIR ::_mkdir
-#define QT_RMDIR ::_rmdir
-#define QT_OPEN_LARGEFILE 0
-#define QT_OPEN_RDONLY _O_RDONLY
-#define QT_OPEN_WRONLY _O_WRONLY
-#define QT_OPEN_RDWR _O_RDWR
-#define QT_OPEN_CREAT _O_CREAT
-#define QT_OPEN_TRUNC _O_TRUNC
-#define QT_OPEN_APPEND _O_APPEND
-#if defined(O_TEXT)
-# define QT_OPEN_TEXT _O_TEXT
-# define QT_OPEN_BINARY _O_BINARY
-#endif
-
-#include "../common/c89/qplatformdefs.h"
-
-#ifdef QT_LARGEFILE_SUPPORT
-#undef QT_FSEEK
-#undef QT_FTELL
-#undef QT_OFF_T
-
-#define QT_FSEEK ::_fseeki64
-#define QT_FTELL ::_ftelli64
-#define QT_OFF_T __int64
-#endif
-
-#define QT_SIGNAL_ARGS int
-
-#define QT_VSNPRINTF(buffer, count, format, arg) \
- vsnprintf_s(buffer, count, count-1, format, arg)
-
-#define QT_SNPRINTF ::_snprintf
-
-# define F_OK 0
-# define X_OK 1
-# define W_OK 2
-# define R_OK 4
-
-typedef int mode_t;
-
-#endif // QPLATFORMDEFS_H
diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf
index 934a18a924..af5ebeddd5 100644
--- a/mkspecs/features/configure.prf
+++ b/mkspecs/features/configure.prf
@@ -39,12 +39,6 @@ defineTest(qtCompileTest) {
# Disable qmake features which are typically counterproductive for tests
qmake_configs = "\"CONFIG -= qt debug_and_release app_bundle lib_bundle\""
- # On WinRT we need to change the entry point as we cannot create windows
- # applications
- winrt {
- qmake_configs += " \"QMAKE_LFLAGS+=/ENTRY:main\""
- }
-
# Clean up after previous run
exists($$test_out_dir/Makefile):qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE distclean")
diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf
index 69d1954306..4a53b99ca1 100644
--- a/mkspecs/features/qt.prf
+++ b/mkspecs/features/qt.prf
@@ -226,15 +226,6 @@ for(ever) {
}
}
QMAKE_USE$$var_sfx += $$MODULE_USES
- # Add capabilities as defined by modules used in the project
- winrt {
- MODULE_WINRT_CAPABILITIES = $$eval(QT.$${QTLIB}.winrt_capabilities)
- !isEmpty(MODULE_WINRT_CAPABILITIES): \
- WINRT_MANIFEST.capabilities_default += $$MODULE_WINRT_CAPABILITIES
- MODULE_WINRT_CAPABILITIES_DEVICE = $$eval(QT.$${QTLIB}.winrt_capabilities_device)
- !isEmpty(MODULE_WINRT_CAPABILITIES_DEVICE): \
- WINRT_MANIFEST.capabilities_device_default += $$MODULE_WINRT_CAPABILITIES_DEVICE
- }
}
!isEmpty(BAD_QT):error("Unknown module(s) in QT$$var_sfx: $$replace(BAD_QT, _private$, -private)")
diff --git a/mkspecs/features/qt_build_config.prf b/mkspecs/features/qt_build_config.prf
index 7ca9943c32..55e01e4a65 100644
--- a/mkspecs/features/qt_build_config.prf
+++ b/mkspecs/features/qt_build_config.prf
@@ -85,7 +85,7 @@ CONFIG = qt_build_extra $$CONFIG
cross_compile: \
CONFIG += force_bootstrap
-android|uikit|winrt: \
+android|uikit: \
CONFIG += builtin_testdata
# Prevent warnings about object files without any symbols
diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf
index 6537d98c5d..93448acb91 100644
--- a/mkspecs/features/qt_configure.prf
+++ b/mkspecs/features/qt_configure.prf
@@ -1225,11 +1225,6 @@ defineTest(qtConfTest_compile) {
qmake_args += "\"CONFIG += $$qmake_configs\""
!$$host|!cross_compile {
- # On WinRT we need to change the entry point as we cannot create windows
- # applications
- winrt: \
- qmake_args += " \"QMAKE_LFLAGS += /ENTRY:main\""
-
# add compiler flags, these are set for the target and should not be applied to host tests
!isEmpty(EXTRA_DEFINES): \
qmake_args += $$system_quote(DEFINES += $$val_escape(EXTRA_DEFINES))
diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf
index 719caf3d4a..a8cc9835a5 100644
--- a/mkspecs/features/qt_module_pris.prf
+++ b/mkspecs/features/qt_module_pris.prf
@@ -154,9 +154,6 @@ defineReplace(qtExportLibsForModule) {
"QT_CONFIG +=$$join(QT.$${MODULE_ID}.QT_CONFIG, " ", " ")" \
"" \
"QT_MODULES += $$MODULE"
- winrt: MODULE_PRI_CONT += \
- "QT.$${MODULE_ID}.winrt_capabilities =$$join(MODULE_WINRT_CAPABILITIES, " ", " ")" \
- "QT.$${MODULE_ID}.winrt_capabilities_device =$$join(MODULE_WINRT_CAPABILITIES_DEVICE, " ", " ")"
write_file($$MODULE_PRI, MODULE_PRI_CONT)|error()
!internal_module:!no_private_module {
module_build_type += internal_module
@@ -233,7 +230,6 @@ defineReplace(qtExportLibsForModule) {
for(var, $$list(VERSION MAJOR_VERSION MINOR_VERSION PATCH_VERSION \
name module depends run_depends plugin_types module_config CONFIG DEFINES \
priority includes bins libs frameworks \
- winrt_capabilities winrt_capabilities_device \
)):defined(QT.$${mod}.$$var, var):cache(QT.$${mod}.$$var, transient)
}
cache(QT_MODULES, transient)
diff --git a/mkspecs/features/toolchain.prf b/mkspecs/features/toolchain.prf
index 9d790f62bc..e03c21dea2 100644
--- a/mkspecs/features/toolchain.prf
+++ b/mkspecs/features/toolchain.prf
@@ -153,10 +153,10 @@ msvc {
arch = amd64
else: !equals(arch, arm):!equals(arch, arm64): \ # may be "win32" or undefined
arch = x86
- # Consider only WinRT and ARM64 desktop builds to be cross-builds -
+ # Consider only ARM64 desktop builds to be cross-builds -
# the host is assumed to be Intel and capable of running the target
# executables (so building for x64 on x86 will break).
- winrt|equals(arch, arm64): \
+ equals(arch, arm64): \
CONFIG += msvc_cross
}
@@ -337,7 +337,6 @@ isEmpty($${target_prefix}.INCDIRS) {
error("Failed to find the Visual C installation directory.")
cmd += $$system_quote($$dir\\vcvarsall.bat) $$arch
}
- winrt: cmd += store
isEmpty(WINSDK_VER): \
error("Mkspec does not specify WINSDK_VER. Cannot continue.")
diff --git a/mkspecs/features/winrt/console.prf b/mkspecs/features/winrt/console.prf
deleted file mode 100644
index c4afe5b96e..0000000000
--- a/mkspecs/features/winrt/console.prf
+++ /dev/null
@@ -1,5 +0,0 @@
-# This is an empty prf file to overwrite the win32 version.
-# On Windows RT all applications need to be windows applications
-# and also link to winmain. Inside winmain we create the launch
-# arguments and also initialize the UI.
-
diff --git a/mkspecs/features/winrt/default_pre.prf b/mkspecs/features/winrt/default_pre.prf
deleted file mode 100644
index 966d24f091..0000000000
--- a/mkspecs/features/winrt/default_pre.prf
+++ /dev/null
@@ -1,14 +0,0 @@
-# Note that the order is important - ucrt(d) has to be first.
-# Otherwise, the linker might use malloc from a different library,
-# but free_dbg() from the runtime, causing an assertion failure
-# due to deleting an item from a different heap.
-# vcruntime(d) is necessary when we don't link to any libraries
-# which would pull it in transitively.
-CONFIG(debug, debug|release): \
- QMAKE_LIBS = ucrtd.lib vcruntimed.lib $$QMAKE_LIBS
-else: \
- QMAKE_LIBS = ucrt.lib vcruntime.lib $$QMAKE_LIBS
-
-equals(TEMPLATE, "vcapp"):!static: CONFIG += windeployqt
-
-load(default_pre)
diff --git a/mkspecs/features/winrt/package_manifest.prf b/mkspecs/features/winrt/package_manifest.prf
deleted file mode 100644
index 279971bd65..0000000000
--- a/mkspecs/features/winrt/package_manifest.prf
+++ /dev/null
@@ -1,200 +0,0 @@
-# This performs basic variable replacement on the contents of the WinRT manifest template, as
-# specified by WINRT_MANIFEST. The resulting manifest file is written to the output directory.
-# While the most common options are covered by the default template, the developer is expected
-# to make an application-level copy of the template in order to customize the manifest further.
-# Afterwards, they can override the default template by assigning their template to WINRT_MANIFEST.
-#
-# All subkeys in WINRT_MANIFEST will be replaced if defined/found, so new variables can be easily
-# added.
-
-# The manifest is generated for each build pass for normal apps, and only once for vcapps.
-# - Normal apps have their package root directory in the same place as the target (one for each build pass).
-# - Visual Studio requires a design-mode manifest in the same location as the vcproj.
-!isEmpty(WINRT_MANIFEST): \
- if(build_pass:equals(TEMPLATE, "app"))| \
- if(!build_pass:equals(TEMPLATE, "vcapp")) {
-
- manifest_file.input = $$WINRT_MANIFEST
-
- contains(TEMPLATE, "vc.*") {
- BUILD_DIR = $$OUT_PWD
- } else {
- load(resolve_target)
- BUILD_DIR = $$dirname(QMAKE_RESOLVED_TARGET)
- }
-
- contains(TEMPLATE, "vc.*"): \
- manifest_file.output = $$BUILD_DIR/Package.appxmanifest
- else: \
- manifest_file.output = $$BUILD_DIR/AppxManifest.xml
-
- !contains(WINRT_MANIFEST.CONFIG, "verbatim") {
- # Provide the C-runtime dependency
- equals(TEMPLATE, "app") {
- VCLIBS = Microsoft.VCLibs.$$replace(MSVC_VER, \\., ).00
- CONFIG(debug, debug|release): \
- VCLIBS = $${VCLIBS}.Debug
- else: \
- VCLIBS = $${VCLIBS}
- # VS 2017 and 2019 still use vclibs 140
- contains(MSVC_VER, "15.0"): VCLIBS = $$replace(VCLIBS, 150, 140)
- contains(MSVC_VER, "16.0"): VCLIBS = $$replace(VCLIBS, 160, 140)
- VCLIBS = "$${VCLIBS}\" MinVersion=\"14.0.0.0\" Publisher=\"CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"
- WINRT_MANIFEST.dependencies += $$VCLIBS
- }
-
- # Provide default values for required variables
- isEmpty(WINRT_MANIFEST.target): WINRT_MANIFEST.target = $$TARGET
- isEmpty(WINRT_MANIFEST.identity) {
- # Reuse the existing UUID if possible
- UUID_CACHE = $$OUT_PWD/.qmake.winrt_uuid_$$TARGET
- exists($$UUID_CACHE) {
- include($$UUID_CACHE)
- } else {
- WINRT_UUID = $$system(uuidgen)
- isEmpty(WINRT_UUID): error("Unable to generate a UUID. Make sure uuidgen is in your PATH.")
- WINRT_UUID = "WINRT_MANIFEST.identity = $$WINRT_UUID"
- write_file($$UUID_CACHE, WINRT_UUID)|error("Unable to write the UUID cache; aborting.")
- eval($$WINRT_UUID)
- }
- }
- isEmpty(WINRT_MANIFEST.name): WINRT_MANIFEST.name = $$TARGET
- isEmpty(WINRT_MANIFEST.architecture): WINRT_MANIFEST.architecture = $$VCPROJ_ARCH
- isEmpty(WINRT_MANIFEST.version): WINRT_MANIFEST.version = 1.0.0.0
- isEmpty(WINRT_MANIFEST.publisher): WINRT_MANIFEST.publisher = Default publisher display name
- isEmpty(WINRT_MANIFEST.publisherid): WINRT_MANIFEST.publisherid = CN=$$(USERNAME)
- isEmpty(WINRT_MANIFEST.phone_product_id): WINRT_MANIFEST.phone_product_id = $$WINRT_MANIFEST.identity
- isEmpty(WINRT_MANIFEST.phone_publisher_id): WINRT_MANIFEST.phone_publisher_id = 00000000-0000-0000-0000-000000000000
- isEmpty(WINRT_MANIFEST.description): WINRT_MANIFEST.description = Default package description
- isEmpty(WINRT_MANIFEST.background): WINRT_MANIFEST.background = green
- isEmpty(WINRT_MANIFEST.foreground): WINRT_MANIFEST.foreground = light
- isEmpty(WINRT_MANIFEST.default_language): WINRT_MANIFEST.default_language = en
- isEmpty(WINRT_MANIFEST.minVersion): \
- WINRT_MANIFEST.minVersion = $$WINDOWS_TARGET_PLATFORM_VERSION
- isEmpty(WINRT_MANIFEST.maxVersionTested): \
- WINRT_MANIFEST.maxVersionTested = $$WINDOWS_TARGET_PLATFORM_MIN_VERSION
-
- INDENT = "$$escape_expand(\\r\\n) "
-
- VS_XML_NAMESPACE = "m2"
- WINRT_MANIFEST.rotation_preference = $$unique(WINRT_MANIFEST.rotation_preference)
- !isEmpty(WINRT_MANIFEST.rotation_preference) {
- MANIFEST_ROTATION += "<$${VS_XML_NAMESPACE}:InitialRotationPreference>"
- for(ROTATION, WINRT_MANIFEST.rotation_preference): \
- MANIFEST_ROTATION += " <$${VS_XML_NAMESPACE}:Rotation Preference=\"$$ROTATION\" />"
- MANIFEST_ROTATION += "</$${VS_XML_NAMESPACE}:InitialRotationPreference>"
-
- WINRT_MANIFEST.rotation_preference = $$join(MANIFEST_ROTATION, $$INDENT, $$INDENT)
- }
-
- INDENT = "$$escape_expand(\\r\\n) "
-
- # All Windows 10 applications need to have internetClient.
- WINRT_MANIFEST.capabilities += internetClient
-
- contains(WINRT_MANIFEST.capabilities, defaults) {
- WINRT_MANIFEST.capabilities -= defaults
- WINRT_MANIFEST.capabilities += $$WINRT_MANIFEST.capabilities_default
- }
-
- contains(WINRT_MANIFEST.capabilities_device, defaults) {
- WINRT_MANIFEST.capabilities_device -= defaults
- WINRT_MANIFEST.capabilities_device += $$WINRT_MANIFEST.capabilities_device_default
- }
-
- UAP_CAPABILITIES += \
- appointments \
- blockedChatMessages \
- chat \
- contacts \
- enterpriseAuthentication \
- # internetClient is special, as it needs to be written without namespace
- #internetClient \
- musicLibrary \
- objects3D \
- phoneCall \
- picturesLibrary \
- removableStorage \
- sharedUserCertificates \
- userAccountInformation \
- videosLibrary \
- voipCall
-
- UAP3_CAPABILITIES += backgroundMediaPlayback remoteSystem userNotificationListener
-
- IOT_CAPABILITIES += systemManagement
-
- # Capabilities are given as a string list and may change with the configuration (network, sensors, etc.)
- WINRT_MANIFEST.capabilities = $$unique(WINRT_MANIFEST.capabilities)
- WINRT_MANIFEST.capabilities_device = $$unique(WINRT_MANIFEST.capabilities_device)
- !isEmpty(WINRT_MANIFEST.capabilities)|!isEmpty(WINRT_MANIFEST.capabilities_device) {
- MANIFEST_CAPABILITIES += "<Capabilities>"
- for (CAPABILITY, WINRT_MANIFEST.capabilities) {
- contains(UAP_CAPABILITIES, $$CAPABILITY): \
- MANIFEST_CAPABILITIES += " <uap:Capability Name=\"$$CAPABILITY\" />"
- else:contains(UAP3_CAPABILITIES, $$CAPABILITY): \
- MANIFEST_CAPABILITIES += " <uap3:Capability Name=\"$$CAPABILITY\" />"
- else:contains(IOT_CAPABILITIES, $$CAPABILITY): \
- MANIFEST_CAPABILITIES += " <iot:Capability Name=\"$$CAPABILITY\" />"
- else: \
- MANIFEST_CAPABILITIES += " <Capability Name=\"$$CAPABILITY\" />"
- }
- for(CAPABILITY, WINRT_MANIFEST.capabilities_device): \
- MANIFEST_CAPABILITIES += " <DeviceCapability Name=\"$$CAPABILITY\" />"
- MANIFEST_CAPABILITIES += "</Capabilities>"
-
- WINRT_MANIFEST.capabilities = $$join(MANIFEST_CAPABILITIES, $$INDENT, $$INDENT)
- }
-
- # Dependencies are given as a string list. The CRT dependency is added automatically above.
- # For MSVC2015/2017 the dependencies are added in conjunction with TargetDeviceFamily
- # Due to the hard coded dependency on "Windows.Universal" the <Dependencies> tag
- # is already inside the MSVC2015 manifest.
- WINRT_MANIFEST.dependencies = $$unique(WINRT_MANIFEST.dependencies)
- !isEmpty(WINRT_MANIFEST.dependencies) {
- for(DEPENDENCY, WINRT_MANIFEST.dependencies): \
- MANIFEST_DEPENDENCIES += " <PackageDependency Name=\"$$DEPENDENCY\" />"
-
- WINRT_MANIFEST.dependencies = $$join(MANIFEST_DEPENDENCIES, $$INDENT, $$INDENT)
- }
-
- # Provide default icons where needed
- isEmpty(WINRT_ASSETS_PATH): WINRT_ASSETS_PATH = $$[QT_HOST_DATA/get]/mkspecs/common/winrt_winphone/assets
- TEMPLATE_CONTENTS = $$cat($$WINRT_MANIFEST, lines)
- ICONS_FOUND = $$find(TEMPLATE_CONTENTS, \\\$\\\$\\{WINRT_MANIFEST\\.(logo|tile)_)
- ICONS_FOUND ~= s/.*\\\$\\\$\\{WINRT_MANIFEST\\.((logo|tile)_[^\}]+)\\}.*/\\1/g
- for (ICON_NAME, ICONS_FOUND) {
- ICON_FILE = $$eval(WINRT_MANIFEST.$$ICON_NAME)
- isEmpty(ICON_FILE) {
- equals(ICON_NAME, "logo_310x150"): ICON_FILE = $$eval(WINRT_MANIFEST.logo_wide)
- else: equals(ICON_NAME, "logo_150x150"): ICON_FILE = $$eval(WINRT_MANIFEST.logo_large)
- # Windows Phone specifics
- else: equals(ICON_NAME, "logo_480x800"): ICON_FILE = $$eval(WINRT_MANIFEST.logo_splash)
- else: equals(ICON_NAME, "logo_71x71"): ICON_FILE = $$eval(WINRT_MANIFEST.logo_medium)
- else: equals(ICON_NAME, "logo_44x44"): ICON_FILE = $$eval(WINRT_MANIFEST.logo_small)
- # Windows RT specifics
- else: equals(ICON_NAME, "logo_620x300"): ICON_FILE = $$eval(WINRT_MANIFEST.logo_splash)
- else: equals(ICON_NAME, "logo_70x70"): ICON_FILE = $$eval(WINRT_MANIFEST.logo_medium)
- else: equals(ICON_NAME, "logo_30x30"): ICON_FILE = $$eval(WINRT_MANIFEST.logo_small)
- }
- isEmpty(ICON_FILE): ICON_FILE = $$WINRT_ASSETS_PATH/$${ICON_NAME}.png
- icon_$${ICON_NAME}.input = $$ICON_FILE
- icon_$${ICON_NAME}.output = $$BUILD_DIR/assets/$$basename(ICON_FILE)
- icon_$${ICON_NAME}.CONFIG = verbatim
- QMAKE_SUBSTITUTES += icon_$${ICON_NAME}
- WINRT_MANIFEST.$${ICON_NAME} = assets/$$basename(ICON_FILE)
- }
-
- !contains(TEMPLATE, "vc.*") {
- winrt_manifest_install.files = $$manifest_file.output
- winrt_manifest_install.path = $$target.path
- winrt_assets_install.files = $$BUILD_DIR/assets/*
- winrt_assets_install.path = $$target.path/assets
- INSTALLS += winrt_manifest_install winrt_assets_install
- }
- } else {
- manifest_file.CONFIG += verbatim
- }
-
- QMAKE_SUBSTITUTES += manifest_file
-}
diff --git a/mkspecs/winrt-arm-msvc2015/qmake.conf b/mkspecs/winrt-arm-msvc2015/qmake.conf
deleted file mode 100644
index bc113d4954..0000000000
--- a/mkspecs/winrt-arm-msvc2015/qmake.conf
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# qmake configuration for winrt-arm-msvc2015
-#
-# Written for Microsoft Visual C++ 2015
-#
-
-include(../common/winrt_winphone/qmake.conf)
-DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 ARM __ARM__ __arm__
-
-QMAKE_CFLAGS += -FS
-QMAKE_CXXFLAGS += -FS
-QMAKE_LFLAGS += /MACHINE:ARM /NODEFAULTLIB:kernel32.lib
-
-QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib
-
-VCPROJ_ARCH = ARM
-WINSDK_VER = 10.0
-WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
-WINRT_MANIFEST.architecture = arm
diff --git a/mkspecs/winrt-arm-msvc2015/qplatformdefs.h b/mkspecs/winrt-arm-msvc2015/qplatformdefs.h
deleted file mode 100644
index 2a1aef5e88..0000000000
--- a/mkspecs/winrt-arm-msvc2015/qplatformdefs.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the qmake spec of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "../common/winrt_winphone/qplatformdefs.h"
diff --git a/mkspecs/winrt-arm-msvc2017/qmake.conf b/mkspecs/winrt-arm-msvc2017/qmake.conf
deleted file mode 100644
index 1160d5766d..0000000000
--- a/mkspecs/winrt-arm-msvc2017/qmake.conf
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# qmake configuration for winrt-arm-msvc2017
-#
-# Written for Microsoft Visual C++ 2017
-#
-
-include(../common/winrt_winphone/qmake.conf)
-DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 ARM __ARM__ __arm__
-
-QMAKE_CFLAGS += -FS
-QMAKE_CXXFLAGS += -FS
-QMAKE_LFLAGS += /MACHINE:ARM /NODEFAULTLIB:kernel32.lib
-
-QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib
-
-VCPROJ_ARCH = ARM
-WINSDK_VER = 10.0
-WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
-WINRT_MANIFEST.architecture = arm
diff --git a/mkspecs/winrt-arm-msvc2017/qplatformdefs.h b/mkspecs/winrt-arm-msvc2017/qplatformdefs.h
deleted file mode 100644
index 907834d385..0000000000
--- a/mkspecs/winrt-arm-msvc2017/qplatformdefs.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the qmake spec of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "../common/winrt_winphone/qplatformdefs.h"
diff --git a/mkspecs/winrt-arm-msvc2019/qmake.conf b/mkspecs/winrt-arm-msvc2019/qmake.conf
deleted file mode 100644
index fe30a843eb..0000000000
--- a/mkspecs/winrt-arm-msvc2019/qmake.conf
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# qmake configuration for winrt-arm-msvc2019
-#
-# Written for Microsoft Visual C++ 2019
-#
-
-include(../common/winrt_winphone/qmake.conf)
-DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 ARM __ARM__ __arm__
-
-QMAKE_CFLAGS += -FS
-QMAKE_CXXFLAGS += -FS
-QMAKE_LFLAGS += /MACHINE:ARM /NODEFAULTLIB:kernel32.lib
-
-QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib
-
-VCPROJ_ARCH = ARM
-WINSDK_VER = 10.0
-WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
-WINRT_MANIFEST.architecture = arm
diff --git a/mkspecs/winrt-arm-msvc2019/qplatformdefs.h b/mkspecs/winrt-arm-msvc2019/qplatformdefs.h
deleted file mode 100644
index 4222bca8e1..0000000000
--- a/mkspecs/winrt-arm-msvc2019/qplatformdefs.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the qmake spec of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "../common/winrt_winphone/qplatformdefs.h"
diff --git a/mkspecs/winrt-arm64-msvc2017/qmake.conf b/mkspecs/winrt-arm64-msvc2017/qmake.conf
deleted file mode 100644
index e53c9ba748..0000000000
--- a/mkspecs/winrt-arm64-msvc2017/qmake.conf
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# qmake configuration for winrt-arm64-msvc2017
-#
-# Written for Microsoft Visual C++ 2017
-#
-
-include(../common/winrt_winphone/qmake.conf)
-DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 arm64 __arm64__ __arm64__
-
-QMAKE_CFLAGS += -FS
-QMAKE_CXXFLAGS += -FS
-QMAKE_LFLAGS += /MACHINE:arm64 /NODEFAULTLIB:kernel32.lib
-
-QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib
-
-VCPROJ_ARCH = arm64
-WINSDK_VER = 10.0
-WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
-WINRT_MANIFEST.architecture = arm64
diff --git a/mkspecs/winrt-arm64-msvc2017/qplatformdefs.h b/mkspecs/winrt-arm64-msvc2017/qplatformdefs.h
deleted file mode 100644
index 4222bca8e1..0000000000
--- a/mkspecs/winrt-arm64-msvc2017/qplatformdefs.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the qmake spec of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "../common/winrt_winphone/qplatformdefs.h"
diff --git a/mkspecs/winrt-arm64-msvc2019/qmake.conf b/mkspecs/winrt-arm64-msvc2019/qmake.conf
deleted file mode 100644
index 8c16e93d26..0000000000
--- a/mkspecs/winrt-arm64-msvc2019/qmake.conf
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# qmake configuration for winrt-arm64-msvc2019
-#
-# Written for Microsoft Visual C++ 2019
-#
-
-include(../common/winrt_winphone/qmake.conf)
-DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 arm64 __arm64__ __arm64__
-
-QMAKE_CFLAGS += -FS
-QMAKE_CXXFLAGS += -FS
-QMAKE_LFLAGS += /MACHINE:arm64 /NODEFAULTLIB:kernel32.lib
-
-QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib
-
-VCPROJ_ARCH = arm64
-WINSDK_VER = 10.0
-WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
-WINRT_MANIFEST.architecture = arm64
diff --git a/mkspecs/winrt-arm64-msvc2019/qplatformdefs.h b/mkspecs/winrt-arm64-msvc2019/qplatformdefs.h
deleted file mode 100644
index 4222bca8e1..0000000000
--- a/mkspecs/winrt-arm64-msvc2019/qplatformdefs.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the qmake spec of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "../common/winrt_winphone/qplatformdefs.h"
diff --git a/mkspecs/winrt-x64-msvc2015/qmake.conf b/mkspecs/winrt-x64-msvc2015/qmake.conf
deleted file mode 100644
index d1d1eb6513..0000000000
--- a/mkspecs/winrt-x64-msvc2015/qmake.conf
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# qmake configuration for winrt-x64-msvc2015
-#
-# Written for Microsoft Visual C++ 2015
-#
-
-include(../common/winrt_winphone/qmake.conf)
-DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 X64 __X64__ __x64__
-
-QMAKE_CFLAGS += -FS
-QMAKE_CXXFLAGS += -FS
-QMAKE_LFLAGS += /MACHINE:X64 /NODEFAULTLIB:kernel32.lib
-
-QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib
-
-VCPROJ_ARCH = x64
-WINSDK_VER = 10.0
-WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
-WINRT_MANIFEST.architecture = x64
diff --git a/mkspecs/winrt-x64-msvc2015/qplatformdefs.h b/mkspecs/winrt-x64-msvc2015/qplatformdefs.h
deleted file mode 100644
index 2a1aef5e88..0000000000
--- a/mkspecs/winrt-x64-msvc2015/qplatformdefs.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the qmake spec of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "../common/winrt_winphone/qplatformdefs.h"
diff --git a/mkspecs/winrt-x64-msvc2017/qmake.conf b/mkspecs/winrt-x64-msvc2017/qmake.conf
deleted file mode 100644
index dce896bd47..0000000000
--- a/mkspecs/winrt-x64-msvc2017/qmake.conf
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# qmake configuration for winrt-x64-msvc2017
-#
-# Written for Microsoft Visual C++ 2017
-#
-
-include(../common/winrt_winphone/qmake.conf)
-DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 X64 __X64__ __x64__
-
-QMAKE_CFLAGS += -FS
-QMAKE_CXXFLAGS += -FS
-QMAKE_LFLAGS += /MACHINE:X64 /NODEFAULTLIB:kernel32.lib
-
-QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib
-
-VCPROJ_ARCH = x64
-WINSDK_VER = 10.0
-WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
-WINRT_MANIFEST.architecture = x64
diff --git a/mkspecs/winrt-x64-msvc2017/qplatformdefs.h b/mkspecs/winrt-x64-msvc2017/qplatformdefs.h
deleted file mode 100644
index 2a1aef5e88..0000000000
--- a/mkspecs/winrt-x64-msvc2017/qplatformdefs.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the qmake spec of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "../common/winrt_winphone/qplatformdefs.h"
diff --git a/mkspecs/winrt-x64-msvc2019/qmake.conf b/mkspecs/winrt-x64-msvc2019/qmake.conf
deleted file mode 100644
index 0d3b6d2196..0000000000
--- a/mkspecs/winrt-x64-msvc2019/qmake.conf
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# qmake configuration for winrt-x64-msvc2019
-#
-# Written for Microsoft Visual C++ 2019
-#
-
-include(../common/winrt_winphone/qmake.conf)
-DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 X64 __X64__ __x64__
-
-QMAKE_CFLAGS += -FS
-QMAKE_CXXFLAGS += -FS
-QMAKE_LFLAGS += /MACHINE:X64 /NODEFAULTLIB:kernel32.lib
-
-QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib
-
-VCPROJ_ARCH = x64
-WINSDK_VER = 10.0
-WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
-WINRT_MANIFEST.architecture = x64
diff --git a/mkspecs/winrt-x64-msvc2019/qplatformdefs.h b/mkspecs/winrt-x64-msvc2019/qplatformdefs.h
deleted file mode 100644
index 4222bca8e1..0000000000
--- a/mkspecs/winrt-x64-msvc2019/qplatformdefs.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the qmake spec of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "../common/winrt_winphone/qplatformdefs.h"
diff --git a/mkspecs/winrt-x86-msvc2015/qmake.conf b/mkspecs/winrt-x86-msvc2015/qmake.conf
deleted file mode 100644
index 06f059b600..0000000000
--- a/mkspecs/winrt-x86-msvc2015/qmake.conf
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# qmake configuration for winrt-x86-msvc2015
-#
-# Written for Microsoft Visual C++ 2015
-#
-
-include(../common/winrt_winphone/qmake.conf)
-DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 X86 __X86__ __x86__
-
-QMAKE_CFLAGS += -FS
-QMAKE_CXXFLAGS += -FS
-QMAKE_LFLAGS += /SAFESEH /MACHINE:X86 /NODEFAULTLIB:kernel32.lib
-
-QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib
-VCPROJ_ARCH = Win32
-WINSDK_VER = 10.0
-WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
-WINRT_MANIFEST.architecture = x86
diff --git a/mkspecs/winrt-x86-msvc2015/qplatformdefs.h b/mkspecs/winrt-x86-msvc2015/qplatformdefs.h
deleted file mode 100644
index 2a1aef5e88..0000000000
--- a/mkspecs/winrt-x86-msvc2015/qplatformdefs.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the qmake spec of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "../common/winrt_winphone/qplatformdefs.h"
diff --git a/mkspecs/winrt-x86-msvc2017/qmake.conf b/mkspecs/winrt-x86-msvc2017/qmake.conf
deleted file mode 100644
index 94fb68f6c0..0000000000
--- a/mkspecs/winrt-x86-msvc2017/qmake.conf
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# qmake configuration for winrt-x86-msvc2017
-#
-# Written for Microsoft Visual C++ 2017
-#
-
-include(../common/winrt_winphone/qmake.conf)
-DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 X86 __X86__ __x86__
-
-QMAKE_CFLAGS += -FS
-QMAKE_CXXFLAGS += -FS
-QMAKE_LFLAGS += /SAFESEH /MACHINE:X86 /NODEFAULTLIB:kernel32.lib
-
-QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib
-VCPROJ_ARCH = Win32
-WINSDK_VER = 10.0
-WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
-WINRT_MANIFEST.architecture = x86
diff --git a/mkspecs/winrt-x86-msvc2017/qplatformdefs.h b/mkspecs/winrt-x86-msvc2017/qplatformdefs.h
deleted file mode 100644
index 2a1aef5e88..0000000000
--- a/mkspecs/winrt-x86-msvc2017/qplatformdefs.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the qmake spec of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "../common/winrt_winphone/qplatformdefs.h"
diff --git a/mkspecs/winrt-x86-msvc2019/qmake.conf b/mkspecs/winrt-x86-msvc2019/qmake.conf
deleted file mode 100644
index 8948e20ab1..0000000000
--- a/mkspecs/winrt-x86-msvc2019/qmake.conf
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# qmake configuration for winrt-x86-msvc2019
-#
-# Written for Microsoft Visual C++ 2019
-#
-
-include(../common/winrt_winphone/qmake.conf)
-DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 X86 __X86__ __x86__
-
-QMAKE_CFLAGS += -FS
-QMAKE_CXXFLAGS += -FS
-QMAKE_LFLAGS += /SAFESEH /MACHINE:X86 /NODEFAULTLIB:kernel32.lib
-
-QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib
-VCPROJ_ARCH = Win32
-WINSDK_VER = 10.0
-WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
-WINRT_MANIFEST.architecture = x86
diff --git a/mkspecs/winrt-x86-msvc2019/qplatformdefs.h b/mkspecs/winrt-x86-msvc2019/qplatformdefs.h
deleted file mode 100644
index 4222bca8e1..0000000000
--- a/mkspecs/winrt-x86-msvc2019/qplatformdefs.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the qmake spec of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "../common/winrt_winphone/qplatformdefs.h"
diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc
index 95a0f42625..9b37756b79 100644
--- a/qmake/doc/src/qmake-manual.qdoc
+++ b/qmake/doc/src/qmake-manual.qdoc
@@ -3219,9 +3219,6 @@
On desktop Windows, the default value is the value of the environment
variable \c{WindowsSDKVersion}.
- On Universal Windows Platform (UWP), the default value is the value of the
- environment variable \c{UCRTVERSION}.
-
\target WINDOWS_TARGET_PLATFORM_MIN_VERSION
\section1 WINDOWS_TARGET_PLATFORM_MIN_VERSION
@@ -3230,172 +3227,6 @@
Defaults to \c{WINDOWS_TARGET_PLATFORM_VERSION}.
- \target WINRT_MANIFEST
- \section1 WINRT_MANIFEST
-
- Specifies parameters to be passed to the application manifest on
- \l{Qt for UWP}{UWP}. The allowed values are:
-
- \table
- \header
- \li Member
- \li Description
- \row
- \li architecture
- \li The target architecture. Defaults to \c VCPROJ_ARCH.
- \row
- \li background
- \li Tile background color. Defaults to \c{green}.
- \row
- \li capabilities
- \li Specifies capabilities to add to the capability list.
- \row
- \li capabilities_device
- \li Specifies device capabilities to add to the capability list
- (location, webcam, and so on).
- \row
- \li CONFIG
- \li Specifies additional flags for processing the input manifest file.
- Currently, \c{verbatim} is the only available option.
- \row
- \li default_language
- \li The default language code of the application. Defaults to "en".
- \row
- \li dependencies
- \li Specifies dependencies required by the package.
- \row
- \li description
- \li Package description. Defaults to \c{Default package description}.
- \row
- \li foreground
- \li Tile foreground (text) color. Defaults to \c{light}.
- \row
- \li iconic_tile_icon
- \li Image file for the \c{iconic} tile template icon. Default provided by
- the mkspec.
- \row
- \li iconic_tile_small
- \li Image file for the small \c{iconic} tile template logo. Default provided
- by the mkspec.
- \row
- \li identity
- \li The unique ID of the app. Defaults to reusing the existing generated
- manifest's UUID, or generates a new UUID if none is present.
- \row
- \li logo_30x30
- \li Logo image file of size 30x30 pixels.
- \row
- \li logo_41x41
- \li Logo image file of size 41x41 pixels. This parameter is obsolete.
- \row
- \li logo_70x70
- \li Logo image file of size 70x70 pixels.
- \row
- \li logo_71x71
- \li Logo image file of size 71x71 pixels. This parameter is obsolete.
- \row
- \li logo_150x150
- \li Logo image file of size 150x150 pixels. This is supported on all Windows
- Store App platforms.
- \row
- \li logo_310x150
- \li Logo image file of size 310x150 pixels. This is supported on all Windows
- Store App platforms.
- \row
- \li logo_310x310
- \li Logo image file of size 310x310 pixels. This is supported on all Windows
- Store App platforms.
- \row
- \li logo_620x300
- \li Splash screen image file of size 620x300 pixels.
- \row
- \li logo_480x800
- \li Splash screen image file of size 480x800 pixels.
- This parameter is obsolete.
- \row
- \li logo_large
- \li Large logo image file. This has to be 150x150 pixels. Supported on all
- Windows Store App platforms. Default provided by the mkspec.
- \row
- \li logo_medium
- \li Medium logo image file. The image must have a pixel size of 70x70.
- Default provided by the mkspec.
- \row
- \li logo_small
- \li Small logo image file. The image must have a pixel size of 30x30.
- Default provided by the mkspec.
- \row
- \li logo_splash
- \li Splash screen image file. The image must have a pixel size of
- 620x300. Default provided by the mkspec.
- \row
- \li logo_store
- \li Logo image file for Windows Store. Default provided by the mkspec.
- \row
- \li logo_wide
- \li Wide logo image file. This has to be 310x150 pixels. Supported on all
- Windows Store App platforms. Default provided by the mkspec.
- \row
- \li name
- \li The name of the package as displayed to the user. Defaults to TARGET.
- \row
- \li phone_product_id
- \li The GUID of the product.
- This parameter is obsolete.
- \row
- \li phone_publisher_id
- \li The GUID of the publisher.
- This parameter is obsolete.
- \row
- \li publisher
- \li Display name of the publisher. Defaults to \c{Default publisher display name}.
- \row
- \li publisher_id
- \li The publisher's distinguished name (default: \c{CN=MyCN}).
- \row
- \li target
- \li The name of the target (.exe). Defaults to TARGET.
- \row
- \li version
- \li The version number of the package. Defaults to \c{1.0.0.0}.
- \row
- \li minVersion
- \li The minimum required Windows version to run the package.
- Defaults to \c{WINDOWS_TARGET_PLATFORM_VERSION}.
- \row
- \li maxVersionTested
- \li The maximum Windows version the package has been tested against.
- Defaults to \c{WINDOWS_TARGET_PLATFORM_MIN_VERSION}.
-
- \endtable
-
- You can use any combination of those values.
-
- For example:
-
- \code
- WINRT_MANIFEST.publisher = MyCompany
- WINRT_MANIFEST.logo_store = someImage.png
- WINRT_MANIFEST.capabilities += internetClient
- WINRT_MANIFEST.capabilities_device += location
- \endcode
-
- Additionally, an input manifest file can be specified by using WINRT_MANIFEST.
-
- For example:
-
- \code
- WINRT_MANIFEST = someManifest.xml.in
- \endcode
-
- In case the input manifest file should not be processed and only copied to
- the target directory, the verbatim configuration needs to be set.
-
- \code
- WINRT_MANIFEST = someManifest.xml.in
- WINRT_MANIFEST.CONFIG += verbatim
- \endcode
-
\target YACCSOURCES
\section1 YACCSOURCES
diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp
index 82c0983272..4129482990 100644
--- a/qmake/generators/win32/msbuild_objectmodel.cpp
+++ b/qmake/generators/win32/msbuild_objectmodel.cpp
@@ -612,16 +612,6 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
<< tag("ItemGroup")
<< attrTag("Label", "ProjectConfigurations");
- bool isWinRT = false;
- for (int i = 0; i < tool.SingleProjects.count(); ++i) {
- xml << tag("ProjectConfiguration")
- << attrTag("Include" , tool.SingleProjects.at(i).Configuration.Name)
- << tagValue("Configuration", tool.SingleProjects.at(i).Configuration.ConfigurationName)
- << tagValue("Platform", tool.SingleProjects.at(i).PlatformName)
- << closetag();
- isWinRT = isWinRT || tool.SingleProjects.at(i).Configuration.WinRT;
- }
-
xml << closetag()
<< tag("PropertyGroup")
<< attrTag("Label", "Globals")
@@ -629,13 +619,6 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
<< tagValue("RootNamespace", tool.Name)
<< tagValue("Keyword", tool.Keyword);
- if (isWinRT) {
- xml << tagValue("MinimumVisualStudioVersion", tool.Version)
- << tagValue("DefaultLanguage", "en")
- << tagValue("AppContainerApplication", "true")
- << tagValue("ApplicationType", "Windows Store")
- << tagValue("ApplicationTypeRevision", tool.SdkVersion);
- }
if (!tool.WindowsTargetPlatformVersion.isEmpty())
xml << tagValue("WindowsTargetPlatformVersion", tool.WindowsTargetPlatformVersion);
if (!tool.WindowsTargetPlatformMinVersion.isEmpty())
@@ -825,41 +808,6 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
}
outputFilter(tool, xml, xmlFilter, "Root Files");
- // App manifest
- if (isWinRT) {
- const QString manifest = QStringLiteral("Package.appxmanifest");
-
- // Find all icons referenced in the manifest
- QSet<QString> icons;
- QFile manifestFile(Option::output_dir + QLatin1Char('/') + manifest);
- if (manifestFile.open(QFile::ReadOnly)) {
- const QString contents = manifestFile.readAll();
- QRegularExpression regexp("[\\\\/a-zA-Z0-9_\\-\\!]*\\.(png|jpg|jpeg)");
- int pos = 0;
- while (pos > -1) {
- QRegularExpressionMatch m;
- pos = contents.indexOf(regexp, pos, &m);
- if (pos >= 0) {
- const QString match = m.captured(0);
- icons.insert(match);
- pos += match.length();
- }
- }
- }
-
- // Write out manifest + icons as content items
- xml << tag(_ItemGroup)
- << tag("AppxManifest")
- << attrTag("Include", manifest)
- << closetag();
- for (const QString &icon : qAsConst(icons)) {
- xml << tag("Image")
- << attrTag("Include", icon)
- << closetag();
- }
- xml << closetag();
- }
-
xml << import("Project", "$(VCTargetsPath)\\Microsoft.Cpp.targets")
<< tag("ImportGroup")
<< attrTag("Label", "ExtensionTargets")
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp
index 9e93fe51f3..15e13a1c32 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -2166,8 +2166,7 @@ VCPreLinkEventTool::VCPreLinkEventTool()
// VCConfiguration --------------------------------------------------
VCConfiguration::VCConfiguration()
- : WinRT(false),
- ATLMinimizesCRunTimeLibraryUsage(unset),
+ : ATLMinimizesCRunTimeLibraryUsage(unset),
BuildBrowserInformation(unset),
CharacterSet(charSetNotSet),
ConfigurationType(typeApplication),
diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h
index 33eff0d914..8793c793ef 100644
--- a/qmake/generators/win32/msvc_objectmodel.h
+++ b/qmake/generators/win32/msvc_objectmodel.h
@@ -872,7 +872,6 @@ public:
bool suppressUnknownOptionWarnings;
DotNET CompilerVersion;
- bool WinRT;
// Variables
triState ATLMinimizesCRunTimeLibraryUsage;
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index e117f472e0..e679cf4f31 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -642,7 +642,6 @@ void VcprojGenerator::writeSubDirs(QTextStream &t)
for(QList<VcsolutionDepend*>::Iterator it = solution_cleanup.begin(); it != solution_cleanup.end(); ++it) {
QString platform = is64Bit ? "x64" : "Win32";
QString xplatform = platform;
- const bool isWinRT = project->isActiveConfig("winrt");
if (!project->isEmpty("VCPROJ_ARCH")) {
xplatform = project->first("VCPROJ_ARCH").toQString();
}
@@ -650,12 +649,8 @@ void VcprojGenerator::writeSubDirs(QTextStream &t)
platform = xplatform;
t << "\n\t\t" << (*it)->uuid << QString(_slnProjDbgConfTag1).arg(xplatform) << platform;
t << "\n\t\t" << (*it)->uuid << QString(_slnProjDbgConfTag2).arg(xplatform) << platform;
- if (isWinRT)
- t << "\n\t\t" << (*it)->uuid << QString(_slnProjDbgConfTag3).arg(xplatform) << platform;
t << "\n\t\t" << (*it)->uuid << QString(_slnProjRelConfTag1).arg(xplatform) << platform;
t << "\n\t\t" << (*it)->uuid << QString(_slnProjRelConfTag2).arg(xplatform) << platform;
- if (isWinRT)
- t << "\n\t\t" << (*it)->uuid << QString(_slnProjRelConfTag3).arg(xplatform) << platform;
}
t << _slnProjConfEnd;
t << _slnExtSections;
@@ -960,16 +955,6 @@ void VcprojGenerator::initConfiguration()
conf.suppressUnknownOptionWarnings = project->isActiveConfig("suppress_vcproj_warnings");
conf.CompilerVersion = vsVersionFromString(project->first("MSVC_VER"));
- if (conf.CompilerVersion >= NET2012) {
- conf.WinRT = project->isActiveConfig("winrt");
- if (conf.WinRT) {
- // Saner defaults
- conf.compiler.UsePrecompiledHeader = pchNone;
- conf.compiler.CompileAsWinRT = _False;
- conf.linker.GenerateWindowsMetadata = _False;
- }
- }
-
initCompilerTool();
// Only on configuration per build
@@ -1028,7 +1013,7 @@ void VcprojGenerator::initConfiguration()
conf.ATLMinimizesCRunTimeLibraryUsage = (project->first("ATLMinimizesCRunTimeLibraryUsage").isEmpty() ? _False : _True);
conf.BuildBrowserInformation = triState(temp.isEmpty() ? (short)unset : temp.toShort());
temp = project->first("CharacterSet");
- conf.CharacterSet = charSet(temp.isEmpty() ? short(conf.WinRT ? charSetUnicode : charSetNotSet) : temp.toShort());
+ conf.CharacterSet = charSet(temp.isEmpty() ? short(charSetNotSet) : temp.toShort());
conf.DeleteExtensionsOnClean = project->first("DeleteExtensionsOnClean").toQString();
conf.ImportLibrary = conf.linker.ImportLibrary;
conf.IntermediateDirectory = project->first("OBJECTS_DIR").toQString();
@@ -1046,7 +1031,7 @@ void VcprojGenerator::initConfiguration()
initPreBuildEventTools();
initPostBuildEventTools();
// Only deploy for crosscompiled projects
- if (!project->isHostBuild() || conf.WinRT)
+ if (!project->isHostBuild())
initDeploymentTool();
initWinDeployQtTool();
initPreLinkEventTools();
@@ -1193,23 +1178,15 @@ void VcprojGenerator::initDeploymentTool()
{
VCConfiguration &conf = vcProject.Configuration;
QString targetPath;
- if (conf.WinRT) {
- vcProject.DeploymentFiles.Name = "Deployment Files";
- vcProject.DeploymentFiles.ParseFiles = _False;
- vcProject.DeploymentFiles.Filter = "deploy";
- vcProject.DeploymentFiles.Guid = _GUIDDeploymentFiles;
- } else {
- targetPath = project->values("deploy.path").join(' ');
- if (targetPath.isEmpty())
- targetPath = QString("%CSIDL_PROGRAM_FILES%\\") + project->first("TARGET");
- if (targetPath.endsWith("/") || targetPath.endsWith("\\"))
- targetPath.chop(1);
- conf.deployment.RemoteDirectory = targetPath;
- }
+ targetPath = project->values("deploy.path").join(' ');
+ if (targetPath.isEmpty())
+ targetPath = QString("%CSIDL_PROGRAM_FILES%\\") + project->first("TARGET");
+ if (targetPath.endsWith("/") || targetPath.endsWith("\\"))
+ targetPath.chop(1);
+ conf.deployment.RemoteDirectory = targetPath;
const ProStringList dllPaths = project->values("QMAKE_DLL_PATHS");
// Only deploy Qt libs for shared build
- if (!dllPaths.isEmpty() &&
- !(conf.WinRT && project->first("MSVC_VER").toQString() == "14.0")) {
+ if (!dllPaths.isEmpty()) {
// FIXME: This code should actually resolve the libraries from all Qt modules.
ProStringList arg = project->values("LIBS") + project->values("LIBS_PRIVATE")
+ project->values("QMAKE_LIBS") + project->values("QMAKE_LIBS_PRIVATE");
@@ -1238,39 +1215,35 @@ void VcprojGenerator::initDeploymentTool()
if (!info.exists())
continue;
- if (conf.WinRT) {
- QString absoluteFilePath(QDir::toNativeSeparators(info.absoluteFilePath()));
- vcProject.DeploymentFiles.addFile(absoluteFilePath);
- } else {
- conf.deployment.AdditionalFiles += info.fileName()
- + "|" + QDir::toNativeSeparators(info.absolutePath())
- + "|" + targetPath
- + "|0;";
- if (!qpaPluginDeployed) {
- QString debugInfix;
- bool foundGuid = dllName.contains(QLatin1String("Guid"));
- if (foundGuid)
- debugInfix = QLatin1Char('d');
-
- if (foundGuid || dllName.contains(QLatin1String("Gui"))) {
- QFileInfo info2;
- for (const ProString &dllPath : dllPaths) {
- QString absoluteDllFilePath = dllPath.toQString();
- if (!absoluteDllFilePath.endsWith(QLatin1Char('/')))
- absoluteDllFilePath += QLatin1Char('/');
- absoluteDllFilePath += QLatin1String("../plugins/platforms/qwindows")
- + debugInfix + QLatin1String(".dll");
- info2 = QFileInfo(absoluteDllFilePath);
- if (info2.exists())
- break;
- }
- if (info2.exists()) {
- conf.deployment.AdditionalFiles += QLatin1String("qwindows") + debugInfix + QLatin1String(".dll")
- + QLatin1Char('|') + QDir::toNativeSeparators(info2.absolutePath())
- + QLatin1Char('|') + targetPath + QLatin1String("\\platforms")
- + QLatin1String("|0;");
- qpaPluginDeployed = true;
- }
+
+ conf.deployment.AdditionalFiles += info.fileName()
+ + "|" + QDir::toNativeSeparators(info.absolutePath())
+ + "|" + targetPath
+ + "|0;";
+ if (!qpaPluginDeployed) {
+ QString debugInfix;
+ bool foundGuid = dllName.contains(QLatin1String("Guid"));
+ if (foundGuid)
+ debugInfix = QLatin1Char('d');
+
+ if (foundGuid || dllName.contains(QLatin1String("Gui"))) {
+ QFileInfo info2;
+ for (const ProString &dllPath : dllPaths) {
+ QString absoluteDllFilePath = dllPath.toQString();
+ if (!absoluteDllFilePath.endsWith(QLatin1Char('/')))
+ absoluteDllFilePath += QLatin1Char('/');
+ absoluteDllFilePath += QLatin1String("../plugins/platforms/qwindows")
+ + debugInfix + QLatin1String(".dll");
+ info2 = QFileInfo(absoluteDllFilePath);
+ if (info2.exists())
+ break;
+ }
+ if (info2.exists()) {
+ conf.deployment.AdditionalFiles += QLatin1String("qwindows") + debugInfix + QLatin1String(".dll")
+ + QLatin1Char('|') + QDir::toNativeSeparators(info2.absolutePath())
+ + QLatin1Char('|') + targetPath + QLatin1String("\\platforms")
+ + QLatin1String("|0;");
+ qpaPluginDeployed = true;
}
}
}
@@ -1280,16 +1253,14 @@ void VcprojGenerator::initDeploymentTool()
for (const ProString &item : project->values("INSTALLS")) {
// get item.path
QString devicePath = project->first(ProKey(item + ".path")).toQString();
- if (!conf.WinRT) {
- if (devicePath.isEmpty())
- devicePath = targetPath;
- // check if item.path is relative (! either /,\ or %)
- if (!(devicePath.at(0) == QLatin1Char('/')
- || devicePath.at(0) == QLatin1Char('\\')
- || devicePath.at(0) == QLatin1Char('%'))) {
- // create output path
- devicePath = Option::fixPathToTargetOS(targetPath + QLatin1Char('\\') + devicePath);
- }
+ if (devicePath.isEmpty())
+ devicePath = targetPath;
+ // check if item.path is relative (! either /,\ or %)
+ if (!(devicePath.at(0) == QLatin1Char('/')
+ || devicePath.at(0) == QLatin1Char('\\')
+ || devicePath.at(0) == QLatin1Char('%'))) {
+ // create output path
+ devicePath = Option::fixPathToTargetOS(targetPath + QLatin1Char('\\') + devicePath);
}
// foreach d in item.files
for (const ProString &src : project->values(ProKey(item + ".files"))) {
@@ -1314,25 +1285,16 @@ void VcprojGenerator::initDeploymentTool()
// foreach dirIterator-entry in d
while(iterator.hasNext()) {
iterator.next();
- if (conf.WinRT) {
- QString absoluteItemFilePath = Option::fixPathToTargetOS(QFileInfo(iterator.filePath()).absoluteFilePath());
- vcProject.DeploymentFiles.addFile(absoluteItemFilePath);
- } else {
- QString absoluteItemPath = Option::fixPathToTargetOS(QFileInfo(iterator.filePath()).absolutePath());
- // Identify if it is just another subdir
- int diffSize = absoluteItemPath.size() - pathSize;
- // write out rules
- conf.deployment.AdditionalFiles += iterator.fileName()
- + "|" + absoluteItemPath
- + "|" + itemDevicePath + (diffSize ? (absoluteItemPath.right(diffSize)) : QLatin1String(""))
- + "|0;";
- }
- }
- }
- if (conf.WinRT) {
- vcProject.DeploymentFiles.Project = this;
- vcProject.DeploymentFiles.Config = &(vcProject.Configuration);
+ QString absoluteItemPath = Option::fixPathToTargetOS(QFileInfo(iterator.filePath()).absolutePath());
+ // Identify if it is just another subdir
+ int diffSize = absoluteItemPath.size() - pathSize;
+ // write out rules
+ conf.deployment.AdditionalFiles += iterator.fileName()
+ + "|" + absoluteItemPath
+ + "|" + itemDevicePath + (diffSize ? (absoluteItemPath.right(diffSize)) : QLatin1String(""))
+ + "|0;";
+ }
}
}
}
diff --git a/src/3rdparty/libjpeg.pri b/src/3rdparty/libjpeg.pri
index 5effbe9d26..9af79e58dc 100644
--- a/src/3rdparty/libjpeg.pri
+++ b/src/3rdparty/libjpeg.pri
@@ -1,5 +1,3 @@
-winrt: DEFINES += NO_GETENV
-
# Disable warnings in 3rdparty code due to unused arguments
gcc: QMAKE_CFLAGS_WARN_ON += -Wno-unused-parameter -Wno-main
diff --git a/src/3rdparty/libpng/pngpriv.h b/src/3rdparty/libpng/pngpriv.h
index 2ab9b70d73..acfc9cf280 100644
--- a/src/3rdparty/libpng/pngpriv.h
+++ b/src/3rdparty/libpng/pngpriv.h
@@ -557,9 +557,6 @@
#if defined(WIN32) || defined(_Windows) || defined(_WINDOWS) || \
defined(_WIN32) || defined(__WIN32__)
# include <windows.h> /* defines _WINDOWS_ macro */
-# if defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP)
-# define _WINRT_ /* Define a macro for Windows Runtime builds */
-# endif
#endif
#endif /* PNG_VERSION_INFO_ONLY */
@@ -570,7 +567,7 @@
/* Memory model/platform independent fns */
#ifndef PNG_ABORT
-# if (defined(_WINDOWS_) || defined(_WIN32_WCE)) && !defined(_WINRT_)
+# if (defined(_WINDOWS_) || defined(_WIN32_WCE))
# define PNG_ABORT() ExitProcess(0)
# else
# define PNG_ABORT() abort()
diff --git a/src/3rdparty/libpng/qtpatches.diff b/src/3rdparty/libpng/qtpatches.diff
index 7ec8388ed0..f90558103b 100644
--- a/src/3rdparty/libpng/qtpatches.diff
+++ b/src/3rdparty/libpng/qtpatches.diff
@@ -31,9 +31,6 @@ index 583c26f9bd..2ab9b70d73 100644
#if defined(WIN32) || defined(_Windows) || defined(_WINDOWS) || \
defined(_WIN32) || defined(__WIN32__)
# include <windows.h> /* defines _WINDOWS_ macro */
-+# if defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP)
-+# define _WINRT_ /* Define a macro for Windows Runtime builds */
-+# endif
#endif
#endif /* PNG_VERSION_INFO_ONLY */
@@ -42,7 +39,7 @@ index 583c26f9bd..2ab9b70d73 100644
/* Memory model/platform independent fns */
#ifndef PNG_ABORT
-# ifdef _WINDOWS_
-+# if (defined(_WINDOWS_) || defined(_WIN32_WCE)) && !defined(_WINRT_)
++# if (defined(_WINDOWS_) || defined(_WIN32_WCE))
# define PNG_ABORT() ExitProcess(0)
# else
# define PNG_ABORT() abort()
diff --git a/src/3rdparty/pcre2/CMakeLists.txt b/src/3rdparty/pcre2/CMakeLists.txt
index 796f54c463..1a63de4d54 100644
--- a/src/3rdparty/pcre2/CMakeLists.txt
+++ b/src/3rdparty/pcre2/CMakeLists.txt
@@ -52,7 +52,7 @@ qt_set_symbol_visibility_hidden(BundledPcre2)
## Scopes:
#####################################################################
-qt_extend_target(BundledPcre2 CONDITION QNX OR UIKIT OR WINRT
+qt_extend_target(BundledPcre2 CONDITION QNX OR UIKIT
DEFINES
PCRE2_DISABLE_JIT
)
diff --git a/src/3rdparty/pcre2/pcre2.pro b/src/3rdparty/pcre2/pcre2.pro
index a3915fa2fa..7b2b430f63 100644
--- a/src/3rdparty/pcre2/pcre2.pro
+++ b/src/3rdparty/pcre2/pcre2.pro
@@ -8,7 +8,7 @@ CONFIG += \
include(pcre2.pri)
# platform/compiler specific definitions
-uikit|qnx|winrt: DEFINES += PCRE2_DISABLE_JIT
+uikit|qnx: DEFINES += PCRE2_DISABLE_JIT
win32:contains(QT_ARCH, "arm"): DEFINES += PCRE2_DISABLE_JIT
win32:contains(QT_ARCH, "arm64"): DEFINES += PCRE2_DISABLE_JIT
diff --git a/src/3rdparty/sqlite.pri b/src/3rdparty/sqlite.pri
index cc8c12a6da..f4c8062468 100644
--- a/src/3rdparty/sqlite.pri
+++ b/src/3rdparty/sqlite.pri
@@ -3,12 +3,8 @@ QT_FOR_CONFIG += core-private
DEFINES += SQLITE_ENABLE_COLUMN_METADATA SQLITE_OMIT_COMPLETE SQLITE_ENABLE_FTS3 SQLITE_ENABLE_FTS3_PARENTHESIS SQLITE_ENABLE_FTS5 SQLITE_ENABLE_RTREE SQLITE_ENABLE_JSON1
!contains(CONFIG, largefile):DEFINES += SQLITE_DISABLE_LFS
qtConfig(posix_fallocate): DEFINES += HAVE_POSIX_FALLOCATE=1
-winrt {
- DEFINES += SQLITE_OS_WINRT
- QMAKE_CFLAGS += -Gy
-}
qnx: DEFINES += _QNX_SOURCE
-!win32:!winrt:!winphone: DEFINES += HAVE_USLEEP=1
+!win32: DEFINES += HAVE_USLEEP=1
qtConfig(dlopen) {
QMAKE_USE += libdl
} else {
diff --git a/src/corelib/.prev_CMakeLists.txt b/src/corelib/.prev_CMakeLists.txt
index 51bb15fc3c..59e670e5db 100644
--- a/src/corelib/.prev_CMakeLists.txt
+++ b/src/corelib/.prev_CMakeLists.txt
@@ -338,29 +338,24 @@ qt_extend_target(Core CONDITION WIN32
io/qfilesystemengine_win.cpp
io/qfsfileengine_win.cpp
io/qlockfile_win.cpp
+ io/qstandardpaths_win.cpp
+ io/qstorageinfo_win.cpp
+ io/qwindowspipereader.cpp io/qwindowspipereader_p.h
+ io/qwindowspipewriter.cpp io/qwindowspipewriter_p.h
kernel/qcoreapplication_win.cpp
kernel/qelapsedtimer_win.cpp
+ kernel/qeventdispatcher_win.cpp kernel/qeventdispatcher_win_p.h
+ kernel/qfunctions_winrt_p.h
kernel/qsharedmemory_win.cpp
kernel/qsystemsemaphore_win.cpp
kernel/qwineventnotifier.cpp kernel/qwineventnotifier.h kernel/qwineventnotifier_p.h
+ kernel/qwinregistry.cpp kernel/qwinregistry_p.h
plugin/qsystemlibrary.cpp plugin/qsystemlibrary_p.h
thread/qatomic_msvc.h
thread/qthread_win.cpp
DEFINES
-QT_NO_CAST_TO_ASCII
LIBRARIES
- ws2_32
-)
-
-qt_extend_target(Core CONDITION WIN32 AND NOT WINRT
- SOURCES
- io/qstandardpaths_win.cpp
- io/qstorageinfo_win.cpp
- io/qwindowspipereader.cpp io/qwindowspipereader_p.h
- io/qwindowspipewriter.cpp io/qwindowspipewriter_p.h
- kernel/qeventdispatcher_win.cpp kernel/qeventdispatcher_win_p.h
- kernel/qwinregistry.cpp kernel/qwinregistry_p.h
- LIBRARIES
advapi32
kernel32
netapi32
@@ -370,6 +365,7 @@ qt_extend_target(Core CONDITION WIN32 AND NOT WINRT
uuid
version
winmm
+ ws2_32
PUBLIC_LIBRARIES
mpr
userenv
@@ -413,27 +409,27 @@ qt_extend_target(Core CONDITION INTEGRITY
--pending_instantiations=128
)
-#### Keys ignored in scope 15:.:.:corelib.pro:pathIsAbsolute(_ss_CMAKE_HOST_DATA_DIR):
+#### Keys ignored in scope 14:.:.:corelib.pro:pathIsAbsolute(_ss_CMAKE_HOST_DATA_DIR):
# CMAKE_HOST_DATA_DIR = "$$[QT_HOST_DATA/src]/"
# CMAKE_HOST_DATA_DIR_IS_ABSOLUTE = "True"
-#### Keys ignored in scope 16:.:.:corelib.pro:pathIsAbsolute(_ss_CMAKE_INSTALL_DATA_DIR):
+#### Keys ignored in scope 15:.:.:corelib.pro:pathIsAbsolute(_ss_CMAKE_INSTALL_DATA_DIR):
# CMAKE_INSTALL_DATA_DIR = "$$[QT_HOST_DATA]/"
# CMAKE_INSTALL_DATA_DIR_IS_ABSOLUTE = "True"
-#### Keys ignored in scope 21:.:global:global/global.pri:QT_CPU_FEATURES__ss_QT_ARCH___contains___f16c:
+#### Keys ignored in scope 20:.:global:global/global.pri:QT_CPU_FEATURES__ss_QT_ARCH___contains___f16c:
# f16c_cxx = "true"
-#### Keys ignored in scope 23:.:global:global/global.pri:CLANG OR intel_icl OR ICC:
+#### Keys ignored in scope 22:.:global:global/global.pri:CLANG OR intel_icl OR ICC:
# f16c_cxx = "false"
-#### Keys ignored in scope 25:.:global:global/global.pri:GCC AND f16c AND x86SimdAlways:
+#### Keys ignored in scope 24:.:global:global/global.pri:GCC AND f16c AND x86SimdAlways:
# f16c_cxx = "true"
-#### Keys ignored in scope 27:.:global:global/global.pri:MSVC AND QT_CPU_FEATURES__ss_QT_ARCH___contains___avx:
+#### Keys ignored in scope 26:.:global:global/global.pri:MSVC AND QT_CPU_FEATURES__ss_QT_ARCH___contains___avx:
# f16c_cxx = "true"
-#### Keys ignored in scope 28:.:global:global/global.pri:else:
+#### Keys ignored in scope 27:.:global:global/global.pri:else:
# f16c_cxx = "false"
qt_extend_target(Core CONDITION _ss_f16c_cxx
@@ -460,7 +456,7 @@ qt_extend_target(Core CONDITION LINUX AND NOT static
global/minimum-linux_p.h
)
-#### Keys ignored in scope 35:.:global:global/global.pri:precompile_header:
+#### Keys ignored in scope 34:.:global:global/global.pri:precompile_header:
# NO_PCH_ASM = "global/minimum-linux.S"
# QMAKE_EXTRA_COMPILERS = "no_pch_assembler"
# no_pch_assembler.commands = "$$QMAKE_CC" "-c" "$(CFLAGS)" "$(INCPATH)" "${QMAKE_FILE_IN}" "-o" "${QMAKE_FILE_OUT}"
@@ -469,7 +465,7 @@ qt_extend_target(Core CONDITION LINUX AND NOT static
# no_pch_assembler.name = "compiling[no_pch]" "${QMAKE_FILE_IN}"
# no_pch_assembler.output = "${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${firstQMAKE_EXT_OBJ}"
-#### Keys ignored in scope 36:.:global:global/global.pri:silent:
+#### Keys ignored in scope 35:.:global:global/global.pri:silent:
# no_pch_assembler.commands = "@echo" "compiling[no_pch]" "${QMAKE_FILE_IN}" "&&"
qt_extend_target(Core CONDITION LINUX AND NOT precompile_header AND NOT static
@@ -487,7 +483,7 @@ qt_extend_target(Core CONDITION QT_FEATURE_journald
PkgConfig::Libsystemd
)
-#### Keys ignored in scope 40:.:global:global/global.pri:GCC AND ltcg:
+#### Keys ignored in scope 39:.:global:global/global.pri:GCC AND ltcg:
# QMAKE_EXTRA_COMPILERS = "versiontagging_compiler"
# versiontagging_compiler.commands = "$$QMAKE_CXX" "-c" "$(CXXFLAGS)" "$(INCPATH)" "-fno-lto" "-o" "${QMAKE_FILE_OUT}" "${QMAKE_FILE_IN}"
# versiontagging_compiler.dependency_type = "TYPE_C"
@@ -496,7 +492,7 @@ qt_extend_target(Core CONDITION QT_FEATURE_journald
# versiontagging_compiler.output = "${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${firstQMAKE_EXT_OBJ}"
# versiontagging_compiler.variable_out = "OBJECTS"
-#### Keys ignored in scope 41:.:global:global/global.pri:silent:
+#### Keys ignored in scope 40:.:global:global/global.pri:silent:
# versiontagging_compiler.commands = "@echo" "compiling[versiontagging]" "${QMAKE_FILE_IN}" "&&"
qt_extend_target(Core CONDITION NOT GCC OR NOT ltcg
@@ -797,7 +793,7 @@ qt_extend_target(Core CONDITION QT_FEATURE_processenvironment
io/qprocess.cpp io/qprocess.h io/qprocess_p.h
)
-qt_extend_target(Core CONDITION QT_FEATURE_processenvironment AND WIN32 AND NOT WINRT
+qt_extend_target(Core CONDITION QT_FEATURE_processenvironment AND WIN32
SOURCES
io/qprocess_win.cpp
)
@@ -812,16 +808,11 @@ qt_extend_target(Core CONDITION QT_FEATURE_settings
io/qsettings.cpp io/qsettings.h io/qsettings_p.h
)
-qt_extend_target(Core CONDITION QT_FEATURE_settings AND WIN32 AND NOT WINRT
+qt_extend_target(Core CONDITION QT_FEATURE_settings AND WIN32
SOURCES
io/qsettings_win.cpp
)
-qt_extend_target(Core CONDITION QT_FEATURE_settings AND WINRT
- SOURCES
- io/qsettings_winrt.cpp
-)
-
qt_extend_target(Core CONDITION APPLE AND QT_FEATURE_settings AND NOT NACL
SOURCES
io/qsettings_mac.cpp
@@ -837,15 +828,6 @@ qt_extend_target(Core CONDITION QT_FEATURE_filesystemiterator AND WIN32
io/qfilesystemiterator_win.cpp
)
-qt_extend_target(Core CONDITION WINRT
- SOURCES
- io/qstandardpaths_winrt.cpp
- io/qstorageinfo_stub.cpp
- kernel/qeventdispatcher_winrt.cpp kernel/qeventdispatcher_winrt_p.h
- kernel/qfunctions_fake_env_p.h
- kernel/qfunctions_winrt.cpp kernel/qfunctions_winrt.h
-)
-
qt_extend_target(Core CONDITION QT_FEATURE_process AND UNIX
SOURCES
../3rdparty/forkfd/forkfd.h
@@ -1076,7 +1058,7 @@ qt_extend_target(Core CONDITION QT_FEATURE_mimetype
mimetypes/qmimetypeparser.cpp mimetypes/qmimetypeparser_p.h
)
-#### Keys ignored in scope 197:.:mimetypes:mimetypes/mimetypes.pri:QT_FEATURE_mimetype:
+#### Keys ignored in scope 188:.:mimetypes:mimetypes/mimetypes.pri:QT_FEATURE_mimetype:
# MIME_DATABASE = "mimetypes/mime/packages/freedesktop.org.xml"
# OTHER_FILES = "$$MIME_DATABASE"
@@ -1085,7 +1067,7 @@ qt_extend_target(Core CONDITION QT_FEATURE_mimetype AND QT_FEATURE_mimetype_data
.rcc
)
-#### Keys ignored in scope 198:.:mimetypes:mimetypes/mimetypes.pri:QT_FEATURE_mimetype_database:
+#### Keys ignored in scope 189:.:mimetypes:mimetypes/mimetypes.pri:QT_FEATURE_mimetype_database:
# QMAKE_EXTRA_COMPILERS = "mimedb"
# mimedb.commands = "${QMAKE_FILE_IN}" ">" "${QMAKE_FILE_OUT}"
# mimedb.depends = "$$PWD/mime/generate.pl"
@@ -1093,23 +1075,23 @@ qt_extend_target(Core CONDITION QT_FEATURE_mimetype AND QT_FEATURE_mimetype_data
# mimedb.output = "$$outpath/qmimeprovider_database.cpp"
# mimedb.variable_out = "INCLUDED_SOURCES"
-#### Keys ignored in scope 199:.:mimetypes:mimetypes/mimetypes.pri:ANDROID:
+#### Keys ignored in scope 190:.:mimetypes:mimetypes/mimetypes.pri:ANDROID:
# outpath = "$$outpath/$${QT_ARCH}"
-#### Keys ignored in scope 201:.:mimetypes:mimetypes/mimetypes.pri:(CMAKE_BUILD_TYPE STREQUAL Debug):
+#### Keys ignored in scope 192:.:mimetypes:mimetypes/mimetypes.pri:(CMAKE_BUILD_TYPE STREQUAL Debug):
# outpath = "$$outpath/debug"
-#### Keys ignored in scope 202:.:mimetypes:mimetypes/mimetypes.pri:else:
+#### Keys ignored in scope 193:.:mimetypes:mimetypes/mimetypes.pri:else:
# outpath = "$$outpath/release"
-#### Keys ignored in scope 203:.:mimetypes:mimetypes/mimetypes.pri:MAKEFILE_GENERATOR___equals___MSVC.NET OR MAKEFILE_GENERATOR___equals___MSBUILD OR QMAKE_SH_ISEMPTY:
+#### Keys ignored in scope 194:.:mimetypes:mimetypes/mimetypes.pri:MAKEFILE_GENERATOR___equals___MSVC.NET OR MAKEFILE_GENERATOR___equals___MSBUILD OR QMAKE_SH_ISEMPTY:
# mimedb.commands = "cmd" "/c" "$$shell_path($$PWD/mime/generate.bat)"
# mimedb.depends = "$$PWD/mime/generate.bat" "$$PWD/mime/hexdump.ps1"
-#### Keys ignored in scope 204:.:mimetypes:mimetypes/mimetypes.pri:else:
+#### Keys ignored in scope 195:.:mimetypes:mimetypes/mimetypes.pri:else:
# mimedb.commands = "perl" "$${mimedb.depends}"
-#### Keys ignored in scope 205:.:mimetypes:mimetypes/mimetypes.pri:QT_FEATURE_zstd:
+#### Keys ignored in scope 196:.:mimetypes:mimetypes/mimetypes.pri:QT_FEATURE_zstd:
# mimedb.commands = "--zstd"
qt_extend_target(Core CONDITION WASM
diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt
index 269891f91a..1f832504d1 100644
--- a/src/corelib/CMakeLists.txt
+++ b/src/corelib/CMakeLists.txt
@@ -446,28 +446,23 @@ qt_extend_target(Core CONDITION WIN32
io/qfilesystemengine_win.cpp
io/qfsfileengine_win.cpp
io/qlockfile_win.cpp
+ io/qstandardpaths_win.cpp
+ io/qstorageinfo_win.cpp
+ io/qwindowspipereader.cpp io/qwindowspipereader_p.h
+ io/qwindowspipewriter.cpp io/qwindowspipewriter_p.h
kernel/qcoreapplication_win.cpp
kernel/qelapsedtimer_win.cpp
+ kernel/qeventdispatcher_win.cpp kernel/qeventdispatcher_win_p.h
+ kernel/qfunctions_winrt_p.h
kernel/qsharedmemory_win.cpp
kernel/qsystemsemaphore_win.cpp
kernel/qwineventnotifier.cpp kernel/qwineventnotifier.h kernel/qwineventnotifier_p.h
+ kernel/qwinregistry.cpp kernel/qwinregistry_p.h
plugin/qsystemlibrary.cpp plugin/qsystemlibrary_p.h
thread/qatomic_msvc.h
thread/qthread_win.cpp
# DEFINES # special case: remove
LIBRARIES
- ws2_32
-)
-
-qt_extend_target(Core CONDITION WIN32 AND NOT WINRT
- SOURCES
- io/qstandardpaths_win.cpp
- io/qstorageinfo_win.cpp
- io/qwindowspipereader.cpp io/qwindowspipereader_p.h
- io/qwindowspipewriter.cpp io/qwindowspipewriter_p.h
- kernel/qeventdispatcher_win.cpp kernel/qeventdispatcher_win_p.h
- kernel/qwinregistry.cpp kernel/qwinregistry_p.h
- LIBRARIES
advapi32
kernel32
netapi32
@@ -477,6 +472,7 @@ qt_extend_target(Core CONDITION WIN32 AND NOT WINRT
uuid
version
winmm
+ ws2_32
PUBLIC_LIBRARIES
mpr
userenv
@@ -520,27 +516,27 @@ qt_extend_target(Core CONDITION INTEGRITY
--pending_instantiations=128
)
-#### Keys ignored in scope 15:.:.:corelib.pro:pathIsAbsolute(_ss_CMAKE_HOST_DATA_DIR):
+#### Keys ignored in scope 14:.:.:corelib.pro:pathIsAbsolute(_ss_CMAKE_HOST_DATA_DIR):
# CMAKE_HOST_DATA_DIR = "$$[QT_HOST_DATA/src]/"
# CMAKE_HOST_DATA_DIR_IS_ABSOLUTE = "True"
-#### Keys ignored in scope 16:.:.:corelib.pro:pathIsAbsolute(_ss_CMAKE_INSTALL_DATA_DIR):
+#### Keys ignored in scope 15:.:.:corelib.pro:pathIsAbsolute(_ss_CMAKE_INSTALL_DATA_DIR):
# CMAKE_INSTALL_DATA_DIR = "$$[QT_HOST_DATA]/"
# CMAKE_INSTALL_DATA_DIR_IS_ABSOLUTE = "True"
-#### Keys ignored in scope 21:.:global:global/global.pri:QT_CPU_FEATURES__ss_QT_ARCH___contains___f16c:
+#### Keys ignored in scope 20:.:global:global/global.pri:QT_CPU_FEATURES__ss_QT_ARCH___contains___f16c:
# f16c_cxx = "true"
-#### Keys ignored in scope 23:.:global:global/global.pri:CLANG OR intel_icl OR ICC:
+#### Keys ignored in scope 22:.:global:global/global.pri:CLANG OR intel_icl OR ICC:
# f16c_cxx = "false"
-#### Keys ignored in scope 25:.:global:global/global.pri:GCC AND f16c AND x86SimdAlways:
+#### Keys ignored in scope 24:.:global:global/global.pri:GCC AND f16c AND x86SimdAlways:
# f16c_cxx = "true"
-#### Keys ignored in scope 27:.:global:global/global.pri:MSVC AND QT_CPU_FEATURES__ss_QT_ARCH___contains___avx:
+#### Keys ignored in scope 26:.:global:global/global.pri:MSVC AND QT_CPU_FEATURES__ss_QT_ARCH___contains___avx:
# f16c_cxx = "true"
-#### Keys ignored in scope 28:.:global:global/global.pri:else:
+#### Keys ignored in scope 27:.:global:global/global.pri:else:
# f16c_cxx = "false"
# extend_target(Core CONDITION _ss_f16c_cxx ... # special case remove: Handled manually
@@ -560,7 +556,7 @@ qt_extend_target(Core CONDITION LINUX AND NOT static
global/minimum-linux_p.h
)
-#### Keys ignored in scope 35:.:global:global/global.pri:precompile_header:
+#### Keys ignored in scope 34:.:global:global/global.pri:precompile_header:
# NO_PCH_ASM = "global/minimum-linux.S"
# QMAKE_EXTRA_COMPILERS = "no_pch_assembler"
# no_pch_assembler.commands = "$$QMAKE_CC" "-c" "$(CFLAGS)" "$(INCPATH)" "${QMAKE_FILE_IN}" "-o" "${QMAKE_FILE_OUT}"
@@ -569,7 +565,7 @@ qt_extend_target(Core CONDITION LINUX AND NOT static
# no_pch_assembler.name = "compiling[no_pch]" "${QMAKE_FILE_IN}"
# no_pch_assembler.output = "${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${firstQMAKE_EXT_OBJ}"
-#### Keys ignored in scope 36:.:global:global/global.pri:silent:
+#### Keys ignored in scope 35:.:global:global/global.pri:silent:
# no_pch_assembler.commands = "@echo" "compiling[no_pch]" "${QMAKE_FILE_IN}" "&&"
qt_extend_target(Core CONDITION LINUX AND NOT precompile_header AND NOT static
@@ -587,7 +583,7 @@ qt_extend_target(Core CONDITION QT_FEATURE_journald
PkgConfig::Libsystemd
)
-#### Keys ignored in scope 40:.:global:global/global.pri:GCC AND ltcg:
+#### Keys ignored in scope 39:.:global:global/global.pri:GCC AND ltcg:
# QMAKE_EXTRA_COMPILERS = "versiontagging_compiler"
# versiontagging_compiler.commands = "$$QMAKE_CXX" "-c" "$(CXXFLAGS)" "$(INCPATH)" "-fno-lto" "-o" "${QMAKE_FILE_OUT}" "${QMAKE_FILE_IN}"
# versiontagging_compiler.dependency_type = "TYPE_C"
@@ -596,7 +592,7 @@ qt_extend_target(Core CONDITION QT_FEATURE_journald
# versiontagging_compiler.output = "${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${firstQMAKE_EXT_OBJ}"
# versiontagging_compiler.variable_out = "OBJECTS"
-#### Keys ignored in scope 41:.:global:global/global.pri:silent:
+#### Keys ignored in scope 40:.:global:global/global.pri:silent:
# versiontagging_compiler.commands = "@echo" "compiling[versiontagging]" "${QMAKE_FILE_IN}" "&&"
qt_extend_target(Core CONDITION NOT GCC OR NOT ltcg
@@ -897,7 +893,7 @@ qt_extend_target(Core CONDITION QT_FEATURE_processenvironment
io/qprocess.cpp io/qprocess.h io/qprocess_p.h
)
-qt_extend_target(Core CONDITION QT_FEATURE_processenvironment AND WIN32 AND NOT WINRT
+qt_extend_target(Core CONDITION QT_FEATURE_processenvironment AND WIN32
SOURCES
io/qprocess_win.cpp
)
@@ -912,16 +908,11 @@ qt_extend_target(Core CONDITION QT_FEATURE_settings
io/qsettings.cpp io/qsettings.h io/qsettings_p.h
)
-qt_extend_target(Core CONDITION QT_FEATURE_settings AND WIN32 AND NOT WINRT
+qt_extend_target(Core CONDITION QT_FEATURE_settings AND WIN32
SOURCES
io/qsettings_win.cpp
)
-qt_extend_target(Core CONDITION QT_FEATURE_settings AND WINRT
- SOURCES
- io/qsettings_winrt.cpp
-)
-
qt_extend_target(Core CONDITION APPLE AND QT_FEATURE_settings AND NOT NACL
SOURCES
io/qsettings_mac.cpp
@@ -937,15 +928,6 @@ qt_extend_target(Core CONDITION QT_FEATURE_filesystemiterator AND WIN32
io/qfilesystemiterator_win.cpp
)
-qt_extend_target(Core CONDITION WINRT
- SOURCES
- io/qstandardpaths_winrt.cpp
- io/qstorageinfo_stub.cpp
- kernel/qeventdispatcher_winrt.cpp kernel/qeventdispatcher_winrt_p.h
- kernel/qfunctions_fake_env_p.h
- kernel/qfunctions_winrt.cpp kernel/qfunctions_winrt.h
-)
-
qt_extend_target(Core CONDITION QT_FEATURE_process AND UNIX
SOURCES
../3rdparty/forkfd/forkfd.h
@@ -1176,7 +1158,7 @@ qt_extend_target(Core CONDITION QT_FEATURE_mimetype
mimetypes/qmimetypeparser.cpp mimetypes/qmimetypeparser_p.h
)
-#### Keys ignored in scope 197:.:mimetypes:mimetypes/mimetypes.pri:QT_FEATURE_mimetype:
+#### Keys ignored in scope 188:.:mimetypes:mimetypes/mimetypes.pri:QT_FEATURE_mimetype:
# MIME_DATABASE = "mimetypes/mime/packages/freedesktop.org.xml"
# OTHER_FILES = "$$MIME_DATABASE"
@@ -1187,7 +1169,7 @@ qt_extend_target(Core CONDITION QT_FEATURE_mimetype
#)
# special case end
-#### Keys ignored in scope 198:.:mimetypes:mimetypes/mimetypes.pri:QT_FEATURE_mimetype_database:
+#### Keys ignored in scope 189:.:mimetypes:mimetypes/mimetypes.pri:QT_FEATURE_mimetype_database:
# QMAKE_EXTRA_COMPILERS = "mimedb"
# mimedb.commands = "${QMAKE_FILE_IN}" ">" "${QMAKE_FILE_OUT}"
# mimedb.depends = "$$PWD/mime/generate.pl"
@@ -1195,23 +1177,23 @@ qt_extend_target(Core CONDITION QT_FEATURE_mimetype
# mimedb.output = "$$outpath/qmimeprovider_database.cpp"
# mimedb.variable_out = "INCLUDED_SOURCES"
-#### Keys ignored in scope 199:.:mimetypes:mimetypes/mimetypes.pri:ANDROID:
+#### Keys ignored in scope 190:.:mimetypes:mimetypes/mimetypes.pri:ANDROID:
# outpath = "$$outpath/$${QT_ARCH}"
-#### Keys ignored in scope 201:.:mimetypes:mimetypes/mimetypes.pri:(CMAKE_BUILD_TYPE STREQUAL Debug):
+#### Keys ignored in scope 192:.:mimetypes:mimetypes/mimetypes.pri:(CMAKE_BUILD_TYPE STREQUAL Debug):
# outpath = "$$outpath/debug"
-#### Keys ignored in scope 202:.:mimetypes:mimetypes/mimetypes.pri:else:
+#### Keys ignored in scope 193:.:mimetypes:mimetypes/mimetypes.pri:else:
# outpath = "$$outpath/release"
-#### Keys ignored in scope 203:.:mimetypes:mimetypes/mimetypes.pri:MAKEFILE_GENERATOR___equals___MSVC.NET OR MAKEFILE_GENERATOR___equals___MSBUILD OR QMAKE_SH_ISEMPTY:
+#### Keys ignored in scope 194:.:mimetypes:mimetypes/mimetypes.pri:MAKEFILE_GENERATOR___equals___MSVC.NET OR MAKEFILE_GENERATOR___equals___MSBUILD OR QMAKE_SH_ISEMPTY:
# mimedb.commands = "cmd" "/c" "$$shell_path($$PWD/mime/generate.bat)"
# mimedb.depends = "$$PWD/mime/generate.bat" "$$PWD/mime/hexdump.ps1"
-#### Keys ignored in scope 204:.:mimetypes:mimetypes/mimetypes.pri:else:
+#### Keys ignored in scope 195:.:mimetypes:mimetypes/mimetypes.pri:else:
# mimedb.commands = "perl" "$${mimedb.depends}"
-#### Keys ignored in scope 205:.:mimetypes:mimetypes/mimetypes.pri:QT_FEATURE_zstd:
+#### Keys ignored in scope 196:.:mimetypes:mimetypes/mimetypes.pri:QT_FEATURE_zstd:
# mimedb.commands = "--zstd"
# Resources:
# special case begin
diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake
index a601ebb437..5df72d869e 100644
--- a/src/corelib/configure.cmake
+++ b/src/corelib/configure.cmake
@@ -788,14 +788,14 @@ qt_feature("process" PUBLIC
SECTION "File I/O"
LABEL "QProcess"
PURPOSE "Supports external process invocation."
- CONDITION QT_FEATURE_processenvironment AND ( QT_FEATURE_thread OR NOT UNIX ) AND NOT WINRT AND NOT UIKIT AND NOT INTEGRITY AND NOT VXWORKS AND NOT rtems
+ CONDITION QT_FEATURE_processenvironment AND ( QT_FEATURE_thread OR NOT UNIX ) AND NOT UIKIT AND NOT INTEGRITY AND NOT VXWORKS AND NOT rtems
)
qt_feature_definition("process" "QT_NO_PROCESS" NEGATE VALUE "1")
qt_feature("processenvironment" PUBLIC
SECTION "File I/O"
LABEL "QProcessEnvironment"
PURPOSE "Provides a higher-level abstraction of environment variables."
- CONDITION NOT WINRT AND NOT INTEGRITY AND NOT rtems
+ CONDITION NOT INTEGRITY AND NOT rtems
)
qt_feature("temporaryfile" PUBLIC
SECTION "File I/O"
@@ -820,7 +820,6 @@ qt_feature("filesystemwatcher" PUBLIC
SECTION "File I/O"
LABEL "QFileSystemWatcher"
PURPOSE "Provides an interface for monitoring files and directories for modifications."
- CONDITION NOT WINRT
)
qt_feature_definition("filesystemwatcher" "QT_NO_FILESYSTEMWATCHER" NEGATE VALUE "1")
qt_feature("filesystemiterator" PUBLIC
diff --git a/src/corelib/configure.json b/src/corelib/configure.json
index 4d34089295..67c01bd8a9 100644
--- a/src/corelib/configure.json
+++ b/src/corelib/configure.json
@@ -895,14 +895,14 @@
"label": "QProcess",
"purpose": "Supports external process invocation.",
"section": "File I/O",
- "condition": "features.processenvironment && (features.thread || !config.unix) && !config.winrt && !config.uikit && !config.integrity && !config.vxworks && !config.rtems",
+ "condition": "features.processenvironment && (features.thread || !config.unix) && !config.uikit && !config.integrity && !config.vxworks && !config.rtems",
"output": [ "publicFeature", "feature" ]
},
"processenvironment": {
"label": "QProcessEnvironment",
"purpose": "Provides a higher-level abstraction of environment variables.",
"section": "File I/O",
- "condition": "!config.winrt && !config.integrity && !config.rtems",
+ "condition": "!config.integrity && !config.rtems",
"output": [ "publicFeature" ]
},
"temporaryfile": {
@@ -928,7 +928,6 @@
"label": "QFileSystemWatcher",
"purpose": "Provides an interface for monitoring files and directories for modifications.",
"section": "File I/O",
- "condition": "!config.winrt",
"output": [ "publicFeature", "feature" ]
},
"filesystemiterator": {
diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro
index 3430154d13..efeba221c5 100644
--- a/src/corelib/corelib.pro
+++ b/src/corelib/corelib.pro
@@ -52,7 +52,7 @@ include(platform/platform.pri)
win32 {
QMAKE_USE_PRIVATE += ws2_32
- !winrt: QMAKE_USE_PRIVATE += advapi32 kernel32 ole32 shell32 uuid user32 winmm
+ QMAKE_USE_PRIVATE += advapi32 kernel32 ole32 shell32 uuid user32 winmm
}
darwin {
diff --git a/src/corelib/global/archdetect.cpp b/src/corelib/global/archdetect.cpp
index 1d00b7f5a5..b758b2326c 100644
--- a/src/corelib/global/archdetect.cpp
+++ b/src/corelib/global/archdetect.cpp
@@ -95,7 +95,7 @@
#endif
// pointer type
-#if defined(Q_OS_WIN64) || (defined(Q_OS_WINRT) && defined(_M_X64))
+#if defined(Q_OS_WIN64)
# define ARCH_POINTER "llp64"
#elif defined(__LP64__) || QT_POINTER_SIZE - 0 == 8
# define ARCH_POINTER "lp64"
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 798e445ee4..4d990f5bb5 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -46,11 +46,9 @@
#include "qdatetime.h"
#include "qoperatingsystemversion.h"
#include "qoperatingsystemversion_p.h"
-#if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN) || defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
# include "qoperatingsystemversion_win_p.h"
-# ifndef Q_OS_WINRT
-# include "private/qwinregistry_p.h"
-# endif
+# include "private/qwinregistry_p.h"
#endif // Q_OS_WIN || Q_OS_CYGWIN
#include <private/qlocale_tools_p.h>
@@ -72,10 +70,6 @@
# include <crtdbg.h>
#endif
-#ifdef Q_OS_WINRT
-#include <Ws2tcpip.h>
-#endif // Q_OS_WINRT
-
#ifdef Q_OS_WIN
# include <qt_windows.h>
#endif
@@ -1463,7 +1457,7 @@ bool qSharedBuild() noexcept
\relates <QtGlobal>
Defined on all supported versions of Windows. That is, if
- \l Q_OS_WIN32, \l Q_OS_WIN64, or \l Q_OS_WINRT is defined.
+ \l Q_OS_WIN32 or \l Q_OS_WIN64 is defined.
*/
/*!
@@ -1488,14 +1482,6 @@ bool qSharedBuild() noexcept
*/
/*!
- \macro Q_OS_WINRT
- \relates <QtGlobal>
-
- Defined for Windows Runtime (Windows Store apps) on Windows 8, Windows RT,
- and Windows Phone 8.
-*/
-
-/*!
\macro Q_OS_CYGWIN
\relates <QtGlobal>
@@ -2165,7 +2151,7 @@ static const char *osVer_helper(QOperatingSystemVersion version = QOperatingSyst
}
#endif
-#elif defined(Q_OS_WIN) || defined(Q_OS_CYGWIN) || defined(Q_OS_WINRT)
+#elif defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
QT_BEGIN_INCLUDE_NAMESPACE
#include "qt_windows.h"
@@ -2223,7 +2209,7 @@ QT_WARNING_POP
static QString readVersionRegistryString(const wchar_t *subKey)
{
-#if !defined(QT_BUILD_QMAKE) && !defined(Q_OS_WINRT)
+#if !defined(QT_BUILD_QMAKE)
return QWinRegistryKey(HKEY_LOCAL_MACHINE, LR"(SOFTWARE\Microsoft\Windows NT\CurrentVersion)")
.stringValue(subKey);
#else
@@ -2834,8 +2820,7 @@ QString QSysInfo::kernelVersion()
\b{FreeBSD note}: this function returns "debian" for Debian/kFreeBSD and
"unknown" otherwise.
- \b{Windows note}: this function "winrt" for WinRT builds, and "windows"
- for normal desktop builds.
+ \b{Windows note}: this function return "windows"
For other Unix-type systems, this function usually returns "unknown".
@@ -2844,9 +2829,7 @@ QString QSysInfo::kernelVersion()
QString QSysInfo::productType()
{
// similar, but not identical to QFileSelectorPrivate::platformSelectors
-#if defined(Q_OS_WINRT)
- return QStringLiteral("winrt");
-#elif defined(Q_OS_WIN)
+#if defined(Q_OS_WIN)
return QStringLiteral("windows");
#elif defined(Q_OS_QNX)
@@ -2968,7 +2951,7 @@ QString QSysInfo::prettyProductName()
if (!name)
return result + versionString;
result += QLatin1String(name);
-# if !defined(Q_OS_WIN) || defined(Q_OS_WINRT)
+# if !defined(Q_OS_WIN)
return result + QLatin1String(" (") + versionString + QLatin1Char(')');
# else
// (resembling winver.exe): Windows 10 "Windows 10 Version 1809"
@@ -3104,7 +3087,7 @@ QByteArray QSysInfo::machineUniqueId()
if (len != -1)
return QByteArray(buffer, len);
}
-#elif defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#elif defined(Q_OS_WIN)
// Let's poke at the registry
// ### Qt 6: Use new helpers from qwinregistry.cpp (once bootstrap builds are obsolete)
HKEY key = NULL;
@@ -3537,7 +3520,7 @@ QByteArray qgetenv(const char *varName)
*/
QString qEnvironmentVariable(const char *varName, const QString &defaultValue)
{
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
const auto locker = qt_scoped_lock(environmentMutex);
QVarLengthArray<wchar_t, 32> wname(int(strlen(varName)) + 1);
for (int i = 0; i < wname.size(); ++i) // wname.size() is correct: will copy terminating null
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index bfbc4ce1e5..b5164d1062 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -507,13 +507,6 @@ static QString prefixFromQtCoreLibraryHelper(const QString &qtCoreLibraryPath)
#endif
#if defined(Q_OS_WIN)
-#if defined(Q_OS_WINRT)
-EXTERN_C IMAGE_DOS_HEADER __ImageBase;
-static HMODULE getWindowsModuleHandle()
-{
- return reinterpret_cast<HMODULE>(&__ImageBase);
-}
-#else // Q_OS_WINRT
static HMODULE getWindowsModuleHandle()
{
HMODULE hModule = NULL;
@@ -522,7 +515,6 @@ static HMODULE getWindowsModuleHandle()
(LPCTSTR)&QLibraryInfo::isDebugBuild, &hModule);
return hModule;
}
-#endif // !Q_OS_WINRT
#endif // Q_OS_WIN
static QString getRelocatablePrefix()
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index 2966e609e7..4e78062ba7 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -226,10 +226,6 @@ static bool isDefaultCategory(const char *category)
*/
static bool systemHasStderr()
{
-#if defined(Q_OS_WINRT)
- return false; // WinRT has no stderr
-#endif
-
return true;
}
@@ -268,7 +264,7 @@ static bool stderrHasConsoleAttached()
if (qEnvironmentVariableIntValue("QT_ASSUME_STDERR_HAS_CONSOLE"))
return true;
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
return GetConsoleWindow();
#elif defined(Q_OS_UNIX)
# ifndef _PATH_TTY
@@ -1851,10 +1847,7 @@ static void qt_message_print(QtMsgType msgType, const QMessageLogContext &contex
static void qt_message_print(const QString &message)
{
-#if defined(Q_OS_WINRT)
- win_outputDebugString_helper(message);
- return;
-#elif defined(Q_OS_WIN) && !defined(QT_BOOTSTRAPPED)
+#if defined(Q_OS_WIN) && !defined(QT_BOOTSTRAPPED)
if (!shouldLogToStderr()) {
win_outputDebugString_helper(message);
return;
diff --git a/src/corelib/global/qoperatingsystemversion_win.cpp b/src/corelib/global/qoperatingsystemversion_win.cpp
index 798d985a76..eb58b60788 100644
--- a/src/corelib/global/qoperatingsystemversion_win.cpp
+++ b/src/corelib/global/qoperatingsystemversion_win.cpp
@@ -46,50 +46,17 @@
QT_BEGIN_NAMESPACE
-#ifdef Q_OS_WINRT
-static inline HMODULE moduleHandleForFunction(LPCVOID address)
-{
- // This is a widely used, decades-old technique for retrieving the handle
- // of a module and is effectively equivalent to GetModuleHandleEx
- // (which is unavailable on WinRT)
- MEMORY_BASIC_INFORMATION mbi = { 0, 0, 0, 0, 0, 0, 0 };
- if (VirtualQuery(address, &mbi, sizeof(mbi)) == 0)
- return 0;
- return reinterpret_cast<HMODULE>(mbi.AllocationBase);
-}
-#endif
-
static inline OSVERSIONINFOEX determineWinOsVersion()
{
OSVERSIONINFOEX result = { sizeof(OSVERSIONINFOEX), 0, 0, 0, 0, {'\0'}, 0, 0, 0, 0, 0};
#define GetProcAddressA GetProcAddress
-
- // GetModuleHandle is not supported in WinRT and linking to it at load time
- // will not pass the Windows App Certification Kit... but it exists and is functional,
- // so use some unusual but widely used techniques to get a pointer to it
-#ifdef Q_OS_WINRT
- // 1. Get HMODULE of kernel32.dll, using the address of some function exported by that DLL
- HMODULE kernelModule = moduleHandleForFunction(reinterpret_cast<LPCVOID>(VirtualQuery));
- if (Q_UNLIKELY(!kernelModule))
- return result;
-
- // 2. Get pointer to GetModuleHandle so we can then load other arbitrary modules (DLLs)
- typedef HMODULE(WINAPI *GetModuleHandleFunction)(LPCWSTR);
- GetModuleHandleFunction pGetModuleHandle = reinterpret_cast<GetModuleHandleFunction>(
- GetProcAddressA(kernelModule, "GetModuleHandleW"));
- if (Q_UNLIKELY(!pGetModuleHandle))
- return result;
-#else
#define pGetModuleHandle GetModuleHandleW
-#endif
HMODULE ntdll = pGetModuleHandle(L"ntdll.dll");
if (Q_UNLIKELY(!ntdll))
return result;
- // NTSTATUS is not defined on WinRT
- typedef LONG NTSTATUS;
typedef NTSTATUS (NTAPI *RtlGetVersionFunction)(LPOSVERSIONINFO);
// RtlGetVersion is documented public API but we must load it dynamically
diff --git a/src/corelib/global/qprocessordetection.h b/src/corelib/global/qprocessordetection.h
index 8d65720850..f7bca43345 100644
--- a/src/corelib/global/qprocessordetection.h
+++ b/src/corelib/global/qprocessordetection.h
@@ -357,8 +357,7 @@
# define Q_BYTE_ORDER __BYTE_ORDER__
# elif defined(__BIG_ENDIAN__) || defined(_big_endian__) || defined(_BIG_ENDIAN)
# define Q_BYTE_ORDER Q_BIG_ENDIAN
-# elif defined(__LITTLE_ENDIAN__) || defined(_little_endian__) || defined(_LITTLE_ENDIAN) \
- || defined(WINAPI_FAMILY) // WinRT is always little-endian according to MSDN.
+# elif defined(__LITTLE_ENDIAN__) || defined(_little_endian__) || defined(_LITTLE_ENDIAN)
# define Q_BYTE_ORDER Q_LITTLE_ENDIAN
# else
# error "Unable to determine byte order!"
diff --git a/src/corelib/global/qrandom.cpp b/src/corelib/global/qrandom.cpp
index 3dc024e301..e35fc21d98 100644
--- a/src/corelib/global/qrandom.cpp
+++ b/src/corelib/global/qrandom.cpp
@@ -167,19 +167,13 @@ struct QRandomGenerator::SystemGenerator
return qMax<qsizetype>(n, 0); // ignore any errors
}
-#elif defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#elif defined(Q_OS_WIN)
qsizetype fillBuffer(void *buffer, qsizetype count) noexcept
{
auto RtlGenRandom = SystemFunction036;
return RtlGenRandom(buffer, ULONG(count)) ? count: 0;
}
-#elif defined(Q_OS_WINRT)
- qsizetype fillBuffer(void *, qsizetype) noexcept
- {
- // always use the fallback
- return 0;
- }
-#endif // Q_OS_WINRT
+#endif // Q_OS_WIN
static SystemGenerator &self();
typedef quint32 result_type;
diff --git a/src/corelib/global/qsystemdetection.h b/src/corelib/global/qsystemdetection.h
index ab023a6cb5..2afd84bcd3 100644
--- a/src/corelib/global/qsystemdetection.h
+++ b/src/corelib/global/qsystemdetection.h
@@ -54,7 +54,6 @@
WATCHOS - watchOS
TVOS - tvOS
WIN32 - Win32 (Windows 2000/XP/Vista/7 and Windows Server 2003/2008)
- WINRT - WinRT (Windows Runtime)
CYGWIN - Cygwin
SOLARIS - Sun Solaris
HPUX - HP-UX
@@ -124,20 +123,7 @@
# define Q_OS_WIN32
# define Q_OS_WIN64
#elif !defined(SAG_COM) && (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__))
-# if defined(WINAPI_FAMILY)
-# ifndef WINAPI_FAMILY_PC_APP
-# define WINAPI_FAMILY_PC_APP WINAPI_FAMILY_APP
-# endif
-# if defined(WINAPI_FAMILY_PHONE_APP) && WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP
-# define Q_OS_WINRT
-# elif WINAPI_FAMILY==WINAPI_FAMILY_PC_APP
-# define Q_OS_WINRT
-# else
-# define Q_OS_WIN32
-# endif
-# else
# define Q_OS_WIN32
-# endif
#elif defined(__sun) || defined(sun)
# define Q_OS_SOLARIS
#elif defined(hpux) || defined(__hpux)
@@ -184,7 +170,7 @@
# error "Qt has not been ported to this OS - see http://www.qt-project.org/"
#endif
-#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) || defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64)
# define Q_OS_WINDOWS
# define Q_OS_WIN
# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri
index 97b7f3970c..c062d9948b 100644
--- a/src/corelib/io/io.pri
+++ b/src/corelib/io/io.pri
@@ -111,7 +111,7 @@ qtConfig(processenvironment) {
io/qprocess.h \
io/qprocess_p.h
- win32:!winrt: \
+ win32: \
SOURCES += io/qprocess_win.cpp
else: unix: \
SOURCES += io/qprocess_unix.cpp
@@ -125,11 +125,7 @@ qtConfig(settings) {
io/qsettings_p.h
win32 {
- !winrt {
- SOURCES += io/qsettings_win.cpp
- } else {
- SOURCES += io/qsettings_winrt.cpp
- }
+ SOURCES += io/qsettings_win.cpp
} else: darwin:!nacl {
SOURCES += io/qsettings_mac.cpp
}
@@ -137,32 +133,26 @@ qtConfig(settings) {
}
win32 {
- SOURCES += io/qfsfileengine_win.cpp
- SOURCES += io/qlockfile_win.cpp
- SOURCES += io/qfilesystemengine_win.cpp
+ SOURCES += io/qfsfileengine_win.cpp
+ SOURCES += io/qlockfile_win.cpp
+ SOURCES += io/qfilesystemengine_win.cpp
- qtConfig(filesystemiterator) {
- SOURCES += io/qfilesystemiterator_win.cpp
- }
+ qtConfig(filesystemiterator) {
+ SOURCES += io/qfilesystemiterator_win.cpp
+ }
- !winrt {
- HEADERS += \
- io/qwindowspipereader_p.h \
- io/qwindowspipewriter_p.h
+ HEADERS += \
+ io/qwindowspipereader_p.h \
+ io/qwindowspipewriter_p.h
- SOURCES += \
- io/qstandardpaths_win.cpp \
- io/qstorageinfo_win.cpp \
- io/qwindowspipereader.cpp \
- io/qwindowspipewriter.cpp
+ SOURCES += \
+ io/qstandardpaths_win.cpp \
+ io/qstorageinfo_win.cpp \
+ io/qwindowspipereader.cpp \
+ io/qwindowspipewriter.cpp
- LIBS += -lmpr -luserenv
- QMAKE_USE_PRIVATE += netapi32
- } else {
- SOURCES += \
- io/qstandardpaths_winrt.cpp \
- io/qstorageinfo_stub.cpp
- }
+ LIBS += -lmpr -luserenv
+ QMAKE_USE_PRIVATE += netapi32
} else:unix {
SOURCES += \
io/qfsfileengine_unix.cpp \
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index 368ad648e0..647f6746a5 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -83,7 +83,7 @@ static QString driveSpec(const QString &path)
#endif
enum {
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
OSSupportsUncPaths = true
#else
OSSupportsUncPaths = false
@@ -100,11 +100,6 @@ static int rootLength(const QString &name, bool allowUncPaths)
const int nextSlash = name.indexOf(QLatin1Char('/'), 2);
return nextSlash >= 0 ? nextSlash + 1 : len;
}
-#if defined(Q_OS_WINRT)
- const QString rootPath = QDir::rootPath(); // rootPath contains the trailing slash
- if (name.startsWith(rootPath, Qt::CaseInsensitive))
- return rootPath.size();
-#endif // Q_OS_WINRT
#if defined(Q_OS_WIN)
if (len >= 2 && name.at(1) == QLatin1Char(':')) {
// Handle a possible drive letter
@@ -196,11 +191,7 @@ inline void QDirPrivate::setPath(const QString &path)
if (p.endsWith(QLatin1Char('/'))
&& p.length() > 1
#if defined(Q_OS_WIN)
-# if defined (Q_OS_WINRT)
- && (!(p.toLower() == QDir::rootPath().toLower()))
-# else
&& (!(p.length() == 3 && p.at(1).unicode() == ':' && p.at(0).isLetter()))
-# endif
#endif
) {
p.truncate(p.length() - 1);
@@ -2373,11 +2364,7 @@ static QString qt_cleanPath(const QString &path, bool *ok)
// Strip away last slash except for root directories
if (ret.length() > 1 && ret.endsWith(QLatin1Char('/'))) {
#if defined (Q_OS_WIN)
-# if defined(Q_OS_WINRT)
- if (!((ret.length() == 3 || ret.length() == QDir::rootPath().length()) && ret.at(1) == QLatin1Char(':')))
-# else
if (!(ret.length() == 3 && ret.at(1) == QLatin1Char(':')))
-# endif
#endif
ret.chop(1);
}
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp
index 824215d1d9..f33f03262f 100644
--- a/src/corelib/io/qfileinfo.cpp
+++ b/src/corelib/io/qfileinfo.cpp
@@ -1178,7 +1178,7 @@ bool QFileInfo::isRoot() const
return false;
if (d->fileEngine == nullptr) {
if (d->fileEntry.isRoot()) {
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
//the path is a drive root, but the drive may not exist
//for backward compatibility, return true only if the drive exists
if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::ExistsAttribute))
diff --git a/src/corelib/io/qfileselector.cpp b/src/corelib/io/qfileselector.cpp
index 0c42a98b37..1a58da1e18 100644
--- a/src/corelib/io/qfileselector.cpp
+++ b/src/corelib/io/qfileselector.cpp
@@ -346,9 +346,6 @@ QStringList QFileSelectorPrivate::platformSelectors()
#if defined(Q_OS_WIN)
ret << QStringLiteral("windows");
ret << QSysInfo::kernelType(); // "winnt"
-# if defined(Q_OS_WINRT)
- ret << QStringLiteral("winrt");
-# endif
#elif defined(Q_OS_UNIX)
ret << QStringLiteral("unix");
# if !defined(Q_OS_ANDROID) && !defined(Q_OS_QNX)
diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp
index a4f47cbf24..4c1b9f87c2 100644
--- a/src/corelib/io/qfilesystemengine_win.cpp
+++ b/src/corelib/io/qfilesystemengine_win.cpp
@@ -61,33 +61,16 @@
#include <direct.h>
#include <winioctl.h>
#include <objbase.h>
-#ifndef Q_OS_WINRT
-# include <shlobj.h>
-# include <shobjidl.h>
-# include <shellapi.h>
-# include <lm.h>
-# include <accctrl.h>
-#endif
+#include <shlobj.h>
+#include <shobjidl.h>
+#include <shellapi.h>
+#include <lm.h>
+#include <accctrl.h>
#include <initguid.h>
#include <ctype.h>
#include <limits.h>
-#ifndef Q_OS_WINRT
-# define SECURITY_WIN32
-# include <security.h>
-#else // !Q_OS_WINRT
-# include "qstandardpaths.h"
-# include "qthreadstorage.h"
-# include <wrl.h>
-# include <windows.foundation.h>
-# include <windows.storage.h>
-# include <Windows.ApplicationModel.h>
-
-using namespace Microsoft::WRL;
-using namespace Microsoft::WRL::Wrappers;
-using namespace ABI::Windows::Foundation;
-using namespace ABI::Windows::Storage;
-using namespace ABI::Windows::ApplicationModel;
-#endif // Q_OS_WINRT
+#define SECURITY_WIN32
+#include <security.h>
#ifndef SPI_GETPLATFORMTYPE
#define SPI_GETPLATFORMTYPE 257
@@ -153,11 +136,11 @@ typedef struct _REPARSE_DATA_BUFFER {
# define FSCTL_GET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 42, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif
-#if defined(Q_OS_WINRT) || defined(QT_BOOTSTRAPPED)
+#if defined(QT_BOOTSTRAPPED)
# define QT_FEATURE_fslibs -1
#else
# define QT_FEATURE_fslibs 1
-#endif // Q_OS_WINRT
+#endif // QT_BOOTSTRAPPED
#if QT_CONFIG(fslibs)
#include <aclapi.h>
@@ -291,7 +274,6 @@ static inline bool toFileTime(const QDateTime &date, FILETIME *fileTime)
static QString readSymLink(const QFileSystemEntry &link)
{
QString result;
-#if !defined(Q_OS_WINRT)
HANDLE handle = CreateFile((wchar_t*)link.nativeFilePath().utf16(),
FILE_READ_EA,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
@@ -346,9 +328,6 @@ static QString readSymLink(const QFileSystemEntry &link)
}
#endif // QT_CONFIG(fslibs)
}
-#else
- Q_UNUSED(link);
-#endif // Q_OS_WINRT
return result;
}
@@ -416,11 +395,7 @@ static inline bool getFindData(QString path, WIN32_FIND_DATA &findData)
// can't handle drives
if (!path.endsWith(QLatin1Char(':'))) {
-#ifndef Q_OS_WINRT
HANDLE hFind = ::FindFirstFile((wchar_t*)path.utf16(), &findData);
-#else
- HANDLE hFind = ::FindFirstFileEx((const wchar_t*)path.utf16(), FindExInfoStandard, &findData, FindExSearchNameMatch, NULL, 0);
-#endif
if (hFind != INVALID_HANDLE_VALUE) {
::FindClose(hFind);
return true;
@@ -531,7 +506,6 @@ private:
bool QFileSystemEngine::uncListSharesOnServer(const QString &server, QStringList *list)
{
DWORD res = ERROR_NOT_SUPPORTED;
-#ifndef Q_OS_WINRT
SHARE_INFO_1 *BufPtr, *p;
DWORD er = 0, tr = 0, resume = 0, i;
do {
@@ -546,10 +520,6 @@ bool QFileSystemEngine::uncListSharesOnServer(const QString &server, QStringList
}
NetApiBufferFree(BufPtr);
} while (res == ERROR_MORE_DATA);
-#else
- Q_UNUSED(server);
- Q_UNUSED(list);
-#endif
return res == ERROR_SUCCESS;
}
@@ -615,16 +585,6 @@ QString QFileSystemEngine::nativeAbsoluteFilePath(const QString &path)
}
if (retLen != 0)
absPath = QString::fromWCharArray(buf.data(), retLen);
-# if defined(Q_OS_WINRT)
- // Win32 returns eg C:/ as root directory with a trailing /.
- // WinRT returns the sandbox root without /.
- // Also C:/../.. returns C:/ on Win32, while for WinRT it steps outside the package
- // and goes beyond package root. Hence force the engine to stay inside
- // the package.
- const QString rootPath = QDir::toNativeSeparators(QDir::rootPath());
- if (absPath.size() < rootPath.size() && rootPath.startsWith(absPath))
- absPath = rootPath;
-# endif // Q_OS_WINRT
// This is really ugly, but GetFullPathName strips off whitespace at the end.
// If you for instance write ". " in the lineedit of QFileDialog,
@@ -652,7 +612,6 @@ QFileSystemEntry QFileSystemEngine::absoluteName(const QFileSystemEntry &entry)
ret = QDir::cleanPath(QDir::currentPath() + QLatin1Char('/') + entry.filePath());
}
-#ifndef Q_OS_WINRT
// The path should be absolute at this point.
// From the docs :
// Absolute paths begin with the directory separator "/"
@@ -665,7 +624,6 @@ QFileSystemEntry QFileSystemEngine::absoluteName(const QFileSystemEntry &entry)
// Force uppercase drive letters.
ret[0] = ret.at(0).toUpper();
}
-#endif // !Q_OS_WINRT
return QFileSystemEntry(ret, QFileSystemEntry::FromInternalPath());
}
@@ -681,7 +639,6 @@ typedef struct _FILE_ID_INFO {
// File ID for Windows up to version 7 and FAT32 drives
static inline QByteArray fileId(HANDLE handle)
{
-#ifndef Q_OS_WINRT
BY_HANDLE_FILE_INFORMATION info;
if (GetFileInformationByHandle(handle, &info)) {
char buffer[sizeof "01234567:0123456701234567"];
@@ -691,10 +648,6 @@ static inline QByteArray fileId(HANDLE handle)
info.nFileIndexLow);
return buffer;
}
-#else // !Q_OS_WINRT
- Q_UNUSED(handle);
- Q_UNIMPLEMENTED();
-#endif // Q_OS_WINRT
return QByteArray();
}
@@ -727,23 +680,10 @@ QByteArray QFileSystemEngine::id(const QFileSystemEntry &entry)
QByteArray result;
-#ifndef Q_OS_WINRT
const HANDLE handle =
CreateFile((wchar_t*)entry.nativeFilePath().utf16(), 0,
FILE_SHARE_READ, NULL, OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS, NULL);
-#else // !Q_OS_WINRT
- CREATEFILE2_EXTENDED_PARAMETERS params;
- params.dwSize = sizeof(params);
- params.dwFileAttributes = FILE_ATTRIBUTE_NORMAL;
- params.dwFileFlags = FILE_FLAG_BACKUP_SEMANTICS;
- params.dwSecurityQosFlags = SECURITY_ANONYMOUS;
- params.lpSecurityAttributes = NULL;
- params.hTemplateFile = NULL;
- const HANDLE handle =
- CreateFile2((const wchar_t*)entry.nativeFilePath().utf16(), 0,
- FILE_SHARE_READ, OPEN_EXISTING, &params);
-#endif // Q_OS_WINRT
if (handle != INVALID_HANDLE_VALUE) {
result = id(handle);
CloseHandle(handle);
@@ -994,7 +934,6 @@ static bool tryDriveUNCFallback(const QFileSystemEntry &fname, QFileSystemMetaDa
{
bool entryExists = false;
DWORD fileAttrib = 0;
-#if !defined(Q_OS_WINRT)
if (fname.isDriveRoot()) {
// a valid drive ??
const UINT oldErrorMode = ::SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
@@ -1006,7 +945,6 @@ static bool tryDriveUNCFallback(const QFileSystemEntry &fname, QFileSystemMetaDa
entryExists = true;
}
} else {
-#endif
const QString &path = fname.nativeFilePath();
bool is_dir = false;
if (path.startsWith(QLatin1String("\\\\?\\UNC"))) {
@@ -1037,9 +975,7 @@ static bool tryDriveUNCFallback(const QFileSystemEntry &fname, QFileSystemMetaDa
fileAttrib = FILE_ATTRIBUTE_DIRECTORY;
entryExists = true;
}
-#if !defined(Q_OS_WINRT)
}
-#endif
if (entryExists)
data.fillFromFileAttribute(fileAttrib);
return entryExists;
@@ -1078,34 +1014,12 @@ bool QFileSystemEngine::fillMetaData(HANDLE fHandle, QFileSystemMetaData &data,
{
data.entryFlags &= ~what;
clearWinStatData(data);
-#ifndef Q_OS_WINRT
BY_HANDLE_FILE_INFORMATION fileInfo;
UINT oldmode = SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
if (GetFileInformationByHandle(fHandle , &fileInfo)) {
data.fillFromFindInfo(fileInfo);
}
SetErrorMode(oldmode);
-#else // !Q_OS_WINRT
- FILE_BASIC_INFO fileBasicInfo;
- if (GetFileInformationByHandleEx(fHandle, FileBasicInfo, &fileBasicInfo, sizeof(fileBasicInfo))) {
- data.fillFromFileAttribute(fileBasicInfo.FileAttributes);
- data.birthTime_.dwHighDateTime = fileBasicInfo.CreationTime.HighPart;
- data.birthTime_.dwLowDateTime = fileBasicInfo.CreationTime.LowPart;
- data.changeTime_.dwHighDateTime = fileBasicInfo.ChangeTime.HighPart;
- data.changeTime_.dwLowDateTime = fileBasicInfo.ChangeTime.LowPart;
- data.lastAccessTime_.dwHighDateTime = fileBasicInfo.LastAccessTime.HighPart;
- data.lastAccessTime_.dwLowDateTime = fileBasicInfo.LastAccessTime.LowPart;
- data.lastWriteTime_.dwHighDateTime = fileBasicInfo.LastWriteTime.HighPart;
- data.lastWriteTime_.dwLowDateTime = fileBasicInfo.LastWriteTime.LowPart;
- if (!(data.fileAttribute_ & FILE_ATTRIBUTE_DIRECTORY)) {
- FILE_STANDARD_INFO fileStandardInfo;
- if (GetFileInformationByHandleEx(fHandle, FileStandardInfo, &fileStandardInfo, sizeof(fileStandardInfo)))
- data.size_ = fileStandardInfo.EndOfFile.QuadPart;
- } else
- data.size_ = 0;
- data.knownFlagsMask |= QFileSystemMetaData::Times | QFileSystemMetaData::SizeAttribute;
- }
-#endif // Q_OS_WINRT
return data.hasFlags(what);
}
@@ -1138,9 +1052,7 @@ bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemM
}
if (what & QFileSystemMetaData::WinStatFlags) {
-#ifndef Q_OS_WINRT
UINT oldmode = SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
-#endif
clearWinStatData(data);
WIN32_FIND_DATA findData;
// The memory structure for WIN32_FIND_DATA is same as WIN32_FILE_ATTRIBUTE_DATA
@@ -1153,15 +1065,11 @@ bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemM
} else {
if (!tryFindFallback(fname, data))
if (!tryDriveUNCFallback(fname, data)) {
-#ifndef Q_OS_WINRT
SetErrorMode(oldmode);
-#endif
return false;
}
}
-#ifndef Q_OS_WINRT
SetErrorMode(oldmode);
-#endif
}
if (what & QFileSystemMetaData::Permissions)
@@ -1201,16 +1109,7 @@ static bool isDirPath(const QString &dirPath, bool *existed)
path += QLatin1Char('\\');
const QString longPath = QFSFileEnginePrivate::longFileName(path);
-#ifndef Q_OS_WINRT
DWORD fileAttrib = ::GetFileAttributes(reinterpret_cast<const wchar_t*>(longPath.utf16()));
-#else // Q_OS_WINRT
- DWORD fileAttrib = INVALID_FILE_ATTRIBUTES;
- WIN32_FILE_ATTRIBUTE_DATA data;
- if (::GetFileAttributesEx(reinterpret_cast<const wchar_t*>(longPath.utf16()),
- GetFileExInfoStandard, &data)) {
- fileAttrib = data.dwFileAttributes;
- }
-#endif // Q_OS_WINRT
if (fileAttrib == INVALID_FILE_ATTRIBUTES) {
int errorCode = GetLastError();
if (errorCode == ERROR_ACCESS_DENIED || errorCode == ERROR_SHARING_VIOLATION) {
@@ -1314,36 +1213,10 @@ bool QFileSystemEngine::removeDirectory(const QFileSystemEntry &entry, bool remo
//static
QString QFileSystemEngine::rootPath()
{
-#if defined(Q_OS_WINRT)
- // We specify the package root as root directory
- QString ret = QLatin1String("/");
- // Get package location
- ComPtr<IPackageStatics> statics;
- if (FAILED(GetActivationFactory(HStringReference(RuntimeClass_Windows_ApplicationModel_Package).Get(), &statics)))
- return ret;
- ComPtr<IPackage> package;
- if (FAILED(statics->get_Current(&package)))
- return ret;
- ComPtr<IStorageFolder> installedLocation;
- if (FAILED(package->get_InstalledLocation(&installedLocation)))
- return ret;
-
- ComPtr<IStorageItem> item;
- if (FAILED(installedLocation.As(&item)))
- return ret;
-
- HString finalWinPath;
- if (FAILED(item->get_Path(finalWinPath.GetAddressOf())))
- return ret;
-
- const QString qtWinPath = QDir::fromNativeSeparators(QString::fromWCharArray(finalWinPath.GetRawBuffer(nullptr)));
- ret = qtWinPath.endsWith(QLatin1Char('/')) ? qtWinPath : qtWinPath + QLatin1Char('/');
-#else
QString ret = QString::fromLatin1(qgetenv("SystemDrive"));
if (ret.isEmpty())
ret = QLatin1String("c:");
ret.append(QLatin1Char('/'));
-#endif
return ret;
}
@@ -1391,7 +1264,6 @@ QString QFileSystemEngine::homePath()
QString QFileSystemEngine::tempPath()
{
QString ret;
-#ifndef Q_OS_WINRT
wchar_t tempPath[MAX_PATH];
const DWORD len = GetTempPath(MAX_PATH, tempPath);
if (len) { // GetTempPath() can return short names, expand.
@@ -1406,24 +1278,6 @@ QString QFileSystemEngine::tempPath()
ret.chop(1);
ret = QDir::fromNativeSeparators(ret);
}
-#else // !Q_OS_WINRT
- ComPtr<IApplicationDataStatics> applicationDataStatics;
- if (FAILED(GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Storage_ApplicationData).Get(), &applicationDataStatics)))
- return ret;
- ComPtr<IApplicationData> applicationData;
- if (FAILED(applicationDataStatics->get_Current(&applicationData)))
- return ret;
- ComPtr<IStorageFolder> tempFolder;
- if (FAILED(applicationData->get_TemporaryFolder(&tempFolder)))
- return ret;
- ComPtr<IStorageItem> tempFolderItem;
- if (FAILED(tempFolder.As(&tempFolderItem)))
- return ret;
- HString path;
- if (FAILED(tempFolderItem->get_Path(path.GetAddressOf())))
- return ret;
- ret = QDir::fromNativeSeparators(QString::fromWCharArray(path.GetRawBuffer(nullptr)));
-#endif // Q_OS_WINRT
if (ret.isEmpty()) {
ret = QLatin1String("C:/tmp");
} else if (ret.length() >= 2 && ret[1] == QLatin1Char(':'))
@@ -1478,17 +1332,8 @@ bool QFileSystemEngine::createLink(const QFileSystemEntry &source, const QFileSy
//static
bool QFileSystemEngine::copyFile(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error)
{
-#ifndef Q_OS_WINRT
bool ret = ::CopyFile((wchar_t*)source.nativeFilePath().utf16(),
(wchar_t*)target.nativeFilePath().utf16(), true) != 0;
-#else // !Q_OS_WINRT
- COPYFILE2_EXTENDED_PARAMETERS copyParams = {
- sizeof(copyParams), COPY_FILE_FAIL_IF_EXISTS, NULL, NULL, NULL
- };
- HRESULT hres = ::CopyFile2((const wchar_t*)source.nativeFilePath().utf16(),
- (const wchar_t*)target.nativeFilePath().utf16(), &copyParams);
- bool ret = SUCCEEDED(hres);
-#endif // Q_OS_WINRT
if(!ret)
error = QSystemError(::GetLastError(), QSystemError::NativeError);
return ret;
@@ -1500,13 +1345,8 @@ bool QFileSystemEngine::renameFile(const QFileSystemEntry &source, const QFileSy
Q_CHECK_FILE_NAME(source, false);
Q_CHECK_FILE_NAME(target, false);
-#ifndef Q_OS_WINRT
bool ret = ::MoveFile((wchar_t*)source.nativeFilePath().utf16(),
(wchar_t*)target.nativeFilePath().utf16()) != 0;
-#else // !Q_OS_WINRT
- bool ret = ::MoveFileEx((const wchar_t*)source.nativeFilePath().utf16(),
- (const wchar_t*)target.nativeFilePath().utf16(), 0) != 0;
-#endif // Q_OS_WINRT
if(!ret)
error = QSystemError(::GetLastError(), QSystemError::NativeError);
return ret;
@@ -1547,7 +1387,6 @@ bool QFileSystemEngine::removeFile(const QFileSystemEntry &entry, QSystemError &
bool QFileSystemEngine::moveFileToTrash(const QFileSystemEntry &source,
QFileSystemEntry &newLocation, QSystemError &error)
{
-#ifndef Q_OS_WINRT
// we need the "display name" of the file, so can't use nativeAbsoluteFilePath
const QString sourcePath = QDir::toNativeSeparators(absoluteName(source).filePath());
@@ -1626,12 +1465,6 @@ bool QFileSystemEngine::moveFileToTrash(const QFileSystemEntry &source,
}
return true;
-#else // Q_OS_WINRT
- Q_UNUSED(source);
- Q_UNUSED(newLocation);
- Q_UNUSED(error);
- return false;
-#endif
}
//static
diff --git a/src/corelib/io/qfilesystementry.cpp b/src/corelib/io/qfilesystementry.cpp
index 3ff90bd0a3..3c8a85291a 100644
--- a/src/corelib/io/qfilesystementry.cpp
+++ b/src/corelib/io/qfilesystementry.cpp
@@ -167,16 +167,6 @@ void QFileSystemEntry::resolveNativeFilePath() const
#else
m_nativeFilePath = QFile::encodeName(QDir::toNativeSeparators(m_filePath));
#endif
-#ifdef Q_OS_WINRT
- while (m_nativeFilePath.startsWith(QLatin1Char('\\')))
- m_nativeFilePath.remove(0,1);
- if (m_nativeFilePath.isEmpty())
- m_nativeFilePath.append(QLatin1Char('.'));
- // WinRT/MSVC2015 allows a maximum of 256 characters for a filepath
- // unless //?/ is prepended which extends the rule to have a maximum
- // of 256 characters in the filename plus the preprending path
- m_nativeFilePath.prepend("\\\\?\\");
-#endif
}
}
@@ -302,13 +292,9 @@ bool QFileSystemEntry::isDriveRoot() const
bool QFileSystemEntry::isDriveRootPath(const QString &path)
{
-#ifndef Q_OS_WINRT
return (path.length() == 3
&& path.at(0).isLetter() && path.at(1) == QLatin1Char(':')
&& path.at(2) == QLatin1Char('/'));
-#else // !Q_OS_WINRT
- return path == QDir::rootPath();
-#endif // !Q_OS_WINRT
}
#endif // Q_OS_WIN
diff --git a/src/corelib/io/qfilesystemmetadata_p.h b/src/corelib/io/qfilesystemmetadata_p.h
index 3154658e5c..dbd89f5903 100644
--- a/src/corelib/io/qfilesystemmetadata_p.h
+++ b/src/corelib/io/qfilesystemmetadata_p.h
@@ -235,9 +235,7 @@ public:
#if defined(Q_OS_WIN)
inline void fillFromFileAttribute(DWORD fileAttribute, bool isDriveRoot = false);
inline void fillFromFindData(WIN32_FIND_DATA &findData, bool setLinkType = false, bool isDriveRoot = false);
-# ifndef Q_OS_WINRT
inline void fillFromFindInfo(BY_HANDLE_FILE_INFORMATION &fileInfo);
-# endif
#endif
private:
friend class QFileSystemEngine;
@@ -372,7 +370,6 @@ inline void QFileSystemMetaData::fillFromFindData(WIN32_FIND_DATA &findData, boo
}
}
-#ifndef Q_OS_WINRT
inline void QFileSystemMetaData::fillFromFindInfo(BY_HANDLE_FILE_INFORMATION &fileInfo)
{
fillFromFileAttribute(fileInfo.dwFileAttributes);
@@ -388,7 +385,6 @@ inline void QFileSystemMetaData::fillFromFindInfo(BY_HANDLE_FILE_INFORMATION &fi
}
knownFlagsMask |= Times | SizeAttribute;
}
-#endif // !Q_OS_WINRT
#endif // Q_OS_WIN
QT_END_NAMESPACE
diff --git a/src/corelib/io/qfilesystemwatcher.cpp b/src/corelib/io/qfilesystemwatcher.cpp
index 96d9210c1c..a5e83ac11f 100644
--- a/src/corelib/io/qfilesystemwatcher.cpp
+++ b/src/corelib/io/qfilesystemwatcher.cpp
@@ -105,7 +105,7 @@ void QFileSystemWatcherPrivate::init()
SIGNAL(directoryChanged(QString,bool)),
q,
SLOT(_q_directoryChanged(QString,bool)));
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
QObject::connect(static_cast<QWindowsFileSystemWatcherEngine *>(native),
&QWindowsFileSystemWatcherEngine::driveLockForRemoval,
q, [this] (const QString &p) { _q_winDriveLockForRemoval(p); });
@@ -115,7 +115,7 @@ void QFileSystemWatcherPrivate::init()
QObject::connect(static_cast<QWindowsFileSystemWatcherEngine *>(native),
&QWindowsFileSystemWatcherEngine::driveRemoved,
q, [this] (const QString &p) { _q_winDriveRemoved(p); });
-#endif // !Q_OS_WINRT
+#endif // Q_OS_WIN
}
}
@@ -162,7 +162,7 @@ void QFileSystemWatcherPrivate::_q_directoryChanged(const QString &path, bool re
emit q->directoryChanged(path, QFileSystemWatcher::QPrivateSignal());
}
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
void QFileSystemWatcherPrivate::_q_winDriveLockForRemoval(const QString &path)
{
@@ -201,7 +201,7 @@ void QFileSystemWatcherPrivate::_q_winDriveRemoved(const QString &path)
if (!path.isEmpty())
temporarilyRemovedPaths.remove(path.at(0));
}
-#endif // Q_OS_WIN && !Q_OS_WINRT
+#endif // Q_OS_WIN
/*!
\class QFileSystemWatcher
diff --git a/src/corelib/io/qfilesystemwatcher_p.h b/src/corelib/io/qfilesystemwatcher_p.h
index 1997ff6c86..cecfe03ff5 100644
--- a/src/corelib/io/qfilesystemwatcher_p.h
+++ b/src/corelib/io/qfilesystemwatcher_p.h
@@ -108,14 +108,14 @@ public:
void _q_fileChanged(const QString &path, bool removed);
void _q_directoryChanged(const QString &path, bool removed);
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
void _q_winDriveLockForRemoval(const QString &);
void _q_winDriveLockForRemovalFailed(const QString &);
void _q_winDriveRemoved(const QString &);
private:
QHash<QChar, QStringList> temporarilyRemovedPaths;
-#endif // Q_OS_WIN && !Q_OS_WINRT
+#endif // Q_OS_WIN
};
diff --git a/src/corelib/io/qfilesystemwatcher_win.cpp b/src/corelib/io/qfilesystemwatcher_win.cpp
index 2f0a209b76..cc04288de5 100644
--- a/src/corelib/io/qfilesystemwatcher_win.cpp
+++ b/src/corelib/io/qfilesystemwatcher_win.cpp
@@ -52,7 +52,6 @@
#include <qt_windows.h>
-#ifndef Q_OS_WINRT
# include <qabstractnativeeventfilter.h>
# include <qcoreapplication.h>
# include <qdir.h>
@@ -61,7 +60,6 @@
# include <dbt.h>
# include <algorithm>
# include <vector>
-#endif // !Q_OS_WINRT
QT_BEGIN_NAMESPACE
@@ -85,7 +83,6 @@ static Qt::HANDLE createChangeNotification(const QString &path, uint flags)
return result;
}
-#ifndef Q_OS_WINRT
///////////
// QWindowsRemovableDriveListener
// Listen for the various WM_DEVICECHANGE message indicating drive addition/removal
@@ -330,7 +327,6 @@ void QWindowsRemovableDriveListener::addPath(const QString &p)
m_removableDrives.push_back(re);
}
-#endif // !Q_OS_WINRT
///////////
// QWindowsFileSystemWatcherEngine
@@ -343,7 +339,6 @@ QWindowsFileSystemWatcherEngine::Handle::Handle()
QWindowsFileSystemWatcherEngine::QWindowsFileSystemWatcherEngine(QObject *parent)
: QFileSystemWatcherEngine(parent)
{
-#ifndef Q_OS_WINRT
if (QAbstractEventDispatcher *eventDispatcher = QAbstractEventDispatcher::instance()) {
m_driveListener = new QWindowsRemovableDriveListener(this);
eventDispatcher->installNativeEventFilter(m_driveListener);
@@ -360,7 +355,6 @@ QWindowsFileSystemWatcherEngine::QWindowsFileSystemWatcherEngine(QObject *parent
qWarning("QFileSystemWatcher: Removable drive notification will not work"
" if there is no QCoreApplication instance.");
}
-#endif // !Q_OS_WINRT
}
QWindowsFileSystemWatcherEngine::~QWindowsFileSystemWatcherEngine()
@@ -524,14 +518,12 @@ QStringList QWindowsFileSystemWatcherEngine::addPaths(const QStringList &paths,
}
}
-#ifndef Q_OS_WINRT
if (Q_LIKELY(m_driveListener)) {
for (const QString &path : paths) {
if (!unhandled.contains(path))
m_driveListener->addPath(path);
}
}
-#endif // !Q_OS_WINRT
return unhandled;
}
@@ -763,6 +755,4 @@ void QWindowsFileSystemWatcherEngineThread::wakeup()
QT_END_NAMESPACE
-#ifndef Q_OS_WINRT
# include "qfilesystemwatcher_win.moc"
-#endif
diff --git a/src/corelib/io/qfilesystemwatcher_win_p.h b/src/corelib/io/qfilesystemwatcher_win_p.h
index 9d74ca3f61..138b6badf2 100644
--- a/src/corelib/io/qfilesystemwatcher_win_p.h
+++ b/src/corelib/io/qfilesystemwatcher_win_p.h
@@ -126,9 +126,7 @@ signals:
private:
QList<QWindowsFileSystemWatcherEngineThread *> threads;
-#ifndef Q_OS_WINRT
QWindowsRemovableDriveListener *m_driveListener = nullptr;
-#endif
};
class QFileSystemWatcherPathKey : public QString
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp
index dd4882a2bc..6b1ab5739e 100644
--- a/src/corelib/io/qfsfileengine_win.cpp
+++ b/src/corelib/io/qfsfileengine_win.cpp
@@ -53,18 +53,14 @@
#include <direct.h>
#include <winioctl.h>
#include <objbase.h>
-#ifndef Q_OS_WINRT
-# include <shlobj.h>
-# include <accctrl.h>
-#endif
+#include <shlobj.h>
+#include <accctrl.h>
#include <initguid.h>
#include <ctype.h>
#include <limits.h>
#include <stdio.h>
-#ifndef Q_OS_WINRT
-# define SECURITY_WIN32
-# include <security.h>
-#endif
+#define SECURITY_WIN32
+#include <security.h>
#ifndef PATH_MAX
#define PATH_MAX FILENAME_MAX
@@ -88,16 +84,12 @@ QString QFSFileEnginePrivate::longFileName(const QString &path)
return path;
QString absPath = QFileSystemEngine::nativeAbsoluteFilePath(path);
-#if !defined(Q_OS_WINRT)
QString prefix = QLatin1String("\\\\?\\");
if (isUncPath(absPath)) {
prefix.append(QLatin1String("UNC\\")); // "\\\\?\\UNC\\"
absPath.remove(0, 2);
}
return prefix + absPath;
-#else
- return absPath;
-#endif
}
/*
@@ -123,7 +115,6 @@ bool QFSFileEnginePrivate::nativeOpen(QIODevice::OpenMode openMode)
? OPEN_ALWAYS
: OPEN_EXISTING;
// Create the file handle.
-#ifndef Q_OS_WINRT
SECURITY_ATTRIBUTES securityAtts = { sizeof(SECURITY_ATTRIBUTES), NULL, FALSE };
fileHandle = CreateFile((const wchar_t*)fileEntry.nativeFilePath().utf16(),
accessRights,
@@ -132,13 +123,6 @@ bool QFSFileEnginePrivate::nativeOpen(QIODevice::OpenMode openMode)
creationDisp,
FILE_ATTRIBUTE_NORMAL,
NULL);
-#else // !Q_OS_WINRT
- fileHandle = CreateFile2((const wchar_t*)fileEntry.nativeFilePath().utf16(),
- accessRights,
- shareMode,
- creationDisp,
- NULL);
-#endif // Q_OS_WINRT
// Bail out on error.
if (fileHandle == INVALID_HANDLE_VALUE) {
@@ -428,7 +412,6 @@ int QFSFileEnginePrivate::nativeHandle() const
*/
bool QFSFileEnginePrivate::nativeIsSequential() const
{
-#if !defined(Q_OS_WINRT)
HANDLE handle = fileHandle;
if (fh || fd != -1)
handle = (HANDLE)_get_osfhandle(fh ? QT_FILENO(fh) : fd);
@@ -438,9 +421,6 @@ bool QFSFileEnginePrivate::nativeIsSequential() const
DWORD fileType = GetFileType(handle);
return (fileType == FILE_TYPE_CHAR)
|| (fileType == FILE_TYPE_PIPE);
-#else
- return false;
-#endif
}
bool QFSFileEngine::caseSensitive() const
@@ -450,7 +430,6 @@ bool QFSFileEngine::caseSensitive() const
QString QFSFileEngine::currentPath(const QString &fileName)
{
-#if !defined(Q_OS_WINRT)
QString ret;
//if filename is a drive: then get the pwd of that drive
if (fileName.length() >= 2 &&
@@ -469,13 +448,8 @@ QString QFSFileEngine::currentPath(const QString &fileName)
if (ret.length() >= 2 && ret[1] == QLatin1Char(':'))
ret[0] = ret.at(0).toUpper(); // Force uppercase drive letters.
return ret;
-#else // !Q_OS_WINRT
- Q_UNUSED(fileName);
- return QFileSystemEngine::currentPath().filePath();
-#endif // Q_OS_WINRT
}
-#if !defined(Q_OS_WINRT)
// cf QStorageInfo::isReady
static inline bool isDriveReady(const wchar_t *path)
{
@@ -485,12 +459,10 @@ static inline bool isDriveReady(const wchar_t *path)
|| GetVolumeInformation(path, nullptr, 0, nullptr, nullptr,
&fileSystemFlags, nullptr, 0) == TRUE;
}
-#endif // !Q_OS_WINRT
QFileInfoList QFSFileEngine::drives()
{
QFileInfoList ret;
-#if !defined(Q_OS_WINRT)
const UINT oldErrorMode = ::SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
quint32 driveBits = (quint32) GetLogicalDrives() & 0x3ffffff;
wchar_t driveName[] = L"A:\\";
@@ -503,10 +475,6 @@ QFileInfoList QFSFileEngine::drives()
}
::SetErrorMode(oldErrorMode);
return ret;
-#else // !Q_OS_WINRT
- ret.append(QFileInfo(QLatin1String("/")));
- return ret;
-#endif // Q_OS_WINRT
}
bool QFSFileEnginePrivate::doStat(QFileSystemMetaData::MetaDataFlags flags) const
@@ -529,7 +497,6 @@ bool QFSFileEnginePrivate::doStat(QFileSystemMetaData::MetaDataFlags flags) cons
bool QFSFileEngine::link(const QString &newName)
{
-#if !defined(Q_OS_WINRT)
bool ret = false;
QString linkName = newName;
@@ -574,11 +541,6 @@ bool QFSFileEngine::link(const QString &newName)
CoUninitialize();
return ret;
-#else // !Q_OS_WINRT
- Q_UNUSED(newName);
- Q_UNIMPLEMENTED();
- return false;
-#endif // Q_OS_WINRT
}
/*!
@@ -891,11 +853,7 @@ uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size,
// first create the file mapping handle
DWORD protection = (openMode & QIODevice::WriteOnly) ? PAGE_READWRITE : PAGE_READONLY;
-#ifndef Q_OS_WINRT
mapHandle = ::CreateFileMapping(handle, 0, protection, 0, 0, 0);
-#else
- mapHandle = ::CreateFileMappingFromApp(handle, 0, protection, 0, 0);
-#endif
if (mapHandle == NULL) {
q->setError(QFile::PermissionsError, qt_error_string());
#ifdef Q_USE_DEPRECATED_MAP_API
@@ -908,24 +866,15 @@ uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size,
DWORD offsetHi = offset >> 32;
DWORD offsetLo = offset & Q_UINT64_C(0xffffffff);
SYSTEM_INFO sysinfo;
-#ifndef Q_OS_WINRT
::GetSystemInfo(&sysinfo);
-#else
- ::GetNativeSystemInfo(&sysinfo);
-#endif
DWORD mask = sysinfo.dwAllocationGranularity - 1;
DWORD extra = offset & mask;
if (extra)
offsetLo &= ~mask;
// attempt to create the map
-#ifndef Q_OS_WINRT
LPVOID mapAddress = ::MapViewOfFile(mapHandle, access,
offsetHi, offsetLo, size + extra);
-#else
- LPVOID mapAddress = ::MapViewOfFileFromApp(mapHandle, access,
- (ULONG64(offsetHi) << 32) + offsetLo, size + extra);
-#endif
if (mapAddress) {
uchar *address = extra + static_cast<uchar*>(mapAddress);
maps[address] = extra;
diff --git a/src/corelib/io/qlockfile_win.cpp b/src/corelib/io/qlockfile_win.cpp
index 277f8d4230..77cdf66694 100644
--- a/src/corelib/io/qlockfile_win.cpp
+++ b/src/corelib/io/qlockfile_win.cpp
@@ -65,7 +65,6 @@ QLockFile::LockError QLockFilePrivate::tryLock_sys()
// but Windows doesn't allow recreating it while this handle is open anyway,
// so this would only create confusion (can't lock, but no lock file to read from).
const DWORD dwShareMode = FILE_SHARE_READ;
-#ifndef Q_OS_WINRT
SECURITY_ATTRIBUTES securityAtts = { sizeof(SECURITY_ATTRIBUTES), NULL, FALSE };
HANDLE fh = CreateFile((const wchar_t*)fileEntry.nativeFilePath().utf16(),
GENERIC_READ | GENERIC_WRITE,
@@ -74,13 +73,6 @@ QLockFile::LockError QLockFilePrivate::tryLock_sys()
CREATE_NEW, // error if already exists
FILE_ATTRIBUTE_NORMAL,
NULL);
-#else // !Q_OS_WINRT
- HANDLE fh = CreateFile2((const wchar_t*)fileEntry.nativeFilePath().utf16(),
- GENERIC_READ | GENERIC_WRITE,
- dwShareMode,
- CREATE_NEW, // error if already exists
- NULL);
-#endif // Q_OS_WINRT
if (fh == INVALID_HANDLE_VALUE) {
const DWORD lastError = GetLastError();
switch (lastError) {
@@ -118,9 +110,6 @@ bool QLockFilePrivate::removeStaleLock()
bool QLockFilePrivate::isProcessRunning(qint64 pid, const QString &appname)
{
- // On WinRT there seems to be no way of obtaining information about other
- // processes due to sandboxing
-#ifndef Q_OS_WINRT
HANDLE procHandle = ::OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid);
if (!procHandle)
return false;
@@ -137,17 +126,11 @@ bool QLockFilePrivate::isProcessRunning(qint64 pid, const QString &appname)
if (!processName.isEmpty() && processName != appname)
return false; // PID got reused by a different application.
-#else // !Q_OS_WINRT
- Q_UNUSED(pid);
- Q_UNUSED(appname);
-#endif // Q_OS_WINRT
-
return true;
}
QString QLockFilePrivate::processNameByPid(qint64 pid)
{
-#if !defined(Q_OS_WINRT)
typedef DWORD (WINAPI *GetModuleFileNameExFunc)(HANDLE, HMODULE, LPTSTR, DWORD);
HMODULE hPsapi = LoadLibraryA("psapi");
@@ -179,10 +162,6 @@ QString QLockFilePrivate::processNameByPid(qint64 pid)
if (i >= 0)
name.truncate(i);
return name;
-#else
- Q_UNUSED(pid);
- return QString();
-#endif
}
void QLockFile::unlock()
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index 854752069e..633777fd5c 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -489,8 +489,7 @@ void QProcessPrivate::Channel::clear()
You can also call error() to find the type of error that occurred
last, and state() to find the current process state.
- \note QProcess is not supported on VxWorks, iOS, tvOS, watchOS,
- or the Universal Windows Platform.
+ \note QProcess is not supported on VxWorks, iOS, tvOS, or watchOS.
\section1 Communicating via Channels
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index a15dbb772f..5d84713a67 100644
--- a/src/corelib/io/qsettings.cpp
+++ b/src/corelib/io/qsettings.cpp
@@ -78,19 +78,7 @@
#ifdef Q_OS_WIN // for homedirpath reading from registry
# include <qt_windows.h>
-# ifndef Q_OS_WINRT
-# include <shlobj.h>
-# endif
-#endif
-
-#ifdef Q_OS_WINRT
-#include <wrl.h>
-#include <windows.foundation.h>
-#include <windows.storage.h>
-using namespace Microsoft::WRL;
-using namespace Microsoft::WRL::Wrappers;
-using namespace ABI::Windows::Foundation;
-using namespace ABI::Windows::Storage;
+# include <shlobj.h>
#endif
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_ANDROID)
@@ -286,7 +274,7 @@ after_loop:
return result;
}
-// see also qsettings_win.cpp, qsettings_winrt.cpp and qsettings_mac.cpp
+// see also qsettings_win.cpp and qsettings_mac.cpp
#if !defined(Q_OS_WIN) && !defined(Q_OS_MAC) && !defined(Q_OS_WASM)
QSettingsPrivate *QSettingsPrivate::create(QSettings::Format format, QSettings::Scope scope,
@@ -945,7 +933,7 @@ void QConfFileSettingsPrivate::initAccess()
sync(); // loads the files the first time
}
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
static QString windowsConfigPath(const KNOWNFOLDERID &type)
{
QString result;
@@ -966,44 +954,7 @@ static QString windowsConfigPath(const KNOWNFOLDERID &type)
return result;
}
-#elif defined(Q_OS_WINRT) // Q_OS_WIN && !Q_OS_WINRT
-
-enum ConfigPathType {
- ConfigPath_CommonAppData,
- ConfigPath_UserAppData
-};
-
-static QString windowsConfigPath(ConfigPathType type)
-{
- static QString result;
- while (result.isEmpty()) {
- ComPtr<IApplicationDataStatics> applicationDataStatics;
- if (FAILED(GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Storage_ApplicationData).Get(), &applicationDataStatics)))
- return result;
- ComPtr<IApplicationData> applicationData;
- if (FAILED(applicationDataStatics->get_Current(&applicationData)))
- return result;
- ComPtr<IStorageFolder> localFolder;
- if (FAILED(applicationData->get_LocalFolder(&localFolder)))
- return result;
- ComPtr<IStorageItem> localFolderItem;
- if (FAILED(localFolder.As(&localFolderItem)))
- return result;
- HString path;
- if (FAILED(localFolderItem->get_Path(path.GetAddressOf())))
- return result;
- result = QString::fromWCharArray(path.GetRawBuffer(nullptr));
- }
-
- switch (type) {
- case ConfigPath_CommonAppData:
- return result + QLatin1String("\\qt-common");
- case ConfigPath_UserAppData:
- return result + QLatin1String("\\qt-user");
- }
- return result;
-}
-#endif // Q_OS_WINRT
+#endif // Q_OS_WIN
static inline int pathHashKey(QSettings::Format format, QSettings::Scope scope)
{
@@ -1056,14 +1007,8 @@ static std::unique_lock<QBasicMutex> initDefaultPaths(std::unique_lock<QBasicMut
Windows registry and the Mac CFPreferences.)
*/
#ifdef Q_OS_WIN
-
-# ifdef Q_OS_WINRT
- const QString roamingAppDataFolder = windowsConfigPath(ConfigPath_UserAppData);
- const QString programDataFolder = windowsConfigPath(ConfigPath_CommonAppData);
-# else
const QString roamingAppDataFolder = windowsConfigPath(FOLDERID_RoamingAppData);
const QString programDataFolder = windowsConfigPath(FOLDERID_ProgramData);
-# endif
pathHash->insert(pathHashKey(QSettings::IniFormat, QSettings::UserScope),
Path(roamingAppDataFolder + QDir::separator(), false));
pathHash->insert(pathHashKey(QSettings::IniFormat, QSettings::SystemScope),
diff --git a/src/corelib/io/qsettings_p.h b/src/corelib/io/qsettings_p.h
index 8ddebd2359..548fcb591d 100644
--- a/src/corelib/io/qsettings_p.h
+++ b/src/corelib/io/qsettings_p.h
@@ -72,10 +72,6 @@ QT_BEGIN_NAMESPACE
#define QT_QSETTINGS_ALWAYS_CASE_SENSITIVE_AND_FORGET_ORIGINAL_KEY_ORDER
#endif
-#if defined(Q_OS_WINRT)
-#define QT_QTSETTINGS_FORGET_ORIGINAL_KEY_ORDER
-#endif
-
// used in testing framework
#define QSETTINGS_P_H_VERSION 3
diff --git a/src/corelib/io/qsettings_winrt.cpp b/src/corelib/io/qsettings_winrt.cpp
deleted file mode 100644
index a208262ab4..0000000000
--- a/src/corelib/io/qsettings_winrt.cpp
+++ /dev/null
@@ -1,690 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qsettings.h"
-
-#include "qsettings_p.h"
-#include "qvector.h"
-#include "qmap.h"
-#include "qdebug.h"
-#include "qfunctions_winrt.h"
-
-#include <wrl.h>
-#include <wrl/event.h>
-#include <Windows.ApplicationModel.h>
-#include <windows.storage.h>
-
-using namespace ABI::Windows::ApplicationModel;
-using namespace ABI::Windows::Storage;
-using namespace ABI::Windows::Foundation;
-using namespace ABI::Windows::Foundation::Collections;
-using namespace Microsoft::WRL;
-using namespace Microsoft::WRL::Wrappers;
-
-typedef ITypedEventHandler<ApplicationData*, IInspectable*> DataHandler;
-typedef Collections::IKeyValuePair<HSTRING, ApplicationDataContainer*> ContainerItem;
-typedef Collections::IIterable<ContainerItem*> ContainerIterable;
-typedef Collections::IIterator<ContainerItem*> ContainerIterator;
-
-typedef Collections::IKeyValuePair<HSTRING, IInspectable*> ValueItem;
-typedef Collections::IIterable<ValueItem*> ValueIterable;
-typedef Collections::IIterator<ValueItem*> ValueIterator;
-
-QT_BEGIN_NAMESPACE
-
-static IApplicationDataContainer *subContainer(IApplicationDataContainer *parent, const QString &name)
-{
- ComPtr<IMapView<HSTRING, ApplicationDataContainer*>> childrenContainer;
- HRESULT hr = parent->get_Containers(&childrenContainer);
- if (FAILED(hr))
- return 0;
-
- ComPtr< ContainerIterable > iterable;
- ComPtr< ContainerIterator > iterator;
-
- hr = childrenContainer.As(&iterable);
- if (FAILED(hr))
- return 0;
-
- hr = iterable->First(&iterator);
- if (FAILED(hr))
- return 0;
- boolean current;
- hr = iterator->get_HasCurrent(&current);
- if (FAILED(hr))
- return 0;
-
- while (SUCCEEDED(hr) && current) {
- ComPtr<ContainerItem> item;
- hr = iterator->get_Current(&item);
- if (FAILED(hr))
- return 0;
-
- HString key;
- hr = item->get_Key(key.GetAddressOf());
- if (FAILED(hr))
- continue;
- QString subName = QString::fromWCharArray(key.GetRawBuffer(nullptr));
- if (name == subName) {
- IApplicationDataContainer *container;
- hr = item->get_Value(&container);
- return SUCCEEDED(hr) ? container : 0;
- }
- hr = iterator->MoveNext(&current);
- }
-
- return 0;
-}
-
-static QStringList subContainerNames(IApplicationDataContainer *container, bool recursive = false)
-{
- QStringList result;
- ComPtr<IMapView<HSTRING, ApplicationDataContainer*>> childrenContainer;
- HRESULT hr = container->get_Containers(&childrenContainer);
- if (FAILED(hr))
- return result;
-
- ComPtr< ContainerIterable > iterable;
- ComPtr< ContainerIterator > iterator;
-
- hr = childrenContainer.As(&iterable);
- if (FAILED(hr))
- return result;
-
- hr = iterable->First(&iterator);
- if (FAILED(hr))
- return result;
- boolean current;
- hr = iterator->get_HasCurrent(&current);
- if (FAILED(hr))
- return result;
-
- while (SUCCEEDED(hr) && current) {
- ComPtr<ContainerItem> item;
- hr = iterator->get_Current(&item);
- if (FAILED(hr))
- return result;
-
- HString key;
- hr = item->get_Key(key.GetAddressOf());
- if (SUCCEEDED(hr)) {
- QString subName = QString::fromWCharArray(key.GetRawBuffer(nullptr));
- result.append(subName);
- if (recursive) {
- ComPtr<IApplicationDataContainer> sub = subContainer(container, subName);
- QStringList subSubNames = subContainerNames(sub.Get(), recursive);
- for (int i = 0; i < subSubNames.size(); ++i)
- subSubNames[i] = subName + QLatin1Char('/') + subSubNames[i];
- result.append(subSubNames);
- }
- hr = iterator->MoveNext(&current);
- }
- }
- return result;
-}
-
-static QStringList keyNames(IApplicationDataContainer *container) {
- HRESULT hr;
- QStringList result;
- ComPtr<IPropertySet> values;
- hr = container->get_Values(&values);
- if (FAILED(hr))
- return result;
-
- ComPtr<IMap<HSTRING, IInspectable*>> settingsMap;
-
- hr = values.As(&settingsMap);
- if (FAILED(hr))
- return result;
-
- ComPtr<IMapView<HSTRING, IInspectable*>> mapView;
- hr = settingsMap->GetView(&mapView);
- if (FAILED(hr))
- return result;
-
- ComPtr< ValueIterable > iterable;
- ComPtr< ValueIterator > iterator;
-
- hr = mapView.As(&iterable);
- if (FAILED(hr))
- return result;
-
- boolean current = false;
- hr = iterable->First(&iterator);
- if (FAILED(hr))
- return result;
- hr = iterator->get_HasCurrent(&current);
- if (FAILED(hr))
- return result;
-
- while (SUCCEEDED(hr) && current){
- ComPtr<ValueItem> item;
- hr = iterator->get_Current(&item);
- if (FAILED(hr))
- return result;
-
- HString key;
- hr = item->get_Key(key.GetAddressOf());
- if (SUCCEEDED(hr)) {
- result += QString::fromWCharArray(key.GetRawBuffer(nullptr));
- hr = iterator->MoveNext(&current);
- }
- }
- return result;
-}
-
-static IApplicationDataContainer *createSubContainer(IApplicationDataContainer *parent, const QString &name)
-{
- HStringReference childGroupNativeName((const wchar_t*)name.utf16(), name.size());
-
- IApplicationDataContainer *result = subContainer(parent, name);
- if (!result)
- parent->CreateContainer(childGroupNativeName.Get(), ApplicationDataCreateDisposition_Always, &result);
- return result;
-}
-
-#define PROP_CASE_TO_VARIANT(TYPE, VARTYPE, QTYPE) \
- case PropertyType_##TYPE: { \
- VARTYPE v; \
- value->Get##TYPE(&v); \
- result.setValue( QTYPE(v) ); \
- break; \
- }
-
-static QVariant propertyValueToQVariant(IPropertyValue *value)
-{
- QVariant result;
- PropertyType type;
- value->get_Type(&type);
- switch (type) {
- PROP_CASE_TO_VARIANT(Boolean, boolean, bool)
- PROP_CASE_TO_VARIANT(UInt8, UINT8, quint8)
- PROP_CASE_TO_VARIANT(Int16, INT16, qint16)
- PROP_CASE_TO_VARIANT(UInt16, UINT16, quint16)
- PROP_CASE_TO_VARIANT(Int32, INT32, qint32)
- PROP_CASE_TO_VARIANT(UInt32, UINT32, quint32)
- PROP_CASE_TO_VARIANT(Int64, INT64, qint64)
- PROP_CASE_TO_VARIANT(UInt64, UINT64, quint64)
- PROP_CASE_TO_VARIANT(Single, FLOAT, float)
- PROP_CASE_TO_VARIANT(Double, DOUBLE, double)
- case PropertyType_StringArray: {
- UINT32 size;
- HSTRING *content;
- value->GetStringArray(&size, &content);
- QStringList list;
- // The last item is assumed to be added by us
- for (UINT32 i = 0; i < size - 1; ++i) {
- QString s = QString::fromWCharArray(WindowsGetStringRawBuffer(content[i], nullptr));
- list.append(s);
- }
- result = QSettingsPrivate::stringListToVariantList(list);
- break;
- }
- case PropertyType_String: {
- HString v;
- value->GetString(v.GetAddressOf());
- result = QSettingsPrivate::stringToVariant(QString::fromWCharArray(v.GetRawBuffer(nullptr)));
- break;
- }
- default: {
- UINT32 size;
- BYTE *arr;
- value->GetUInt8Array(&size, &arr);
- QByteArray data = QByteArray::fromRawData((const char*)arr, size);
- QString s;
- if (size) {
- // We assume this is our qt stored data like on other platforms
- // as well. QList and others are converted to byte arrays
- s = QString::fromWCharArray((const wchar_t *)data.constData(), data.size() / 2);
- result = QSettingsPrivate::stringToVariant(s);
- }
- break;
- }
- }
- return result;
-}
-
-class QWinRTSettingsPrivate : public QSettingsPrivate
-{
-public:
- QWinRTSettingsPrivate(QSettings::Scope scope, const QString &organization,
- const QString &application);
- QWinRTSettingsPrivate(const QString &rKey);
- ~QWinRTSettingsPrivate();
-
- void remove(const QString &uKey) override;
- void set(const QString &uKey, const QVariant &value) override;
- bool get(const QString &uKey, QVariant *value) const override;
- QStringList children(const QString &uKey, ChildSpec spec) const override;
- void clear() override;
- void sync() override;
- void flush() override;
- bool isWritable() const override;
- QString fileName() const override;
-
-private:
- void init(QSettings::Scope scope);
- IApplicationDataContainer *getContainer(IApplicationDataContainer *parent, const QString &group, bool create = false) const;
- void clearContainerMaps();
-
- HRESULT onDataChanged(IApplicationData*, IInspectable*);
-
- ComPtr<IApplicationData> applicationData;
- QVector<ComPtr<IApplicationDataContainer>> readContainers;
- ComPtr<IApplicationDataContainer> writeContainer;
- EventRegistrationToken dataChangedToken;
-};
-
-QWinRTSettingsPrivate::QWinRTSettingsPrivate(QSettings::Scope scope, const QString &organization,
- const QString &application)
- : QSettingsPrivate(QSettings::NativeFormat, scope, organization, application)
- , writeContainer(0)
-{
- init(scope);
-}
-
-QWinRTSettingsPrivate::QWinRTSettingsPrivate(const QString &rPath)
- : QSettingsPrivate(QSettings::NativeFormat, QSettings::UserScope, rPath, QString())
- , writeContainer(0)
-{
- init(QSettings::UserScope);
-}
-
-QWinRTSettingsPrivate::~QWinRTSettingsPrivate()
-{
- clearContainerMaps();
-}
-
-void QWinRTSettingsPrivate::remove(const QString &uKey)
-{
- int lastIndex = uKey.lastIndexOf(QLatin1Char('/'));
- QString groupName = (lastIndex > 0) ? uKey.left(lastIndex) : QString();
- QString groupKey = uKey.mid(lastIndex + 1);
-
- ComPtr<IApplicationDataContainer> container = getContainer(writeContainer.Get(), groupName, false);
- if (!container)
- return;
-
- HRESULT hr;
- ComPtr<IPropertySet> values;
- hr = container->get_Values(&values);
- if (FAILED(hr))
- return;
-
- ComPtr<IMap<HSTRING, IInspectable*>> settingsMap;
-
- hr = values.As(&settingsMap);
- if (FAILED(hr))
- return;
-
- HStringReference ref((const wchar_t*)groupKey.utf16(), groupKey.size());
- hr = settingsMap->Remove(ref.Get());
-
- // groupKey can be a container as well
- hr = container->DeleteContainer(ref.Get());
- init(scope);
-}
-
-void QWinRTSettingsPrivate::set(const QString &uKey, const QVariant &value)
-{
- int lastIndex = uKey.lastIndexOf(QLatin1Char('/'));
- QString groupName = (lastIndex > 0) ? uKey.left(lastIndex) : QString();
- QString groupKey = uKey.mid(lastIndex + 1);
-
- ComPtr<IApplicationDataContainer> container = getContainer(writeContainer.Get(), groupName, true);
-
- ComPtr<IPropertySet> values;
- HRESULT hr = container->get_Values(&values);
- if (FAILED(hr)) {
- qErrnoWarning(hr, "Could not access Windows container values");
- setStatus(QSettings::AccessError);
- return;
- }
-
- ComPtr<IMap<HSTRING, IInspectable*>> settingsMap;
- hr = values.As(&settingsMap);
- if (FAILED(hr)) {
- setStatus(QSettings::AccessError);
- return;
- }
-
- ComPtr<IPropertyValueStatics> valueStatics;
- hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Foundation_PropertyValue).Get(), &valueStatics);
- if (FAILED(hr)) {
- setStatus(QSettings::AccessError);
- return;
- }
-
- ComPtr<IInspectable> val;
-
- switch (value.type()) {
- case QVariant::List:
- case QVariant::StringList: {
- QStringList l = variantListToStringList(value.toList());
- QStringList::const_iterator it = l.constBegin();
- bool containsNull = false;
- for (; it != l.constEnd(); ++it) {
- if ((*it).length() == 0 || it->contains(QChar::Null)) {
- // We can only store as binary
- containsNull = true;
- break;
- }
- }
-
- if (containsNull) {
- // Store binary
- const QString s = variantToString(value);
- hr = valueStatics->CreateUInt8Array(s.length() * 2, (BYTE*) s.utf16(), &val);
- } else {
- // Store as native string list
- int size = l.size();
- HSTRING *nativeHandleList = new HSTRING[size+1];
- for (int i = 0; i < size; ++i)
- hr = WindowsCreateString((const wchar_t*)l[i].utf16(), l[i].size(), &nativeHandleList[i]);
- // Add end marker
- hr = WindowsCreateString((const wchar_t*)L"\0\0@", 3, &nativeHandleList[size]);
- hr = valueStatics->CreateStringArray(size + 1 , nativeHandleList, &val);
- for (int i = 0; i < size; ++i)
- hr = WindowsDeleteString(nativeHandleList[i]);
- delete [] nativeHandleList;
- }
- break;
- }
- case QVariant::Bool:
- hr = valueStatics->CreateBoolean(boolean(value.toBool()), &val);
- break;
- case QVariant::Int:
- hr = valueStatics->CreateInt32(INT32(value.toInt()), &val);
- break;
- case QVariant::UInt:
- hr = valueStatics->CreateUInt32(UINT32(value.toUInt()), &val);
- break;
- case QVariant::LongLong:
- hr = valueStatics->CreateInt64(INT64(value.toLongLong()), &val);
- break;
- case QVariant::ULongLong:
- hr = valueStatics->CreateUInt64(UINT64(value.toULongLong()), &val);
- break;
- default: {
- const QString s = variantToString(value);
- if (s.contains(QChar::Null)) {
- hr = valueStatics->CreateUInt8Array(s.length() * 2, (BYTE*) s.utf16(), &val);
- } else {
- HStringReference ref((const wchar_t*)s.utf16(), s.size());
- hr = valueStatics->CreateString(ref.Get(), &val);
- }
-
- break;
- }
- }
-
- RETURN_VOID_IF_FAILED("QSettings: Could not save QVariant value into IInspectable");
-
- HStringReference key((const wchar_t*)groupKey.utf16(), groupKey.size());
- boolean rep;
-
- hr = settingsMap->Insert(key.Get(), val.Get(), &rep);
- RETURN_VOID_IF_FAILED("QSettings: Could not store value");
-}
-
-bool QWinRTSettingsPrivate::get(const QString &uKey, QVariant *value) const
-{
- int lastIndex = uKey.lastIndexOf(QLatin1Char('/'));
- QString groupName = (lastIndex > 0) ? uKey.left(lastIndex) : QString();
- QString groupKey = uKey.mid(lastIndex + 1);
-
- HRESULT hr;
-
- for (int i = 0; i < readContainers.size(); ++i) {
- ComPtr<IApplicationDataContainer> container = const_cast<QWinRTSettingsPrivate*>(this)->getContainer(readContainers.at(i).Get(), groupName);
-
- if (!container)
- continue;
-
- ComPtr<IPropertySet> values;
- hr = container->get_Values(&values);
- if (FAILED(hr))
- continue;
-
- ComPtr<IMap<HSTRING, IInspectable*>> settingsMap;
- hr = values.As(&settingsMap);
- if (FAILED(hr))
- continue;
-
- HStringReference key((const wchar_t*)groupKey.utf16(), groupKey.size());
- boolean exists;
-
- hr = settingsMap.Get()->HasKey(key.Get(), &exists);
- if (FAILED(hr))
- continue;
-
- if (!exists) {
- if (!fallbacks)
- break;
- else
- continue;
- }
-
- if (value) {
- ComPtr<IInspectable> val;
- hr = settingsMap->Lookup(key.Get(), &val);
- if (FAILED(hr))
- return false;
-
- ComPtr<IPropertyValue> pVal;
- hr = val.As(&pVal);
- if (FAILED(hr))
- return false;
-
- *value = propertyValueToQVariant(pVal.Get());
- }
- return true;
- }
- setStatus(QSettings::AccessError);
- return false;
-}
-
-QStringList QWinRTSettingsPrivate::children(const QString &uKey, ChildSpec spec) const
-{
- QStringList result;
- for (int i = 0; i < readContainers.size(); ++i) {
- ComPtr<IApplicationDataContainer> container = getContainer(readContainers.at(i).Get(), uKey, false);
- if (!container.Get())
- continue;
-
- // Get Keys in this container
- if (spec == AllKeys || spec == ChildKeys)
- result += keyNames(container.Get());
-
- // Get Subcontainer(s)
- if (spec == AllKeys || spec == ChildGroups) {
- const QStringList subContainerList = subContainerNames(container.Get(), spec == AllKeys);
-
- if (spec == AllKeys) {
- for (const QString &item : subContainerList) {
- const QString subChildren = uKey.isEmpty() ? item : (uKey + QLatin1Char('/') + item);
- const QStringList subResult = children(subChildren, ChildKeys);
- for (const QString &subItem : subResult)
- result += item + QLatin1Char('/') + subItem;
- }
- }
-
- if (spec == ChildGroups)
- result += subContainerList;
- }
-
- }
- result.removeDuplicates();
- return result;
-}
-
-void QWinRTSettingsPrivate::clear()
-{
- ComPtr<IApplicationDataContainer> container;
- HRESULT hr;
- if (scope == QSettings::UserScope)
- hr = applicationData->get_LocalSettings(&container);
- else
- hr = applicationData->get_RoamingSettings(&container);
-
- RETURN_VOID_IF_FAILED("Could not access settings container");
-
- QString containerName = applicationName.isEmpty() ? organizationName : applicationName;
- HStringReference containerNativeName((const wchar_t*)containerName.utf16(), containerName.size());
-
- hr = container->DeleteContainer(containerNativeName.Get());
- RETURN_VOID_IF_FAILED("Could not delete Container");
-
- init(scope);
-}
-
-void QWinRTSettingsPrivate::sync()
-{
- // No native sync available
-}
-
-void QWinRTSettingsPrivate::flush()
-{
- // No native flush available
-}
-
-QString QWinRTSettingsPrivate::fileName() const
-{
- Q_UNIMPLEMENTED();
- return QString();
-}
-
-HRESULT QWinRTSettingsPrivate::onDataChanged(IApplicationData *, IInspectable *)
-{
- // This only happens, if roaming data is changed by the OS.
- // To ensure sanity we clean up the map and start from scratch
- init(scope);
- return S_OK;
-}
-
-void QWinRTSettingsPrivate::init(QSettings::Scope scope)
-{
- clearContainerMaps();
-
- ComPtr<IApplicationDataStatics> applicationDataStatics;
- HRESULT hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Storage_ApplicationData).Get(), &applicationDataStatics);
- if (FAILED(hr)) {
- qErrnoWarning(hr, "Could not access Storage Factory");
- setStatus(QSettings::AccessError);
- return;
- }
-
- hr = applicationDataStatics->get_Current(&applicationData);
- if (FAILED(hr)) {
- qErrnoWarning(hr, "Could not access application data statics");
- setStatus(QSettings::AccessError);
- return;
- }
-
- const QString organizationString = organizationName.isEmpty() ? QLatin1String("OrganizationDefaults") : organizationName;
- ComPtr<IApplicationDataContainer> localContainer;
- if (scope == QSettings::UserScope && SUCCEEDED(applicationData->get_LocalSettings(&localContainer))) {
- if (!applicationName.isEmpty())
- readContainers.append(createSubContainer(localContainer.Get(), applicationName));
- readContainers.append(createSubContainer(localContainer.Get(), organizationString));
- }
-
- ComPtr<IApplicationDataContainer> roamingContainer;
- if (SUCCEEDED(applicationData->get_RoamingSettings(&roamingContainer))) {
- if (!applicationName.isEmpty())
- readContainers.append(createSubContainer(roamingContainer.Get(), applicationName));
- readContainers.append(createSubContainer(roamingContainer.Get(), organizationString));
- }
-
- ComPtr<IApplicationDataContainer> writeRootContainer = (scope == QSettings::UserScope) ? localContainer : roamingContainer;
- if (!applicationName.isEmpty())
- writeContainer = createSubContainer(writeRootContainer.Get(), applicationName);
- else
- writeContainer = createSubContainer(writeRootContainer.Get(), organizationString);
-
- hr = applicationData->add_DataChanged(Callback<DataHandler>(this, &QWinRTSettingsPrivate::onDataChanged).Get(), &dataChangedToken);
-}
-
-IApplicationDataContainer *QWinRTSettingsPrivate::getContainer(IApplicationDataContainer *parent, const QString &group, bool create) const
-{
- IApplicationDataContainer *current = parent;
- if (group.isEmpty())
- return current;
- const QStringList groupPath = group.split(QLatin1Char('/'), Qt::SkipEmptyParts);
-
- for (const QString &subGroup : groupPath) {
- ComPtr<IApplicationDataContainer> sub = subContainer(current, subGroup);
- if (!sub && create)
- sub = createSubContainer(current, subGroup);
- if (!sub)
- return 0; // Something seriously went wrong
- current = sub.Detach();
- }
- return current;
-}
-
-void QWinRTSettingsPrivate::clearContainerMaps()
-{
- readContainers.clear();
- writeContainer.Reset();
-}
-
-bool QWinRTSettingsPrivate::isWritable() const
-{
- return true;
-}
-
-QSettingsPrivate *QSettingsPrivate::create(QSettings::Format format, QSettings::Scope scope,
- const QString &organization, const QString &application)
-{
- if (format == QSettings::NativeFormat)
- return new QWinRTSettingsPrivate(scope, organization, application);
- else
- return new QConfFileSettingsPrivate(format, scope, organization, application);
-}
-
-QSettingsPrivate *QSettingsPrivate::create(const QString &fileName, QSettings::Format format)
-{
- if (format == QSettings::NativeFormat)
- return new QWinRTSettingsPrivate(fileName);
- else
- return new QConfFileSettingsPrivate(fileName, format);
-}
-
-QT_END_NAMESPACE
diff --git a/src/corelib/io/qstandardpaths_winrt.cpp b/src/corelib/io/qstandardpaths_winrt.cpp
deleted file mode 100644
index a7de15472e..0000000000
--- a/src/corelib/io/qstandardpaths_winrt.cpp
+++ /dev/null
@@ -1,138 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qstandardpaths.h"
-
-#include <qdir.h>
-#include <private/qsystemlibrary_p.h>
-#include <qcoreapplication.h>
-#include <qstringlist.h>
-
-#include <qt_windows.h>
-
-#include <wrl.h>
-#include <windows.foundation.h>
-#include <windows.storage.h>
-#include <Windows.ApplicationModel.h>
-
-using namespace Microsoft::WRL;
-using namespace Microsoft::WRL::Wrappers;
-using namespace ABI::Windows::Foundation;
-using namespace ABI::Windows::Storage;
-using namespace ABI::Windows::ApplicationModel;
-
-#ifndef QT_NO_STANDARDPATHS
-
-QT_BEGIN_NAMESPACE
-
-static QString convertCharArray(const wchar_t *path)
-{
- return QDir::fromNativeSeparators(QString::fromWCharArray(path));
-}
-
-QString QStandardPaths::writableLocation(StandardLocation type)
-{
- QString result;
-
- switch (type) {
- case ConfigLocation: // same as AppLocalDataLocation, on Windows
- case GenericConfigLocation: // same as GenericDataLocation, on Windows
- case AppConfigLocation:
- case AppDataLocation:
- case AppLocalDataLocation:
- case GenericDataLocation: {
- ComPtr<IApplicationDataStatics> applicationDataStatics;
- if (FAILED(GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Storage_ApplicationData).Get(), &applicationDataStatics)))
- break;
- ComPtr<IApplicationData> applicationData;
- if (FAILED(applicationDataStatics->get_Current(&applicationData)))
- break;
- ComPtr<IStorageFolder> settingsFolder;
- if (FAILED(applicationData->get_LocalFolder(&settingsFolder)))
- break;
- ComPtr<IStorageItem> settingsFolderItem;
- if (FAILED(settingsFolder.As(&settingsFolderItem)))
- break;
- HString path;
- if (FAILED(settingsFolderItem->get_Path(path.GetAddressOf())))
- break;
- result = convertCharArray(path.GetRawBuffer(nullptr));
- if (isTestModeEnabled())
- result += QLatin1String("/qttest");
- break;
- }
- case CacheLocation:
- return writableLocation(AppLocalDataLocation) + QLatin1String("/cache");
-
- case GenericCacheLocation:
- return writableLocation(GenericDataLocation) + QLatin1String("/cache");
-
- case TempLocation:
- result = QDir::tempPath();
- break;
-
- case ApplicationsLocation:
- case DesktopLocation:
- case FontsLocation:
- case HomeLocation:
- case RuntimeLocation:
- // these are read-only
- break;
-
- case DocumentsLocation:
- case MusicLocation:
- case MoviesLocation:
- case PicturesLocation:
- case DownloadLocation:
- default:
- Q_UNIMPLEMENTED();
- }
- return result;
-
-}
-
-QStringList QStandardPaths::standardLocations(StandardLocation type)
-{
- const QString writable = writableLocation(type);
- return writable.isEmpty() ? QStringList() : QStringList(writable);
-}
-
-QT_END_NAMESPACE
-
-#endif // QT_NO_STANDARDPATHS
diff --git a/src/corelib/io/qstorageinfo_p.h b/src/corelib/io/qstorageinfo_p.h
index ec5bb785e3..421e364311 100644
--- a/src/corelib/io/qstorageinfo_p.h
+++ b/src/corelib/io/qstorageinfo_p.h
@@ -71,7 +71,7 @@ public:
static QStorageInfo root();
protected:
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
void retrieveVolumeInfo();
void retrieveDiskFreeSpace();
#elif defined(Q_OS_MAC)
diff --git a/src/corelib/io/qstorageinfo_stub.cpp b/src/corelib/io/qstorageinfo_stub.cpp
deleted file mode 100644
index a312b9dc89..0000000000
--- a/src/corelib/io/qstorageinfo_stub.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Ivan Komissarov <ABBAPOH@gmail.com>
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qstorageinfo_p.h"
-
-QT_BEGIN_NAMESPACE
-
-void QStorageInfoPrivate::initRootPath()
-{
- Q_UNIMPLEMENTED();
- rootPath = QString();
-}
-
-void QStorageInfoPrivate::doStat()
-{
- Q_UNIMPLEMENTED();
-}
-
-QList<QStorageInfo> QStorageInfoPrivate::mountedVolumes()
-{
- Q_UNIMPLEMENTED();
- return QList<QStorageInfo>();
-}
-
-QStorageInfo QStorageInfoPrivate::root()
-{
- Q_UNIMPLEMENTED();
- return QStorageInfo();
-}
-
-QT_END_NAMESPACE
diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp
index c016a622c7..e6a160c3b2 100644
--- a/src/corelib/io/qtemporaryfile.cpp
+++ b/src/corelib/io/qtemporaryfile.cpp
@@ -219,17 +219,10 @@ static bool createFileFromTemplate(NativeFileHandle &file, QTemporaryFileName &t
const DWORD shareMode = (flags & QTemporaryFileEngine::Win32NonShared)
? 0u : (FILE_SHARE_READ | FILE_SHARE_WRITE);
-# ifndef Q_OS_WINRT
file = CreateFile((const wchar_t *)path.constData(),
GENERIC_READ | GENERIC_WRITE,
shareMode, NULL, CREATE_NEW,
FILE_ATTRIBUTE_NORMAL, NULL);
-# else // !Q_OS_WINRT
- file = CreateFile2((const wchar_t *)path.constData(),
- GENERIC_READ | GENERIC_WRITE,
- shareMode, CREATE_NEW,
- NULL);
-# endif // Q_OS_WINRT
if (file != INVALID_HANDLE_VALUE)
return true;
@@ -380,7 +373,7 @@ bool QTemporaryFileEngine::open(QIODevice::OpenMode openMode)
return false;
}
-#if !defined(Q_OS_WIN) || defined(Q_OS_WINRT)
+#if !defined(Q_OS_WIN)
d->closeFileHandle = true;
#endif
diff --git a/src/corelib/kernel/kernel.pri b/src/corelib/kernel/kernel.pri
index 76609894ba..fc48ef430e 100644
--- a/src/corelib/kernel/kernel.pri
+++ b/src/corelib/kernel/kernel.pri
@@ -88,27 +88,15 @@ win32 {
kernel/qsystemsemaphore_win.cpp
HEADERS += \
kernel/qwineventnotifier.h \
- kernel/qwineventnotifier_p.h
-
- winrt {
- SOURCES += kernel/qeventdispatcher_winrt.cpp
- HEADERS += kernel/qeventdispatcher_winrt_p.h
- } else {
- SOURCES += kernel/qeventdispatcher_win.cpp \
- kernel/qwinregistry.cpp
- HEADERS += kernel/qeventdispatcher_win_p.h \
- kernel/qwinregistry_p.h
- }
-
- !winrt: LIBS_PRIVATE += -lversion
-}
+ kernel/qwineventnotifier_p.h \
+ kernel/qfunctions_winrt_p.h
-winrt {
- SOURCES += \
- kernel/qfunctions_winrt.cpp
- HEADERS += \
- kernel/qfunctions_fake_env_p.h \
- kernel/qfunctions_winrt.h
+ SOURCES += kernel/qeventdispatcher_win.cpp \
+ kernel/qwinregistry.cpp
+ HEADERS += kernel/qeventdispatcher_win_p.h \
+ kernel/qwinregistry_p.h
+
+ LIBS_PRIVATE += -lversion
}
mac {
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 43f641244b..a3414b3edc 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -87,16 +87,7 @@
# include "qeventdispatcher_unix_p.h"
#endif
#ifdef Q_OS_WIN
-# ifdef Q_OS_WINRT
-# include "qeventdispatcher_winrt_p.h"
-# include "qfunctions_winrt.h"
-# include <wrl.h>
-# include <Windows.ApplicationModel.core.h>
- using namespace ABI::Windows::ApplicationModel::Core;
- using namespace Microsoft::WRL;
-# else
-# include "qeventdispatcher_win_p.h"
-# endif
+#include "qeventdispatcher_win_p.h"
#endif
#endif // QT_NO_QOBJECT
@@ -397,7 +388,7 @@ Q_GLOBAL_STATIC(QCoreApplicationData, coreappdata)
static bool quitLockRefEnabled = true;
#endif
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
// Check whether the command line arguments match those passed to main()
// by comparing to the global __argv/__argc (MS extension).
// Deep comparison is required since argv/argc is rebuilt by WinMain for
@@ -423,7 +414,7 @@ static inline bool contains(int argc, char **argv, const char *needle)
}
return false;
}
-#endif // Q_OS_WIN && !Q_OS_WINRT
+#endif // Q_OS_WIN
QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv, uint flags)
:
@@ -432,7 +423,7 @@ QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv, uint
#endif
argc(aargc)
, argv(aargv)
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
, origArgc(0)
, origArgv(nullptr)
#endif
@@ -451,13 +442,13 @@ QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv, uint
argc = 0;
argv = const_cast<char **>(&empty);
}
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
if (!isArgvModified(argc, argv)) {
origArgc = argc;
origArgv = new char *[argc];
std::copy(argv, argv + argc, QT_MAKE_CHECKED_ARRAY_ITERATOR(origArgv, argc));
}
-#endif // Q_OS_WIN && !Q_OS_WINRT
+#endif // Q_OS_WIN
#ifndef QT_NO_QOBJECT
QCoreApplicationPrivate::is_app_closing = false;
@@ -467,10 +458,6 @@ QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv, uint
qFatal("FATAL: The application binary appears to be running setuid, this is a security hole.");
# endif // Q_OS_UNIX
-#ifdef Q_OS_WINRT
- QThreadData::setMainThread();
-#endif
-
QThread *cur = QThread::currentThread(); // note: this may end up setting theMainThread!
if (cur != theMainThread.loadAcquire())
qWarning("WARNING: QApplication was not created in the main() thread.");
@@ -482,7 +469,7 @@ QCoreApplicationPrivate::~QCoreApplicationPrivate()
#ifndef QT_NO_QOBJECT
cleanupThreadData();
#endif
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
delete [] origArgv;
#endif
QCoreApplicationPrivate::clearApplicationFilePath();
@@ -570,10 +557,6 @@ void QCoreApplicationPrivate::appendApplicationPathToLibraryPaths()
coreappdata()->app_libpaths.reset(app_libpaths = new QStringList);
QString app_location = QCoreApplication::applicationFilePath();
app_location.truncate(app_location.lastIndexOf(QLatin1Char('/')));
-#ifdef Q_OS_WINRT
- if (app_location.isEmpty())
- app_location.append(QLatin1Char('/'));
-#endif
app_location = QDir(app_location).canonicalPath();
if (QFile::exists(app_location) && !app_libpaths->contains(app_location))
app_libpaths->append(app_location);
@@ -2466,7 +2449,7 @@ QStringList QCoreApplication::arguments()
char ** const av = self->d_func()->argv;
list.reserve(ac);
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
// On Windows, it is possible to pass Unicode arguments on
// the command line. To restore those, we split the command line
// and filter out arguments that were deleted by derived application
@@ -2483,7 +2466,7 @@ QStringList QCoreApplication::arguments()
}
return list;
} // Fall back to rebuilding from argv/argc when a modified argv was passed.
-#endif // defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#endif // defined(Q_OS_WIN)
for (int a = 0; a < ac; ++a) {
list << QString::fromLocal8Bit(av[a]);
@@ -2623,9 +2606,6 @@ QString QCoreApplication::applicationName()
\li Windows (classic desktop)
\li PRODUCTVERSION parameter of the VERSIONINFO resource
\row
- \li Universal Windows Platform
- \li version attribute of the application package manifest
- \row
\li macOS, iOS, tvOS, watchOS
\li CFBundleVersion property of the information property list
\row
diff --git a/src/corelib/kernel/qcoreapplication_p.h b/src/corelib/kernel/qcoreapplication_p.h
index 9d2fde619c..cb3a5a8a4f 100644
--- a/src/corelib/kernel/qcoreapplication_p.h
+++ b/src/corelib/kernel/qcoreapplication_p.h
@@ -154,7 +154,7 @@ public:
int &argc;
char **argv;
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
int origArgc;
char **origArgv; // store unmodified arguments for QCoreApplication::arguments()
#endif
diff --git a/src/corelib/kernel/qcoreapplication_win.cpp b/src/corelib/kernel/qcoreapplication_win.cpp
index 824c0535ed..a0fbf97838 100644
--- a/src/corelib/kernel/qcoreapplication_win.cpp
+++ b/src/corelib/kernel/qcoreapplication_win.cpp
@@ -53,16 +53,6 @@
#include <ctype.h>
#include <qt_windows.h>
-#ifdef Q_OS_WINRT
-#include <qfunctions_winrt.h>
-#include <wrl.h>
-#include <Windows.ApplicationModel.core.h>
-#include <windows.foundation.h>
-using namespace ABI::Windows::ApplicationModel;
-using namespace Microsoft::WRL;
-using namespace Microsoft::WRL::Wrappers;
-#endif
-
QT_BEGIN_NAMESPACE
Q_CORE_EXPORT QString qAppFileName() // get application file name
@@ -105,33 +95,6 @@ QString QCoreApplicationPrivate::appVersion() const
{
QString applicationVersion;
#ifndef QT_BOOTSTRAPPED
-# ifdef Q_OS_WINRT
- HRESULT hr;
-
- ComPtr<IPackageStatics> packageFactory;
- hr = RoGetActivationFactory(
- HString::MakeReference(RuntimeClass_Windows_ApplicationModel_Package).Get(),
- IID_PPV_ARGS(&packageFactory));
- RETURN_IF_FAILED("Failed to create package instance", return QString());
-
- ComPtr<IPackage> package;
- packageFactory->get_Current(&package);
- RETURN_IF_FAILED("Failed to get current application package", return QString());
-
- ComPtr<IPackageId> packageId;
- package->get_Id(&packageId);
- RETURN_IF_FAILED("Failed to get current application package ID", return QString());
-
- PackageVersion version;
- packageId->get_Version(&version);
- RETURN_IF_FAILED("Failed to get current application package version", return QString());
-
- applicationVersion = QStringLiteral("%1.%2.%3.%4")
- .arg(version.Major)
- .arg(version.Minor)
- .arg(version.Build)
- .arg(version.Revision);
-# else
const QString appFileName = qAppFileName();
QVarLengthArray<wchar_t> buffer(appFileName.size() + 1);
buffer[appFileName.toWCharArray(buffer.data())] = 0;
@@ -154,13 +117,10 @@ QString QCoreApplicationPrivate::appVersion() const
}
}
}
-# endif
#endif
return applicationVersion;
}
-#ifndef Q_OS_WINRT
-
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
Q_CORE_EXPORT HINSTANCE qWinAppInst() // get Windows app handle
{
@@ -913,8 +873,6 @@ QDebug operator<<(QDebug dbg, const MSG &msg)
#endif // QT_NO_QOBJECT
-#endif // !defined(Q_OS_WINRT)
-
#ifndef QT_NO_QOBJECT
void QCoreApplicationPrivate::removePostedTimerEvent(QObject *object, int timerId)
{
diff --git a/src/corelib/kernel/qcorecmdlineargs_p.h b/src/corelib/kernel/qcorecmdlineargs_p.h
index 33445a1625..b9f1ef6317 100644
--- a/src/corelib/kernel/qcorecmdlineargs_p.h
+++ b/src/corelib/kernel/qcorecmdlineargs_p.h
@@ -82,17 +82,7 @@ static inline QStringList qWinCmdArgs(const QString &cmdLine)
return result;
}
-#elif defined(Q_OS_WINRT) // Q_OS_WIN32
-
-static inline QStringList qCmdLineArgs(int argc, char *argv[])
-{
- QStringList args;
- for (int i = 0; i != argc; ++i)
- args += QString::fromLocal8Bit(argv[i]);
- return args;
-}
-
-#endif // Q_OS_WINRT
+#endif // Q_OS_WIN32
QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qeventdispatcher_winrt.cpp b/src/corelib/kernel/qeventdispatcher_winrt.cpp
deleted file mode 100644
index f7a1f969a8..0000000000
--- a/src/corelib/kernel/qeventdispatcher_winrt.cpp
+++ /dev/null
@@ -1,656 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qeventdispatcher_winrt_p.h"
-
-#include <QtCore/QCoreApplication>
-#include <QtCore/QThread>
-#include <QtCore/QHash>
-#include <QtCore/QMutex>
-#include <QtCore/QSemaphore>
-#include <QtCore/qfunctions_winrt.h>
-#include <private/qabstracteventdispatcher_p.h>
-#include <private/qcoreapplication_p.h>
-
-#include <functional>
-#include <memory>
-
-#include <wrl.h>
-#include <windows.foundation.h>
-#include <windows.system.threading.h>
-#include <windows.ui.core.h>
-#include <windows.applicationmodel.core.h>
-using namespace Microsoft::WRL;
-using namespace Microsoft::WRL::Wrappers;
-using namespace ABI::Windows::System::Threading;
-using namespace ABI::Windows::Foundation;
-using namespace ABI::Windows::Foundation::Collections;
-using namespace ABI::Windows::UI::Core;
-using namespace ABI::Windows::ApplicationModel::Core;
-
-QT_BEGIN_NAMESPACE
-
-#define INTERRUPT_HANDLE 0
-#define INVALID_TIMER_ID -1
-
-struct WinRTTimerInfo : public QAbstractEventDispatcher::TimerInfo {
- WinRTTimerInfo(int timerId = INVALID_TIMER_ID, int interval = 0, Qt::TimerType timerType = Qt::CoarseTimer,
- QObject *obj = 0, quint64 tt = 0) :
- QAbstractEventDispatcher::TimerInfo(timerId, interval, timerType),
- inEvent(false), object(obj), targetTime(tt)
- {
- }
-
- bool inEvent;
- QObject *object;
- quint64 targetTime;
-};
-
-class AgileDispatchedHandler : public RuntimeClass<RuntimeClassFlags<WinRtClassicComMix>, IDispatchedHandler, IAgileObject>
-{
-public:
- AgileDispatchedHandler(const std::function<HRESULT()> &delegate)
- : delegate(delegate)
- {
- }
-
- HRESULT __stdcall Invoke()
- {
- return delegate();
- }
-
-private:
- std::function<HRESULT()> delegate;
-};
-
-class QWorkHandler : public IWorkItemHandler
-{
-public:
- QWorkHandler(const std::function<HRESULT()> &delegate)
- : m_delegate(delegate)
- {
- }
-
- STDMETHODIMP Invoke(ABI::Windows::Foundation::IAsyncAction *operation)
- {
- HRESULT res = m_delegate();
- Q_UNUSED(operation);
- return res;
- }
-
- STDMETHODIMP QueryInterface(REFIID riid, void FAR* FAR* ppvObj)
- {
- if (riid == IID_IUnknown || riid == IID_IWorkItemHandler) {
- *ppvObj = this;
- AddRef();
- return NOERROR;
- }
- *ppvObj = NULL;
- return ResultFromScode(E_NOINTERFACE);
- }
-
- STDMETHODIMP_(ULONG) AddRef(void)
- {
- return ++m_refs;
- }
-
- STDMETHODIMP_(ULONG) Release(void)
- {
- if (--m_refs == 0) {
- delete this;
- return 0;
- }
- return m_refs;
- }
-
-private:
- std::function<HRESULT()> m_delegate;
- ULONG m_refs{0};
-};
-
-class QEventDispatcherWinRTPrivate : public QAbstractEventDispatcherPrivate
-{
- Q_DECLARE_PUBLIC(QEventDispatcherWinRT)
-
-public:
- QEventDispatcherWinRTPrivate();
- ~QEventDispatcherWinRTPrivate();
-
-private:
- QHash<int, QObject *> timerIdToObject;
- QVector<WinRTTimerInfo> timerInfos;
- mutable QMutex timerInfoLock;
- QHash<HANDLE, int> timerHandleToId;
- QHash<int, HANDLE> timerIdToHandle;
- QHash<int, HANDLE> timerIdToCancelHandle;
-
- void addTimer(int id, int interval, Qt::TimerType type, QObject *obj,
- HANDLE handle, HANDLE cancelHandle)
- {
- // Zero timer events do not need these handles.
- if (interval > 0) {
- timerHandleToId.insert(handle, id);
- timerIdToHandle.insert(id, handle);
- timerIdToCancelHandle.insert(id, cancelHandle);
- }
-
- const quint64 targetTime = qt_msectime() + interval;
- const WinRTTimerInfo info(id, interval, type, obj, targetTime);
- QMutexLocker locker(&timerInfoLock);
- if (id >= timerInfos.size())
- timerInfos.resize(id + 1);
- timerInfos[id] = info;
- timerIdToObject.insert(id, obj);
- }
-
- bool removeTimer(int id)
- {
- QMutexLocker locker(&timerInfoLock);
- if (id >= timerInfos.size())
- return false;
-
- WinRTTimerInfo &info = timerInfos[id];
- if (info.timerId == INVALID_TIMER_ID)
- return false;
-
- if (info.interval > 0 && (!timerIdToHandle.contains(id) || !timerIdToCancelHandle.contains(id)))
- return false;
-
- info.timerId = INVALID_TIMER_ID;
-
- // Remove invalid timerinfos from the vector's end, if the timer with the highest id was removed
- int lastTimer = timerInfos.size() - 1;
- while (lastTimer >= 0 && timerInfos.at(lastTimer).timerId == INVALID_TIMER_ID)
- --lastTimer;
- if (lastTimer >= 0 && lastTimer != timerInfos.size() - 1)
- timerInfos.resize(lastTimer + 1);
- timerIdToObject.remove(id);
- // ... remove handle from all lists
- if (info.interval > 0) {
- HANDLE handle = timerIdToHandle.take(id);
- timerHandleToId.remove(handle);
- SetEvent(timerIdToCancelHandle.take(id));
- }
- return true;
- }
-};
-
-QEventDispatcherWinRT::QEventDispatcherWinRT(QObject *parent)
- : QAbstractEventDispatcher(*new QEventDispatcherWinRTPrivate, parent)
-{
-}
-
-QEventDispatcherWinRT::QEventDispatcherWinRT(QEventDispatcherWinRTPrivate &dd, QObject *parent)
- : QAbstractEventDispatcher(dd, parent)
-{ }
-
-QEventDispatcherWinRT::~QEventDispatcherWinRT()
-{
-}
-
-HRESULT QEventDispatcherWinRT::runOnXamlThread(const std::function<HRESULT ()> &delegate, bool waitForRun)
-{
- static __declspec(thread) ICoreDispatcher *dispatcher = nullptr;
- HRESULT hr;
- if (!dispatcher) {
- ComPtr<ICoreImmersiveApplication> application;
- hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_ApplicationModel_Core_CoreApplication).Get(),
- IID_PPV_ARGS(&application));
- ComPtr<ICoreApplicationView> view;
- hr = application->get_MainView(&view);
- if (SUCCEEDED(hr) && view) {
- ComPtr<ICoreWindow> window;
- hr = view->get_CoreWindow(&window);
- Q_ASSERT_SUCCEEDED(hr);
- if (!window) {
- // In case the application is launched via activation
- // there might not be a main view (eg ShareTarget).
- // Hence iterate through the available views and try to find
- // a dispatcher in there
- ComPtr<IVectorView<CoreApplicationView*>> appViews;
- hr = application->get_Views(&appViews);
- Q_ASSERT_SUCCEEDED(hr);
- quint32 count;
- hr = appViews->get_Size(&count);
- Q_ASSERT_SUCCEEDED(hr);
- for (quint32 i = 0; i < count; ++i) {
- hr = appViews->GetAt(i, &view);
- Q_ASSERT_SUCCEEDED(hr);
- hr = view->get_CoreWindow(&window);
- Q_ASSERT_SUCCEEDED(hr);
- if (window) {
- hr = window->get_Dispatcher(&dispatcher);
- Q_ASSERT_SUCCEEDED(hr);
- if (dispatcher)
- break;
- }
- }
- } else {
- hr = window->get_Dispatcher(&dispatcher);
- Q_ASSERT_SUCCEEDED(hr);
- }
- }
- }
-
- if (Q_UNLIKELY(!dispatcher)) {
- // In case the application is launched in a way that has no UI and
- // also does not allow to create one, e.g. as a background task.
- // Features like network operations do still work, others might cause
- // errors in that case.
- ComPtr<IThreadPoolStatics> tpStatics;
- hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_System_Threading_ThreadPool).Get(),
- IID_PPV_ARGS(&tpStatics));
- ComPtr<IAsyncAction> op;
- hr = tpStatics.Get()->RunAsync(new QWorkHandler(delegate), &op);
- if (FAILED(hr) || !waitForRun)
- return hr;
- return QWinRTFunctions::await(op);
- }
-
- boolean onXamlThread;
- hr = dispatcher->get_HasThreadAccess(&onXamlThread);
- Q_ASSERT_SUCCEEDED(hr);
- if (onXamlThread) // Already there
- return delegate();
-
- ComPtr<IAsyncAction> op;
- hr = dispatcher->RunAsync(CoreDispatcherPriority_Normal, Make<AgileDispatchedHandler>(delegate).Get(), &op);
- if (FAILED(hr) || !waitForRun)
- return hr;
- return QWinRTFunctions::await(op);
-}
-
-HRESULT QEventDispatcherWinRT::runOnMainThread(const std::function<HRESULT()> &delegate, int timeout)
-{
- if (QThread::currentThread() == QCoreApplication::instance()->thread())
- return delegate();
-
- struct State {
- QSemaphore semaphore;
- HRESULT result;
- };
-
- const auto state = std::make_shared<State>();
-
- QMetaObject::invokeMethod(QCoreApplication::instance(), [delegate, state]() {
- const QSemaphoreReleaser releaser{state->semaphore};
- state->result = delegate();
- }, nullptr);
-
- return state->semaphore.tryAcquire(1, timeout) ? state->result : E_FAIL;
-}
-
-bool QEventDispatcherWinRT::processEvents(QEventLoop::ProcessEventsFlags flags)
-{
- Q_D(QEventDispatcherWinRT);
-
- DWORD waitTime = 0;
- do {
- // Additional user events have to be handled before timer events, but the function may not
- // return yet.
- const bool userEventsSent = sendPostedEvents(flags);
-
- const QVector<HANDLE> timerHandles = d->timerIdToHandle.values().toVector();
- if (waitTime)
- emit aboutToBlock();
- bool timerEventsSent = false;
- DWORD waitResult = WaitForMultipleObjectsEx(timerHandles.count(), timerHandles.constData(), FALSE, waitTime, TRUE);
- while (waitResult >= WAIT_OBJECT_0 && waitResult < WAIT_OBJECT_0 + timerHandles.count()) {
- timerEventsSent = true;
- const HANDLE handle = timerHandles.value(waitResult - WAIT_OBJECT_0);
- ResetEvent(handle);
- const int timerId = d->timerHandleToId.value(handle);
- if (timerId == INTERRUPT_HANDLE)
- break;
-
- {
- QMutexLocker locker(&d->timerInfoLock);
-
- WinRTTimerInfo &info = d->timerInfos[timerId];
- Q_ASSERT(info.timerId != INVALID_TIMER_ID);
-
- QCoreApplication::postEvent(this, new QTimerEvent(timerId));
-
- // Update timer's targetTime
- const quint64 targetTime = qt_msectime() + info.interval;
- info.targetTime = targetTime;
- }
- waitResult = WaitForMultipleObjectsEx(timerHandles.count(), timerHandles.constData(), FALSE, 0, TRUE);
- }
- emit awake();
- if (timerEventsSent || userEventsSent)
- return true;
-
- // We cannot wait infinitely like on other platforms, as
- // WaitForMultipleObjectsEx might not return.
- // For instance win32 uses MsgWaitForMultipleObjects to hook
- // into the native event loop, while WinRT handles those
- // via callbacks.
- waitTime = 1;
- } while (flags & QEventLoop::WaitForMoreEvents);
- return false;
-}
-
-bool QEventDispatcherWinRT::sendPostedEvents(QEventLoop::ProcessEventsFlags flags)
-{
- Q_UNUSED(flags);
- if (hasPendingEvents()) {
- QCoreApplication::sendPostedEvents();
- return true;
- }
- return false;
-}
-
-bool QEventDispatcherWinRT::hasPendingEvents()
-{
- return qGlobalPostedEventsCount();
-}
-
-void QEventDispatcherWinRT::registerSocketNotifier(QSocketNotifier *notifier)
-{
- Q_UNUSED(notifier);
- Q_UNIMPLEMENTED();
-}
-void QEventDispatcherWinRT::unregisterSocketNotifier(QSocketNotifier *notifier)
-{
- Q_UNUSED(notifier);
- Q_UNIMPLEMENTED();
-}
-
-void QEventDispatcherWinRT::registerTimer(int timerId, int interval, Qt::TimerType timerType, QObject *object)
-{
- Q_UNUSED(timerType);
-
- if (timerId < 1 || interval < 0 || !object) {
-#ifndef QT_NO_DEBUG
- qWarning("QEventDispatcherWinRT::registerTimer: invalid arguments");
-#endif
- return;
- } else if (object->thread() != thread() || thread() != QThread::currentThread()) {
-#ifndef QT_NO_DEBUG
- qWarning("QEventDispatcherWinRT::registerTimer: timers cannot be started from another thread");
-#endif
- return;
- }
-
- Q_D(QEventDispatcherWinRT);
- // Don't use timer factory for zero-delay timers
- if (interval == 0u) {
- d->addTimer(timerId, interval, timerType, object, INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE);
- QCoreApplication::postEvent(this, new QTimerEvent(timerId));
- return;
- }
-
- TimeSpan period;
- // TimeSpan is based on 100-nanosecond units
- period.Duration = qMax(qint64(1), qint64(interval) * 10000);
- const HANDLE handle = CreateEventEx(NULL, NULL, CREATE_EVENT_MANUAL_RESET, SYNCHRONIZE | EVENT_MODIFY_STATE);
- const HANDLE cancelHandle = CreateEventEx(NULL, NULL, CREATE_EVENT_MANUAL_RESET, SYNCHRONIZE|EVENT_MODIFY_STATE);
- HRESULT hr = runOnXamlThread([cancelHandle, handle, period]() {
- static ComPtr<IThreadPoolTimerStatics> timerFactory;
- HRESULT hr;
- if (!timerFactory) {
- hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_System_Threading_ThreadPoolTimer).Get(),
- &timerFactory);
- Q_ASSERT_SUCCEEDED(hr);
- }
- IThreadPoolTimer *timer;
- hr = timerFactory->CreatePeriodicTimerWithCompletion(
- Callback<ITimerElapsedHandler>([handle, cancelHandle](IThreadPoolTimer *timer) {
- DWORD cancelResult = WaitForSingleObjectEx(cancelHandle, 0, TRUE);
- if (cancelResult == WAIT_OBJECT_0) {
- timer->Cancel();
- return S_OK;
- }
- if (!SetEvent(handle)) {
- Q_ASSERT_X(false, "QEventDispatcherWinRT::registerTimer",
- "SetEvent should never fail here");
- return S_OK;
- }
- return S_OK;
- }).Get(), period,
- Callback<ITimerDestroyedHandler>([handle, cancelHandle](IThreadPoolTimer *) {
- CloseHandle(handle);
- CloseHandle(cancelHandle);
- return S_OK;
- }).Get(), &timer);
- RETURN_HR_IF_FAILED("Failed to create periodic timer");
- return hr;
- }, false);
- if (FAILED(hr)) {
- CloseHandle(handle);
- CloseHandle(cancelHandle);
- return;
- }
- d->addTimer(timerId, interval, timerType, object, handle, cancelHandle);
-}
-
-bool QEventDispatcherWinRT::unregisterTimer(int timerId)
-{
- if (timerId < 1) {
-#ifndef QT_NO_DEBUG
- qWarning("QEventDispatcherWinRT::unregisterTimer: invalid argument");
-#endif
- return false;
- }
- if (thread() != QThread::currentThread()) {
-#ifndef QT_NO_DEBUG
- qWarning("QEventDispatcherWinRT::unregisterTimer: timers cannot be stopped from another thread");
-#endif
- return false;
- }
-
- // As we post all timer events internally, they have to pe removed to prevent stray events
- QCoreApplicationPrivate::removePostedTimerEvent(this, timerId);
- Q_D(QEventDispatcherWinRT);
- return d->removeTimer(timerId);
-}
-
-bool QEventDispatcherWinRT::unregisterTimers(QObject *object)
-{
- if (!object) {
-#ifndef QT_NO_DEBUG
- qWarning("QEventDispatcherWinRT::unregisterTimers: invalid argument");
-#endif
- return false;
- }
- QThread *currentThread = QThread::currentThread();
- if (object->thread() != thread() || thread() != currentThread) {
-#ifndef QT_NO_DEBUG
- qWarning("QEventDispatcherWinRT::unregisterTimers: timers cannot be stopped from another thread");
-#endif
- return false;
- }
-
- Q_D(QEventDispatcherWinRT);
- const auto timerIds = d->timerIdToObject.keys(); // ### FIXME: iterate over hash directly? But unregisterTimer() modifies the hash!
- for (int id : timerIds) {
- if (d->timerIdToObject.value(id) == object)
- unregisterTimer(id);
- }
-
- return true;
-}
-
-QList<QAbstractEventDispatcher::TimerInfo> QEventDispatcherWinRT::registeredTimers(QObject *object) const
-{
- if (!object) {
-#ifndef QT_NO_DEBUG
- qWarning("QEventDispatcherWinRT:registeredTimers: invalid argument");
-#endif
- return QList<TimerInfo>();
- }
-
- Q_D(const QEventDispatcherWinRT);
- QMutexLocker locker(&d->timerInfoLock);
- QList<TimerInfo> timerInfos;
- for (const WinRTTimerInfo &info : d->timerInfos) {
- if (info.object == object && info.timerId != INVALID_TIMER_ID)
- timerInfos.append(info);
- }
- return timerInfos;
-}
-
-bool QEventDispatcherWinRT::registerEventNotifier(QWinEventNotifier *notifier)
-{
- Q_UNUSED(notifier);
- Q_UNIMPLEMENTED();
- return false;
-}
-
-void QEventDispatcherWinRT::unregisterEventNotifier(QWinEventNotifier *notifier)
-{
- Q_UNUSED(notifier);
- Q_UNIMPLEMENTED();
-}
-
-int QEventDispatcherWinRT::remainingTime(int timerId)
-{
- if (timerId < 1) {
-#ifndef QT_NO_DEBUG
- qWarning("QEventDispatcherWinRT::remainingTime: invalid argument");
-#endif
- return -1;
- }
-
- Q_D(QEventDispatcherWinRT);
- QMutexLocker locker(&d->timerInfoLock);
- const WinRTTimerInfo timerInfo = d->timerInfos.at(timerId);
- if (timerInfo.timerId == INVALID_TIMER_ID) {
-#ifndef QT_NO_DEBUG
- qWarning("QEventDispatcherWinRT::remainingTime: timer id %d not found", timerId);
-#endif
- return -1;
- }
-
- const quint64 currentTime = qt_msectime();
- if (currentTime < timerInfo.targetTime) {
- // time to wait
- return timerInfo.targetTime - currentTime;
- } else {
- return 0;
- }
-
- return -1;
-}
-
-void QEventDispatcherWinRT::wakeUp()
-{
-}
-
-void QEventDispatcherWinRT::interrupt()
-{
- Q_D(QEventDispatcherWinRT);
- SetEvent(d->timerIdToHandle.value(INTERRUPT_HANDLE));
-}
-
-void QEventDispatcherWinRT::flush()
-{
-}
-
-void QEventDispatcherWinRT::startingUp()
-{
-}
-
-void QEventDispatcherWinRT::closingDown()
-{
-}
-
-bool QEventDispatcherWinRT::event(QEvent *e)
-{
- Q_D(QEventDispatcherWinRT);
- switch (e->type()) {
- case QEvent::Timer: {
- QTimerEvent *timerEvent = static_cast<QTimerEvent *>(e);
- const int id = timerEvent->timerId();
-
- QMutexLocker locker(&d->timerInfoLock);
-
- Q_ASSERT(id < d->timerInfos.size());
- WinRTTimerInfo &info = d->timerInfos[id];
- Q_ASSERT(info.timerId != INVALID_TIMER_ID);
-
- if (info.inEvent) // but don't allow event to recurse
- break;
- info.inEvent = true;
-
- QObject *timerObj = d->timerIdToObject.value(id);
- locker.unlock();
-
- QTimerEvent te(id);
- QCoreApplication::sendEvent(timerObj, &te);
-
- locker.relock();
-
- // The timer might have been removed in the meanwhile. If the timer was
- // the last one in the list, id is bigger than the list's size.
- // Otherwise, the id will just be set to INVALID_TIMER_ID.
- if (id >= d->timerInfos.size() || info.timerId == INVALID_TIMER_ID)
- break;
-
- if (info.interval == 0 && info.inEvent) {
- // post the next zero timer event as long as the timer was not restarted
- QCoreApplication::postEvent(this, new QTimerEvent(id));
- }
- info.inEvent = false;
- }
- default:
- break;
- }
- return QAbstractEventDispatcher::event(e);
-}
-
-QEventDispatcherWinRTPrivate::QEventDispatcherWinRTPrivate()
-{
- const bool isGuiThread = QCoreApplication::instance() &&
- QThread::currentThread() == QCoreApplication::instance()->thread();
- CoInitializeEx(NULL, isGuiThread ? COINIT_APARTMENTTHREADED : COINIT_MULTITHREADED);
- HANDLE interruptHandle = CreateEventEx(NULL, NULL, NULL, SYNCHRONIZE|EVENT_MODIFY_STATE);
- timerIdToHandle.insert(INTERRUPT_HANDLE, interruptHandle);
- timerHandleToId.insert(interruptHandle, INTERRUPT_HANDLE);
- timerInfos.reserve(256);
-}
-
-QEventDispatcherWinRTPrivate::~QEventDispatcherWinRTPrivate()
-{
- CloseHandle(timerIdToHandle.value(INTERRUPT_HANDLE));
- CoUninitialize();
-}
-
-QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qeventdispatcher_winrt_p.h b/src/corelib/kernel/qeventdispatcher_winrt_p.h
deleted file mode 100644
index 2672f11123..0000000000
--- a/src/corelib/kernel/qeventdispatcher_winrt_p.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#ifndef QEVENTDISPATCHER_WINRT_P_H
-#define QEVENTDISPATCHER_WINRT_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtCore/private/qglobal_p.h>
-#include "QtCore/qabstracteventdispatcher.h"
-
-#include <qt_windows.h>
-
-#include <functional>
-
-QT_BEGIN_NAMESPACE
-
-quint64 qt_msectime();
-
-class QEventDispatcherWinRTPrivate;
-
-class Q_CORE_EXPORT QEventDispatcherWinRT : public QAbstractEventDispatcher
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(QEventDispatcherWinRT)
-
-public:
- explicit QEventDispatcherWinRT(QObject *parent = 0);
- ~QEventDispatcherWinRT();
-
- static HRESULT runOnXamlThread(const std::function<HRESULT()> &delegate, bool waitForRun = true);
- static HRESULT runOnMainThread(const std::function<HRESULT()> &delegate, int timeout = 100);
-
- bool processEvents(QEventLoop::ProcessEventsFlags flags);
- bool hasPendingEvents();
-
- void registerSocketNotifier(QSocketNotifier *notifier);
- void unregisterSocketNotifier(QSocketNotifier *notifier);
-
- void registerTimer(int timerId, int interval, Qt::TimerType timerType, QObject *object);
- bool unregisterTimer(int timerId);
- bool unregisterTimers(QObject *object);
- QList<TimerInfo> registeredTimers(QObject *object) const;
-
- int remainingTime(int timerId);
-
- bool registerEventNotifier(QWinEventNotifier *notifier);
- void unregisterEventNotifier(QWinEventNotifier *notifier);
-
- void wakeUp();
- void interrupt();
- void flush();
-
- void startingUp();
- void closingDown();
-
-protected:
- QEventDispatcherWinRT(QEventDispatcherWinRTPrivate &dd, QObject *parent = 0);
-
- virtual bool sendPostedEvents(QEventLoop::ProcessEventsFlags flags);
- bool event(QEvent *);
- int activateTimers();
-};
-
-QT_END_NAMESPACE
-
-#endif // QEVENTDISPATCHER_WINRT_P_H
diff --git a/src/corelib/kernel/qfunctions_fake_env_p.h b/src/corelib/kernel/qfunctions_fake_env_p.h
deleted file mode 100644
index 68d17ed4a1..0000000000
--- a/src/corelib/kernel/qfunctions_fake_env_p.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QFUNCTIONS_FAKE_ENV_P_H
-#define QFUNCTIONS_FAKE_ENV_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qbytearray.h"
-#include "qvector.h"
-
-QT_BEGIN_NAMESPACE
-
-// Environment ------------------------------------------------------
-struct Variable {
- Variable() { }
-
- Variable(const QByteArray &name, const QByteArray &value)
- : name(name), value(value) { }
-
- QByteArray name;
- QByteArray value;
-};
-
-Q_DECLARE_TYPEINFO(Variable, Q_MOVABLE_TYPE);
-
-struct NameEquals {
- typedef bool result_type;
- const char *name;
- explicit NameEquals(const char *name) noexcept : name(name) {}
- result_type operator()(const Variable &other) const noexcept
- { return qstrcmp(other.name, name) == 0; }
-};
-
-#ifndef Q_CLANG_QDOC
-Q_GLOBAL_STATIC(QVector<Variable>, qt_app_environment)
-#endif
-
-errno_t qt_fake_getenv_s(size_t *sizeNeeded, char *buffer, size_t bufferSize, const char *varName)
-{
- if (!sizeNeeded)
- return EINVAL;
-
- QVector<Variable>::const_iterator end = qt_app_environment->constEnd();
- QVector<Variable>::const_iterator iterator = std::find_if(qt_app_environment->constBegin(),
- end,
- NameEquals(varName));
- if (iterator == end) {
- if (buffer)
- buffer[0] = '\0';
- return ENOENT;
- }
-
- const int size = iterator->value.size() + 1;
- if (bufferSize < size_t(size)) {
- *sizeNeeded = size;
- return ERANGE;
- }
-
- qstrcpy(buffer, iterator->value.constData());
- return 0;
-}
-
-errno_t qt_fake__putenv_s(const char *varName, const char *value)
-{
- QVector<Variable>::iterator end = qt_app_environment->end();
- QVector<Variable>::iterator iterator = std::find_if(qt_app_environment->begin(),
- end,
- NameEquals(varName));
- if (!value || !*value) {
- if (iterator != end)
- qt_app_environment->erase(iterator);
- } else {
- if (iterator == end)
- qt_app_environment->append(Variable(varName, value));
- else
- iterator->value = value;
- }
-
- return 0;
-}
-
-QT_END_NAMESPACE
-
-#endif // QFUNCTIONS_FAKE_ENV_P_H
diff --git a/src/corelib/kernel/qfunctions_p.h b/src/corelib/kernel/qfunctions_p.h
index 715c553dc5..6744146aa8 100644
--- a/src/corelib/kernel/qfunctions_p.h
+++ b/src/corelib/kernel/qfunctions_p.h
@@ -57,8 +57,6 @@
# include "QtCore/qfunctions_vxworks.h"
#elif defined(Q_OS_NACL)
# include "QtCore/qfunctions_nacl.h"
-#elif defined(Q_OS_WINRT)
-# include "QtCore/qfunctions_winrt.h"
#endif
#endif
diff --git a/src/corelib/kernel/qfunctions_winrt.cpp b/src/corelib/kernel/qfunctions_winrt.cpp
deleted file mode 100644
index 6b7e79806f..0000000000
--- a/src/corelib/kernel/qfunctions_winrt.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qfunctions_winrt.h"
-
-#ifdef Q_OS_WINRT
-
-#include "qfunctions_fake_env_p.h"
-
-QT_BEGIN_NAMESPACE
-
-void qt_winrt_tzset()
-{
-}
-
-void qt_winrt__tzset()
-{
-}
-
-QT_END_NAMESPACE
-
-#endif // Q_OS_WINRT
diff --git a/src/corelib/kernel/qfunctions_winrt.h b/src/corelib/kernel/qfunctions_winrt_p.h
index d0c44be683..aa32747bc8 100644
--- a/src/corelib/kernel/qfunctions_winrt.h
+++ b/src/corelib/kernel/qfunctions_winrt_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -37,12 +37,23 @@
**
****************************************************************************/
-#ifndef QFUNCTIONS_WINRT_H
-#define QFUNCTIONS_WINRT_H
+#ifndef QFUNCTIONS_WINRT_P_H
+#define QFUNCTIONS_WINRT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
#include <QtCore/qglobal.h>
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) && defined(Q_CC_MSVC)
#include <QtCore/QCoreApplication>
#include <QtCore/QThread>
@@ -50,6 +61,9 @@
#include <QtCore/QElapsedTimer>
#include <QtCore/qt_windows.h>
+#include <wrl.h>
+#include <windows.foundation.h>
+
// Convenience macros for handling HRESULT values
#define RETURN_IF_FAILED(msg, ret) \
if (FAILED(hr)) { \
@@ -75,86 +89,6 @@
#define Q_ASSERT_SUCCEEDED(hr) \
Q_ASSERT_X(SUCCEEDED(hr), Q_FUNC_INFO, qPrintable(qt_error_string(hr)));
-#ifdef Q_OS_WINRT
-
-QT_BEGIN_NAMESPACE
-
-#ifdef QT_BUILD_CORE_LIB
-#endif
-
-// Environment ------------------------------------------------------
-errno_t qt_fake_getenv_s(size_t*, char*, size_t, const char*);
-errno_t qt_fake__putenv_s(const char*, const char*);
-void qt_winrt_tzset();
-void qt_winrt__tzset();
-
-QT_END_NAMESPACE
-
-// As Windows Runtime lacks some standard functions used in Qt, these got
-// reimplemented. Other projects do this as well. Inline functions are used
-// that there is a central place to disable functions for newer versions if
-// they get available. There are no defines used anymore, because this
-// will break member functions of classes which are called like these
-// functions.
-// The other declarations available in this file are being used per
-// define inside qplatformdefs.h of the corresponding WinRT mkspec.
-
-#define generate_inline_return_func0(funcname, returntype) \
- inline returntype funcname() \
- { \
- return QT_PREPEND_NAMESPACE(qt_winrt_##funcname)(); \
- }
-#define generate_inline_return_func1(funcname, returntype, param1) \
- inline returntype funcname(param1 p1) \
- { \
- return QT_PREPEND_NAMESPACE(qt_winrt_##funcname)(p1); \
- }
-#define generate_inline_return_func2(funcname, returntype, prependnamespace, param1, param2) \
- inline returntype funcname(param1 p1, param2 p2) \
- { \
- return QT_PREPEND_NAMESPACE(prependnamespace##funcname)(p1, p2); \
- }
-#define generate_inline_return_func3(funcname, returntype, param1, param2, param3) \
- inline returntype funcname(param1 p1, param2 p2, param3 p3) \
- { \
- return QT_PREPEND_NAMESPACE(qt_winrt_##funcname)(p1, p2, p3); \
- }
-#define generate_inline_return_func4(funcname, returntype, prependnamespace, param1, param2, param3, param4) \
- inline returntype funcname(param1 p1, param2 p2, param3 p3, param4 p4) \
- { \
- return QT_PREPEND_NAMESPACE(prependnamespace##funcname)(p1, p2, p3, p4); \
- }
-#define generate_inline_return_func5(funcname, returntype, param1, param2, param3, param4, param5) \
- inline returntype funcname(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5) \
- { \
- return QT_PREPEND_NAMESPACE(qt_winrt_##funcname)(p1, p2, p3, p4, p5); \
- }
-#define generate_inline_return_func6(funcname, returntype, param1, param2, param3, param4, param5, param6) \
- inline returntype funcname(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, param6 p6) \
- { \
- return QT_PREPEND_NAMESPACE(qt_winrt_##funcname)(p1, p2, p3, p4, p5, p6); \
- }
-#define generate_inline_return_func7(funcname, returntype, param1, param2, param3, param4, param5, param6, param7) \
- inline returntype funcname(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, param6 p6, param7 p7) \
- { \
- return QT_PREPEND_NAMESPACE(qt_winrt_##funcname)(p1, p2, p3, p4, p5, p6, p7); \
- }
-
-typedef unsigned (__stdcall *StartAdressExFunc)(void *);
-typedef void(*StartAdressFunc)(void *);
-typedef int ( __cdecl *CompareFunc ) (const void *, const void *) ;
-
-generate_inline_return_func4(getenv_s, errno_t, qt_fake_, size_t *, char *, size_t, const char *)
-generate_inline_return_func2(_putenv_s, errno_t, qt_fake_, const char *, const char *)
-generate_inline_return_func0(tzset, void)
-generate_inline_return_func0(_tzset, void)
-
-namespace Microsoft {
- namespace WRL {
- template <typename T> class ComPtr;
- }
-}
-
QT_BEGIN_NAMESPACE
namespace QWinRTFunctions {
@@ -170,7 +104,7 @@ enum AwaitStyle
template <typename T>
static inline HRESULT _await_impl(const Microsoft::WRL::ComPtr<T> &asyncOp, AwaitStyle awaitStyle, uint timeout)
{
- Microsoft::WRL::ComPtr<IAsyncInfo> asyncInfo;
+ Microsoft::WRL::ComPtr<ABI::Windows::Foundation::IAsyncInfo> asyncInfo;
HRESULT hr = asyncOp.As(&asyncInfo);
if (FAILED(hr))
return hr;
@@ -245,8 +179,6 @@ static inline HRESULT await(const Microsoft::WRL::ComPtr<T> &asyncOp, U *results
QT_END_NAMESPACE
-#endif // Q_OS_WINRT
-
-#endif // Q_OS_WIN
+#endif // Q_OS_WIN && Q_CC_MSVC
-#endif // QFUNCTIONS_WINRT_H
+#endif // QFUNCTIONS_WINRT_P_H
diff --git a/src/corelib/kernel/qsharedmemory_win.cpp b/src/corelib/kernel/qsharedmemory_win.cpp
index 02de2339a5..cbf31bcb2f 100644
--- a/src/corelib/kernel/qsharedmemory_win.cpp
+++ b/src/corelib/kernel/qsharedmemory_win.cpp
@@ -101,12 +101,8 @@ HANDLE QSharedMemoryPrivate::handle()
errorString = QSharedMemory::tr("%1: unable to make key").arg(function);
return 0;
}
-#if defined(Q_OS_WINRT)
- hand = OpenFileMappingFromApp(FILE_MAP_ALL_ACCESS, FALSE, reinterpret_cast<PCWSTR>(nativeKey.utf16()));
-#else
hand = OpenFileMapping(FILE_MAP_ALL_ACCESS, false,
reinterpret_cast<const wchar_t*>(nativeKey.utf16()));
-#endif
if (!hand) {
setErrorString(function);
return 0;
@@ -136,13 +132,8 @@ bool QSharedMemoryPrivate::create(int size)
}
// Create the file mapping.
-#if defined(Q_OS_WINRT)
- hand = CreateFileMappingFromApp(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, size,
- reinterpret_cast<PCWSTR>(nativeKey.utf16()));
-#else
hand = CreateFileMapping(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, 0, size,
reinterpret_cast<const wchar_t*>(nativeKey.utf16()));
-#endif
setErrorString(function);
// hand is valid when it already exists unlike unix so explicitly check
@@ -153,11 +144,7 @@ bool QSharedMemoryPrivate::attach(QSharedMemory::AccessMode mode)
{
// Grab a pointer to the memory block
int permissions = (mode == QSharedMemory::ReadOnly ? FILE_MAP_READ : FILE_MAP_ALL_ACCESS);
-#if defined(Q_OS_WINRT)
- memory = (void *)MapViewOfFileFromApp(handle(), permissions, 0, 0);
-#else
memory = (void *)MapViewOfFile(handle(), permissions, 0, 0, 0);
-#endif
if (0 == memory) {
setErrorString(QLatin1String("QSharedMemory::attach"));
cleanHandle();
diff --git a/src/corelib/kernel/qsystemerror.cpp b/src/corelib/kernel/qsystemerror.cpp
index a735e12925..6a250f5f3a 100644
--- a/src/corelib/kernel/qsystemerror.cpp
+++ b/src/corelib/kernel/qsystemerror.cpp
@@ -76,7 +76,6 @@ namespace {
static QString windowsErrorString(int errorCode)
{
QString ret;
-#ifndef Q_OS_WINRT
wchar_t *string = 0;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
@@ -87,17 +86,6 @@ static QString windowsErrorString(int errorCode)
NULL);
ret = QString::fromWCharArray(string);
LocalFree((HLOCAL)string);
-#else
- wchar_t errorString[1024];
- FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
- NULL,
- errorCode,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- (LPWSTR)&errorString,
- sizeof(errorString)/sizeof(wchar_t),
- NULL);
- ret = QString::fromWCharArray(errorString);
-#endif // Q_OS_WINRT
if (ret.isEmpty() && errorCode == ERROR_MOD_NOT_FOUND)
ret = QString::fromLatin1("The specified module could not be found.");
diff --git a/src/corelib/kernel/qsystemsemaphore_win.cpp b/src/corelib/kernel/qsystemsemaphore_win.cpp
index 2b35803291..d19476db4a 100644
--- a/src/corelib/kernel/qsystemsemaphore_win.cpp
+++ b/src/corelib/kernel/qsystemsemaphore_win.cpp
@@ -85,14 +85,8 @@ HANDLE QSystemSemaphorePrivate::handle(QSystemSemaphore::AccessMode)
// Create it if it doesn't already exists.
if (semaphore == 0) {
-#if defined(Q_OS_WINRT)
- semaphore = CreateSemaphoreEx(0, initialValue, MAXLONG,
- reinterpret_cast<const wchar_t*>(fileName.utf16()),
- 0, SEMAPHORE_ALL_ACCESS);
-#else
semaphore = CreateSemaphore(0, initialValue, MAXLONG,
reinterpret_cast<const wchar_t*>(fileName.utf16()));
-#endif
if (semaphore == NULL)
setErrorString(QLatin1String("QSystemSemaphore::handle"));
}
diff --git a/src/corelib/kernel/qtestsupport_core.cpp b/src/corelib/kernel/qtestsupport_core.cpp
index 428ebbd652..928c8021bc 100644
--- a/src/corelib/kernel/qtestsupport_core.cpp
+++ b/src/corelib/kernel/qtestsupport_core.cpp
@@ -49,9 +49,7 @@ Q_CORE_EXPORT void QTestPrivate::qSleep(int ms)
{
Q_ASSERT(ms > 0);
-#if defined(Q_OS_WINRT)
- WaitForSingleObjectEx(GetCurrentThread(), ms, true);
-#elif defined(Q_OS_WIN)
+#if defined(Q_OS_WIN)
Sleep(uint(ms));
#else
struct timespec ts = { time_t(ms / 1000), (ms % 1000) * 1000 * 1000 };
diff --git a/src/corelib/kernel/qwineventnotifier.cpp b/src/corelib/kernel/qwineventnotifier.cpp
index 0c574e9a4b..b306e3aba1 100644
--- a/src/corelib/kernel/qwineventnotifier.cpp
+++ b/src/corelib/kernel/qwineventnotifier.cpp
@@ -39,11 +39,7 @@
#include "qwineventnotifier_p.h"
-#ifdef Q_OS_WINRT
-#include "qeventdispatcher_winrt_p.h"
-#else
#include "qeventdispatcher_win_p.h"
-#endif
#include "qcoreapplication.h"
#include <private/qthread_p.h>
@@ -235,21 +231,6 @@ bool QWinEventNotifier::event(QEvent * e)
return false;
}
-#if defined(Q_OS_WINRT)
-
-bool QWinEventNotifierPrivate::registerWaitObject()
-{
- Q_UNIMPLEMENTED();
- return false;
-}
-
-void QWinEventNotifierPrivate::unregisterWaitObject()
-{
- Q_UNIMPLEMENTED();
-}
-
-#else // defined(Q_OS_WINRT)
-
static void CALLBACK wfsoCallback(void *context, BOOLEAN /*ignore*/)
{
QWinEventNotifierPrivate *nd = reinterpret_cast<QWinEventNotifierPrivate *>(context);
@@ -287,6 +268,4 @@ void QWinEventNotifierPrivate::unregisterWaitObject()
qErrnoWarning("QWinEventNotifier: UnregisterWaitEx failed.");
}
-#endif // !defined(Q_OS_WINRT)
-
QT_END_NAMESPACE
diff --git a/src/corelib/plugin/qlibrary_win.cpp b/src/corelib/plugin/qlibrary_win.cpp
index ef58724be8..ef1b389adc 100644
--- a/src/corelib/plugin/qlibrary_win.cpp
+++ b/src/corelib/plugin/qlibrary_win.cpp
@@ -63,10 +63,8 @@ QStringList QLibraryPrivate::prefixes_sys()
bool QLibraryPrivate::load_sys()
{
-#ifndef Q_OS_WINRT
//avoid 'Bad Image' message box
UINT oldmode = SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX);
-#endif
// We make the following attempts at locating the library:
//
// Windows
@@ -91,22 +89,11 @@ bool QLibraryPrivate::load_sys()
attempts.prepend(fileName);
else
attempts.append(fileName);
-#ifdef Q_OS_WINRT
- if (fileName.startsWith(QLatin1Char('/')))
- attempts.prepend(QDir::rootPath() + fileName);
-#endif
locker.unlock();
Handle hnd = nullptr;
for (const QString &attempt : qAsConst(attempts)) {
-#ifndef Q_OS_WINRT
hnd = LoadLibrary(reinterpret_cast<const wchar_t*>(QDir::toNativeSeparators(attempt).utf16()));
-#else // Q_OS_WINRT
- QString path = QDir::toNativeSeparators(QDir::current().relativeFilePath(attempt));
- hnd = LoadPackagedLibrary(reinterpret_cast<LPCWSTR>(path.utf16()), 0);
- if (hnd)
- qualifiedFileName = attempt;
-#endif // !Q_OS_WINRT
// If we have a handle or the last error is something other than "unable
// to find the module", then bail out
@@ -114,9 +101,7 @@ bool QLibraryPrivate::load_sys()
break;
}
-#ifndef Q_OS_WINRT
SetErrorMode(oldmode);
-#endif
locker.relock();
if (!hnd) {
errorString = QLibrary::tr("Cannot load library %1: %2").arg(
@@ -125,7 +110,6 @@ bool QLibraryPrivate::load_sys()
// Query the actual name of the library that was loaded
errorString.clear();
-#ifndef Q_OS_WINRT
wchar_t buffer[MAX_PATH];
::GetModuleFileName(hnd, buffer, MAX_PATH);
@@ -147,7 +131,6 @@ bool QLibraryPrivate::load_sys()
Q_ASSERT(!ok || hmod == hnd);
Q_UNUSED(ok);
}
-#endif // !Q_OS_WINRT
}
pHnd.storeRelaxed(hnd);
return (pHnd != nullptr);
diff --git a/src/corelib/plugin/qsystemlibrary.cpp b/src/corelib/plugin/qsystemlibrary.cpp
index 1a88476596..fe6760c8d8 100644
--- a/src/corelib/plugin/qsystemlibrary.cpp
+++ b/src/corelib/plugin/qsystemlibrary.cpp
@@ -72,14 +72,6 @@
QT_BEGIN_NAMESPACE
-#if defined(Q_OS_WINRT)
-HINSTANCE QSystemLibrary::load(const wchar_t *libraryName, bool onlySystemDirectory /* = true */)
-{
- Q_UNUSED(onlySystemDirectory);
- return ::LoadPackagedLibrary(libraryName, 0);
-}
-#else
-
#if !defined(QT_BOOTSTRAPPED)
extern QString qAppFileName();
#endif
@@ -129,6 +121,4 @@ HINSTANCE QSystemLibrary::load(const wchar_t *libraryName, bool onlySystemDirect
}
-#endif // Q_OS_WINRT
-
QT_END_NAMESPACE
diff --git a/src/corelib/text/qcollator_p.h b/src/corelib/text/qcollator_p.h
index 444ae06a99..304c7135e1 100644
--- a/src/corelib/text/qcollator_p.h
+++ b/src/corelib/text/qcollator_p.h
@@ -79,9 +79,6 @@ const CollatorType NoCollator = 0;
typedef QString CollatorKeyType;
typedef int CollatorType;
const CollatorType NoCollator = 0;
-# ifdef Q_OS_WINRT
-# define USE_COMPARESTRINGEX
-# endif
#else // posix - ignores CollatorType collator, only handles system locale
typedef QVector<wchar_t> CollatorKeyType;
diff --git a/src/corelib/text/qlocale_win.cpp b/src/corelib/text/qlocale_win.cpp
index a6582236d5..9af37cb8d0 100644
--- a/src/corelib/text/qlocale_win.cpp
+++ b/src/corelib/text/qlocale_win.cpp
@@ -51,32 +51,11 @@
# include <time.h>
#endif
-#ifdef Q_OS_WINRT
-#include <qfunctions_winrt.h>
-
-#include <wrl.h>
-#include <windows.foundation.h>
-#include <windows.foundation.collections.h>
-#include <windows.system.userprofile.h>
-#endif // Q_OS_WINRT
-
QT_BEGIN_NAMESPACE
-#ifndef Q_OS_WINRT
static QByteArray getWinLocaleName(LCID id = LOCALE_USER_DEFAULT);
static QString winIso639LangName(LCID id = LOCALE_USER_DEFAULT);
static QString winIso3116CtryName(LCID id = LOCALE_USER_DEFAULT);
-#else // !Q_OS_WINRT
-using namespace Microsoft::WRL;
-using namespace Microsoft::WRL::Wrappers;
-using namespace ABI::Windows::Foundation;
-using namespace ABI::Windows::System::UserProfile;
-
-static QByteArray getWinLocaleName(LPWSTR id = LOCALE_NAME_USER_DEFAULT);
-static const char *winLangCodeToIsoName(int code);
-static QString winIso639LangName(LPWSTR id = LOCALE_NAME_USER_DEFAULT);
-static QString winIso3116CtryName(LPWSTR id = LOCALE_NAME_USER_DEFAULT);
-#endif // Q_OS_WINRT
#ifndef QT_NO_SYSTEMLOCALE
@@ -141,11 +120,7 @@ private:
};
// cached values:
-#ifndef Q_OS_WINRT
LCID lcid;
-#else
- WCHAR lcName[LOCALE_NAME_MAX_LENGTH];
-#endif
SubstitutionType substitutionType;
QString zero; // cached value for zeroDigit()
@@ -170,47 +145,27 @@ Q_GLOBAL_STATIC(QSystemLocalePrivate, systemLocalePrivate)
QSystemLocalePrivate::QSystemLocalePrivate()
: substitutionType(SUnknown)
{
-#ifndef Q_OS_WINRT
lcid = GetUserDefaultLCID();
-#else
- GetUserDefaultLocaleName(lcName, LOCALE_NAME_MAX_LENGTH);
-#endif
}
inline int QSystemLocalePrivate::getCurrencyFormat(DWORD flags, LPCWSTR value, const CURRENCYFMTW *format, LPWSTR data, int size)
{
-#ifndef Q_OS_WINRT
return GetCurrencyFormat(lcid, flags, value, format, data, size);
-#else
- return GetCurrencyFormatEx(lcName, flags, value, format, data, size);
-#endif
}
inline int QSystemLocalePrivate::getDateFormat(DWORD flags, const SYSTEMTIME * date, LPCWSTR format, LPWSTR data, int size)
{
-#ifndef Q_OS_WINRT
return GetDateFormat(lcid, flags, date, format, data, size);
-#else
- return GetDateFormatEx(lcName, flags, date, format, data, size, NULL);
-#endif
}
inline int QSystemLocalePrivate::getTimeFormat(DWORD flags, const SYSTEMTIME *date, LPCWSTR format, LPWSTR data, int size)
{
-#ifndef Q_OS_WINRT
return GetTimeFormat(lcid, flags, date, format, data, size);
-#else
- return GetTimeFormatEx(lcName, flags, date, format, data, size);
-#endif
}
inline int QSystemLocalePrivate::getLocaleInfo(LCTYPE type, LPWSTR data, int size)
{
-#ifndef Q_OS_WINRT
return GetLocaleInfo(lcid, type, data, size);
-#else
- return GetLocaleInfoEx(lcName, type, data, size);
-#endif
}
template<typename T>
@@ -646,7 +601,6 @@ QVariant QSystemLocalePrivate::toCurrencyString(const QSystemLocale::CurrencyToS
QVariant QSystemLocalePrivate::uiLanguages()
{
-#ifndef Q_OS_WINRT
unsigned long cnt = 0;
QVarLengthArray<wchar_t, 64> buf(64);
# if !defined(QT_BOOTSTRAPPED) && !defined(QT_BUILD_QMAKE) // Not present in MinGW 4.9/bootstrap builds.
@@ -672,35 +626,6 @@ QVariant QSystemLocalePrivate::uiLanguages()
str += s.size() + 1;
}
return result;
-#else // !Q_OS_WINRT
- QStringList result;
-
- ComPtr<IGlobalizationPreferencesStatics> preferences;
- HRESULT hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_System_UserProfile_GlobalizationPreferences).Get(), &preferences);
- if (FAILED(hr)) {
- qWarning("Could not obtain ApplicationLanguagesStatic");
- return QStringList();
- }
-
- ComPtr<ABI::Windows::Foundation::Collections::IVectorView<HSTRING> > languageList;
- // Languages is a ranked list of "long names" (e.g. en-US) of preferred languages
- hr = preferences->get_Languages(&languageList);
- Q_ASSERT_SUCCEEDED(hr);
- unsigned int size;
- hr = languageList->get_Size(&size);
- Q_ASSERT_SUCCEEDED(hr);
- result.reserve(size);
- for (unsigned int i = 0; i < size; ++i) {
- HString language;
- hr = languageList->GetAt(i, language.GetAddressOf());
- Q_ASSERT_SUCCEEDED(hr);
- UINT32 length;
- PCWSTR rawString = language.GetRawBuffer(&length);
- result << QString::fromWCharArray(rawString, length);
- }
-
- return result;
-#endif // Q_OS_WINRT
}
QVariant QSystemLocalePrivate::nativeLanguageName()
@@ -716,11 +641,7 @@ QVariant QSystemLocalePrivate::nativeCountryName()
void QSystemLocalePrivate::update()
{
-#ifndef Q_OS_WINRT
lcid = GetUserDefaultLCID();
-#else
- GetUserDefaultLocaleName(lcName, LOCALE_NAME_MAX_LENGTH);
-#endif
substitutionType = SUnknown;
zero.resize(0);
}
@@ -1061,11 +982,7 @@ LCID qt_inIsoNametoLCID(const char *name)
}
-#ifndef Q_OS_WINRT
static QString winIso639LangName(LCID id)
-#else
-static QString winIso639LangName(LPWSTR id)
-#endif
{
QString result;
@@ -1073,11 +990,7 @@ static QString winIso639LangName(LPWSTR id)
// the language code
QString lang_code;
wchar_t out[256];
-#ifndef Q_OS_WINRT
if (GetLocaleInfo(id, LOCALE_ILANGUAGE, out, 255))
-#else
- if (GetLocaleInfoEx(id, LOCALE_ILANGUAGE, out, 255))
-#endif
lang_code = QString::fromWCharArray(out);
if (!lang_code.isEmpty()) {
@@ -1100,47 +1013,27 @@ static QString winIso639LangName(LPWSTR id)
return result;
// not one of the problematic languages - do the usual lookup
-#ifndef Q_OS_WINRT
if (GetLocaleInfo(id, LOCALE_SISO639LANGNAME, out, 255))
-#else
- if (GetLocaleInfoEx(id, LOCALE_SISO639LANGNAME, out, 255))
-#endif
result = QString::fromWCharArray(out);
return result;
}
-#ifndef Q_OS_WINRT
static QString winIso3116CtryName(LCID id)
-#else
-static QString winIso3116CtryName(LPWSTR id)
-#endif
{
QString result;
wchar_t out[256];
-#ifndef Q_OS_WINRT
if (GetLocaleInfo(id, LOCALE_SISO3166CTRYNAME, out, 255))
-#else
- if (GetLocaleInfoEx(id, LOCALE_SISO3166CTRYNAME, out, 255))
-#endif
result = QString::fromWCharArray(out);
return result;
}
-#ifndef Q_OS_WINRT
static QByteArray getWinLocaleName(LCID id)
-#else
-static QByteArray getWinLocaleName(LPWSTR id)
-#endif
{
QByteArray result;
-#ifndef Q_OS_WINRT
if (id == LOCALE_USER_DEFAULT) {
-#else
- if (QString::fromWCharArray(id) == QString::fromWCharArray(LOCALE_NAME_USER_DEFAULT)) {
-#endif
static QByteArray langEnvVar = qgetenv("LANG");
result = langEnvVar;
QString lang, script, cntry;
@@ -1155,16 +1048,8 @@ static QByteArray getWinLocaleName(LPWSTR id)
}
}
-#ifndef Q_OS_WINRT
if (id == LOCALE_USER_DEFAULT)
id = GetUserDefaultLCID();
-#else // !Q_OS_WINRT
- WCHAR lcName[LOCALE_NAME_MAX_LENGTH];
- if (QString::fromWCharArray(id) == QString::fromWCharArray(LOCALE_NAME_USER_DEFAULT)) {
- GetUserDefaultLocaleName(lcName, LOCALE_NAME_MAX_LENGTH);
- id = lcName;
- }
-#endif // Q_OS_WINRT
QString resultusage = winIso639LangName(id);
QString country = winIso3116CtryName(id);
if (!country.isEmpty())
@@ -1175,13 +1060,7 @@ static QByteArray getWinLocaleName(LPWSTR id)
Q_CORE_EXPORT QLocale qt_localeFromLCID(LCID id)
{
-#ifndef Q_OS_WINRT
return QLocale(QString::fromLatin1(getWinLocaleName(id)));
-#else // !Q_OS_WINRT
- WCHAR name[LOCALE_NAME_MAX_LENGTH];
- LCIDToLocaleName(id, name, LOCALE_NAME_MAX_LENGTH, 0);
- return QLocale(QString::fromLatin1(getWinLocaleName(name)));
-#endif // Q_OS_WINRT
}
QT_END_NAMESPACE
diff --git a/src/corelib/text/qstringconverter.cpp b/src/corelib/text/qstringconverter.cpp
index 43ebde6449..d1b3055bd4 100644
--- a/src/corelib/text/qstringconverter.cpp
+++ b/src/corelib/text/qstringconverter.cpp
@@ -1115,7 +1115,6 @@ static QString convertToUnicodeCharByChar(const char *chars, qsizetype length, Q
state->remainingChars = 0;
}
const char *mb = mbcs;
-#if !defined(Q_OS_WINRT)
const char *next = 0;
QString s;
while ((next = CharNextExA(CP_ACP, mb, 0)) != mb) {
@@ -1134,21 +1133,6 @@ static QString convertToUnicodeCharByChar(const char *chars, qsizetype length, Q
}
mb = next;
}
-#else
- QString s;
- size_t size = mbstowcs(NULL, mb, length);
- if (size == size_t(-1)) {
- Q_ASSERT("Error in CE TextCodec");
- return QString();
- }
- wchar_t* ws = new wchar_t[size + 2];
- ws[size +1] = 0;
- ws[size] = 0;
- size = mbstowcs(ws, mb, length);
- for (size_t i = 0; i < size; i++)
- s.append(QChar(ws[i]));
- delete [] ws;
-#endif
delete [] mbcs;
return s;
}
diff --git a/src/corelib/thread/qmutex_win.cpp b/src/corelib/thread/qmutex_win.cpp
index e221bc89cb..73673cd5fb 100644
--- a/src/corelib/thread/qmutex_win.cpp
+++ b/src/corelib/thread/qmutex_win.cpp
@@ -46,11 +46,7 @@ QT_BEGIN_NAMESPACE
QMutexPrivate::QMutexPrivate()
{
-#ifndef Q_OS_WINRT
event = CreateEvent(0, FALSE, FALSE, 0);
-#else
- event = CreateEventEx(0, NULL, 0, EVENT_ALL_ACCESS);
-#endif
if (!event)
qWarning("QMutexData::QMutexData: Cannot create event");
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index d575253408..36e9b2a7a2 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -184,9 +184,7 @@ QThreadPrivate::QThreadPrivate(QThreadData *d)
#if defined (Q_OS_WIN)
handle = 0;
-# ifndef Q_OS_WINRT
id = 0;
-# endif
waiters = 0;
terminationEnabled = true;
terminatePending = false;
diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h
index b2d1628e6e..9255b05104 100644
--- a/src/corelib/thread/qthread_p.h
+++ b/src/corelib/thread/qthread_p.h
@@ -67,16 +67,6 @@
#include <algorithm>
#include <atomic>
-#ifdef Q_OS_WINRT
-namespace ABI {
- namespace Windows {
- namespace Foundation {
- struct IAsyncAction;
- }
- }
-}
-#endif // Q_OS_WINRT
-
QT_BEGIN_NAMESPACE
class QAbstractEventDispatcher;
@@ -246,9 +236,6 @@ public:
~QThreadData();
static Q_AUTOTEST_EXPORT QThreadData *current(bool createIfNecessary = true);
-#ifdef Q_OS_WINRT
- static void setMainThread();
-#endif
static void clearCurrentThreadData();
static QThreadData *get2(QThread *thread)
{ Q_ASSERT_X(thread != nullptr, "QThread", "internal error"); return thread->d_func()->data; }
diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp
index 00d67b3a00..78c4d8d672 100644
--- a/src/corelib/thread/qthread_win.cpp
+++ b/src/corelib/thread/qthread_win.cpp
@@ -46,49 +46,19 @@
#include <qpointer.h>
#include <private/qcoreapplication_p.h>
-#ifndef Q_OS_WINRT
#include <private/qeventdispatcher_win_p.h>
-#else
-#include <private/qeventdispatcher_winrt_p.h>
-#endif
#include <qt_windows.h>
-#ifndef Q_OS_WINRT
-# ifndef _MT
-# define _MT
-# endif // _MT
-# include <process.h>
-#endif // Q_OS_WINRT
+#ifndef _MT
+# define _MT
+#endif // _MT
+#include <process.h>
QT_BEGIN_NAMESPACE
#if QT_CONFIG(thread)
-#ifdef Q_OS_WINRT
-inline DWORD qWinRTTlsAlloc() {
- return FlsAlloc(0);
-}
-
-inline bool qWinRTTlsFree(DWORD dwTlsIndex) {
- return FlsFree(dwTlsIndex);
-}
-
-inline LPVOID qWinRTTlsGetValue(DWORD dwTlsIndex) {
- return FlsGetValue(dwTlsIndex);
-}
-
-inline bool qWinRTTlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue) {
- return FlsSetValue(dwTlsIndex, lpTlsValue);
-}
-
-#define TlsAlloc qWinRTTlsAlloc
-#define TlsFree qWinRTTlsFree
-#define TlsSetValue qWinRTTlsSetValue
-#define TlsGetValue qWinRTTlsGetValue
-
-#endif // Q_OS_WINRT
-
void qt_watch_adopted_thread(const HANDLE adoptedThreadHandle, QThread *qthread);
DWORD WINAPI qt_adopted_thread_watcher_function(LPVOID);
@@ -142,15 +112,9 @@ QThreadData *QThreadData::current(bool createIfNecessary)
threadData->isAdopted = true;
threadData->threadId.storeRelaxed(reinterpret_cast<Qt::HANDLE>(quintptr(GetCurrentThreadId())));
-#ifndef Q_OS_WINRT
if (!QCoreApplicationPrivate::theMainThread) {
QCoreApplicationPrivate::theMainThread = threadData->thread.loadRelaxed();
} else {
-#else
- // for winrt the main thread is set explicitly in QCoreApplication's constructor as the
- // native main thread (Xaml thread) is not Qt's main thread.
- {
-#endif
HANDLE realHandle = INVALID_HANDLE_VALUE;
DuplicateHandle(GetCurrentProcess(),
GetCurrentThread(),
@@ -165,33 +129,6 @@ QThreadData *QThreadData::current(bool createIfNecessary)
return threadData;
}
-#ifdef Q_OS_WINRT
-void QThreadData::setMainThread()
-{
- Q_ASSERT(!QCoreApplicationPrivate::theMainThread);
- qt_create_tls();
- QThreadData *threadData = reinterpret_cast<QThreadData *>(TlsGetValue(qt_current_thread_data_tls_index));
- if (!threadData) {
- threadData = new QThreadData;
- // This needs to be called prior to new AdoptedThread() to
- // avoid recursion.
- TlsSetValue(qt_current_thread_data_tls_index, threadData);
- QT_TRY {
- threadData->thread = new QAdoptedThread(threadData);
- } QT_CATCH(...) {
- TlsSetValue(qt_current_thread_data_tls_index, 0);
- threadData->deref();
- threadData = 0;
- QT_RETHROW;
- }
- threadData->deref();
- threadData->isAdopted = true;
- threadData->threadId.storeRelaxed(reinterpret_cast<Qt::HANDLE>(quintptr(GetCurrentThreadId())));
- }
- QCoreApplicationPrivate::theMainThread = threadData->thread.loadRelaxed();
-}
-#endif
-
void QAdoptedThread::init()
{
d_func()->handle = GetCurrentThread();
@@ -225,11 +162,7 @@ void qt_watch_adopted_thread(const HANDLE adoptedThreadHandle, QThread *qthread)
// Start watcher thread if it is not already running.
if (qt_adopted_thread_watcher_id == 0) {
if (qt_adopted_thread_wakeup == 0) {
-#ifndef Q_OS_WINRT
qt_adopted_thread_wakeup = CreateEvent(0, false, false, 0);
-#else
- qt_adopted_thread_wakeup = CreateEventEx(0, NULL, 0, EVENT_ALL_ACCESS);
-#endif
qt_adopted_thread_handles.prepend(qt_adopted_thread_wakeup);
}
@@ -268,21 +201,13 @@ DWORD WINAPI qt_adopted_thread_watcher_function(LPVOID)
// no need to loop, no timeout
offset = 0;
count = handlesCopy.count();
-#ifndef Q_OS_WINRT
ret = WaitForMultipleObjects(handlesCopy.count(), handlesCopy.constData(), false, INFINITE);
-#else
- ret = WaitForMultipleObjectsEx(handlesCopy.count(), handlesCopy.constData(), false, INFINITE, false);
-#endif
} else {
int loop = 0;
do {
offset = loop * MAXIMUM_WAIT_OBJECTS;
count = qMin(handlesCopy.count() - offset, MAXIMUM_WAIT_OBJECTS);
-#ifndef Q_OS_WINRT
ret = WaitForMultipleObjects(count, handlesCopy.constData() + offset, false, 100);
-#else
- ret = WaitForMultipleObjectsEx(count, handlesCopy.constData() + offset, false, 100, false);
-#endif
loop = (loop + 1) % loops;
} while (ret == WAIT_TIMEOUT);
}
@@ -323,7 +248,7 @@ DWORD WINAPI qt_adopted_thread_watcher_function(LPVOID)
return 0;
}
-#if !defined(QT_NO_DEBUG) && defined(Q_CC_MSVC) && !defined(Q_OS_WINRT)
+#if !defined(QT_NO_DEBUG) && defined(Q_CC_MSVC)
#ifndef Q_OS_WIN64
# define ULONG_PTR DWORD
@@ -354,7 +279,7 @@ void qt_set_thread_name(HANDLE threadId, LPCSTR threadName)
{
}
}
-#endif // !QT_NO_DEBUG && Q_CC_MSVC && !Q_OS_WINRT
+#endif // !QT_NO_DEBUG && Q_CC_MSVC
/**************************************************************************
** QThreadPrivate
@@ -365,11 +290,7 @@ void qt_set_thread_name(HANDLE threadId, LPCSTR threadName)
QAbstractEventDispatcher *QThreadPrivate::createEventDispatcher(QThreadData *data)
{
Q_UNUSED(data);
-#ifndef Q_OS_WINRT
return new QEventDispatcherWin32;
-#else
- return new QEventDispatcherWinRT;
-#endif
}
#if QT_CONFIG(thread)
@@ -392,7 +313,7 @@ unsigned int __stdcall QT_ENSURE_STACK_ALIGNED_FOR_SSE QThreadPrivate::start(voi
data->ensureEventDispatcher();
-#if !defined(QT_NO_DEBUG) && defined(Q_CC_MSVC) && !defined(Q_OS_WINRT)
+#if !defined(QT_NO_DEBUG) && defined(Q_CC_MSVC)
// sets the name of the current thread.
QByteArray objectName = thr->objectName().toLocal8Bit();
qt_set_thread_name(HANDLE(-1),
@@ -457,11 +378,7 @@ Qt::HANDLE QThread::currentThreadIdImpl() noexcept
int QThread::idealThreadCount() noexcept
{
SYSTEM_INFO sysinfo;
-#ifndef Q_OS_WINRT
GetSystemInfo(&sysinfo);
-#else
- GetNativeSystemInfo(&sysinfo);
-#endif
return sysinfo.dwNumberOfProcessors;
}
@@ -519,16 +436,7 @@ void QThread::start(Priority priority)
less than NormalPriority), but the newly created thread preempts
its 'parent' and runs at normal priority.
*/
-#if defined(Q_CC_MSVC) && !defined(_DLL) // && !defined(Q_OS_WINRT)
-# ifdef Q_OS_WINRT
- // If you wish to accept the memory leaks, uncomment the part above.
- // See:
- // https://support.microsoft.com/en-us/kb/104641
- // https://msdn.microsoft.com/en-us/library/kdzttdcb.aspx
-# error "Microsoft documentation says this combination leaks memory every time a thread is started. " \
- "Please change your build back to -MD/-MDd or, if you understand this issue and want to continue, " \
- "edit this source file."
-# endif
+#if defined(Q_CC_MSVC) && !defined(_DLL)
// MSVC -MT or -MTd build
d->handle = (Qt::HANDLE) _beginthreadex(NULL, d->stackSize, QThreadPrivate::start,
this, CREATE_SUSPENDED, &(d->id));
@@ -537,7 +445,7 @@ void QThread::start(Priority priority)
d->handle = CreateThread(nullptr, d->stackSize,
reinterpret_cast<LPTHREAD_START_ROUTINE>(QThreadPrivate::start),
this, CREATE_SUSPENDED, reinterpret_cast<LPDWORD>(&d->id));
-#endif // Q_OS_WINRT
+#endif
if (!d->handle) {
qErrnoWarning("QThread::start: Failed to create thread");
@@ -603,10 +511,7 @@ void QThread::terminate()
return;
}
- // Calling ExitThread() in setTerminationEnabled is all we can do on WinRT
-#ifndef Q_OS_WINRT
TerminateThread(d->handle, 0);
-#endif
QThreadPrivate::finish(this, false);
}
@@ -626,11 +531,7 @@ bool QThread::wait(QDeadlineTimer deadline)
locker.mutex()->unlock();
bool ret = false;
-#ifndef Q_OS_WINRT
switch (WaitForSingleObject(d->handle, deadline.remainingTime())) {
-#else
- switch (WaitForSingleObjectEx(d->handle, deadline.remainingTime(), false)) {
-#endif
case WAIT_OBJECT_0:
ret = true;
break;
@@ -671,11 +572,7 @@ void QThread::setTerminationEnabled(bool enabled)
if (enabled && d->terminatePending) {
QThreadPrivate::finish(thr, false);
locker.unlock(); // don't leave the mutex locked!
-#ifndef Q_OS_WINRT
_endthreadex(0);
-#else
- ExitThread(0);
-#endif
}
}
diff --git a/src/corelib/thread/qwaitcondition_win.cpp b/src/corelib/thread/qwaitcondition_win.cpp
index a6ad95b397..ba34129b7f 100644
--- a/src/corelib/thread/qwaitcondition_win.cpp
+++ b/src/corelib/thread/qwaitcondition_win.cpp
@@ -61,11 +61,7 @@ class QWaitConditionEvent
public:
inline QWaitConditionEvent() : priority(0), wokenUp(false)
{
-#ifndef Q_OS_WINRT
event = CreateEvent(NULL, TRUE, FALSE, NULL);
-#else
- event = CreateEventEx(NULL, NULL, CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS);
-#endif
}
inline ~QWaitConditionEvent() { CloseHandle(event); }
int priority;
@@ -92,9 +88,7 @@ QWaitConditionEvent *QWaitConditionPrivate::pre()
mtx.lock();
QWaitConditionEvent *wce =
freeQueue.isEmpty() ? new QWaitConditionEvent : freeQueue.takeFirst();
-#ifndef Q_OS_WINRT
wce->priority = GetThreadPriority(GetCurrentThread());
-#endif
wce->wokenUp = false;
// insert 'wce' into the queue (sorted by priority)
diff --git a/src/corelib/time/qdatetime.cpp b/src/corelib/time/qdatetime.cpp
index 39fdc491df..78cfa05ec9 100644
--- a/src/corelib/time/qdatetime.cpp
+++ b/src/corelib/time/qdatetime.cpp
@@ -63,9 +63,6 @@
#include <time.h>
#ifdef Q_OS_WIN
# include <qt_windows.h>
-# ifdef Q_OS_WINRT
-# include "qfunctions_winrt.h"
-# endif
#endif
#if defined(Q_OS_MAC)
diff --git a/src/corelib/time/qtimezoneprivate_win.cpp b/src/corelib/time/qtimezoneprivate_win.cpp
index 0aaf469ed9..1dc362e45a 100644
--- a/src/corelib/time/qtimezoneprivate_win.cpp
+++ b/src/corelib/time/qtimezoneprivate_win.cpp
@@ -46,11 +46,7 @@
#include <algorithm>
-#ifndef Q_OS_WINRT
#include <private/qwinregistry_p.h>
-// The registry-based timezone backend is not available on WinRT, which falls back to equivalent APIs.
-#define QT_USE_REGISTRY_TIMEZONE 1
-#endif
QT_BEGIN_NAMESPACE
@@ -71,10 +67,8 @@ QT_BEGIN_NAMESPACE
// Vista introduced support for historic data, see MSDN docs on DYNAMIC_TIME_ZONE_INFORMATION
// http://msdn.microsoft.com/en-gb/library/windows/desktop/ms724253%28v=vs.85%29.aspx
-#ifdef QT_USE_REGISTRY_TIMEZONE
static const wchar_t tzRegPath[] = LR"(SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones)";
static const wchar_t currTzRegPath[] = LR"(SYSTEM\CurrentControlSet\Control\TimeZoneInformation)";
-#endif
enum {
MIN_YEAR = -292275056,
@@ -138,8 +132,6 @@ bool equalTzi(const TIME_ZONE_INFORMATION &tzi1, const TIME_ZONE_INFORMATION &tz
&& wcscmp(tzi1.DaylightName, tzi2.DaylightName) == 0);
}
-#ifdef QT_USE_REGISTRY_TIMEZONE
-
QWinTimeZonePrivate::QWinTransitionRule readRegistryRule(const HKEY &key,
const wchar_t *value, bool *ok)
{
@@ -189,73 +181,6 @@ TIME_ZONE_INFORMATION getRegistryTzi(const QByteArray &windowsId, bool *ok)
return tzi;
}
-#else // QT_USE_REGISTRY_TIMEZONE
-struct QWinDynamicTimeZone
-{
- QString standardName;
- QString daylightName;
- QString timezoneName;
- qint32 bias;
- bool daylightTime;
-};
-
-typedef QHash<QByteArray, QWinDynamicTimeZone> QWinRTTimeZoneHash;
-
-Q_GLOBAL_STATIC(QWinRTTimeZoneHash, gTimeZones)
-
-void enumerateTimeZones()
-{
- DYNAMIC_TIME_ZONE_INFORMATION dtzInfo;
- quint32 index = 0;
- QString prevTimeZoneKeyName;
- while (SUCCEEDED(EnumDynamicTimeZoneInformation(index++, &dtzInfo))) {
- QWinDynamicTimeZone item;
- item.timezoneName = QString::fromWCharArray(dtzInfo.TimeZoneKeyName);
- // As soon as key name repeats, break. Some systems continue to always
- // return the last item independent of index being out of range
- if (item.timezoneName == prevTimeZoneKeyName)
- break;
- item.standardName = QString::fromWCharArray(dtzInfo.StandardName);
- item.daylightName = QString::fromWCharArray(dtzInfo.DaylightName);
- item.daylightTime = !dtzInfo.DynamicDaylightTimeDisabled;
- item.bias = dtzInfo.Bias;
- gTimeZones->insert(item.timezoneName.toUtf8(), item);
- prevTimeZoneKeyName = item.timezoneName;
- }
-}
-
-DYNAMIC_TIME_ZONE_INFORMATION dynamicInfoForId(const QByteArray &windowsId)
-{
- DYNAMIC_TIME_ZONE_INFORMATION dtzInfo;
- quint32 index = 0;
- QString prevTimeZoneKeyName;
- while (SUCCEEDED(EnumDynamicTimeZoneInformation(index++, &dtzInfo))) {
- const QString timeZoneName = QString::fromWCharArray(dtzInfo.TimeZoneKeyName);
- if (timeZoneName == QLatin1String(windowsId))
- break;
- if (timeZoneName == prevTimeZoneKeyName)
- break;
- prevTimeZoneKeyName = timeZoneName;
- }
- return dtzInfo;
-}
-
-QWinTimeZonePrivate::QWinTransitionRule
-readDynamicRule(DYNAMIC_TIME_ZONE_INFORMATION &dtzi, int year, bool *ok)
-{
- TIME_ZONE_INFORMATION tzi;
- QWinTimeZonePrivate::QWinTransitionRule rule;
- *ok = GetTimeZoneInformationForYear(year, &dtzi, &tzi);
- if (*ok) {
- rule.startYear = 0;
- rule.standardTimeBias = tzi.Bias + tzi.StandardBias;
- rule.daylightTimeBias = tzi.Bias + tzi.DaylightBias - rule.standardTimeBias;
- rule.standardTimeRule = tzi.StandardDate;
- rule.daylightTimeRule = tzi.DaylightDate;
- }
- return rule;
-}
-#endif // QT_USE_REGISTRY_TIMEZONE
bool isSameRule(const QWinTimeZonePrivate::QWinTransitionRule &last,
const QWinTimeZonePrivate::QWinTransitionRule &rule)
@@ -273,7 +198,6 @@ bool isSameRule(const QWinTimeZonePrivate::QWinTransitionRule &last,
QList<QByteArray> availableWindowsIds()
{
-#ifdef QT_USE_REGISTRY_TIMEZONE
// TODO Consider caching results in a global static, very unlikely to change.
QList<QByteArray> list;
QWinRegistryKey key(HKEY_LOCAL_MACHINE, tzRegPath);
@@ -290,16 +214,10 @@ QList<QByteArray> availableWindowsIds()
}
}
return list;
-#else // QT_USE_REGISTRY_TIMEZONE
- if (gTimeZones->isEmpty())
- enumerateTimeZones();
- return gTimeZones->keys();
-#endif // QT_USE_REGISTRY_TIMEZONE
}
QByteArray windowsSystemZoneId()
{
-#ifdef QT_USE_REGISTRY_TIMEZONE
// On Vista and later is held in the value TimeZoneKeyName in key currTzRegPath
const QString id = QWinRegistryKey(HKEY_LOCAL_MACHINE, currTzRegPath)
.stringValue(L"TimeZoneKeyName");
@@ -316,11 +234,6 @@ QByteArray windowsSystemZoneId()
if (equalTzi(getRegistryTzi(winId, &ok), sysTzi))
return winId;
}
-#else // QT_USE_REGISTRY_TIMEZONE
- DYNAMIC_TIME_ZONE_INFORMATION dtzi;
- if (SUCCEEDED(GetDynamicTimeZoneInformation(&dtzi)))
- return QString::fromWCharArray(dtzi.TimeZoneKeyName).toLocal8Bit();
-#endif // QT_USE_REGISTRY_TIMEZONE
// If we can't determine the current ID use UTC
return QTimeZonePrivate::utcQByteArray();
@@ -544,7 +457,6 @@ void QWinTimeZonePrivate::init(const QByteArray &ianaId)
bool badMonth = false; // Only warn once per zone, if at all.
if (!m_windowsId.isEmpty()) {
-#ifdef QT_USE_REGISTRY_TIMEZONE
// Open the base TZI for the time zone
const QString baseKeyPath = QString::fromWCharArray(tzRegPath) + QLatin1Char('\\')
+ QString::fromUtf8(m_windowsId);
@@ -591,50 +503,6 @@ void QWinTimeZonePrivate::init(const QByteArray &ianaId)
m_tranRules.append(rule);
}
}
-#else // QT_USE_REGISTRY_TIMEZONE
- if (gTimeZones->isEmpty())
- enumerateTimeZones();
- QWinRTTimeZoneHash::const_iterator it = gTimeZones->find(m_windowsId);
- if (it != gTimeZones->constEnd()) {
- m_displayName = it->timezoneName;
- m_standardName = it->standardName;
- m_daylightName = it->daylightName;
- DWORD firstYear = 0;
- DWORD lastYear = 0;
- DYNAMIC_TIME_ZONE_INFORMATION dtzi = dynamicInfoForId(m_windowsId);
- if (GetDynamicTimeZoneInformationEffectiveYears(&dtzi, &firstYear, &lastYear)
- == ERROR_SUCCESS && firstYear < lastYear) {
- for (DWORD year = firstYear; year <= lastYear; ++year) {
- bool ok = false;
- QWinTransitionRule rule = readDynamicRule(dtzi, year, &ok);
- if (ok
- // Don't repeat a recurrent rule
- && (m_tranRules.isEmpty()
- || !isSameRule(m_tranRules.last(), rule))) {
- if (!badMonth
- && (rule.standardTimeRule.wMonth == 0)
- != (rule.daylightTimeRule.wMonth == 0)) {
- badMonth = true;
- qWarning("MS dynamic TZ API violated its wMonth constraint;"
- "this may cause mistakes for %s from %d",
- ianaId.constData(), year);
- }
- rule.startYear = m_tranRules.isEmpty() ? MIN_YEAR : year;
- m_tranRules.append(rule);
- }
- }
- } else {
- // At least try to get the non-dynamic data:
- dtzi.DynamicDaylightTimeDisabled = false;
- bool ok = false;
- QWinTransitionRule rule = readDynamicRule(dtzi, 1970, &ok);
- if (ok) {
- rule.startYear = MIN_YEAR;
- m_tranRules.append(rule);
- }
- }
- }
-#endif // QT_USE_REGISTRY_TIMEZONE
}
// If there are no rules then we failed to find a windowsId or any tzi info
diff --git a/src/corelib/tools/qcommandlineparser.cpp b/src/corelib/tools/qcommandlineparser.cpp
index a3d2a2f7c0..ed4171fe4d 100644
--- a/src/corelib/tools/qcommandlineparser.cpp
+++ b/src/corelib/tools/qcommandlineparser.cpp
@@ -45,7 +45,7 @@
#include <qhash.h>
#include <qvector.h>
#include <qdebug.h>
-#if defined(Q_OS_WIN) && !defined(QT_BOOTSTRAPPED) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN) && !defined(QT_BOOTSTRAPPED)
# include <qt_windows.h>
#endif
#include <stdio.h>
@@ -542,7 +542,7 @@ QString QCommandLineParser::errorText() const
enum MessageType { UsageMessage, ErrorMessage };
-#if defined(Q_OS_WIN) && !defined(QT_BOOTSTRAPPED) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN) && !defined(QT_BOOTSTRAPPED)
// Return whether to use a message box. Use handles if a console can be obtained
// or we are run with redirected handles (for example, by QProcess).
static inline bool displayMessageBox()
@@ -554,17 +554,11 @@ static inline bool displayMessageBox()
GetStartupInfo(&startupInfo);
return !(startupInfo.dwFlags & STARTF_USESTDHANDLES);
}
-#endif // Q_OS_WIN && !QT_BOOTSTRAPPED && !Q_OS_WIN && !Q_OS_WINRT
+#endif // Q_OS_WIN && !QT_BOOTSTRAPPED
static void showParserMessage(const QString &message, MessageType type)
{
-#if defined(Q_OS_WINRT)
- if (type == UsageMessage)
- qInfo("%ls", qUtf16Printable(message));
- else
- qCritical("%ls", qUtf16Printable(message));
- return;
-#elif defined(Q_OS_WIN) && !defined(QT_BOOTSTRAPPED)
+#if defined(Q_OS_WIN) && !defined(QT_BOOTSTRAPPED)
if (displayMessageBox()) {
const UINT flags = MB_OK | MB_TOPMOST | MB_SETFOREGROUND
| (type == UsageMessage ? MB_ICONINFORMATION : MB_ICONERROR);
diff --git a/src/gui/.prev_CMakeLists.txt b/src/gui/.prev_CMakeLists.txt
index b9b2076af5..6670408378 100644
--- a/src/gui/.prev_CMakeLists.txt
+++ b/src/gui/.prev_CMakeLists.txt
@@ -300,6 +300,7 @@ qt_extend_target(Gui CONDITION QT_FEATURE_animation
qt_extend_target(Gui CONDITION WIN32
SOURCES
+ image/qpixmap_win.cpp
kernel/qwindowdefs_win.h
rhi/qrhid3d11.cpp rhi/qrhid3d11_p.h
rhi/qrhid3d11_p_p.h
@@ -364,7 +365,7 @@ qt_extend_target(Gui CONDITION APPLE AND QT_FEATURE_accessibility
${FWFoundation}
)
-qt_extend_target(Gui CONDITION QT_FEATURE_accessibility AND WIN32 AND NOT WINRT
+qt_extend_target(Gui CONDITION QT_FEATURE_accessibility AND WIN32
SOURCES
accessible/windows/apisupport/qwindowsuiawrapper.cpp accessible/windows/apisupport/qwindowsuiawrapper_p.h
accessible/windows/apisupport/uiaattributeids_p.h
@@ -406,11 +407,6 @@ qt_extend_target(Gui CONDITION QT_FEATURE_movie
image/qmovie.cpp image/qmovie.h
)
-qt_extend_target(Gui CONDITION WIN32 AND NOT WINRT
- SOURCES
- image/qpixmap_win.cpp
-)
-
qt_extend_target(Gui CONDITION QT_FEATURE_png
SOURCES
image/qpnghandler.cpp image/qpnghandler_p.h
diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt
index af144a2e24..3c844c7f51 100644
--- a/src/gui/CMakeLists.txt
+++ b/src/gui/CMakeLists.txt
@@ -13,9 +13,7 @@ qt_find_package(WrapPNG PROVIDED_TARGETS WrapPNG::WrapPNG)
qt_find_package(WrapFreetype PROVIDED_TARGETS WrapFreetype::WrapFreetype)
if (QT_FEATURE_gui)
- if (WINRT)
- set(_default_platform "winrt")
- elseif(WIN32)
+ if(WIN32)
set(_default_platform "windows")
elseif(ANDROID)
set(_default_platform "android")
@@ -392,6 +390,7 @@ qt_extend_target(Gui CONDITION QT_FEATURE_animation
qt_extend_target(Gui CONDITION WIN32
SOURCES
+ image/qpixmap_win.cpp
kernel/qwindowdefs_win.h
rhi/qrhid3d11.cpp rhi/qrhid3d11_p.h
rhi/qrhid3d11_p_p.h
@@ -457,7 +456,7 @@ qt_extend_target(Gui CONDITION APPLE AND QT_FEATURE_accessibility
${FWFoundation}
)
-qt_extend_target(Gui CONDITION QT_FEATURE_accessibility AND WIN32 AND NOT WINRT
+qt_extend_target(Gui CONDITION QT_FEATURE_accessibility AND WIN32
SOURCES
accessible/windows/apisupport/qwindowsuiawrapper.cpp accessible/windows/apisupport/qwindowsuiawrapper_p.h
accessible/windows/apisupport/uiaattributeids_p.h
@@ -499,11 +498,6 @@ qt_extend_target(Gui CONDITION QT_FEATURE_movie
image/qmovie.cpp image/qmovie.h
)
-qt_extend_target(Gui CONDITION WIN32 AND NOT WINRT
- SOURCES
- image/qpixmap_win.cpp
-)
-
qt_extend_target(Gui CONDITION QT_FEATURE_png
SOURCES
image/qpnghandler.cpp image/qpnghandler_p.h
diff --git a/src/gui/accessible/accessible.pri b/src/gui/accessible/accessible.pri
index 7a376d98a2..471e2fbaea 100644
--- a/src/gui/accessible/accessible.pri
+++ b/src/gui/accessible/accessible.pri
@@ -24,5 +24,5 @@ qtConfig(accessibility) {
LIBS_PRIVATE += -framework Foundation
}
- win32:!winrt: include(windows/windows.pri)
+ win32: include(windows/windows.pri)
}
diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake
index e844a603ac..9ee5089f49 100644
--- a/src/gui/configure.cmake
+++ b/src/gui/configure.cmake
@@ -569,7 +569,7 @@ qt_feature("directwrite2" PRIVATE
)
qt_feature("direct2d" PRIVATE
LABEL "Direct 2D"
- CONDITION WIN32 AND NOT WINRT AND libs.d2d1 OR FIXME
+ CONDITION WIN32 AND libs.d2d1 OR FIXME
)
qt_feature("direct2d1_1" PRIVATE
LABEL "Direct 2D 1.1"
@@ -692,13 +692,13 @@ qt_feature("opengles32" PUBLIC
qt_feature("opengl-desktop"
LABEL "Desktop OpenGL"
AUTODETECT NOT WIN32
- CONDITION ( WIN32 AND NOT WINRT AND ( MSVC OR OpenGL_FOUND ) ) OR ( NOT WATCHOS AND NOT WIN32 AND NOT WASM AND OpenGL_FOUND )
+ CONDITION ( WIN32 AND ( MSVC OR OpenGL_FOUND ) ) OR ( NOT WATCHOS AND NOT WIN32 AND NOT WASM AND OpenGL_FOUND )
ENABLE INPUT_opengl STREQUAL 'desktop'
DISABLE INPUT_opengl STREQUAL 'es2' OR INPUT_opengl STREQUAL 'dynamic' OR INPUT_opengl STREQUAL 'no'
)
qt_feature("opengl-dynamic"
LABEL "Dynamic OpenGL"
- CONDITION WIN32 AND NOT WINRT
+ CONDITION WIN32
DISABLE INPUT_opengl STREQUAL 'no' OR INPUT_opengl STREQUAL 'desktop'
)
qt_feature("dynamicgl" PUBLIC
diff --git a/src/gui/configure.json b/src/gui/configure.json
index f770ee7729..377865679d 100644
--- a/src/gui/configure.json
+++ b/src/gui/configure.json
@@ -1069,7 +1069,7 @@
},
"direct2d": {
"label": "Direct 2D",
- "condition": "config.win32 && !config.winrt && libs.d2d1",
+ "condition": "config.win32 && libs.d2d1",
"output": [ "privateFeature" ]
},
"direct2d1_1": {
@@ -1224,12 +1224,12 @@
"autoDetect": "!config.win32",
"enable": "input.opengl == 'desktop'",
"disable": "input.opengl == 'es2' || input.opengl == 'dynamic' || input.opengl == 'no'",
- "condition": "(config.win32 && !config.winrt && (config.msvc || libs.opengl)) || (!config.watchos && !config.win32 && !config.wasm && libs.opengl)"
+ "condition": "(config.win32 && (config.msvc || libs.opengl)) || (!config.watchos && !config.win32 && !config.wasm && libs.opengl)"
},
"opengl-dynamic": {
"label": "Dynamic OpenGL",
"disable": "input.opengl == 'no' || input.opengl == 'desktop'",
- "condition": "config.win32 && !config.winrt",
+ "condition": "config.win32",
"output": [
{ "type": "publicFeature", "name": "dynamicgl" },
{ "type": "define", "name": "QT_OPENGL_DYNAMIC" }
diff --git a/src/gui/configure.pri b/src/gui/configure.pri
index 490ef0df28..667ccf53e2 100644
--- a/src/gui/configure.pri
+++ b/src/gui/configure.pri
@@ -60,7 +60,6 @@ defineTest(qtConfTest_qpaDefaultPlatform) {
name =
!isEmpty(config.input.qpa_default_platform): name = $$config.input.qpa_default_platform
else: !isEmpty(QT_QPA_DEFAULT_PLATFORM): name = $$QT_QPA_DEFAULT_PLATFORM
- else: winrt: name = winrt
else: win32: name = windows
else: android: name = android
else: macos: name = cocoa
diff --git a/src/gui/image/image.pri b/src/gui/image/image.pri
index c1cd798490..bf0aa519a8 100644
--- a/src/gui/image/image.pri
+++ b/src/gui/image/image.pri
@@ -55,7 +55,7 @@ qtConfig(movie) {
SOURCES += image/qmovie.cpp
}
-win32:!winrt: SOURCES += image/qpixmap_win.cpp
+win32: SOURCES += image/qpixmap_win.cpp
darwin: OBJECTIVE_SOURCES += image/qimage_darwin.mm
diff --git a/src/gui/kernel/qclipboard.cpp b/src/gui/kernel/qclipboard.cpp
index 3b42e78624..79a2caea69 100644
--- a/src/gui/kernel/qclipboard.cpp
+++ b/src/gui/kernel/qclipboard.cpp
@@ -137,17 +137,6 @@ QT_BEGIN_NAMESPACE
\endlist
- \section1 Notes for Universal Windows Platform Users
-
- \list
-
- \li The Universal Windows Platform only allows to query the
- clipboard in case the application is active and an application
- window has focus. Accessing the clipboard data when in background
- will fail due to access denial.
-
- \endlist
-
\sa QGuiApplication
*/
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index c6facb8ceb..cde21dc8dd 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -1256,12 +1256,12 @@ static void init_platform(const QString &pluginNamesWithArguments, const QString
if (!availablePlugins.isEmpty())
fatalMessage += QStringLiteral("\nAvailable platform plugins are: %1.\n").arg(availablePlugins.join(QLatin1String(", ")));
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
// Windows: Display message box unless it is a console application
// or debug build showing an assert box.
if (!QLibraryInfo::isDebugBuild() && !GetConsoleWindow())
MessageBox(0, (LPCTSTR)fatalMessage.utf16(), (LPCTSTR)(QCoreApplication::applicationName().utf16()), MB_OK | MB_ICONERROR);
-#endif // Q_OS_WIN && !Q_OS_WINRT
+#endif // Q_OS_WIN
qFatal("%s", qPrintable(fatalMessage));
return;
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 24e0289c53..65315ed7cb 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -158,9 +158,6 @@ static const qreal aliasedCoordinateDelta = 0.5 - 0.015625;
static inline bool winClearTypeFontsEnabled()
{
-#ifdef Q_OS_WINRT
- return false;
-#else // Q_OS_WINRT
UINT result = 0;
#if !defined(SPI_GETFONTSMOOTHINGTYPE) // MinGW
# define SPI_GETFONTSMOOTHINGTYPE 0x200A
@@ -168,7 +165,6 @@ static inline bool winClearTypeFontsEnabled()
#endif
SystemParametersInfo(SPI_GETFONTSMOOTHINGTYPE, 0, &result, 0);
return result == FE_FONTSMOOTHINGCLEARTYPE;
-#endif // !Q_OS_WINRT
}
/*!
diff --git a/src/gui/rhi/qrhid3d11.cpp b/src/gui/rhi/qrhid3d11.cpp
index 5b7ad10a2f..c284e17f46 100644
--- a/src/gui/rhi/qrhid3d11.cpp
+++ b/src/gui/rhi/qrhid3d11.cpp
@@ -147,11 +147,7 @@ QRhiD3D11::QRhiD3D11(QRhiD3D11InitParams *params, QRhiD3D11NativeHandles *import
static QString comErrorMessage(HRESULT hr)
{
-#ifndef Q_OS_WINRT
const _com_error comError(hr);
-#else
- const _com_error comError(hr, nullptr);
-#endif
QString result = QLatin1String("Error 0x") + QString::number(ulong(hr), 16);
if (const wchar_t *msg = comError.ErrorMessage())
result += QLatin1String(": ") + QString::fromWCharArray(msg);
diff --git a/src/network/.prev_CMakeLists.txt b/src/network/.prev_CMakeLists.txt
index 1af21c806b..bc088516a3 100644
--- a/src/network/.prev_CMakeLists.txt
+++ b/src/network/.prev_CMakeLists.txt
@@ -35,6 +35,7 @@ qt_add_module(Network
kernel/qtnetworkglobal.h kernel/qtnetworkglobal_p.h
socket/qabstractsocket.cpp socket/qabstractsocket.h socket/qabstractsocket_p.h
socket/qabstractsocketengine.cpp socket/qabstractsocketengine_p.h
+ socket/qnativesocketengine.cpp socket/qnativesocketengine_p.h
socket/qtcpserver.cpp socket/qtcpserver.h socket/qtcpserver_p.h
socket/qtcpsocket.cpp socket/qtcpsocket.h socket/qtcpsocket_p.h
socket/qudpsocket.cpp socket/qudpsocket.h
@@ -59,7 +60,6 @@ qt_add_module(Network
)
#### Keys ignored in scope 1:.:.:network.pro:<TRUE>:
-# MODULE_WINRT_CAPABILITIES = "internetClient" "internetClientServer" "privateNetworkClientServer"
# QMAKE_LIBS = "$$QMAKE_LIBS_NETWORK"
## Scopes:
@@ -178,10 +178,6 @@ qt_extend_target(Network CONDITION ANDROID AND QT_FEATURE_dnslookup
qt_extend_target(Network CONDITION WIN32
SOURCES
kernel/qhostinfo_win.cpp
-)
-
-qt_extend_target(Network CONDITION WIN32 AND NOT WINRT
- SOURCES
kernel/qnetworkinterface_win.cpp
kernel/qnetworkproxy_win.cpp
socket/qnativesocketengine_win.cpp
@@ -191,22 +187,11 @@ qt_extend_target(Network CONDITION WIN32 AND NOT WINRT
iphlpapi
)
-qt_extend_target(Network CONDITION QT_FEATURE_dnslookup AND WIN32 AND NOT WINRT
+qt_extend_target(Network CONDITION QT_FEATURE_dnslookup AND WIN32
SOURCES
kernel/qdnslookup_win.cpp
)
-qt_extend_target(Network CONDITION WINRT
- SOURCES
- kernel/qnetworkinterface_winrt.cpp
- socket/qnativesocketengine_winrt.cpp socket/qnativesocketengine_winrt_p.h
-)
-
-qt_extend_target(Network CONDITION QT_FEATURE_dnslookup AND WINRT
- SOURCES
- kernel/qdnslookup_winrt.cpp
-)
-
qt_extend_target(Network CONDITION APPLE AND NOT UIKIT
LIBRARIES
${FWCoreServices}
@@ -245,7 +230,7 @@ qt_extend_target(Network CONDITION MACOS
kernel/qnetworkproxy_mac.cpp
)
-qt_extend_target(Network CONDITION QT_FEATURE_libproxy AND NOT MACOS AND (UNIX OR WINRT)
+qt_extend_target(Network CONDITION QT_FEATURE_libproxy AND UNIX AND NOT MACOS
SOURCES
kernel/qnetworkproxy_libproxy.cpp
LIBRARIES
@@ -253,7 +238,7 @@ qt_extend_target(Network CONDITION QT_FEATURE_libproxy AND NOT MACOS AND (UNIX O
PkgConfig::Libproxy
)
-qt_extend_target(Network CONDITION NOT MACOS AND NOT QT_FEATURE_libproxy AND (UNIX OR WINRT)
+qt_extend_target(Network CONDITION UNIX AND NOT MACOS AND NOT QT_FEATURE_libproxy
SOURCES
kernel/qnetworkproxy_generic.cpp
)
@@ -269,11 +254,6 @@ qt_extend_target(Network CONDITION QT_FEATURE_sctp
socket/qsctpsocket.cpp socket/qsctpsocket.h socket/qsctpsocket_p.h
)
-qt_extend_target(Network CONDITION NOT WINRT
- SOURCES
- socket/qnativesocketengine.cpp socket/qnativesocketengine_p.h
-)
-
qt_extend_target(Network CONDITION MSVC
MOC_OPTIONS
"-D_WINSOCK_DEPRECATED_NO_WARNINGS"
@@ -285,7 +265,7 @@ qt_extend_target(Network CONDITION QT_FEATURE_localserver
socket/qlocalsocket.cpp socket/qlocalsocket.h socket/qlocalsocket_p.h
)
-qt_extend_target(Network CONDITION QT_FEATURE_localserver AND (INTEGRITY OR WINRT)
+qt_extend_target(Network CONDITION INTEGRITY AND QT_FEATURE_localserver
SOURCES
socket/qlocalserver_tcp.cpp
socket/qlocalsocket_tcp.cpp
@@ -293,13 +273,13 @@ qt_extend_target(Network CONDITION QT_FEATURE_localserver AND (INTEGRITY OR WINR
QT_LOCALSOCKET_TCP
)
-qt_extend_target(Network CONDITION QT_FEATURE_localserver AND UNIX AND NOT INTEGRITY AND NOT WINRT
+qt_extend_target(Network CONDITION QT_FEATURE_localserver AND UNIX AND NOT INTEGRITY
SOURCES
socket/qlocalserver_unix.cpp
socket/qlocalsocket_unix.cpp
)
-qt_extend_target(Network CONDITION QT_FEATURE_localserver AND WIN32 AND NOT WINRT
+qt_extend_target(Network CONDITION QT_FEATURE_localserver AND WIN32
SOURCES
socket/qlocalserver_win.cpp
socket/qlocalsocket_win.cpp
@@ -328,16 +308,6 @@ qt_extend_target(Network CONDITION QT_FEATURE_ssl
ssl/qsslsocket.cpp ssl/qsslsocket.h ssl/qsslsocket_p.h
)
-qt_extend_target(Network CONDITION QT_FEATURE_ssl AND WINRT
- SOURCES
- ssl/qsslcertificate_winrt.cpp
- ssl/qssldiffiehellmanparameters_dummy.cpp
- ssl/qsslellipticcurve_dummy.cpp
- ssl/qsslkey_qt.cpp
- ssl/qsslkey_winrt.cpp
- ssl/qsslsocket_winrt.cpp ssl/qsslsocket_winrt_p.h
-)
-
qt_extend_target(Network CONDITION QT_FEATURE_schannel AND QT_FEATURE_ssl
SOURCES
ssl/qsslcertificate_schannel.cpp
diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt
index 6ff806fef9..0aff359750 100644
--- a/src/network/CMakeLists.txt
+++ b/src/network/CMakeLists.txt
@@ -35,6 +35,7 @@ qt_add_module(Network
kernel/qtnetworkglobal.h kernel/qtnetworkglobal_p.h
socket/qabstractsocket.cpp socket/qabstractsocket.h socket/qabstractsocket_p.h
socket/qabstractsocketengine.cpp socket/qabstractsocketengine_p.h
+ socket/qnativesocketengine.cpp socket/qnativesocketengine_p.h
socket/qtcpserver.cpp socket/qtcpserver.h socket/qtcpserver_p.h
socket/qtcpsocket.cpp socket/qtcpsocket.h socket/qtcpsocket_p.h
socket/qudpsocket.cpp socket/qudpsocket.h
@@ -59,7 +60,6 @@ qt_add_module(Network
)
#### Keys ignored in scope 1:.:.:network.pro:<TRUE>:
-# MODULE_WINRT_CAPABILITIES = "internetClient" "internetClientServer" "privateNetworkClientServer"
# QMAKE_LIBS = "$$QMAKE_LIBS_NETWORK"
## Scopes:
@@ -178,10 +178,6 @@ qt_extend_target(Network CONDITION ANDROID AND QT_FEATURE_dnslookup
qt_extend_target(Network CONDITION WIN32
SOURCES
kernel/qhostinfo_win.cpp
-)
-
-qt_extend_target(Network CONDITION WIN32 AND NOT WINRT
- SOURCES
kernel/qnetworkinterface_win.cpp
kernel/qnetworkproxy_win.cpp
socket/qnativesocketengine_win.cpp
@@ -191,22 +187,11 @@ qt_extend_target(Network CONDITION WIN32 AND NOT WINRT
iphlpapi
)
-qt_extend_target(Network CONDITION QT_FEATURE_dnslookup AND WIN32 AND NOT WINRT
+qt_extend_target(Network CONDITION QT_FEATURE_dnslookup AND WIN32
SOURCES
kernel/qdnslookup_win.cpp
)
-qt_extend_target(Network CONDITION WINRT
- SOURCES
- kernel/qnetworkinterface_winrt.cpp
- socket/qnativesocketengine_winrt.cpp socket/qnativesocketengine_winrt_p.h
-)
-
-qt_extend_target(Network CONDITION QT_FEATURE_dnslookup AND WINRT
- SOURCES
- kernel/qdnslookup_winrt.cpp
-)
-
qt_extend_target(Network CONDITION APPLE AND NOT UIKIT
LIBRARIES
${FWCoreServices}
@@ -245,7 +230,7 @@ qt_extend_target(Network CONDITION MACOS
kernel/qnetworkproxy_mac.cpp
)
-qt_extend_target(Network CONDITION QT_FEATURE_libproxy AND NOT MACOS AND (UNIX OR WINRT)
+qt_extend_target(Network CONDITION QT_FEATURE_libproxy AND UNIX AND NOT MACOS
SOURCES
kernel/qnetworkproxy_libproxy.cpp
LIBRARIES
@@ -253,7 +238,7 @@ qt_extend_target(Network CONDITION QT_FEATURE_libproxy AND NOT MACOS AND (UNIX O
PkgConfig::Libproxy
)
-qt_extend_target(Network CONDITION NOT MACOS AND NOT QT_FEATURE_libproxy AND (UNIX OR WINRT)
+qt_extend_target(Network CONDITION UNIX AND NOT MACOS AND NOT QT_FEATURE_libproxy
SOURCES
kernel/qnetworkproxy_generic.cpp
)
@@ -269,11 +254,6 @@ qt_extend_target(Network CONDITION QT_FEATURE_sctp
socket/qsctpsocket.cpp socket/qsctpsocket.h socket/qsctpsocket_p.h
)
-qt_extend_target(Network CONDITION NOT WINRT
- SOURCES
- socket/qnativesocketengine.cpp socket/qnativesocketengine_p.h
-)
-
qt_extend_target(Network CONDITION MSVC
MOC_OPTIONS
"-D_WINSOCK_DEPRECATED_NO_WARNINGS"
@@ -285,7 +265,7 @@ qt_extend_target(Network CONDITION QT_FEATURE_localserver
socket/qlocalsocket.cpp socket/qlocalsocket.h socket/qlocalsocket_p.h
)
-qt_extend_target(Network CONDITION QT_FEATURE_localserver AND (INTEGRITY OR WINRT)
+qt_extend_target(Network CONDITION INTEGRITY AND QT_FEATURE_localserver
SOURCES
socket/qlocalserver_tcp.cpp
socket/qlocalsocket_tcp.cpp
@@ -293,13 +273,13 @@ qt_extend_target(Network CONDITION QT_FEATURE_localserver AND (INTEGRITY OR WINR
QT_LOCALSOCKET_TCP
)
-qt_extend_target(Network CONDITION QT_FEATURE_localserver AND UNIX AND NOT INTEGRITY AND NOT WINRT
+qt_extend_target(Network CONDITION QT_FEATURE_localserver AND UNIX AND NOT INTEGRITY
SOURCES
socket/qlocalserver_unix.cpp
socket/qlocalsocket_unix.cpp
)
-qt_extend_target(Network CONDITION QT_FEATURE_localserver AND WIN32 AND NOT WINRT
+qt_extend_target(Network CONDITION QT_FEATURE_localserver AND WIN32
SOURCES
socket/qlocalserver_win.cpp
socket/qlocalsocket_win.cpp
@@ -328,16 +308,6 @@ qt_extend_target(Network CONDITION QT_FEATURE_ssl
ssl/qsslsocket.cpp ssl/qsslsocket.h ssl/qsslsocket_p.h
)
-qt_extend_target(Network CONDITION QT_FEATURE_ssl AND WINRT
- SOURCES
- ssl/qsslcertificate_winrt.cpp
- ssl/qssldiffiehellmanparameters_dummy.cpp
- ssl/qsslellipticcurve_dummy.cpp
- ssl/qsslkey_qt.cpp
- ssl/qsslkey_winrt.cpp
- ssl/qsslsocket_winrt.cpp ssl/qsslsocket_winrt_p.h
-)
-
qt_extend_target(Network CONDITION QT_FEATURE_schannel AND QT_FEATURE_ssl
SOURCES
ssl/qsslcertificate_schannel.cpp
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index f916ee2981..468a530e7b 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -640,7 +640,6 @@ QHttpNetworkReply* QHttpNetworkConnectionPrivate::queueRequest(const QHttpNetwor
channels[0].h2RequestsToSend.insert(request.priority(), pair);
}
-#ifndef Q_OS_WINRT
// For Happy Eyeballs the networkLayerState is set to Unknown
// until we have started the first connection attempt. So no
// request will be started until we know if IPv4 or IPv6
@@ -648,13 +647,6 @@ QHttpNetworkReply* QHttpNetworkConnectionPrivate::queueRequest(const QHttpNetwor
if (networkLayerState == Unknown || networkLayerState == HostLookupPending) {
startHostInfoLookup();
} else if ( networkLayerState == IPv4 || networkLayerState == IPv6 ) {
-#else // !Q_OS_WINRT
- {
- // Skip the host lookup part for winrt. Host lookup and proxy handling are done by Windows
- // internally and networkLayerPreference is ignored on this platform. Instead of refactoring
- // the whole approach we just pretend that everything important is known here.
- networkLayerState = IPv4;
-#endif
// this used to be called via invokeMethod and a QueuedConnection
// It is the only place _q_startNextRequest is called directly without going
// through the event loop using a QueuedConnection.
diff --git a/src/network/configure.cmake b/src/network/configure.cmake
index 1dccd67f78..1bfa978612 100644
--- a/src/network/configure.cmake
+++ b/src/network/configure.cmake
@@ -264,7 +264,7 @@ qt_feature("openssl" PRIVATE
qt_feature_definition("openssl" "QT_NO_OPENSSL" NEGATE)
qt_feature_config("openssl" QMAKE_PUBLIC_QT_CONFIG)
qt_feature("openssl-runtime"
- AUTODETECT NOT WINRT AND NOT WASM
+ AUTODETECT NOT WASM
CONDITION NOT QT_FEATURE_securetransport AND NOT QT_FEATURE_schannel AND TEST_openssl_headers
ENABLE INPUT_openssl STREQUAL 'yes' OR INPUT_openssl STREQUAL 'runtime'
DISABLE INPUT_openssl STREQUAL 'no' OR INPUT_openssl STREQUAL 'linked' OR INPUT_ssl STREQUAL 'no'
@@ -284,13 +284,13 @@ qt_feature("securetransport" PUBLIC
qt_feature_definition("securetransport" "QT_SECURETRANSPORT")
qt_feature("schannel" PUBLIC
LABEL "Schannel"
- CONDITION INPUT_schannel STREQUAL 'yes' AND WIN32 AND NOT WINRT AND ( INPUT_openssl STREQUAL '' OR INPUT_openssl STREQUAL 'no' )
+ CONDITION INPUT_schannel STREQUAL 'yes' AND WIN32 AND ( INPUT_openssl STREQUAL '' OR INPUT_openssl STREQUAL 'no' )
DISABLE INPUT_schannel STREQUAL 'no' OR INPUT_ssl STREQUAL 'no'
)
qt_feature_definition("schannel" "QT_SCHANNEL")
qt_feature("ssl" PUBLIC
LABEL "SSL"
- CONDITION WINRT OR QT_FEATURE_securetransport OR QT_FEATURE_openssl OR QT_FEATURE_schannel
+ CONDITION QT_FEATURE_securetransport OR QT_FEATURE_openssl OR QT_FEATURE_schannel
)
qt_feature_definition("ssl" "QT_NO_SSL" NEGATE VALUE "1")
qt_feature("dtls" PUBLIC
@@ -389,7 +389,7 @@ qt_feature("sspi" PUBLIC
SECTION "Networking"
LABEL "SSPI"
PURPOSE "Enable NTLM/SPNEGO authentication through SSPI"
- CONDITION WIN32 AND NOT WINRT
+ CONDITION WIN32
)
qt_feature_definition("sspi" "QT_NO_SSPI" NEGATE VALUE "1")
qt_feature("netlistmgr" PRIVATE
@@ -421,7 +421,7 @@ qt_configure_add_summary_entry(
)
qt_configure_add_summary_entry(
ARGS "schannel"
- CONDITION WIN32 AND NOT WINRT
+ CONDITION WIN32
)
qt_configure_add_summary_entry(ARGS "openssl")
qt_configure_add_summary_entry(ARGS "openssl-linked")
diff --git a/src/network/configure.json b/src/network/configure.json
index 254a36d725..5f26f83c54 100644
--- a/src/network/configure.json
+++ b/src/network/configure.json
@@ -272,7 +272,7 @@
]
},
"openssl-runtime": {
- "autoDetect": "!config.winrt && !config.wasm",
+ "autoDetect": "!config.wasm",
"enable": "input.openssl == 'yes' || input.openssl == 'runtime'",
"disable": "input.openssl == 'no' || input.openssl == 'linked' || input.ssl == 'no'",
"condition": "!features.securetransport && !features.schannel && libs.openssl_headers"
@@ -299,7 +299,7 @@
"schannel": {
"label": "Schannel",
"disable": "input.schannel == 'no' || input.ssl == 'no'",
- "condition": "input.schannel == 'yes' && config.win32 && !config.winrt && (input.openssl == '' || input.openssl == 'no')",
+ "condition": "input.schannel == 'yes' && config.win32 && (input.openssl == '' || input.openssl == 'no')",
"output": [
"publicFeature",
{ "type": "define", "name": "QT_SCHANNEL" }
@@ -307,7 +307,7 @@
},
"ssl": {
"label": "SSL",
- "condition": "config.winrt || features.securetransport || features.openssl || features.schannel",
+ "condition": "features.securetransport || features.openssl || features.schannel",
"output": [ "publicFeature", "feature" ]
},
"dtls": {
@@ -411,7 +411,7 @@
"label": "SSPI",
"purpose": "Enable NTLM/SPNEGO authentication through SSPI",
"section": "Networking",
- "condition": "config.win32 && !config.winrt",
+ "condition": "config.win32",
"output": [ "publicFeature", "feature" ]
},
"netlistmgr": {
@@ -469,7 +469,7 @@ For example:
{
"type": "feature",
"args": "schannel",
- "condition": "config.win32 && !config.winrt"
+ "condition": "config.win32"
},
"openssl",
"openssl-linked",
diff --git a/src/network/kernel/kernel.pri b/src/network/kernel/kernel.pri
index 7dd5b1d97e..d7d0dd522c 100644
--- a/src/network/kernel/kernel.pri
+++ b/src/network/kernel/kernel.pri
@@ -62,16 +62,10 @@ android:qtConfig(dnslookup) {
}
win32: {
- SOURCES += kernel/qhostinfo_win.cpp
-
- !winrt {
- SOURCES += kernel/qnetworkinterface_win.cpp
- qtConfig(dnslookup): SOURCES += kernel/qdnslookup_win.cpp
- LIBS_PRIVATE += -ldnsapi -liphlpapi
- } else {
- SOURCES += kernel/qnetworkinterface_winrt.cpp
- qtConfig(dnslookup): SOURCES += kernel/qdnslookup_winrt.cpp
- }
+ SOURCES += kernel/qhostinfo_win.cpp \
+ kernel/qnetworkinterface_win.cpp
+ qtConfig(dnslookup): SOURCES += kernel/qdnslookup_win.cpp
+ LIBS_PRIVATE += -ldnsapi -liphlpapi
}
mac {
@@ -94,7 +88,7 @@ qtConfig(gssapi): QMAKE_USE_PRIVATE += gssapi
uikit:HEADERS += kernel/qnetworkinterface_uikit_p.h
osx:SOURCES += kernel/qnetworkproxy_mac.cpp
-else:win32:!winrt: SOURCES += kernel/qnetworkproxy_win.cpp
+else:win32: SOURCES += kernel/qnetworkproxy_win.cpp
else: qtConfig(libproxy) {
SOURCES += kernel/qnetworkproxy_libproxy.cpp
QMAKE_USE_PRIVATE += libproxy libdl
diff --git a/src/network/kernel/qdnslookup_winrt.cpp b/src/network/kernel/qdnslookup_winrt.cpp
deleted file mode 100644
index 30510d89fc..0000000000
--- a/src/network/kernel/qdnslookup_winrt.cpp
+++ /dev/null
@@ -1,157 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtNetwork module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qdnslookup_p.h"
-
-#include <qfunctions_winrt.h>
-#include <qurl.h>
-#include <qdebug.h>
-
-#include <wrl.h>
-#include <windows.foundation.h>
-#include <windows.foundation.collections.h>
-#include <windows.networking.h>
-#include <windows.networking.sockets.h>
-
-using namespace Microsoft::WRL;
-using namespace Microsoft::WRL::Wrappers;
-using namespace ABI::Windows::Foundation;
-using namespace ABI::Windows::Foundation::Collections;
-using namespace ABI::Windows::Networking;
-using namespace ABI::Windows::Networking::Connectivity;
-using namespace ABI::Windows::Networking::Sockets;
-
-#define E_NO_SUCH_HOST 0x80072af9
-
-QT_BEGIN_NAMESPACE
-
-void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestName, const QHostAddress &nameserver, QDnsLookupReply *reply)
-{
- // TODO: Add nameserver support for winRT
- if (!nameserver.isNull())
- qWarning("Ignoring nameserver as its currently not supported on WinRT");
-
- // TODO: is there any way to do "proper" dns lookup?
- if (requestType != QDnsLookup::A && requestType != QDnsLookup::AAAA
- && requestType != QDnsLookup::ANY) {
- reply->error = QDnsLookup::InvalidRequestError;
- reply->errorString = QLatin1String("WinRT only supports IPv4 and IPv6 requests");
- return;
- }
-
- QString aceHostname = QUrl::fromAce(requestName);
- if (aceHostname.isEmpty()) {
- reply->error = QDnsLookup::InvalidRequestError;
- reply->errorString = requestName.isEmpty() ? tr("No hostname given") : tr("Invalid hostname");
- return;
- }
-
- ComPtr<IHostNameFactory> hostnameFactory;
- HRESULT hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_HostName).Get(),
- IID_PPV_ARGS(&hostnameFactory));
- if (FAILED(hr)) {
- reply->error = QDnsLookup::ResolverError;
- reply->errorString = QLatin1String("Could not obtain hostname factory");
- return;
- }
- ComPtr<IHostName> host;
- HStringReference hostNameRef((const wchar_t*)aceHostname.utf16());
- hr = hostnameFactory->CreateHostName(hostNameRef.Get(), &host);
- Q_ASSERT_SUCCEEDED(hr);
-
- ComPtr<IDatagramSocketStatics> datagramSocketStatics;
- hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_Sockets_DatagramSocket).Get(), &datagramSocketStatics);
- Q_ASSERT_SUCCEEDED(hr);
-
- ComPtr<IAsyncOperation<IVectorView<EndpointPair *> *>> op;
- hr = datagramSocketStatics->GetEndpointPairsAsync(host.Get(),
- HString::MakeReference(L"0").Get(),
- &op);
- Q_ASSERT_SUCCEEDED(hr);
-
- ComPtr<IVectorView<EndpointPair *>> endpointPairs;
- hr = QWinRTFunctions::await(op, endpointPairs.GetAddressOf(), QWinRTFunctions::YieldThread, 60 * 1000);
- if (hr == E_NO_SUCH_HOST || !endpointPairs) {
- reply->error = QDnsLookup::NotFoundError;
- reply->errorString = tr("Host %1 could not be found.").arg(aceHostname);
- return;
- }
- if (FAILED(hr)) {
- reply->error = QDnsLookup::ServerFailureError;
- reply->errorString = tr("Unknown error");
- return;
- }
-
- unsigned int size;
- hr = endpointPairs->get_Size(&size);
- Q_ASSERT_SUCCEEDED(hr);
- // endpoint pairs might contain duplicates so we temporarily store addresses in a QSet
- QSet<QHostAddress> addresses;
- for (unsigned int i = 0; i < size; ++i) {
- ComPtr<IEndpointPair> endpointpair;
- hr = endpointPairs->GetAt(i, &endpointpair);
- Q_ASSERT_SUCCEEDED(hr);
- ComPtr<IHostName> remoteHost;
- hr = endpointpair->get_RemoteHostName(&remoteHost);
- Q_ASSERT_SUCCEEDED(hr);
- HostNameType type;
- hr = remoteHost->get_Type(&type);
- Q_ASSERT_SUCCEEDED(hr);
- if (type == HostNameType_Bluetooth || type == HostNameType_DomainName
- || (requestType != QDnsLookup::ANY
- && ((type == HostNameType_Ipv4 && requestType == QDnsLookup::AAAA)
- || (type == HostNameType_Ipv6 && requestType == QDnsLookup::A))))
- continue;
-
- HString name;
- hr = remoteHost->get_CanonicalName(name.GetAddressOf());
- Q_ASSERT_SUCCEEDED(hr);
- UINT32 length;
- PCWSTR rawString = name.GetRawBuffer(&length);
- addresses.insert(QHostAddress(QString::fromWCharArray(rawString, length)));
- }
- for (const QHostAddress &address : qAsConst(addresses)) {
- QDnsHostAddressRecord record;
- record.d->name = aceHostname;
- record.d->value = address;
- reply->hostAddressRecords.append(record);
- }
-}
-
-QT_END_NAMESPACE
diff --git a/src/network/kernel/qhostaddress.cpp b/src/network/kernel/qhostaddress.cpp
index b9fc129685..0783c0751f 100644
--- a/src/network/kernel/qhostaddress.cpp
+++ b/src/network/kernel/qhostaddress.cpp
@@ -479,14 +479,10 @@ QHostAddress::QHostAddress(const QString &address)
QHostAddress::QHostAddress(const struct sockaddr *sockaddr)
: d(new QHostAddressPrivate)
{
-#ifndef Q_OS_WINRT
if (sockaddr->sa_family == AF_INET)
setAddress(htonl(((const sockaddr_in *)sockaddr)->sin_addr.s_addr));
else if (sockaddr->sa_family == AF_INET6)
setAddress(((const sockaddr_in6 *)sockaddr)->sin6_addr.s6_addr);
-#else
- Q_UNUSED(sockaddr)
-#endif
}
/*!
@@ -659,15 +655,11 @@ bool QHostAddress::setAddress(const QString &address)
void QHostAddress::setAddress(const struct sockaddr *sockaddr)
{
d.detach();
-#ifndef Q_OS_WINRT
clear();
if (sockaddr->sa_family == AF_INET)
setAddress(htonl(((const sockaddr_in *)sockaddr)->sin_addr.s_addr));
else if (sockaddr->sa_family == AF_INET6)
setAddress(((const sockaddr_in6 *)sockaddr)->sin6_addr.s6_addr);
-#else
- Q_UNUSED(sockaddr)
-#endif
}
/*!
diff --git a/src/network/kernel/qnetworkinterface_winrt.cpp b/src/network/kernel/qnetworkinterface_winrt.cpp
deleted file mode 100644
index 24ac3df52f..0000000000
--- a/src/network/kernel/qnetworkinterface_winrt.cpp
+++ /dev/null
@@ -1,245 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtNetwork module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qnetworkinterface.h"
-#include "qnetworkinterface_p.h"
-
-#ifndef QT_NO_NETWORKINTERFACE
-
-#include <qfunctions_winrt.h>
-
-#include <wrl.h>
-#include <windows.foundation.h>
-#include <windows.foundation.collections.h>
-#include <windows.networking.h>
-#include <windows.networking.connectivity.h>
-
-using namespace Microsoft::WRL;
-using namespace Microsoft::WRL::Wrappers;
-using namespace ABI::Windows::Foundation;
-using namespace ABI::Windows::Foundation::Collections;
-using namespace ABI::Windows::Networking;
-using namespace ABI::Windows::Networking::Connectivity;
-
-#include <qhostinfo.h>
-
-QT_BEGIN_NAMESPACE
-
-struct HostNameInfo {
- GUID adapterId;
- unsigned char prefixLength;
- QString address;
-};
-
-uint QNetworkInterfaceManager::interfaceIndexFromName(const QString &name)
-{
- // TBD - may not be possible
- Q_UNUSED(name);
- return 0;
-}
-
-QString QNetworkInterfaceManager::interfaceNameFromIndex(uint index)
-{
- // TBD - may not be possible
- return QString::number(index);
-}
-
-static QNetworkInterfacePrivate *interfaceFromProfile(IConnectionProfile *profile, QList<HostNameInfo> *hostList)
-{
- if (!profile)
- return 0;
-
- QNetworkInterfacePrivate *iface = new QNetworkInterfacePrivate;
-
- NetworkConnectivityLevel connectivityLevel;
- HRESULT hr = profile->GetNetworkConnectivityLevel(&connectivityLevel);
- Q_ASSERT_SUCCEEDED(hr);
- if (connectivityLevel != NetworkConnectivityLevel_None)
- iface->flags = QNetworkInterface::IsUp | QNetworkInterface::IsRunning;
- iface->flags |= QNetworkInterface::CanBroadcast;
-
- ComPtr<INetworkAdapter> adapter;
- hr = profile->get_NetworkAdapter(&adapter);
- // Indicates that no internet connection is available/the device is in airplane mode
- if (hr == E_INVALIDARG)
- return 0;
- Q_ASSERT_SUCCEEDED(hr);
- UINT32 type;
- hr = adapter->get_IanaInterfaceType(&type);
- Q_ASSERT_SUCCEEDED(hr);
- if (type == 23)
- iface->flags |= QNetworkInterface::IsPointToPoint;
- GUID id;
- hr = adapter->get_NetworkAdapterId(&id);
- Q_ASSERT_SUCCEEDED(hr);
- OLECHAR adapterName[39]={0};
- StringFromGUID2(id, adapterName, 39);
- iface->name = QString::fromWCharArray(adapterName);
-
- // According to http://stackoverflow.com/questions/12936193/how-unique-is-the-ethernet-network-adapter-id-in-winrt-it-is-derived-from-the-m
- // obtaining the MAC address using WinRT API is impossible
- // iface->hardwareAddress = ?
-
- for (int i = 0; i < hostList->length(); ++i) {
- const HostNameInfo hostInfo = hostList->at(i);
- if (id != hostInfo.adapterId)
- continue;
-
- QNetworkAddressEntry entry;
- entry.setIp(QHostAddress(hostInfo.address));
- entry.setPrefixLength(hostInfo.prefixLength);
- iface->addressEntries << entry;
-
- hostList->takeAt(i);
- --i;
- }
- return iface;
-}
-
-static QList<QNetworkInterfacePrivate *> interfaceListing()
-{
- QList<QNetworkInterfacePrivate *> interfaces;
-
- QList<HostNameInfo> hostList;
-
- ComPtr<INetworkInformationStatics> hostNameStatics;
- HRESULT hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_Connectivity_NetworkInformation).Get(), &hostNameStatics);
- Q_ASSERT_SUCCEEDED(hr);
-
- ComPtr<IVectorView<HostName *>> hostNames;
- hr = hostNameStatics->GetHostNames(&hostNames);
- Q_ASSERT_SUCCEEDED(hr);
- if (!hostNames)
- return interfaces;
-
- unsigned int hostNameCount;
- hr = hostNames->get_Size(&hostNameCount);
- Q_ASSERT_SUCCEEDED(hr);
- for (unsigned i = 0; i < hostNameCount; ++i) {
- HostNameInfo hostInfo;
- ComPtr<IHostName> hostName;
- hr = hostNames->GetAt(i, &hostName);
- Q_ASSERT_SUCCEEDED(hr);
-
- HostNameType type;
- hr = hostName->get_Type(&type);
- Q_ASSERT_SUCCEEDED(hr);
- if (type == HostNameType_DomainName)
- continue;
-
- ComPtr<IIPInformation> ipInformation;
- hr = hostName->get_IPInformation(&ipInformation);
- Q_ASSERT_SUCCEEDED(hr);
- ComPtr<INetworkAdapter> currentAdapter;
- hr = ipInformation->get_NetworkAdapter(&currentAdapter);
- Q_ASSERT_SUCCEEDED(hr);
-
- hr = currentAdapter->get_NetworkAdapterId(&hostInfo.adapterId);
- Q_ASSERT_SUCCEEDED(hr);
-
- ComPtr<IReference<unsigned char>> prefixLengthReference;
- hr = ipInformation->get_PrefixLength(&prefixLengthReference);
- Q_ASSERT_SUCCEEDED(hr);
-
- hr = prefixLengthReference->get_Value(&hostInfo.prefixLength);
- Q_ASSERT_SUCCEEDED(hr);
-
- // invalid prefixes
- if ((type == HostNameType_Ipv4 && hostInfo.prefixLength > 32)
- || (type == HostNameType_Ipv6 && hostInfo.prefixLength > 128))
- continue;
-
- HString name;
- hr = hostName->get_CanonicalName(name.GetAddressOf());
- Q_ASSERT_SUCCEEDED(hr);
- UINT32 length;
- PCWSTR rawString = name.GetRawBuffer(&length);
- hostInfo.address = QString::fromWCharArray(rawString, length);
-
- hostList << hostInfo;
- }
-
- INetworkInformationStatics *networkInfoStatics;
- hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_Connectivity_NetworkInformation).Get(), &networkInfoStatics);
- Q_ASSERT_SUCCEEDED(hr);
- ComPtr<IConnectionProfile> connectionProfile;
- hr = networkInfoStatics->GetInternetConnectionProfile(&connectionProfile);
- Q_ASSERT_SUCCEEDED(hr);
- QNetworkInterfacePrivate *iface = interfaceFromProfile(connectionProfile.Get(), &hostList);
- if (iface) {
- iface->index = 0;
- interfaces << iface;
- }
-
- ComPtr<IVectorView<ConnectionProfile *>> connectionProfiles;
- hr = networkInfoStatics->GetConnectionProfiles(&connectionProfiles);
- Q_ASSERT_SUCCEEDED(hr);
- if (!connectionProfiles)
- return interfaces;
-
- unsigned int size;
- hr = connectionProfiles->get_Size(&size);
- Q_ASSERT_SUCCEEDED(hr);
- for (unsigned int i = 0; i < size; ++i) {
- ComPtr<IConnectionProfile> profile;
- hr = connectionProfiles->GetAt(i, &profile);
- Q_ASSERT_SUCCEEDED(hr);
-
- iface = interfaceFromProfile(profile.Get(), &hostList);
- if (iface) {
- iface->index = i + 1;
- interfaces << iface;
- }
- }
- return interfaces;
-}
-
-QList<QNetworkInterfacePrivate *> QNetworkInterfaceManager::scan()
-{
- return interfaceListing();
-}
-
-QString QHostInfo::localDomainName()
-{
- return QString();
-}
-
-QT_END_NAMESPACE
-
-#endif // QT_NO_NETWORKINTERFACE
diff --git a/src/network/kernel/qnetworkproxy_win.cpp b/src/network/kernel/qnetworkproxy_win.cpp
index 9dfe32d5f7..c4dc33f66f 100644
--- a/src/network/kernel/qnetworkproxy_win.cpp
+++ b/src/network/kernel/qnetworkproxy_win.cpp
@@ -367,7 +367,6 @@ static QList<QNetworkProxy> parseServerList(const QNetworkProxyQuery &query, con
return removeDuplicateProxies(result);
}
-#if !defined(Q_OS_WINRT)
namespace {
class QRegistryWatcher {
Q_DISABLE_COPY_MOVE(QRegistryWatcher)
@@ -421,7 +420,6 @@ private:
QVector<HKEY> m_registryHandles;
};
} // namespace
-#endif // !defined(Q_OS_WINRT)
class QWindowsSystemProxy
{
@@ -441,9 +439,7 @@ public:
QStringList proxyServerList;
QStringList proxyBypass;
QList<QNetworkProxy> defaultResult;
-#if !defined(Q_OS_WINRT)
QRegistryWatcher proxySettingsWatcher;
-#endif
bool initialized;
bool functional;
bool isAutoConfig;
@@ -477,9 +473,7 @@ void QWindowsSystemProxy::reset()
void QWindowsSystemProxy::init()
{
bool proxySettingsChanged = false;
-#if !defined(Q_OS_WINRT)
proxySettingsChanged = proxySettingsWatcher.hasChanged();
-#endif
if (initialized && !proxySettingsChanged)
return;
@@ -487,12 +481,10 @@ void QWindowsSystemProxy::init()
reset();
-#if !defined(Q_OS_WINRT)
proxySettingsWatcher.clear(); // needs reset to trigger a new detection
proxySettingsWatcher.addLocation(HKEY_CURRENT_USER, QStringLiteral("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"));
proxySettingsWatcher.addLocation(HKEY_LOCAL_MACHINE, QStringLiteral("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"));
proxySettingsWatcher.addLocation(HKEY_LOCAL_MACHINE, QStringLiteral("Software\\Policies\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"));
-#endif
// load the winhttp.dll library
QSystemLibrary lib(L"winhttp");
diff --git a/src/network/network.pro b/src/network/network.pro
index 7bd54fd12e..b1bfc51f90 100644
--- a/src/network/network.pro
+++ b/src/network/network.pro
@@ -21,9 +21,4 @@ include(ssl/ssl.pri)
QMAKE_LIBS += $$QMAKE_LIBS_NETWORK
-MODULE_WINRT_CAPABILITIES = \
- internetClient \
- internetClientServer \
- privateNetworkClientServer
-
load(qt_module)
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp
index 03d69d6204..0f9e22d131 100644
--- a/src/network/socket/qabstractsocket.cpp
+++ b/src/network/socket/qabstractsocket.cpp
@@ -948,7 +948,7 @@ void QAbstractSocketPrivate::resolveProxy(const QString &hostname, quint16 port)
}
#endif // !QT_NO_NETWORKPROXY
-#if !defined(QT_NO_NETWORKPROXY) || defined(Q_OS_WINRT)
+#if !defined(QT_NO_NETWORKPROXY)
/*!
\internal
@@ -990,7 +990,7 @@ void QAbstractSocketPrivate::startConnectingByName(const QString &host)
emit q->stateChanged(state);
}
-#endif // !QT_NO_NETWORKPROXY || Q_OS_WINRT
+#endif // !QT_NO_NETWORKPROXY
/*! \internal
@@ -1713,7 +1713,6 @@ void QAbstractSocket::connectToHost(const QString &hostName, quint16 port,
QIODevice::open(openMode);
d->readChannelCount = d->writeChannelCount = 0;
-#ifndef Q_OS_WINRT
d->state = HostLookupState;
emit stateChanged(d->state);
@@ -1751,10 +1750,6 @@ void QAbstractSocket::connectToHost(const QString &hostName, quint16 port,
(d->state == ConnectingState || d->state == HostLookupState)
? " (connection in progress)" : "");
#endif
-#else // !Q_OS_WINRT
- // On WinRT we should always connect by name. Lookup and proxy handling are done by the API.
- d->startConnectingByName(hostName);
-#endif
}
/*! \overload
diff --git a/src/network/socket/qabstractsocketengine.cpp b/src/network/socket/qabstractsocketengine.cpp
index 44139ff81d..50462fb11f 100644
--- a/src/network/socket/qabstractsocketengine.cpp
+++ b/src/network/socket/qabstractsocketengine.cpp
@@ -39,11 +39,7 @@
#include "qabstractsocketengine_p.h"
-#ifndef Q_OS_WINRT
#include "qnativesocketengine_p.h"
-#else
-#include "qnativesocketengine_winrt_p.h"
-#endif
#include "qmutex.h"
#include "qnetworkproxy.h"
diff --git a/src/network/socket/qlocalserver.cpp b/src/network/socket/qlocalserver.cpp
index 5ca2db70b9..251b785dfd 100644
--- a/src/network/socket/qlocalserver.cpp
+++ b/src/network/socket/qlocalserver.cpp
@@ -195,7 +195,7 @@ QLocalServer::SocketOptions QLocalServer::socketOptions() const
\l{https://msdn.microsoft.com/en-us/library/windows/desktop/ms740522(v=vs.85).aspx}
{Winsock 2 Socket Handle}.
- \li With WinRT and on INTEGRITY, the returned value is the
+ \li On INTEGRITY, the returned value is the
QTcpServer socket descriptor and the type is defined by
\l{QTcpServer::socketDescriptor}{socketDescriptor}.
diff --git a/src/network/socket/qlocalsocket.cpp b/src/network/socket/qlocalsocket.cpp
index 60e753e2e2..ab3fcecf66 100644
--- a/src/network/socket/qlocalsocket.cpp
+++ b/src/network/socket/qlocalsocket.cpp
@@ -135,7 +135,7 @@ QT_BEGIN_NAMESPACE
\l{https://msdn.microsoft.com/en-us/library/windows/desktop/ms740522(v=vs.85).aspx}
{Winsock 2 Socket Handle}.
- \li With WinRT and on INTEGRITY, the returned value is the
+ \li On INTEGRITY, the returned value is the
QTcpSocket socket descriptor and the type is defined by
\l{QTcpSocket::socketDescriptor}{socketDescriptor}.
diff --git a/src/network/socket/qnativesocketengine.cpp b/src/network/socket/qnativesocketengine.cpp
index ad625b758e..6667a6b097 100644
--- a/src/network/socket/qnativesocketengine.cpp
+++ b/src/network/socket/qnativesocketengine.cpp
@@ -195,7 +195,7 @@ QNativeSocketEnginePrivate::QNativeSocketEnginePrivate() :
writeNotifier(nullptr),
exceptNotifier(nullptr)
{
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
QSysInfo::machineHostName(); // this initializes ws2_32.dll
#endif
}
diff --git a/src/network/socket/qnativesocketengine_winrt.cpp b/src/network/socket/qnativesocketengine_winrt.cpp
deleted file mode 100644
index 2eb2141fee..0000000000
--- a/src/network/socket/qnativesocketengine_winrt.cpp
+++ /dev/null
@@ -1,1815 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtNetwork module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <qt_windows.h>
-
-#include "qnativesocketengine_winrt_p.h"
-
-#include <qcoreapplication.h>
-#include <qabstracteventdispatcher.h>
-#include <qsocketnotifier.h>
-#include <qdatetime.h>
-#include <qnetworkinterface.h>
-#include <qelapsedtimer.h>
-#include <qthread.h>
-#include <qabstracteventdispatcher.h>
-#include <qfunctions_winrt.h>
-
-#include <private/qthread_p.h>
-#include <private/qabstractsocket_p.h>
-#include <private/qeventdispatcher_winrt_p.h>
-
-#ifndef QT_NO_SSL
-#include <QSslSocket>
-#endif
-
-#include <functional>
-#include <wrl.h>
-#include <windows.foundation.collections.h>
-#include <windows.storage.streams.h>
-#include <windows.networking.h>
-#include <windows.networking.sockets.h>
-#include <robuffer.h>
-
-using namespace Microsoft::WRL;
-using namespace Microsoft::WRL::Wrappers;
-using namespace ABI::Windows::Foundation;
-using namespace ABI::Windows::Foundation::Collections;
-using namespace ABI::Windows::Storage::Streams;
-using namespace ABI::Windows::Networking;
-using namespace ABI::Windows::Networking::Connectivity;
-using namespace ABI::Windows::Networking::Sockets;
-#if _MSC_VER >= 1900
-using namespace ABI::Windows::Security::EnterpriseData;
-#endif
-
-typedef ITypedEventHandler<StreamSocketListener *, StreamSocketListenerConnectionReceivedEventArgs *> ClientConnectedHandler;
-typedef ITypedEventHandler<DatagramSocket *, DatagramSocketMessageReceivedEventArgs *> DatagramReceivedHandler;
-typedef IAsyncOperationWithProgressCompletedHandler<IBuffer *, UINT32> SocketReadCompletedHandler;
-typedef IAsyncOperationWithProgressCompletedHandler<UINT32, UINT32> SocketWriteCompletedHandler;
-typedef IAsyncOperationWithProgress<IBuffer *, UINT32> IAsyncBufferOperation;
-
-QT_BEGIN_NAMESPACE
-
-Q_LOGGING_CATEGORY(lcNetworkSocket, "qt.network.socket");
-Q_LOGGING_CATEGORY(lcNetworkSocketVerbose, "qt.network.socket.verbose");
-
-#if _MSC_VER >= 1900
-static HRESULT qt_winrt_try_create_thread_network_context(QString host, ComPtr<IThreadNetworkContext> &context)
-{
- HRESULT hr;
- ComPtr<IProtectionPolicyManagerStatics> protectionPolicyManager;
-
- hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Security_EnterpriseData_ProtectionPolicyManager).Get(),
- &protectionPolicyManager);
- RETURN_HR_IF_FAILED("Could not access ProtectionPolicyManager statics.");
-
- ComPtr<IHostNameFactory> hostNameFactory;
- hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_HostName).Get(),
- &hostNameFactory);
- RETURN_HR_IF_FAILED("Could not access HostName factory.");
-
- ComPtr<IHostName> hostName;
- HStringReference hostRef(reinterpret_cast<LPCWSTR>(host.utf16()), host.length());
- hr = hostNameFactory->CreateHostName(hostRef.Get(), &hostName);
- RETURN_HR_IF_FAILED("Could not create hostname.");
-
- ComPtr<IAsyncOperation<HSTRING>> op;
- hr = protectionPolicyManager->GetPrimaryManagedIdentityForNetworkEndpointAsync(hostName.Get(), &op);
- RETURN_HR_IF_FAILED("Could not get identity operation.");
-
- HSTRING hIdentity;
- hr = QWinRTFunctions::await(op, &hIdentity);
- RETURN_HR_IF_FAILED("Could not wait for identity operation.");
-
- // Implies there is no need for a network context for this address
- if (hIdentity == nullptr)
- return S_OK;
-
- hr = protectionPolicyManager->CreateCurrentThreadNetworkContext(hIdentity, &context);
- RETURN_HR_IF_FAILED("Could not create thread network context");
-
- return S_OK;
-}
-#endif // _MSC_VER >= 1900
-
-typedef QHash<qintptr, IStreamSocket *> TcpSocketHash;
-
-struct SocketHandler
-{
- SocketHandler() : socketCount(0) {}
- qintptr socketCount;
- TcpSocketHash pendingTcpSockets;
-};
-
-Q_GLOBAL_STATIC(SocketHandler, gSocketHandler)
-
-struct SocketGlobal
-{
- SocketGlobal()
- {
- HRESULT hr;
- hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Storage_Streams_Buffer).Get(),
- &bufferFactory);
- Q_ASSERT_SUCCEEDED(hr);
- }
-
- ComPtr<IBufferFactory> bufferFactory;
-};
-Q_GLOBAL_STATIC(SocketGlobal, g)
-
-#define READ_BUFFER_SIZE 65536
-
-static inline QString qt_QStringFromHString(const HString &string)
-{
- UINT32 length;
- PCWSTR rawString = string.GetRawBuffer(&length);
- return QString::fromWCharArray(rawString, length);
-}
-
-class SocketEngineWorker : public QObject
-{
- Q_OBJECT
-public:
- SocketEngineWorker(QNativeSocketEnginePrivate *engine)
- : enginePrivate(engine)
- {
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << engine;
- }
-
- ~SocketEngineWorker()
- {
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO;
- if (Q_UNLIKELY(initialReadOp)) {
- qCDebug(lcNetworkSocket) << Q_FUNC_INFO << "Closing initial read operation";
- ComPtr<IAsyncInfo> info;
- HRESULT hr = initialReadOp.As(&info);
- Q_ASSERT_SUCCEEDED(hr);
- if (info) {
- hr = info->Cancel();
- Q_ASSERT_SUCCEEDED(hr);
- hr = info->Close();
- Q_ASSERT_SUCCEEDED(hr);
- }
- }
-
- if (readOp) {
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << "Closing read operation";
- ComPtr<IAsyncInfo> info;
- HRESULT hr = readOp.As(&info);
- Q_ASSERT_SUCCEEDED(hr);
- if (info) {
- hr = info->Cancel();
- Q_ASSERT_SUCCEEDED(hr);
- hr = info->Close();
- Q_ASSERT_SUCCEEDED(hr);
- }
- }
-
- if (connectOp) {
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << "Closing connect operation";
- ComPtr<IAsyncInfo> info;
- HRESULT hr = connectOp.As(&info);
- Q_ASSERT_SUCCEEDED(hr);
- if (info) {
- hr = info->Cancel();
- Q_ASSERT_SUCCEEDED(hr);
- hr = info->Close();
- Q_ASSERT_SUCCEEDED(hr);
- }
- }
- }
-
-signals:
- void connectOpFinished(bool success, QAbstractSocket::SocketError error, WinRTSocketEngine::ErrorString errorString);
- void newDataReceived();
- void socketErrorOccured(QAbstractSocket::SocketError error);
-
-public:
- void startReading()
- {
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO;
- ComPtr<IBuffer> buffer;
- HRESULT hr = g->bufferFactory->Create(READ_BUFFER_SIZE, &buffer);
- Q_ASSERT_SUCCEEDED(hr);
- ComPtr<IInputStream> stream;
- hr = tcpSocket->get_InputStream(&stream);
- Q_ASSERT_SUCCEEDED(hr);
- hr = stream->ReadAsync(buffer.Get(), READ_BUFFER_SIZE, InputStreamOptions_Partial, initialReadOp.GetAddressOf());
- Q_ASSERT_SUCCEEDED(hr);
- enginePrivate->socketState = QAbstractSocket::ConnectedState;
- hr = initialReadOp->put_Completed(Callback<SocketReadCompletedHandler>(this, &SocketEngineWorker::onReadyRead).Get());
- Q_ASSERT_SUCCEEDED(hr);
- }
-
- HRESULT onConnectOpFinished(IAsyncAction *action, AsyncStatus)
- {
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO;
- HRESULT hr = action->GetResults();
- if (FAILED(hr)) {
- if (hr == HRESULT_FROM_WIN32(WSAETIMEDOUT)) {
- emit connectOpFinished(false, QAbstractSocket::NetworkError, WinRTSocketEngine::ConnectionTimeOutErrorString);
- return S_OK;
- } else if (hr == HRESULT_FROM_WIN32(WSAEHOSTUNREACH)) {
- emit connectOpFinished(false, QAbstractSocket::HostNotFoundError, WinRTSocketEngine::HostUnreachableErrorString);
- return S_OK;
- } else if (hr == HRESULT_FROM_WIN32(WSAECONNREFUSED)) {
- emit connectOpFinished(false, QAbstractSocket::ConnectionRefusedError, WinRTSocketEngine::ConnectionRefusedErrorString);
- return S_OK;
- } else {
- emit connectOpFinished(false, QAbstractSocket::UnknownSocketError, WinRTSocketEngine::UnknownSocketErrorString);
- return S_OK;
- }
- }
-
- // The callback might be triggered several times if we do not cancel/reset it here
- if (connectOp) {
- ComPtr<IAsyncInfo> info;
- hr = connectOp.As(&info);
- Q_ASSERT_SUCCEEDED(hr);
- if (info) {
- hr = info->Cancel();
- Q_ASSERT_SUCCEEDED(hr);
- hr = info->Close();
- Q_ASSERT_SUCCEEDED(hr);
- }
- hr = connectOp.Reset();
- Q_ASSERT_SUCCEEDED(hr);
- }
-
- emit connectOpFinished(true, QAbstractSocket::UnknownSocketError, WinRTSocketEngine::UnknownSocketErrorString);
- return S_OK;
- }
-
- HRESULT OnNewDatagramReceived(IDatagramSocket *, IDatagramSocketMessageReceivedEventArgs *args)
- {
- qCDebug(lcNetworkSocketVerbose) << this << Q_FUNC_INFO;
- WinRtDatagram datagram;
- QHostAddress returnAddress;
- ComPtr<IHostName> remoteHost;
- HRESULT hr = args->get_RemoteAddress(&remoteHost);
- RETURN_OK_IF_FAILED("Could not obtain remote host");
- HString remoteHostString;
- hr = remoteHost->get_CanonicalName(remoteHostString.GetAddressOf());
- RETURN_OK_IF_FAILED("Could not obtain remote host's canonical name");
- returnAddress.setAddress(qt_QStringFromHString(remoteHostString));
- datagram.header.senderAddress = returnAddress;
- HString remotePort;
- hr = args->get_RemotePort(remotePort.GetAddressOf());
- RETURN_OK_IF_FAILED("Could not obtain remote port");
- datagram.header.senderPort = qt_QStringFromHString(remotePort).toInt();
-
- ComPtr<IDataReader> reader;
- hr = args->GetDataReader(&reader);
- RETURN_OK_IF_FAILED("Could not obtain data reader");
- quint32 length;
- hr = reader->get_UnconsumedBufferLength(&length);
- RETURN_OK_IF_FAILED("Could not obtain unconsumed buffer length");
- datagram.data.resize(length);
- hr = reader->ReadBytes(length, reinterpret_cast<BYTE *>(datagram.data.data()));
- RETURN_OK_IF_FAILED("Could not read datagram");
-
- QMutexLocker locker(&mutex);
- // Notify the engine about new datagrams being present at the next event loop iteration
- if (emitDataReceived)
- emit newDataReceived();
- pendingDatagrams << datagram;
-
- return S_OK;
- }
-
- HRESULT onReadyRead(IAsyncBufferOperation *asyncInfo, AsyncStatus status)
- {
- qCDebug(lcNetworkSocketVerbose) << this << Q_FUNC_INFO;
- if (asyncInfo == initialReadOp.Get()) {
- initialReadOp.Reset();
- } else if (asyncInfo == readOp.Get()) {
- readOp.Reset();
- } else {
- Q_ASSERT(false);
- }
-
- // A read in UnconnectedState will close the socket and return -1 and thus tell the caller,
- // that the connection was closed. The socket cannot be closed here, as the subsequent read
- // might fail then.
- if (status == Error || status == Canceled) {
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << "Remote host closed";
- emit socketErrorOccured(QAbstractSocket::RemoteHostClosedError);
- return S_OK;
- }
-
- ComPtr<IBuffer> buffer;
- HRESULT hr = asyncInfo->GetResults(&buffer);
- if (FAILED(hr)) {
- qErrnoWarning(hr, "Failed to get read results buffer");
- emit socketErrorOccured(QAbstractSocket::UnknownSocketError);
- return S_OK;
- }
-
- UINT32 bufferLength;
- hr = buffer->get_Length(&bufferLength);
- if (FAILED(hr)) {
- qErrnoWarning(hr, "Failed to get buffer length");
- emit socketErrorOccured(QAbstractSocket::UnknownSocketError);
- return S_OK;
- }
- // A zero sized buffer length signals, that the remote host closed the connection. The socket
- // cannot be closed though, as the following read might have socket descriptor -1 and thus and
- // the closing of the socket won't be communicated to the caller. So only the error is set. The
- // actual socket close happens inside of read.
- if (!bufferLength) {
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << "Remote host closed";
- emit socketErrorOccured(QAbstractSocket::RemoteHostClosedError);
- return S_OK;
- }
-
- ComPtr<Windows::Storage::Streams::IBufferByteAccess> byteArrayAccess;
- hr = buffer.As(&byteArrayAccess);
- if (FAILED(hr)) {
- qErrnoWarning(hr, "Failed to get cast buffer");
- emit socketErrorOccured(QAbstractSocket::UnknownSocketError);
- return S_OK;
- }
- byte *data;
- hr = byteArrayAccess->Buffer(&data);
- if (FAILED(hr)) {
- qErrnoWarning(hr, "Failed to access buffer data");
- emit socketErrorOccured(QAbstractSocket::UnknownSocketError);
- return S_OK;
- }
-
- QByteArray newData(reinterpret_cast<const char*>(data), qint64(bufferLength));
-
- QMutexLocker readLocker(&mutex);
- emit newDataReceived();
- pendingData.append(newData);
- readLocker.unlock();
-
- hr = QEventDispatcherWinRT::runOnXamlThread([buffer, this]() {
- UINT32 readBufferLength;
- ComPtr<IInputStream> stream;
- HRESULT hr = tcpSocket->get_InputStream(&stream);
- if (FAILED(hr)) {
- qErrnoWarning(hr, "Failed to obtain input stream");
- emit socketErrorOccured(QAbstractSocket::UnknownSocketError);
- return S_OK;
- }
-
- // Reuse the stream buffer
- hr = buffer->get_Capacity(&readBufferLength);
- if (FAILED(hr)) {
- qErrnoWarning(hr, "Failed to get buffer capacity");
- emit socketErrorOccured(QAbstractSocket::UnknownSocketError);
- return S_OK;
- }
- hr = buffer->put_Length(0);
- if (FAILED(hr)) {
- qErrnoWarning(hr, "Failed to set buffer length");
- emit socketErrorOccured(QAbstractSocket::UnknownSocketError);
- return S_OK;
- }
-
- hr = stream->ReadAsync(buffer.Get(), readBufferLength, InputStreamOptions_Partial, &readOp);
- if (FAILED(hr)) {
- qErrnoWarning(hr, "onReadyRead(): Could not read into socket stream buffer.");
- emit socketErrorOccured(QAbstractSocket::UnknownSocketError);
- return S_OK;
- }
- hr = readOp->put_Completed(Callback<SocketReadCompletedHandler>(this, &SocketEngineWorker::onReadyRead).Get());
- if (FAILED(hr)) {
- qErrnoWarning(hr, "onReadyRead(): Failed to set socket read callback.");
- emit socketErrorOccured(QAbstractSocket::UnknownSocketError);
- return S_OK;
- }
- return S_OK;
- });
- Q_ASSERT_SUCCEEDED(hr);
- return S_OK;
- }
-
- void setTcpSocket(ComPtr<IStreamSocket> socket) { tcpSocket = socket; }
-
-private:
- friend class QNativeSocketEngine;
- ComPtr<IStreamSocket> tcpSocket;
-
- QList<WinRtDatagram> pendingDatagrams;
- bool emitDataReceived = true;
- QByteArray pendingData;
-
- // Protects pendingData/pendingDatagrams which are accessed from native callbacks
- QMutex mutex;
-
- ComPtr<IAsyncAction> connectOp;
- ComPtr<IAsyncOperationWithProgress<IBuffer *, UINT32>> initialReadOp;
- ComPtr<IAsyncOperationWithProgress<IBuffer *, UINT32>> readOp;
-
- QNativeSocketEnginePrivate *enginePrivate;
-};
-
-static QByteArray socketDescription(const QAbstractSocketEngine *s)
-{
- QByteArray result;
- if (const QObject *o = s->parent()) {
- const QString name = o->objectName();
- if (!name.isEmpty()) {
- result += '"';
- result += name.toLocal8Bit();
- result += "\"/";
- }
- result += o->metaObject()->className();
- }
- return result;
-}
-
-// Common constructs
-#define Q_CHECK_VALID_SOCKETLAYER(function, returnValue) do { \
- if (!isValid()) { \
- qWarning(""#function" was called on an uninitialized socket device"); \
- return returnValue; \
- } } while (0)
-#define Q_CHECK_INVALID_SOCKETLAYER(function, returnValue) do { \
- if (isValid()) { \
- qWarning(""#function" was called on an already initialized socket device"); \
- return returnValue; \
- } } while (0)
-#define Q_CHECK_STATE(function, checkState, returnValue) do { \
- if (d->socketState != (checkState)) { \
- qWarning(""#function" was not called in "#checkState); \
- return (returnValue); \
- } } while (0)
-#define Q_CHECK_NOT_STATE(function, checkState, returnValue) do { \
- if (d->socketState == (checkState)) { \
- qWarning(""#function" was called in "#checkState); \
- return (returnValue); \
- } } while (0)
-#define Q_CHECK_STATES(function, state1, state2, returnValue) do { \
- if (d->socketState != (state1) && d->socketState != (state2)) { \
- qWarning(""#function" was called" \
- " not in "#state1" or "#state2); \
- return (returnValue); \
- } } while (0)
-#define Q_CHECK_STATES3(function, state1, state2, state3, returnValue) do { \
- if (d->socketState != (state1) && d->socketState != (state2) && d->socketState != (state3)) { \
- qWarning(""#function" was called" \
- " not in "#state1", "#state2" or "#state3); \
- return (returnValue); \
- } } while (0)
-#define Q_CHECK_TYPE(function, type, returnValue) do { \
- if (d->socketType != (type)) { \
- qWarning(#function" was called by a" \
- " socket other than "#type""); \
- return (returnValue); \
- } } while (0)
-#define Q_TR(a) QT_TRANSLATE_NOOP(QNativeSocketEngine, a)
-
-template <typename T>
-static AsyncStatus opStatus(const ComPtr<T> &op)
-{
- ComPtr<IAsyncInfo> info;
- HRESULT hr = op.As(&info);
- Q_ASSERT_SUCCEEDED(hr);
- AsyncStatus status;
- hr = info->get_Status(&status);
- Q_ASSERT_SUCCEEDED(hr);
- return status;
-}
-
-static qint64 writeIOStream(ComPtr<IOutputStream> stream, const char *data, qint64 len)
-{
- qCDebug(lcNetworkSocket) << Q_FUNC_INFO << data << len;
- ComPtr<IBuffer> buffer;
- HRESULT hr = g->bufferFactory->Create(len, &buffer);
- Q_ASSERT_SUCCEEDED(hr);
- hr = buffer->put_Length(len);
- Q_ASSERT_SUCCEEDED(hr);
- ComPtr<Windows::Storage::Streams::IBufferByteAccess> byteArrayAccess;
- hr = buffer.As(&byteArrayAccess);
- Q_ASSERT_SUCCEEDED(hr);
- byte *bytes;
- hr = byteArrayAccess->Buffer(&bytes);
- Q_ASSERT_SUCCEEDED(hr);
- memcpy(bytes, data, len);
- ComPtr<IAsyncOperationWithProgress<UINT32, UINT32>> op;
- hr = stream->WriteAsync(buffer.Get(), &op);
- RETURN_IF_FAILED("Failed to write to stream", return -1);
- UINT32 bytesWritten;
- hr = QWinRTFunctions::await(op, &bytesWritten);
- RETURN_IF_FAILED("Failed to write to stream", return -1);
- return bytesWritten;
-}
-
-QNativeSocketEngine::QNativeSocketEngine(QObject *parent)
- : QAbstractSocketEngine(*new QNativeSocketEnginePrivate(), parent)
-{
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << parent;
- qRegisterMetaType<WinRtDatagram>();
- qRegisterMetaType<WinRTSocketEngine::ErrorString>();
- Q_D(QNativeSocketEngine);
-#ifndef QT_NO_SSL
- if (parent)
- d->sslSocket = qobject_cast<QSslSocket *>(parent->parent());
-#endif
-
- connect(this, &QNativeSocketEngine::connectionReady,
- this, &QNativeSocketEngine::connectionNotification, Qt::QueuedConnection);
- connect(this, &QNativeSocketEngine::readReady,
- this, &QNativeSocketEngine::processReadReady, Qt::QueuedConnection);
- connect(this, &QNativeSocketEngine::writeReady,
- this, &QNativeSocketEngine::writeNotification, Qt::QueuedConnection);
- connect(d->worker, &SocketEngineWorker::connectOpFinished,
- this, &QNativeSocketEngine::handleConnectOpFinished, Qt::QueuedConnection);
- connect(d->worker, &SocketEngineWorker::newDataReceived, this, &QNativeSocketEngine::handleNewData, Qt::QueuedConnection);
- connect(d->worker, &SocketEngineWorker::socketErrorOccured,
- this, &QNativeSocketEngine::handleTcpError, Qt::QueuedConnection);
-}
-
-QNativeSocketEngine::~QNativeSocketEngine()
-{
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO;
- close();
-}
-
-bool QNativeSocketEngine::initialize(QAbstractSocket::SocketType type, QAbstractSocket::NetworkLayerProtocol protocol)
-{
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << type << protocol;
- Q_D(QNativeSocketEngine);
- if (isValid())
- close();
-
- // Create the socket
- if (!d->createNewSocket(type, protocol))
- return false;
-
- if (type == QAbstractSocket::UdpSocket) {
- // Set the broadcasting flag if it's a UDP socket.
- if (!setOption(BroadcastSocketOption, 1)) {
- d->setError(QAbstractSocket::UnsupportedSocketOperationError,
- WinRTSocketEngine::BroadcastingInitFailedErrorString);
- close();
- return false;
- }
-
- // Set some extra flags that are interesting to us, but accept failure
- setOption(ReceivePacketInformation, 1);
- setOption(ReceiveHopLimit, 1);
- }
-
-
- // Make sure we receive out-of-band data
- if (type == QAbstractSocket::TcpSocket
- && !setOption(ReceiveOutOfBandData, 1)) {
- qWarning("QNativeSocketEngine::initialize unable to inline out-of-band data");
- }
-
-
- d->socketType = type;
- d->socketProtocol = protocol;
- return true;
-}
-
-bool QNativeSocketEngine::initialize(qintptr socketDescriptor, QAbstractSocket::SocketState socketState)
-{
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << socketDescriptor << socketState;
- Q_D(QNativeSocketEngine);
-
- if (isValid())
- close();
-
- // Currently, only TCP sockets are initialized this way.
- IStreamSocket *socket = gSocketHandler->pendingTcpSockets.take(socketDescriptor);
- d->socketDescriptor = qintptr(socket);
- d->socketType = QAbstractSocket::TcpSocket;
-
- if (!d->socketDescriptor || !d->fetchConnectionParameters()) {
- d->setError(QAbstractSocket::UnsupportedSocketOperationError,
- WinRTSocketEngine::InvalidSocketErrorString);
- d->socketDescriptor = -1;
- return false;
- }
-
- // Start processing incoming data
- if (d->socketType == QAbstractSocket::TcpSocket) {
- HRESULT hr = QEventDispatcherWinRT::runOnXamlThread([d, socket, this]() {
- d->worker->setTcpSocket(socket);
- d->worker->startReading();
- return S_OK;
- });
- if (FAILED(hr))
- return false;
- } else {
- d->socketState = socketState;
- }
-
- return true;
-}
-
-qintptr QNativeSocketEngine::socketDescriptor() const
-{
- Q_D(const QNativeSocketEngine);
- return d->socketDescriptor;
-}
-
-bool QNativeSocketEngine::isValid() const
-{
- Q_D(const QNativeSocketEngine);
- return d->socketDescriptor != -1;
-}
-
-bool QNativeSocketEngine::connectToHost(const QHostAddress &address, quint16 port)
-{
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << address << port;
- Q_D(QNativeSocketEngine);
- Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::connectToHost(), false);
- Q_CHECK_STATES3(QNativeSocketEngine::connectToHost(), QAbstractSocket::BoundState,
- QAbstractSocket::UnconnectedState, QAbstractSocket::ConnectingState, false);
- const QString addressString = address.toString();
- return connectToHostByName(addressString, port);
-}
-
-bool QNativeSocketEngine::connectToHostByName(const QString &name, quint16 port)
-{
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << name << port;
- Q_D(QNativeSocketEngine);
- Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::connectToHostByName(), false);
- Q_CHECK_STATES3(QNativeSocketEngine::connectToHostByName(), QAbstractSocket::BoundState,
- QAbstractSocket::UnconnectedState, QAbstractSocket::ConnectingState, false);
- HRESULT hr;
-
-#if _MSC_VER >= 1900
- ComPtr<IThreadNetworkContext> networkContext;
- if (!qEnvironmentVariableIsEmpty("QT_WINRT_USE_THREAD_NETWORK_CONTEXT")) {
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << "Creating network context";
- hr = qt_winrt_try_create_thread_network_context(name, networkContext);
- if (FAILED(hr)) {
- setError(QAbstractSocket::ConnectionRefusedError, QLatin1String("Could not create thread network context."));
- d->socketState = QAbstractSocket::ConnectedState;
- return true;
- }
- }
-#endif // _MSC_VER >= 1900
-
- HStringReference hostNameRef(reinterpret_cast<LPCWSTR>(name.utf16()));
- ComPtr<IHostNameFactory> hostNameFactory;
- hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_HostName).Get(),
- &hostNameFactory);
- Q_ASSERT_SUCCEEDED(hr);
- ComPtr<IHostName> remoteHost;
- hr = hostNameFactory->CreateHostName(hostNameRef.Get(), &remoteHost);
- RETURN_FALSE_IF_FAILED("QNativeSocketEngine::connectToHostByName: Could not create hostname.");
-
- const QString portString = QString::number(port);
- HStringReference portReference(reinterpret_cast<LPCWSTR>(portString.utf16()));
- if (d->socketType == QAbstractSocket::TcpSocket)
- hr = d->tcpSocket()->ConnectAsync(remoteHost.Get(), portReference.Get(), &d->worker->connectOp);
- else if (d->socketType == QAbstractSocket::UdpSocket)
- hr = d->udpSocket()->ConnectAsync(remoteHost.Get(), portReference.Get(), &d->worker->connectOp);
- if (hr == E_ACCESSDENIED) {
- qErrnoWarning(hr, "QNativeSocketEngine::connectToHostByName: Unable to connect to host (%s:%hu/%s). "
- "Please check your manifest capabilities.",
- qPrintable(name), port, socketDescription(this).constData());
- return false;
- }
- Q_ASSERT_SUCCEEDED(hr);
-
-#if _MSC_VER >= 1900
- if (networkContext != nullptr) {
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << "Closing network context";
- ComPtr<IClosable> networkContextCloser;
- hr = networkContext.As(&networkContextCloser);
- Q_ASSERT_SUCCEEDED(hr);
- hr = networkContextCloser->Close();
- Q_ASSERT_SUCCEEDED(hr);
- }
-#endif // _MSC_VER >= 1900
-
- d->socketState = QAbstractSocket::ConnectingState;
- QEventDispatcherWinRT::runOnXamlThread([d, &hr]() {
- hr = d->worker->connectOp->put_Completed(Callback<IAsyncActionCompletedHandler>(
- d->worker, &SocketEngineWorker::onConnectOpFinished).Get());
- RETURN_OK_IF_FAILED("connectToHostByName: Could not register \"connectOp\" callback");
- return S_OK;
- });
- if (FAILED(hr))
- return false;
-
- return d->socketState == QAbstractSocket::ConnectedState;
-}
-
-bool QNativeSocketEngine::bind(const QHostAddress &address, quint16 port)
-{
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << address << port;
- Q_D(QNativeSocketEngine);
- Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::bind(), false);
- Q_CHECK_STATE(QNativeSocketEngine::bind(), QAbstractSocket::UnconnectedState, false);
-
- HRESULT hr;
- // runOnXamlThread may only return S_OK (will assert otherwise) so no need to check its result.
- // hr is set inside the lambda though. If an error occurred hr will point that out.
- bool specificErrorSet = false;
- QEventDispatcherWinRT::runOnXamlThread([address, d, &hr, port, &specificErrorSet, this]() {
- ComPtr<IHostName> hostAddress;
-
- if (address != QHostAddress::Any && address != QHostAddress::AnyIPv4 && address != QHostAddress::AnyIPv6) {
- ComPtr<IHostNameFactory> hostNameFactory;
- hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_HostName).Get(),
- &hostNameFactory);
- RETURN_OK_IF_FAILED("QNativeSocketEngine::bind: Could not obtain hostname factory");
- const QString addressString = address.toString();
- HStringReference addressRef(reinterpret_cast<LPCWSTR>(addressString.utf16()));
- hr = hostNameFactory->CreateHostName(addressRef.Get(), &hostAddress);
- RETURN_OK_IF_FAILED("QNativeSocketEngine::bind: Could not create hostname.");
- }
-
- QString portQString = port ? QString::number(port) : QString();
- HStringReference portString(reinterpret_cast<LPCWSTR>(portQString.utf16()));
-
- ComPtr<IAsyncAction> op;
- if (d->socketType == QAbstractSocket::TcpSocket) {
- if (!d->tcpListener) {
- hr = RoActivateInstance(HString::MakeReference(RuntimeClass_Windows_Networking_Sockets_StreamSocketListener).Get(),
- &d->tcpListener);
- RETURN_OK_IF_FAILED("QNativeSocketEngine::bind: Could not create tcp listener");
- }
-
- hr = d->tcpListener->add_ConnectionReceived(
- Callback<ClientConnectedHandler>(d, &QNativeSocketEnginePrivate::handleClientConnection).Get(),
- &d->connectionToken);
- RETURN_OK_IF_FAILED("QNativeSocketEngine::bind: Could not register client connection callback");
- hr = d->tcpListener->BindEndpointAsync(hostAddress.Get(), portString.Get(), &op);
- } else if (d->socketType == QAbstractSocket::UdpSocket) {
- hr = d->udpSocket()->BindEndpointAsync(hostAddress.Get(), portString.Get(), &op);
- }
- if (hr == E_ACCESSDENIED) {
- qErrnoWarning(hr, "Unable to bind socket (%s:%hu/%s). Please check your manifest capabilities.",
- qPrintable(address.toString()), port, socketDescription(this).constData());
- d->setError(QAbstractSocket::SocketAccessError,
- WinRTSocketEngine::AccessErrorString);
- d->socketState = QAbstractSocket::UnconnectedState;
- specificErrorSet = true;
- return S_OK;
- }
- RETURN_OK_IF_FAILED("QNativeSocketEngine::bind: Unable to bind socket");
-
- hr = QWinRTFunctions::await(op);
- if (hr == 0x80072741) { // The requested address is not valid in its context
- d->setError(QAbstractSocket::SocketAddressNotAvailableError,
- WinRTSocketEngine::AddressNotAvailableErrorString);
- d->socketState = QAbstractSocket::UnconnectedState;
- specificErrorSet = true;
- return S_OK;
- // Only one usage of each socket address (protocol/network address/port) is normally permitted
- } else if (hr == 0x80072740) {
- d->setError(QAbstractSocket::AddressInUseError,
- WinRTSocketEngine::AddressInuseErrorString);
- d->socketState = QAbstractSocket::UnconnectedState;
- specificErrorSet = true;
- return S_OK;
- }
- RETURN_OK_IF_FAILED("QNativeSocketEngine::bind: Could not wait for bind to finish");
- return S_OK;
- });
- if (FAILED(hr)) {
- if (!specificErrorSet) {
- d->setError(QAbstractSocket::UnknownSocketError,
- WinRTSocketEngine::UnknownSocketErrorString);
- d->socketState = QAbstractSocket::UnconnectedState;
- }
- return false;
- }
-
- d->socketState = QAbstractSocket::BoundState;
- return d->fetchConnectionParameters();
-}
-
-bool QNativeSocketEngine::listen()
-{
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO;
- Q_D(QNativeSocketEngine);
- Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::listen(), false);
- Q_CHECK_STATE(QNativeSocketEngine::listen(), QAbstractSocket::BoundState, false);
-#if QT_CONFIG(sctp)
- Q_CHECK_TYPES(QNativeSocketEngine::listen(), QAbstractSocket::TcpSocket,
- QAbstractSocket::SctpSocket, false);
-#else
- Q_CHECK_TYPE(QNativeSocketEngine::listen(), QAbstractSocket::TcpSocket, false);
-#endif
-
- if (d->tcpListener && d->socketDescriptor != -1) {
- d->socketState = QAbstractSocket::ListeningState;
- return true;
- }
- return false;
-}
-
-int QNativeSocketEngine::accept()
-{
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO;
- Q_D(QNativeSocketEngine);
- Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::accept(), -1);
- Q_CHECK_STATE(QNativeSocketEngine::accept(), QAbstractSocket::ListeningState, -1);
-#if QT_CONFIG(sctp)
- Q_CHECK_TYPES(QNativeSocketEngine::accept(), QAbstractSocket::TcpSocket,
- QAbstractSocket::SctpSocket, -1);
-#else
- Q_CHECK_TYPE(QNativeSocketEngine::accept(), QAbstractSocket::TcpSocket, -1);
-#endif
-
- if (d->socketDescriptor == -1 || d->pendingConnections.isEmpty()) {
- d->setError(QAbstractSocket::TemporaryError, WinRTSocketEngine::TemporaryErrorString);
- return -1;
- }
-
- if (d->socketType == QAbstractSocket::TcpSocket) {
- IStreamSocket *socket = d->pendingConnections.takeFirst();
-
- SocketHandler *handler = gSocketHandler();
- handler->pendingTcpSockets.insert(++handler->socketCount, socket);
- return handler->socketCount;
- }
-
- return -1;
-}
-
-void QNativeSocketEngine::close()
-{
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO;
- Q_D(QNativeSocketEngine);
-
- if (d->closingDown)
- return;
-
- if (d->pendingReadNotification) {
- // We use QPointer here to see if this QNativeSocketEngine was deleted as a result of
- // finishing and cleaning up a network request when calling "processReadReady".
- QPointer<QNativeSocketEngine> alive(this);
- processReadReady();
- if (alive.isNull())
- return;
- }
-
- d->closingDown = true;
-
- d->notifyOnRead = false;
- d->notifyOnWrite = false;
- d->notifyOnException = false;
- d->emitReadReady = false;
-
- HRESULT hr;
- if (d->socketType == QAbstractSocket::TcpSocket) {
- hr = QEventDispatcherWinRT::runOnXamlThread([d]() {
- HRESULT hr;
- // To close the connection properly (not with a hard reset) all pending read operation have to
- // be finished or cancelled. The API isn't available on Windows 8.1 though.
- ComPtr<IStreamSocket3> socket3;
- hr = d->tcpSocket()->QueryInterface(IID_PPV_ARGS(&socket3));
- Q_ASSERT_SUCCEEDED(hr);
-
- ComPtr<IAsyncAction> action;
- hr = socket3->CancelIOAsync(&action);
- Q_ASSERT_SUCCEEDED(hr);
- hr = QWinRTFunctions::await(action, QWinRTFunctions::YieldThread, 5000);
- // If there is no pending IO (no read established before) the function will fail with
- // "function was called at an unexpected time" which is fine.
- // Timeout is fine as well. The result will be the socket being hard reset instead of
- // being closed gracefully
- if (hr != E_ILLEGAL_METHOD_CALL && hr != ERROR_TIMEOUT)
- Q_ASSERT_SUCCEEDED(hr);
- return S_OK;
- });
- Q_ASSERT_SUCCEEDED(hr);
- }
-
- if (d->socketDescriptor != -1) {
- ComPtr<IClosable> socket;
- if (d->socketType == QAbstractSocket::TcpSocket) {
- hr = d->tcpSocket()->QueryInterface(IID_PPV_ARGS(&socket));
- Q_ASSERT_SUCCEEDED(hr);
- hr = d->tcpSocket()->Release();
- Q_ASSERT_SUCCEEDED(hr);
- } else if (d->socketType == QAbstractSocket::UdpSocket) {
- hr = d->udpSocket()->QueryInterface(IID_PPV_ARGS(&socket));
- Q_ASSERT_SUCCEEDED(hr);
- hr = d->udpSocket()->Release();
- Q_ASSERT_SUCCEEDED(hr);
- }
-
- if (socket) {
- hr = socket->Close();
- Q_ASSERT_SUCCEEDED(hr);
- }
- d->socketDescriptor = -1;
- }
- d->socketState = QAbstractSocket::UnconnectedState;
- d->hasSetSocketError = false;
- d->localPort = 0;
- d->localAddress.clear();
- d->peerPort = 0;
- d->peerAddress.clear();
- d->inboundStreamCount = d->outboundStreamCount = 0;
-}
-
-bool QNativeSocketEngine::joinMulticastGroup(const QHostAddress &groupAddress, const QNetworkInterface &iface)
-{
- Q_D(QNativeSocketEngine);
- Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::joinMulticastGroup(), false);
- Q_CHECK_STATE(QNativeSocketEngine::joinMulticastGroup(), QAbstractSocket::BoundState, false);
- Q_CHECK_TYPE(QNativeSocketEngine::joinMulticastGroup(), QAbstractSocket::UdpSocket, false);
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << groupAddress << iface;
- Q_UNIMPLEMENTED();
- return false;
-}
-
-bool QNativeSocketEngine::leaveMulticastGroup(const QHostAddress &groupAddress, const QNetworkInterface &iface)
-{
- Q_D(QNativeSocketEngine);
- Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::leaveMulticastGroup(), false);
- Q_CHECK_STATE(QNativeSocketEngine::leaveMulticastGroup(), QAbstractSocket::BoundState, false);
- Q_CHECK_TYPE(QNativeSocketEngine::leaveMulticastGroup(), QAbstractSocket::UdpSocket, false);
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << groupAddress << iface;
- Q_UNIMPLEMENTED();
- return false;
-}
-
-QNetworkInterface QNativeSocketEngine::multicastInterface() const
-{
- Q_D(const QNativeSocketEngine);
- Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::multicastInterface(), QNetworkInterface());
- Q_CHECK_TYPE(QNativeSocketEngine::multicastInterface(), QAbstractSocket::UdpSocket, QNetworkInterface());
- Q_UNIMPLEMENTED();
- return QNetworkInterface();
-}
-
-bool QNativeSocketEngine::setMulticastInterface(const QNetworkInterface &iface)
-{
- Q_D(QNativeSocketEngine);
- Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::setMulticastInterface(), false);
- Q_CHECK_TYPE(QNativeSocketEngine::setMulticastInterface(), QAbstractSocket::UdpSocket, false);
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << iface;
- Q_UNIMPLEMENTED();
- return false;
-}
-
-qint64 QNativeSocketEngine::bytesAvailable() const
-{
- Q_D(const QNativeSocketEngine);
- Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::bytesAvailable(), -1);
- Q_CHECK_NOT_STATE(QNativeSocketEngine::bytesAvailable(), QAbstractSocket::UnconnectedState, -1);
- if (d->socketType != QAbstractSocket::TcpSocket)
- return -1;
-
- QMutexLocker locker(&d->worker->mutex);
- const qint64 bytesAvailable = d->worker->pendingData.length();
-
- qCDebug(lcNetworkSocketVerbose) << this << Q_FUNC_INFO << bytesAvailable;
- return bytesAvailable;
-}
-
-qint64 QNativeSocketEngine::read(char *data, qint64 maxlen)
-{
- qCDebug(lcNetworkSocketVerbose) << this << Q_FUNC_INFO << maxlen;
- Q_D(QNativeSocketEngine);
- Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::read(), -1);
- Q_CHECK_STATES(QNativeSocketEngine::read(), QAbstractSocket::ConnectedState, QAbstractSocket::BoundState, -1);
- if (d->socketType != QAbstractSocket::TcpSocket)
- return -1;
-
- // There will be a read notification when the socket was closed by the remote host. If that
- // happens and there isn't anything left in the buffer, we have to return -1 in order to signal
- // the closing of the socket.
- QMutexLocker mutexLocker(&d->worker->mutex);
- if (d->worker->pendingData.isEmpty() && d->socketState != QAbstractSocket::ConnectedState) {
- close();
- return -1;
- }
-
- QByteArray readData;
- const int copyLength = qMin(maxlen, qint64(d->worker->pendingData.length()));
- if (maxlen >= d->worker->pendingData.length()) {
- qCDebug(lcNetworkSocketVerbose) << this << Q_FUNC_INFO << "Reading full buffer";
- readData = d->worker->pendingData;
- d->worker->pendingData.clear();
- d->emitReadReady = true;
- } else {
- qCDebug(lcNetworkSocketVerbose) << this << Q_FUNC_INFO << "Reading part of the buffer ("
- << copyLength << "of" << d->worker->pendingData.length() << "bytes";
- readData = d->worker->pendingData.left(maxlen);
- d->worker->pendingData.remove(0, maxlen);
- if (d->notifyOnRead) {
- d->pendingReadNotification = true;
- emit readReady();
- }
- }
- mutexLocker.unlock();
-
- memcpy(data, readData, copyLength);
- qCDebug(lcNetworkSocketVerbose) << this << Q_FUNC_INFO << "Read" << copyLength << "bytes";
- return copyLength;
-}
-
-qint64 QNativeSocketEngine::write(const char *data, qint64 len)
-{
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << data << len;
- Q_D(QNativeSocketEngine);
- Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::write(), -1);
- Q_CHECK_STATE(QNativeSocketEngine::write(), QAbstractSocket::ConnectedState, -1);
-
- HRESULT hr = E_FAIL;
- ComPtr<IOutputStream> stream;
- if (d->socketType == QAbstractSocket::TcpSocket)
- hr = d->tcpSocket()->get_OutputStream(&stream);
- else if (d->socketType == QAbstractSocket::UdpSocket)
- hr = d->udpSocket()->get_OutputStream(&stream);
- Q_ASSERT_SUCCEEDED(hr);
-
- qint64 bytesWritten = writeIOStream(stream, data, len);
- if (bytesWritten < 0)
- d->setError(QAbstractSocket::SocketAccessError, WinRTSocketEngine::AccessErrorString);
- else if (bytesWritten > 0 && d->notifyOnWrite)
- emit writeReady();
-
- return bytesWritten;
-}
-
-qint64 QNativeSocketEngine::readDatagram(char *data, qint64 maxlen, QIpPacketHeader *header,
- PacketHeaderOptions)
-{
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << maxlen;
-#ifndef QT_NO_UDPSOCKET
- Q_D(QNativeSocketEngine);
- Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::readDatagram(), -1);
- Q_CHECK_STATES(QNativeSocketEngine::readDatagram(), QAbstractSocket::BoundState,
- QAbstractSocket::ConnectedState, -1);
-
- QMutexLocker locker(&d->worker->mutex);
- if (d->socketType != QAbstractSocket::UdpSocket || d->worker->pendingDatagrams.isEmpty()) {
- if (header)
- header->clear();
- return -1;
- }
-
- WinRtDatagram datagram = d->worker->pendingDatagrams.takeFirst();
- if (header)
- *header = datagram.header;
-
- QByteArray readOrigin;
- if (maxlen < datagram.data.length())
- readOrigin = datagram.data.left(maxlen);
- else
- readOrigin = datagram.data;
- if (d->worker->pendingDatagrams.isEmpty()) {
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << "That's all folks";
- d->worker->emitDataReceived = true;
- d->emitReadReady = true;
- }
-
- locker.unlock();
- memcpy(data, readOrigin, qMin(maxlen, qint64(datagram.data.length())));
- return readOrigin.length();
-#else
- Q_UNUSED(data)
- Q_UNUSED(maxlen)
- Q_UNUSED(header)
- return -1;
-#endif // QT_NO_UDPSOCKET
-}
-
-qint64 QNativeSocketEngine::writeDatagram(const char *data, qint64 len, const QIpPacketHeader &header)
-{
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << data << len;
-#ifndef QT_NO_UDPSOCKET
- Q_D(QNativeSocketEngine);
- Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::writeDatagram(), -1);
- Q_CHECK_STATES(QNativeSocketEngine::writeDatagram(), QAbstractSocket::BoundState,
- QAbstractSocket::ConnectedState, -1);
-
- if (d->socketType != QAbstractSocket::UdpSocket)
- return -1;
-
- ComPtr<IHostName> remoteHost;
- ComPtr<IHostNameFactory> hostNameFactory;
-
- HRESULT hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_HostName).Get(),
- &hostNameFactory);
- Q_ASSERT_SUCCEEDED(hr);
- const QString addressString = header.destinationAddress.toString();
- HStringReference hostNameRef(reinterpret_cast<LPCWSTR>(addressString.utf16()));
- hr = hostNameFactory->CreateHostName(hostNameRef.Get(), &remoteHost);
- RETURN_IF_FAILED("QNativeSocketEngine::writeDatagram: Could not create hostname.", return -1);
-
- ComPtr<IAsyncOperation<IOutputStream *>> streamOperation;
- ComPtr<IOutputStream> stream;
- const QString portString = QString::number(header.destinationPort);
- HStringReference portRef(reinterpret_cast<LPCWSTR>(portString.utf16()));
- hr = d->udpSocket()->GetOutputStreamAsync(remoteHost.Get(), portRef.Get(), &streamOperation);
- Q_ASSERT_SUCCEEDED(hr);
-
- hr = QWinRTFunctions::await(streamOperation, stream.GetAddressOf());
- Q_ASSERT_SUCCEEDED(hr);
-
- return writeIOStream(stream, data, len);
-#else
- Q_UNUSED(data)
- Q_UNUSED(len)
- Q_UNUSED(header)
- return -1;
-#endif // QT_NO_UDPSOCKET
-}
-
-bool QNativeSocketEngine::hasPendingDatagrams() const
-{
- Q_D(const QNativeSocketEngine);
- Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::hasPendingDatagrams(), false);
- Q_CHECK_NOT_STATE(QNativeSocketEngine::hasPendingDatagrams(), QAbstractSocket::UnconnectedState, false);
- Q_CHECK_TYPE(QNativeSocketEngine::hasPendingDatagrams(), QAbstractSocket::UdpSocket, false);
-
- QMutexLocker locker(&d->worker->mutex);
- return d->worker->pendingDatagrams.length() > 0;
-}
-
-qint64 QNativeSocketEngine::pendingDatagramSize() const
-{
- Q_D(const QNativeSocketEngine);
- Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::pendingDatagramSize(), -1);
- Q_CHECK_TYPE(QNativeSocketEngine::pendingDatagramSize(), QAbstractSocket::UdpSocket, -1);
-
- QMutexLocker locker(&d->worker->mutex);
- if (d->worker->pendingDatagrams.isEmpty())
- return -1;
-
- return d->worker->pendingDatagrams.at(0).data.length();
-}
-
-qint64 QNativeSocketEngine::bytesToWrite() const
-{
- return 0;
-}
-
-qint64 QNativeSocketEngine::receiveBufferSize() const
-{
- Q_D(const QNativeSocketEngine);
- return d->option(QAbstractSocketEngine::ReceiveBufferSocketOption);
-}
-
-void QNativeSocketEngine::setReceiveBufferSize(qint64 bufferSize)
-{
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << bufferSize;
- Q_D(QNativeSocketEngine);
- d->setOption(QAbstractSocketEngine::ReceiveBufferSocketOption, bufferSize);
-}
-
-qint64 QNativeSocketEngine::sendBufferSize() const
-{
- Q_D(const QNativeSocketEngine);
- return d->option(QAbstractSocketEngine::SendBufferSocketOption);
-}
-
-void QNativeSocketEngine::setSendBufferSize(qint64 bufferSize)
-{
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << bufferSize;
- Q_D(QNativeSocketEngine);
- d->setOption(QAbstractSocketEngine::SendBufferSocketOption, bufferSize);
-}
-
-int QNativeSocketEngine::option(QAbstractSocketEngine::SocketOption option) const
-{
- Q_D(const QNativeSocketEngine);
- return d->option(option);
-}
-
-bool QNativeSocketEngine::setOption(QAbstractSocketEngine::SocketOption option, int value)
-{
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << option << value;
- Q_D(QNativeSocketEngine);
- return d->setOption(option, value);
-}
-
-bool QNativeSocketEngine::waitForRead(int msecs, bool *timedOut)
-{
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << msecs;
- Q_D(QNativeSocketEngine);
- Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::waitForRead(), false);
- Q_CHECK_NOT_STATE(QNativeSocketEngine::waitForRead(),
- QAbstractSocket::UnconnectedState, false);
-
- if (timedOut)
- *timedOut = false;
-
- QElapsedTimer timer;
- timer.start();
- while (msecs > timer.elapsed()) {
- // Servers with active connections are ready for reading
- if (!d->currentConnections.isEmpty())
- return true;
-
- // If we are a client, we are ready to read if our buffer has data
- QMutexLocker locker(&d->worker->mutex);
- if (!d->worker->pendingData.isEmpty())
- return true;
-
- // Nothing to do, wait for more events
- d->eventLoop.processEvents();
- }
-
- d->setError(QAbstractSocket::SocketTimeoutError,
- WinRTSocketEngine::TimeOutErrorString);
-
- if (timedOut)
- *timedOut = true;
- return false;
-}
-
-bool QNativeSocketEngine::waitForWrite(int msecs, bool *timedOut)
-{
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << msecs;
- Q_UNUSED(timedOut);
- Q_D(QNativeSocketEngine);
- Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::waitForWrite(), false);
- Q_CHECK_NOT_STATE(QNativeSocketEngine::waitForWrite(),
- QAbstractSocket::UnconnectedState, false);
-
- if (d->socketState == QAbstractSocket::ConnectingState) {
- HRESULT hr = QWinRTFunctions::await(d->worker->connectOp, QWinRTFunctions::ProcessMainThreadEvents);
- if (SUCCEEDED(hr)) {
- handleConnectOpFinished(true, QAbstractSocket::UnknownSocketError, WinRTSocketEngine::UnknownSocketErrorString);
- return true;
- }
- }
- return false;
-}
-
-bool QNativeSocketEngine::waitForReadOrWrite(bool *readyToRead, bool *readyToWrite, bool checkRead, bool checkWrite, int msecs, bool *timedOut)
-{
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << checkRead << checkWrite << msecs;
- Q_D(QNativeSocketEngine);
- Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::waitForReadOrWrite(), false);
- Q_CHECK_NOT_STATE(QNativeSocketEngine::waitForReadOrWrite(),
- QAbstractSocket::UnconnectedState, false);
-
- Q_UNUSED(readyToRead);
- Q_UNUSED(readyToWrite);
- Q_UNUSED(timedOut);
- return false;
-}
-
-bool QNativeSocketEngine::isReadNotificationEnabled() const
-{
- Q_D(const QNativeSocketEngine);
- return d->notifyOnRead;
-}
-
-void QNativeSocketEngine::setReadNotificationEnabled(bool enable)
-{
- qCDebug(lcNetworkSocketVerbose) << this << Q_FUNC_INFO << enable;
- Q_D(QNativeSocketEngine);
- d->notifyOnRead = enable;
-}
-
-bool QNativeSocketEngine::isWriteNotificationEnabled() const
-{
- Q_D(const QNativeSocketEngine);
- return d->notifyOnWrite;
-}
-
-void QNativeSocketEngine::setWriteNotificationEnabled(bool enable)
-{
- qCDebug(lcNetworkSocketVerbose) << this << Q_FUNC_INFO << enable;
- Q_D(QNativeSocketEngine);
- d->notifyOnWrite = enable;
- if (enable && d->socketState == QAbstractSocket::ConnectedState) {
- if (bytesToWrite())
- return; // will be emitted as a result of bytes written
- writeNotification();
- }
-}
-
-bool QNativeSocketEngine::isExceptionNotificationEnabled() const
-{
- Q_D(const QNativeSocketEngine);
- return d->notifyOnException;
-}
-
-void QNativeSocketEngine::setExceptionNotificationEnabled(bool enable)
-{
- qCDebug(lcNetworkSocketVerbose) << this << Q_FUNC_INFO << enable;
- Q_D(QNativeSocketEngine);
- d->notifyOnException = enable;
-}
-
-void QNativeSocketEngine::establishRead()
-{
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO;
- Q_D(QNativeSocketEngine);
-
- HRESULT hr;
- hr = QEventDispatcherWinRT::runOnXamlThread([d]() {
- d->worker->setTcpSocket(d->tcpSocket());
- d->worker->startReading();
- return S_OK;
- });
- Q_ASSERT_SUCCEEDED(hr);
-}
-
-void QNativeSocketEngine::handleConnectOpFinished(bool success, QAbstractSocket::SocketError error, WinRTSocketEngine::ErrorString errorString)
-{
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << success << error << errorString;
- Q_D(QNativeSocketEngine);
- disconnect(d->worker, &SocketEngineWorker::connectOpFinished,
- this, &QNativeSocketEngine::handleConnectOpFinished);
- if (!success) {
- d->setError(error, errorString);
- d->socketState = QAbstractSocket::UnconnectedState;
- close();
- return;
- }
-
- d->socketState = QAbstractSocket::ConnectedState;
- d->fetchConnectionParameters();
- emit connectionReady();
-
- if (d->socketType != QAbstractSocket::TcpSocket)
- return;
-
-#ifndef QT_NO_SSL
- // Delay the reader so that the SSL socket can upgrade
- if (d->sslSocket)
- QObject::connect(qobject_cast<QSslSocket *>(d->sslSocket), &QSslSocket::encrypted, this, &QNativeSocketEngine::establishRead);
- else
-#endif
- establishRead();
-}
-
-void QNativeSocketEngine::handleNewData()
-{
- qCDebug(lcNetworkSocketVerbose) << this << Q_FUNC_INFO;
- Q_D(QNativeSocketEngine);
-
- if (d->notifyOnRead && d->emitReadReady) {
- if (d->socketType == QAbstractSocket::UdpSocket && !d->worker->emitDataReceived)
- return;
- qCDebug(lcNetworkSocketVerbose) << this << Q_FUNC_INFO << "Emitting readReady";
- d->pendingReadNotification = true;
- emit readReady();
- d->worker->emitDataReceived = false;
- d->emitReadReady = false;
- }
-}
-
-void QNativeSocketEngine::handleTcpError(QAbstractSocket::SocketError error)
-{
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << error;
- Q_D(QNativeSocketEngine);
- WinRTSocketEngine::ErrorString errorString;
- switch (error) {
- case QAbstractSocket::RemoteHostClosedError:
- errorString = WinRTSocketEngine::RemoteHostClosedErrorString;
- break;
- default:
- errorString = WinRTSocketEngine::UnknownSocketErrorString;
- }
-
- d->setError(error, errorString);
- close();
-}
-
-void QNativeSocketEngine::processReadReady()
-{
- Q_D(QNativeSocketEngine);
- if (d->closingDown)
- return;
-
- d->pendingReadNotification = false;
- readNotification();
-}
-
-bool QNativeSocketEnginePrivate::createNewSocket(QAbstractSocket::SocketType socketType, QAbstractSocket::NetworkLayerProtocol &socketProtocol)
-{
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << socketType << socketProtocol;
- Q_UNUSED(socketProtocol);
- HRESULT hr;
-
- switch (socketType) {
- case QAbstractSocket::TcpSocket: {
- ComPtr<IStreamSocket> socket;
- hr = RoActivateInstance(HString::MakeReference(RuntimeClass_Windows_Networking_Sockets_StreamSocket).Get(), &socket);
- RETURN_FALSE_IF_FAILED("createNewSocket: Could not create socket instance");
- socketDescriptor = qintptr(socket.Detach());
- break;
- }
- case QAbstractSocket::UdpSocket: {
- ComPtr<IDatagramSocket> socket;
- hr = RoActivateInstance(HString::MakeReference(RuntimeClass_Windows_Networking_Sockets_DatagramSocket).Get(), &socket);
- RETURN_FALSE_IF_FAILED("createNewSocket: Could not create socket instance");
- socketDescriptor = qintptr(socket.Detach());
- QEventDispatcherWinRT::runOnXamlThread([&hr, this]() {
- hr = udpSocket()->add_MessageReceived(Callback<DatagramReceivedHandler>(worker, &SocketEngineWorker::OnNewDatagramReceived).Get(), &connectionToken);
- if (FAILED(hr)) {
- qErrnoWarning(hr, "createNewSocket: Could not add \"message received\" callback");
- return hr;
- }
- return S_OK;
- });
- if (FAILED(hr))
- return false;
- break;
- }
- default:
- qWarning("Invalid socket type");
- return false;
- }
-
- this->socketType = socketType;
-
- // Make the socket nonblocking.
- if (!setOption(QAbstractSocketEngine::NonBlockingSocketOption, 1)) {
- setError(QAbstractSocket::UnsupportedSocketOperationError, WinRTSocketEngine::NonBlockingInitFailedErrorString);
- q_func()->close();
- return false;
- }
-
- return true;
-}
-
-QNativeSocketEnginePrivate::QNativeSocketEnginePrivate()
- : QAbstractSocketEnginePrivate()
- , notifyOnRead(true)
- , notifyOnWrite(true)
- , notifyOnException(false)
- , closingDown(false)
- , socketDescriptor(-1)
- , worker(new SocketEngineWorker(this))
- , sslSocket(nullptr)
- , connectionToken( { -1 } )
-{
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO;
-}
-
-QNativeSocketEnginePrivate::~QNativeSocketEnginePrivate()
-{
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO;
- if (socketDescriptor == -1 || connectionToken.value == -1)
- return;
-
- HRESULT hr;
- if (socketType == QAbstractSocket::UdpSocket)
- hr = udpSocket()->remove_MessageReceived(connectionToken);
- else if (socketType == QAbstractSocket::TcpSocket)
- hr = tcpListener->remove_ConnectionReceived(connectionToken);
- Q_ASSERT_SUCCEEDED(hr);
-
- worker->deleteLater();
-}
-
-void QNativeSocketEnginePrivate::setError(QAbstractSocket::SocketError error, WinRTSocketEngine::ErrorString errorString) const
-{
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << error << errorString;
- if (hasSetSocketError) {
- // Only set socket errors once for one engine; expect the
- // socket to recreate its engine after an error. Note: There's
- // one exception: SocketError(11) bypasses this as it's purely
- // a temporary internal error condition.
- // Another exception is the way the waitFor*() functions set
- // an error when a timeout occurs. After the call to setError()
- // they reset the hasSetSocketError to false
- return;
- }
- if (error != QAbstractSocket::SocketError(11))
- hasSetSocketError = true;
-
- socketError = error;
-
- switch (errorString) {
- case WinRTSocketEngine::NonBlockingInitFailedErrorString:
- socketErrorString = QNativeSocketEngine::tr("Unable to initialize non-blocking socket");
- break;
- case WinRTSocketEngine::BroadcastingInitFailedErrorString:
- socketErrorString = QNativeSocketEngine::tr("Unable to initialize broadcast socket");
- break;
- // should not happen anymore
- case WinRTSocketEngine::NoIpV6ErrorString:
- socketErrorString = QNativeSocketEngine::tr("Attempt to use IPv6 socket on a platform with no IPv6 support");
- break;
- case WinRTSocketEngine::RemoteHostClosedErrorString:
- socketErrorString = QNativeSocketEngine::tr("The remote host closed the connection");
- break;
- case WinRTSocketEngine::TimeOutErrorString:
- socketErrorString = QNativeSocketEngine::tr("Network operation timed out");
- break;
- case WinRTSocketEngine::ResourceErrorString:
- socketErrorString = QNativeSocketEngine::tr("Out of resources");
- break;
- case WinRTSocketEngine::OperationUnsupportedErrorString:
- socketErrorString = QNativeSocketEngine::tr("Unsupported socket operation");
- break;
- case WinRTSocketEngine::ProtocolUnsupportedErrorString:
- socketErrorString = QNativeSocketEngine::tr("Protocol type not supported");
- break;
- case WinRTSocketEngine::InvalidSocketErrorString:
- socketErrorString = QNativeSocketEngine::tr("Invalid socket descriptor");
- break;
- case WinRTSocketEngine::HostUnreachableErrorString:
- socketErrorString = QNativeSocketEngine::tr("Host unreachable");
- break;
- case WinRTSocketEngine::NetworkUnreachableErrorString:
- socketErrorString = QNativeSocketEngine::tr("Network unreachable");
- break;
- case WinRTSocketEngine::AccessErrorString:
- socketErrorString = QNativeSocketEngine::tr("Permission denied");
- break;
- case WinRTSocketEngine::ConnectionTimeOutErrorString:
- socketErrorString = QNativeSocketEngine::tr("Connection timed out");
- break;
- case WinRTSocketEngine::ConnectionRefusedErrorString:
- socketErrorString = QNativeSocketEngine::tr("Connection refused");
- break;
- case WinRTSocketEngine::AddressInuseErrorString:
- socketErrorString = QNativeSocketEngine::tr("The bound address is already in use");
- break;
- case WinRTSocketEngine::AddressNotAvailableErrorString:
- socketErrorString = QNativeSocketEngine::tr("The address is not available");
- break;
- case WinRTSocketEngine::AddressProtectedErrorString:
- socketErrorString = QNativeSocketEngine::tr("The address is protected");
- break;
- case WinRTSocketEngine::DatagramTooLargeErrorString:
- socketErrorString = QNativeSocketEngine::tr("Datagram was too large to send");
- break;
- case WinRTSocketEngine::SendDatagramErrorString:
- socketErrorString = QNativeSocketEngine::tr("Unable to send a message");
- break;
- case WinRTSocketEngine::ReceiveDatagramErrorString:
- socketErrorString = QNativeSocketEngine::tr("Unable to receive a message");
- break;
- case WinRTSocketEngine::WriteErrorString:
- socketErrorString = QNativeSocketEngine::tr("Unable to write");
- break;
- case WinRTSocketEngine::ReadErrorString:
- socketErrorString = QNativeSocketEngine::tr("Network error");
- break;
- case WinRTSocketEngine::PortInuseErrorString:
- socketErrorString = QNativeSocketEngine::tr("Another socket is already listening on the same port");
- break;
- case WinRTSocketEngine::NotSocketErrorString:
- socketErrorString = QNativeSocketEngine::tr("Operation on non-socket");
- break;
- case WinRTSocketEngine::InvalidProxyTypeString:
- socketErrorString = QNativeSocketEngine::tr("The proxy type is invalid for this operation");
- break;
- case WinRTSocketEngine::TemporaryErrorString:
- socketErrorString = QNativeSocketEngine::tr("Temporary error");
- break;
- case WinRTSocketEngine::UnknownSocketErrorString:
- socketErrorString = QNativeSocketEngine::tr("Unknown error");
- break;
- }
-}
-
-int QNativeSocketEnginePrivate::option(QAbstractSocketEngine::SocketOption opt) const
-{
- ComPtr<IStreamSocketControl> control;
- if (socketType == QAbstractSocket::TcpSocket) {
- if (FAILED(tcpSocket()->get_Control(&control))) {
- qWarning("QNativeSocketEnginePrivate::option: Could not obtain socket control");
- return -1;
- }
- }
- switch (opt) {
- case QAbstractSocketEngine::NonBlockingSocketOption:
- case QAbstractSocketEngine::BroadcastSocketOption:
- case QAbstractSocketEngine::ReceiveOutOfBandData:
- return 1;
- case QAbstractSocketEngine::SendBufferSocketOption:
- if (socketType == QAbstractSocket::UdpSocket)
- return -1;
-
- UINT32 bufferSize;
- if (FAILED(control->get_OutboundBufferSizeInBytes(&bufferSize))) {
- qWarning("Could not obtain OutboundBufferSizeInBytes information vom socket control");
- return -1;
- }
- return bufferSize;
- case QAbstractSocketEngine::LowDelayOption:
- if (socketType == QAbstractSocket::UdpSocket)
- return -1;
-
- boolean noDelay;
- if (FAILED(control->get_NoDelay(&noDelay))) {
- qWarning("Could not obtain NoDelay information from socket control");
- return -1;
- }
- return noDelay;
- case QAbstractSocketEngine::KeepAliveOption:
- if (socketType == QAbstractSocket::UdpSocket)
- return -1;
-
- boolean keepAlive;
- if (FAILED(control->get_KeepAlive(&keepAlive))) {
- qWarning("Could not obtain KeepAlive information from socket control");
- return -1;
- }
- return keepAlive;
- case QAbstractSocketEngine::ReceiveBufferSocketOption:
- case QAbstractSocketEngine::AddressReusable:
- case QAbstractSocketEngine::BindExclusively:
- case QAbstractSocketEngine::MulticastTtlOption:
- case QAbstractSocketEngine::MulticastLoopbackOption:
- case QAbstractSocketEngine::TypeOfServiceOption:
- case QAbstractSocketEngine::MaxStreamsSocketOption:
- case QAbstractSocketEngine::PathMtuInformation:
- default:
- return -1;
- }
- return -1;
-}
-
-bool QNativeSocketEnginePrivate::setOption(QAbstractSocketEngine::SocketOption opt, int v)
-{
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO << opt << v;
- ComPtr<IStreamSocketControl> control;
- if (socketType == QAbstractSocket::TcpSocket) {
- if (FAILED(tcpSocket()->get_Control(&control))) {
- qWarning("QNativeSocketEnginePrivate::setOption: Could not obtain socket control");
- return false;
- }
- }
- switch (opt) {
- case QAbstractSocketEngine::NonBlockingSocketOption:
- case QAbstractSocketEngine::BroadcastSocketOption:
- case QAbstractSocketEngine::ReceiveOutOfBandData:
- return v != 0;
- case QAbstractSocketEngine::SendBufferSocketOption:
- if (socketType == QAbstractSocket::UdpSocket)
- return false;
-
- if (FAILED(control->put_OutboundBufferSizeInBytes(v))) {
- qWarning("Could not set OutboundBufferSizeInBytes");
- return false;
- }
- return true;
- case QAbstractSocketEngine::LowDelayOption: {
- if (socketType == QAbstractSocket::UdpSocket)
- return false;
-
- boolean noDelay = v;
- if (FAILED(control->put_NoDelay(noDelay))) {
- qWarning("Could not obtain NoDelay information from socket control");
- return false;
- }
- return true;
- }
- case QAbstractSocketEngine::KeepAliveOption: {
- if (socketType == QAbstractSocket::UdpSocket
- || socketState != QAbstractSocket::UnconnectedState)
- return false;
-
- boolean keepAlive = v;
- if (FAILED(control->put_KeepAlive(keepAlive))) {
- qWarning("Could not set KeepAlive value");
- return false;
- }
- return true;
- }
- case QAbstractSocketEngine::ReceiveBufferSocketOption:
- case QAbstractSocketEngine::AddressReusable:
- case QAbstractSocketEngine::BindExclusively:
- case QAbstractSocketEngine::MulticastTtlOption:
- case QAbstractSocketEngine::MulticastLoopbackOption:
- case QAbstractSocketEngine::TypeOfServiceOption:
- case QAbstractSocketEngine::MaxStreamsSocketOption:
- case QAbstractSocketEngine::PathMtuInformation:
- default:
- return false;
- }
- return false;
-}
-
-bool QNativeSocketEnginePrivate::fetchConnectionParameters()
-{
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO;
- localPort = 0;
- localAddress.clear();
- peerPort = 0;
- peerAddress.clear();
- inboundStreamCount = outboundStreamCount = 0;
-
- HRESULT hr;
- if (socketType == QAbstractSocket::TcpSocket) {
- ComPtr<IHostName> hostName;
- HString tmpHString;
- ComPtr<IStreamSocketInformation> info;
- hr = tcpSocket()->get_Information(&info);
- Q_ASSERT_SUCCEEDED(hr);
- hr = info->get_LocalAddress(&hostName);
- Q_ASSERT_SUCCEEDED(hr);
- if (hostName) {
- hr = hostName->get_CanonicalName(tmpHString.GetAddressOf());
- Q_ASSERT_SUCCEEDED(hr);
- localAddress.setAddress(qt_QStringFromHString(tmpHString));
- hr = info->get_LocalPort(tmpHString.GetAddressOf());
- Q_ASSERT_SUCCEEDED(hr);
- localPort = qt_QStringFromHString(tmpHString).toInt();
- }
- if (!localPort && tcpListener) {
- ComPtr<IStreamSocketListenerInformation> listenerInfo = 0;
- hr = tcpListener->get_Information(&listenerInfo);
- Q_ASSERT_SUCCEEDED(hr);
- hr = listenerInfo->get_LocalPort(tmpHString.GetAddressOf());
- Q_ASSERT_SUCCEEDED(hr);
- localPort = qt_QStringFromHString(tmpHString).toInt();
- localAddress = QHostAddress::Any;
- }
- info->get_RemoteAddress(&hostName);
- if (hostName) {
- hr = hostName->get_CanonicalName(tmpHString.GetAddressOf());
- Q_ASSERT_SUCCEEDED(hr);
- peerAddress.setAddress(qt_QStringFromHString(tmpHString));
- hr = info->get_RemotePort(tmpHString.GetAddressOf());
- Q_ASSERT_SUCCEEDED(hr);
- peerPort = qt_QStringFromHString(tmpHString).toInt();
- inboundStreamCount = outboundStreamCount = 1;
- }
- } else if (socketType == QAbstractSocket::UdpSocket) {
- ComPtr<IHostName> hostName;
- HString tmpHString;
- ComPtr<IDatagramSocketInformation> info;
- hr = udpSocket()->get_Information(&info);
- Q_ASSERT_SUCCEEDED(hr);
- hr = info->get_LocalAddress(&hostName);
- Q_ASSERT_SUCCEEDED(hr);
- if (hostName) {
- hr = hostName->get_CanonicalName(tmpHString.GetAddressOf());
- Q_ASSERT_SUCCEEDED(hr);
- localAddress.setAddress(qt_QStringFromHString(tmpHString));
- hr = info->get_LocalPort(tmpHString.GetAddressOf());
- Q_ASSERT_SUCCEEDED(hr);
- localPort = qt_QStringFromHString(tmpHString).toInt();
- }
-
- hr = info->get_RemoteAddress(&hostName);
- Q_ASSERT_SUCCEEDED(hr);
- if (hostName) {
- hr = hostName->get_CanonicalName(tmpHString.GetAddressOf());
- Q_ASSERT_SUCCEEDED(hr);
- peerAddress.setAddress(qt_QStringFromHString(tmpHString));
- hr = info->get_RemotePort(tmpHString.GetAddressOf());
- Q_ASSERT_SUCCEEDED(hr);
- peerPort = qt_QStringFromHString(tmpHString).toInt();
- inboundStreamCount = outboundStreamCount = 1;
- }
- }
- return true;
-}
-
-HRESULT QNativeSocketEnginePrivate::handleClientConnection(IStreamSocketListener *listener, IStreamSocketListenerConnectionReceivedEventArgs *args)
-{
- qCDebug(lcNetworkSocket) << this << Q_FUNC_INFO;
- Q_Q(QNativeSocketEngine);
- Q_UNUSED(listener)
- IStreamSocket *socket;
- args->get_Socket(&socket);
- pendingConnections.append(socket);
- emit q->connectionReady();
- if (notifyOnRead)
- emit q->readReady();
- return S_OK;
-}
-
-QT_END_NAMESPACE
-
-#include "qnativesocketengine_winrt.moc"
diff --git a/src/network/socket/qnativesocketengine_winrt_p.h b/src/network/socket/qnativesocketengine_winrt_p.h
deleted file mode 100644
index e1fe58bb97..0000000000
--- a/src/network/socket/qnativesocketengine_winrt_p.h
+++ /dev/null
@@ -1,243 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtNetwork module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QNATIVESOCKETENGINE_WINRT_P_H
-#define QNATIVESOCKETENGINE_WINRT_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists for the convenience
-// of the QLibrary class. This header file may change from
-// version to version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtNetwork/private/qtnetworkglobal_p.h>
-#include <QtCore/QEventLoop>
-#include <QtCore/QBuffer>
-#include <QtCore/QLoggingCategory>
-#include <QtCore/QMutex>
-#include <QtCore/QAtomicInteger>
-#include "QtNetwork/qhostaddress.h"
-#include "private/qabstractsocketengine_p.h"
-#include <wrl.h>
-#include <windows.networking.sockets.h>
-
-QT_BEGIN_NAMESPACE
-
-Q_DECLARE_LOGGING_CATEGORY(lcNetworkSocket)
-Q_DECLARE_LOGGING_CATEGORY(lcNetworkSocketVerbose)
-
-namespace WinRTSocketEngine {
- enum ErrorString {
- NonBlockingInitFailedErrorString,
- BroadcastingInitFailedErrorString,
- NoIpV6ErrorString,
- RemoteHostClosedErrorString,
- TimeOutErrorString,
- ResourceErrorString,
- OperationUnsupportedErrorString,
- ProtocolUnsupportedErrorString,
- InvalidSocketErrorString,
- HostUnreachableErrorString,
- NetworkUnreachableErrorString,
- AccessErrorString,
- ConnectionTimeOutErrorString,
- ConnectionRefusedErrorString,
- AddressInuseErrorString,
- AddressNotAvailableErrorString,
- AddressProtectedErrorString,
- DatagramTooLargeErrorString,
- SendDatagramErrorString,
- ReceiveDatagramErrorString,
- WriteErrorString,
- ReadErrorString,
- PortInuseErrorString,
- NotSocketErrorString,
- InvalidProxyTypeString,
- TemporaryErrorString,
-
- UnknownSocketErrorString = -1
- };
-}
-
-class QNativeSocketEnginePrivate;
-class SocketEngineWorker;
-
-struct WinRtDatagram {
- QByteArray data;
- QIpPacketHeader header;
-};
-
-class Q_AUTOTEST_EXPORT QNativeSocketEngine : public QAbstractSocketEngine
-{
- Q_OBJECT
-public:
- QNativeSocketEngine(QObject *parent = 0);
- ~QNativeSocketEngine();
-
- bool initialize(QAbstractSocket::SocketType type, QAbstractSocket::NetworkLayerProtocol protocol = QAbstractSocket::IPv4Protocol);
- bool initialize(qintptr socketDescriptor, QAbstractSocket::SocketState socketState = QAbstractSocket::ConnectedState);
-
- qintptr socketDescriptor() const;
-
- bool isValid() const;
-
- bool connectToHost(const QHostAddress &address, quint16 port);
- bool connectToHostByName(const QString &name, quint16 port);
- bool bind(const QHostAddress &address, quint16 port);
- bool listen();
- int accept();
- void close();
-
-#ifndef QT_NO_NETWORKINTERFACE
- bool joinMulticastGroup(const QHostAddress &groupAddress,
- const QNetworkInterface &iface);
- bool leaveMulticastGroup(const QHostAddress &groupAddress,
- const QNetworkInterface &iface);
- QNetworkInterface multicastInterface() const;
- bool setMulticastInterface(const QNetworkInterface &iface);
-#endif
-
- qint64 bytesAvailable() const;
-
- qint64 read(char *data, qint64 maxlen);
- qint64 write(const char *data, qint64 len);
-
- qint64 readDatagram(char *data, qint64 maxlen, QIpPacketHeader * = 0, PacketHeaderOptions = WantNone);
- qint64 writeDatagram(const char *data, qint64 len, const QIpPacketHeader &header);
- bool hasPendingDatagrams() const;
- qint64 pendingDatagramSize() const;
-
- qint64 bytesToWrite() const;
-
- qint64 receiveBufferSize() const;
- void setReceiveBufferSize(qint64 bufferSize);
-
- qint64 sendBufferSize() const;
- void setSendBufferSize(qint64 bufferSize);
-
- int option(SocketOption option) const;
- bool setOption(SocketOption option, int value);
-
- bool waitForRead(int msecs = 30000, bool *timedOut = 0);
- bool waitForWrite(int msecs = 30000, bool *timedOut = 0);
- bool waitForReadOrWrite(bool *readyToRead, bool *readyToWrite,
- bool checkRead, bool checkWrite,
- int msecs = 30000, bool *timedOut = 0);
-
- bool isReadNotificationEnabled() const;
- void setReadNotificationEnabled(bool enable);
- bool isWriteNotificationEnabled() const;
- void setWriteNotificationEnabled(bool enable);
- bool isExceptionNotificationEnabled() const;
- void setExceptionNotificationEnabled(bool enable);
-
-signals:
- void connectionReady();
- void readReady();
- void writeReady();
- void newDatagramReceived(const WinRtDatagram &datagram);
-
-private slots:
- void establishRead();
- void handleConnectOpFinished(bool success, QAbstractSocket::SocketError error,
- WinRTSocketEngine::ErrorString errorString);
- void handleNewData();
- void handleTcpError(QAbstractSocket::SocketError error);
- void processReadReady();
-
-private:
- Q_DECLARE_PRIVATE(QNativeSocketEngine)
- Q_DISABLE_COPY_MOVE(QNativeSocketEngine)
-};
-
-class QNativeSocketEnginePrivate : public QAbstractSocketEnginePrivate
-{
- Q_DECLARE_PUBLIC(QNativeSocketEngine)
-public:
- QNativeSocketEnginePrivate();
- ~QNativeSocketEnginePrivate();
-
- qintptr socketDescriptor;
- SocketEngineWorker *worker;
-
- bool notifyOnRead, notifyOnWrite, notifyOnException;
- QAtomicInt closingDown;
-
- void setError(QAbstractSocket::SocketError error, WinRTSocketEngine::ErrorString errorString) const;
-
- // native functions
- int option(QNativeSocketEngine::SocketOption option) const;
- bool setOption(QNativeSocketEngine::SocketOption option, int value);
-
- bool createNewSocket(QAbstractSocket::SocketType type, QAbstractSocket::NetworkLayerProtocol &protocol);
-
- bool checkProxy(const QHostAddress &address);
- bool fetchConnectionParameters();
-
-private:
- inline ABI::Windows::Networking::Sockets::IStreamSocket *tcpSocket() const
- { return reinterpret_cast<ABI::Windows::Networking::Sockets::IStreamSocket *>(socketDescriptor); }
- inline ABI::Windows::Networking::Sockets::IDatagramSocket *udpSocket() const
- { return reinterpret_cast<ABI::Windows::Networking::Sockets::IDatagramSocket *>(socketDescriptor); }
- Microsoft::WRL::ComPtr<ABI::Windows::Networking::Sockets::IStreamSocketListener> tcpListener;
-
- QList<ABI::Windows::Networking::Sockets::IStreamSocket *> pendingConnections;
- QList<ABI::Windows::Networking::Sockets::IStreamSocket *> currentConnections;
- QEventLoop eventLoop;
- QAbstractSocket *sslSocket;
- EventRegistrationToken connectionToken;
-
- bool emitReadReady = true;
- bool pendingReadNotification = false;
-
- HRESULT handleClientConnection(ABI::Windows::Networking::Sockets::IStreamSocketListener *tcpListener,
- ABI::Windows::Networking::Sockets::IStreamSocketListenerConnectionReceivedEventArgs *args);
-};
-
-QT_END_NAMESPACE
-
-Q_DECLARE_METATYPE(WinRtDatagram)
-Q_DECLARE_METATYPE(WinRTSocketEngine::ErrorString)
-
-#endif // QNATIVESOCKETENGINE_WINRT_P_H
diff --git a/src/network/socket/socket.pri b/src/network/socket/socket.pri
index c3a98ea31a..67325ac70f 100644
--- a/src/network/socket/socket.pri
+++ b/src/network/socket/socket.pri
@@ -43,10 +43,8 @@ qtConfig(sctp) {
socket/qsctpsocket.cpp
}
-!winrt {
- SOURCES += socket/qnativesocketengine.cpp
- HEADERS += socket/qnativesocketengine_p.h
-}
+SOURCES += socket/qnativesocketengine.cpp
+HEADERS += socket/qnativesocketengine_p.h
unix {
SOURCES += socket/qnativesocketengine_unix.cpp
@@ -57,13 +55,8 @@ unix {
# invalid C/C++ code otherwise.
msvc: QMAKE_MOC_OPTIONS += -D_WINSOCK_DEPRECATED_NO_WARNINGS
-win32:!winrt:SOURCES += socket/qnativesocketengine_win.cpp
-win32:!winrt: QMAKE_USE_PRIVATE += advapi32
-
-winrt {
- SOURCES += socket/qnativesocketengine_winrt.cpp
- HEADERS += socket/qnativesocketengine_winrt_p.h
-}
+win32: SOURCES += socket/qnativesocketengine_win.cpp
+win32: QMAKE_USE_PRIVATE += advapi32
qtConfig(localserver) {
HEADERS += socket/qlocalserver.h \
@@ -73,7 +66,7 @@ qtConfig(localserver) {
SOURCES += socket/qlocalsocket.cpp \
socket/qlocalserver.cpp
- integrity|winrt {
+ integrity {
SOURCES += socket/qlocalsocket_tcp.cpp \
socket/qlocalserver_tcp.cpp
DEFINES += QT_LOCALSOCKET_TCP
diff --git a/src/network/ssl/qssl.cpp b/src/network/ssl/qssl.cpp
index 87b9a1b038..4482e8862b 100644
--- a/src/network/ssl/qssl.cpp
+++ b/src/network/ssl/qssl.cpp
@@ -111,11 +111,11 @@ Q_LOGGING_CATEGORY(lcSsl, "qt.network.ssl");
Describes the protocol of the cipher.
\value TlsV1_0 TLSv1.0
- \value TlsV1_0OrLater TLSv1.0 and later versions. This option is not available when using the WinRT backend due to platform limitations.
- \value TlsV1_1 TLSv1.1. When using the WinRT backend this option will also enable TLSv1.0.
- \value TlsV1_1OrLater TLSv1.1 and later versions. This option is not available when using the WinRT backend due to platform limitations.
- \value TlsV1_2 TLSv1.2. When using the WinRT backend this option will also enable TLSv1.0 and TLSv1.1.
- \value TlsV1_2OrLater TLSv1.2 and later versions. This option is not available when using the WinRT backend due to platform limitations.
+ \value TlsV1_0OrLater TLSv1.0 and later versions.
+ \value TlsV1_1 TLSv1.1.
+ \value TlsV1_1OrLater TLSv1.1 and later versions.
+ \value TlsV1_2 TLSv1.2.
+ \value TlsV1_2OrLater TLSv1.2 and later versions.
\value DtlsV1_0 DTLSv1.0
\value DtlsV1_0OrLater DTLSv1.0 and later versions.
\value DtlsV1_2 DTLSv1.2
diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp
index 7539c26ecb..6daf5c362e 100644
--- a/src/network/ssl/qsslcertificate.cpp
+++ b/src/network/ssl/qsslcertificate.cpp
@@ -115,9 +115,6 @@
#ifndef QT_NO_OPENSSL
#include "qsslsocket_openssl_symbols_p.h"
#endif
-#ifdef Q_OS_WINRT
-#include "qsslsocket_winrt_p.h"
-#endif
#ifdef QT_SECURETRANSPORT
#include "qsslsocket_mac_p.h"
#endif
diff --git a/src/network/ssl/qsslcertificate_p.h b/src/network/ssl/qsslcertificate_p.h
index 234cd45ceb..4588aa7d6f 100644
--- a/src/network/ssl/qsslcertificate_p.h
+++ b/src/network/ssl/qsslcertificate_p.h
@@ -70,11 +70,6 @@ struct X509_EXTENSION;
struct ASN1_OBJECT;
#endif
-#ifdef Q_OS_WINRT
-#include <wrl.h>
-#include <windows.security.cryptography.certificates.h>
-#endif
-
#if QT_CONFIG(schannel)
#include <wincrypt.h>
#endif
@@ -146,12 +141,6 @@ public:
QAtomicInt ref;
-#ifdef Q_OS_WINRT
- Microsoft::WRL::ComPtr<ABI::Windows::Security::Cryptography::Certificates::ICertificate> certificate;
-
- static QSslCertificate QSslCertificate_from_Certificate(ABI::Windows::Security::Cryptography::Certificates::ICertificate *iCertificate);
-#endif
-
#if QT_CONFIG(schannel)
const CERT_CONTEXT *certificateContext = nullptr;
diff --git a/src/network/ssl/qsslcertificate_qt.cpp b/src/network/ssl/qsslcertificate_qt.cpp
index 7cf96a4a88..d75e620ff7 100644
--- a/src/network/ssl/qsslcertificate_qt.cpp
+++ b/src/network/ssl/qsslcertificate_qt.cpp
@@ -141,7 +141,7 @@ QDateTime QSslCertificate::expiryDate() const
return d->notValidAfter;
}
-#if !defined(Q_OS_WINRT) && !QT_CONFIG(schannel) // implemented in qsslcertificate_{winrt,schannel}.cpp
+#if !QT_CONFIG(schannel) // implemented in qsslcertificate_schannel.cpp
Qt::HANDLE QSslCertificate::handle() const
{
Q_UNIMPLEMENTED();
diff --git a/src/network/ssl/qsslcertificate_winrt.cpp b/src/network/ssl/qsslcertificate_winrt.cpp
deleted file mode 100644
index e601307c17..0000000000
--- a/src/network/ssl/qsslcertificate_winrt.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtNetwork module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qsslcertificate_p.h"
-
-#include <QtCore/qfunctions_winrt.h>
-
-#include <wrl.h>
-#include <windows.storage.streams.h>
-#include <windows.security.cryptography.h>
-#include <robuffer.h>
-
-using namespace Microsoft::WRL;
-using namespace Microsoft::WRL::Wrappers;
-using namespace ABI::Windows::Foundation;
-using namespace ABI::Windows::Security::Cryptography;
-using namespace ABI::Windows::Security::Cryptography::Certificates;
-using namespace ABI::Windows::Storage::Streams;
-
-QT_USE_NAMESPACE
-
-struct SslCertificateGlobal
-{
- SslCertificateGlobal() {
- HRESULT hr;
- hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Security_Cryptography_Certificates_Certificate).Get(),
- &certificateFactory);
- Q_ASSERT_SUCCEEDED(hr);
- hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Security_Cryptography_CryptographicBuffer).Get(),
- &bufferFactory);
- Q_ASSERT_SUCCEEDED(hr);
- }
-
- ComPtr<ICertificateFactory> certificateFactory;
- ComPtr<ICryptographicBufferStatics> bufferFactory;
-};
-Q_GLOBAL_STATIC(SslCertificateGlobal, g)
-
-QSslCertificate QSslCertificatePrivate::QSslCertificate_from_Certificate(ICertificate *iCertificate)
-{
- Q_ASSERT(iCertificate);
- ComPtr<IBuffer> buffer;
- HRESULT hr = iCertificate->GetCertificateBlob(&buffer);
- RETURN_IF_FAILED("Could not obtain certification blob", return QSslCertificate());
- ComPtr<Windows::Storage::Streams::IBufferByteAccess> byteAccess;
- hr = buffer.As(&byteAccess);
- RETURN_IF_FAILED("Could not obtain byte access to buffer", return QSslCertificate());
- char *data;
- hr = byteAccess->Buffer(reinterpret_cast<byte **>(&data));
- RETURN_IF_FAILED("Could not obtain buffer data", return QSslCertificate());
- UINT32 size;
- hr = buffer->get_Length(&size);
- RETURN_IF_FAILED("Could not obtain buffer length ", return QSslCertificate());
- QByteArray der(data, size);
-
- QSslCertificate certificate;
- certificate.d->null = false;
- certificate.d->certificate = iCertificate;
-
- return certificatesFromDer(der, 1).at(0);
-}
-
-Qt::HANDLE QSslCertificate::handle() const
-{
- if (!d->certificate) {
- HRESULT hr;
- ComPtr<IBuffer> buffer;
- hr = g->bufferFactory->CreateFromByteArray(d->derData.length(), (BYTE *)d->derData.data(), &buffer);
- RETURN_IF_FAILED("Failed to create the certificate data buffer", return nullptr);
-
- hr = g->certificateFactory->CreateCertificate(buffer.Get(), &d->certificate);
- RETURN_IF_FAILED("Failed to create the certificate handle from the data buffer",
- return nullptr);
- }
-
- return d->certificate.Get();
-}
diff --git a/src/network/ssl/qsslkey_qt.cpp b/src/network/ssl/qsslkey_qt.cpp
index 43969c3d28..f3bd75dfa6 100644
--- a/src/network/ssl/qsslkey_qt.cpp
+++ b/src/network/ssl/qsslkey_qt.cpp
@@ -715,11 +715,6 @@ static EncryptionData readPbes1(const QVector<QAsn1Element> &element, const QByt
key.truncate(8); // first 8 bytes are used for the key
QSslKeyPrivate::Cipher cipher = oidCipherMap[encryptionScheme];
-#ifdef Q_OS_WINRT
- // @todo: document this instead? find some other solution?
- if (cipher == QSslKeyPrivate::Cipher::Rc2Cbc)
- qWarning("PBES1 with RC2_CBC doesn't work properly on WinRT.");
-#endif
// Steps 4-6 are done after returning
return {cipher, key, iv};
}
diff --git a/src/network/ssl/qsslkey_winrt.cpp b/src/network/ssl/qsslkey_winrt.cpp
deleted file mode 100644
index 69eaaa387f..0000000000
--- a/src/network/ssl/qsslkey_winrt.cpp
+++ /dev/null
@@ -1,169 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtNetwork module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qssl_p.h"
-#include "qsslkey.h"
-#include "qsslkey_p.h"
-#include "qsslcertificate_p.h"
-
-#include <QtCore/qfunctions_winrt.h>
-
-#include <wrl.h>
-#include <windows.security.cryptography.h>
-#include <windows.security.cryptography.core.h>
-#include <windows.security.cryptography.certificates.h>
-#include <windows.storage.streams.h>
-#include <robuffer.h>
-
-using namespace Microsoft::WRL;
-using namespace Microsoft::WRL::Wrappers;
-using namespace ABI::Windows::Foundation;
-using namespace ABI::Windows::Security::Cryptography;
-using namespace ABI::Windows::Security::Cryptography::Certificates;
-using namespace ABI::Windows::Security::Cryptography::Core;
-using namespace ABI::Windows::Storage::Streams;
-
-QT_USE_NAMESPACE
-
-struct SslKeyGlobal
-{
- SslKeyGlobal()
- {
- HRESULT hr;
- hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Security_Cryptography_Core_CryptographicEngine).Get(),
- &engine);
- Q_ASSERT_SUCCEEDED(hr);
-
- ComPtr<ISymmetricKeyAlgorithmProviderStatics> keyProviderFactory;
- hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Security_Cryptography_Core_SymmetricKeyAlgorithmProvider).Get(),
- &keyProviderFactory);
- Q_ASSERT_SUCCEEDED(hr);
- hr = keyProviderFactory->OpenAlgorithm(HString::MakeReference(L"DES_CBC").Get(),
- &keyProviders[QSslKeyPrivate::DesCbc]);
- Q_ASSERT_SUCCEEDED(hr);
- hr = keyProviderFactory->OpenAlgorithm(HString::MakeReference(L"3DES_CBC").Get(),
- &keyProviders[QSslKeyPrivate::DesEde3Cbc]);
- Q_ASSERT_SUCCEEDED(hr);
- hr = keyProviderFactory->OpenAlgorithm(HString::MakeReference(L"RC2_CBC").Get(),
- &keyProviders[QSslKeyPrivate::Rc2Cbc]);
- Q_ASSERT_SUCCEEDED(hr);
- hr = keyProviderFactory->OpenAlgorithm(HString::MakeReference(L"AES_CBC").Get(),
- &keyProviders[QSslKeyPrivate::Aes128Cbc]);
- Q_ASSERT_SUCCEEDED(hr);
- hr = keyProviderFactory->OpenAlgorithm(HString::MakeReference(L"AES_CBC").Get(),
- &keyProviders[QSslKeyPrivate::Aes192Cbc]);
- Q_ASSERT_SUCCEEDED(hr);
- hr = keyProviderFactory->OpenAlgorithm(HString::MakeReference(L"AES_CBC").Get(),
- &keyProviders[QSslKeyPrivate::Aes256Cbc]);
- Q_ASSERT_SUCCEEDED(hr);
-
- hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Security_Cryptography_CryptographicBuffer).Get(),
- &bufferFactory);
- Q_ASSERT_SUCCEEDED(hr);
- }
-
- ComPtr<ICryptographicEngineStatics> engine;
- QHash<QSslKeyPrivate::Cipher, ComPtr<ISymmetricKeyAlgorithmProvider>> keyProviders;
- ComPtr<ICryptographicBufferStatics> bufferFactory;
-};
-Q_GLOBAL_STATIC(SslKeyGlobal, g)
-
-static QByteArray doCrypt(QSslKeyPrivate::Cipher cipher, QByteArray data, const QByteArray &key, const QByteArray &iv, bool encrypt)
-{
- HRESULT hr;
-
- ISymmetricKeyAlgorithmProvider *keyProvider = g->keyProviders[cipher].Get();
- Q_ASSERT(keyProvider);
-
- ComPtr<IBuffer> keyBuffer;
- hr = g->bufferFactory->CreateFromByteArray(key.length(), (BYTE *)key.data(), &keyBuffer);
- Q_ASSERT_SUCCEEDED(hr);
- ComPtr<ICryptographicKey> cryptographicKey;
- hr = keyProvider->CreateSymmetricKey(keyBuffer.Get(), &cryptographicKey);
- Q_ASSERT_SUCCEEDED(hr);
-
- UINT32 blockLength;
- hr = keyProvider->get_BlockLength(&blockLength);
- Q_ASSERT_SUCCEEDED(hr);
- if (encrypt) { // Add padding
- const char padding = blockLength - data.length() % blockLength;
- data += QByteArray(padding, padding);
- }
-
- ComPtr<IBuffer> dataBuffer;
- hr = g->bufferFactory->CreateFromByteArray(data.length(), (BYTE *)data.data(), &dataBuffer);
- Q_ASSERT_SUCCEEDED(hr);
- ComPtr<IBuffer> ivBuffer;
- hr = g->bufferFactory->CreateFromByteArray(iv.length(), (BYTE *)iv.data(), &ivBuffer);
- Q_ASSERT_SUCCEEDED(hr);
- ComPtr<IBuffer> resultBuffer;
- hr = encrypt ? g->engine->Encrypt(cryptographicKey.Get(), dataBuffer.Get(), ivBuffer.Get(), &resultBuffer)
- : g->engine->Decrypt(cryptographicKey.Get(), dataBuffer.Get(), ivBuffer.Get(), &resultBuffer);
- Q_ASSERT_SUCCEEDED(hr);
-
- UINT32 resultLength;
- hr = resultBuffer->get_Length(&resultLength);
- Q_ASSERT_SUCCEEDED(hr);
- ComPtr<Windows::Storage::Streams::IBufferByteAccess> bufferAccess;
- hr = resultBuffer.As(&bufferAccess);
- Q_ASSERT_SUCCEEDED(hr);
- byte *resultData;
- hr = bufferAccess->Buffer(&resultData);
- Q_ASSERT_SUCCEEDED(hr);
-
- if (!encrypt) { // Remove padding
- const uchar padding = resultData[resultLength - 1];
- if (padding > 0 && padding <= blockLength)
- resultLength -= padding;
- else
- qCWarning(lcSsl, "Invalid padding length of %u; decryption likely failed.", padding);
- }
-
- return QByteArray(reinterpret_cast<const char *>(resultData), resultLength);
-}
-
-QByteArray QSslKeyPrivate::decrypt(Cipher cipher, const QByteArray &data, const QByteArray &key, const QByteArray &iv)
-{
- return doCrypt(cipher, data, key, iv, false);
-}
-
-QByteArray QSslKeyPrivate::encrypt(Cipher cipher, const QByteArray &data, const QByteArray &key, const QByteArray &iv)
-{
- return doCrypt(cipher, data, key, iv, true);
-}
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index 47dc7a9f71..64e556ac3c 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -456,9 +456,6 @@
#ifndef QT_NO_OPENSSL
#include "qsslsocket_openssl_p.h"
#endif
-#ifdef Q_OS_WINRT
-#include "qsslsocket_winrt_p.h"
-#endif
#ifdef QT_SECURETRANSPORT
#include "qsslsocket_mac_p.h"
#endif
diff --git a/src/network/ssl/qsslsocket.h b/src/network/ssl/qsslsocket.h
index d21e8900d8..e7e24ef246 100644
--- a/src/network/ssl/qsslsocket.h
+++ b/src/network/ssl/qsslsocket.h
@@ -279,7 +279,7 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_flushWriteBuffer())
Q_PRIVATE_SLOT(d_func(), void _q_flushReadBuffer())
Q_PRIVATE_SLOT(d_func(), void _q_resumeImplementation())
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) && !QT_CONFIG(schannel)
+#if defined(Q_OS_WIN) && !QT_CONFIG(schannel)
Q_PRIVATE_SLOT(d_func(), void _q_caRootLoaded(QSslCertificate,QSslCertificate))
#endif
friend class QSslSocketBackendPrivate;
diff --git a/src/network/ssl/qsslsocket_p.h b/src/network/ssl/qsslsocket_p.h
index 971650a71c..c5e604cf5e 100644
--- a/src/network/ssl/qsslsocket_p.h
+++ b/src/network/ssl/qsslsocket_p.h
@@ -75,9 +75,7 @@ class QSslContext;
#elif defined(Q_OS_WIN)
#include <QtCore/qt_windows.h>
#include <memory>
-#ifndef Q_OS_WINRT
#include <wincrypt.h>
-#endif // !Q_OS_WINRT
#ifndef HCRYPTPROV_LEGACY
#define HCRYPTPROV_LEGACY HCRYPTPROV
#endif // !HCRYPTPROV_LEGACY
@@ -184,7 +182,7 @@ public:
void _q_flushWriteBuffer();
void _q_flushReadBuffer();
void _q_resumeImplementation();
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) && !QT_CONFIG(schannel)
+#if defined(Q_OS_WIN) && !QT_CONFIG(schannel)
virtual void _q_caRootLoaded(QSslCertificate,QSslCertificate) = 0;
#endif
diff --git a/src/network/ssl/qsslsocket_winrt.cpp b/src/network/ssl/qsslsocket_winrt.cpp
deleted file mode 100644
index 5f5201fc82..0000000000
--- a/src/network/ssl/qsslsocket_winrt.cpp
+++ /dev/null
@@ -1,682 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtNetwork module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qssl_p.h"
-#include "qsslsocket_winrt_p.h"
-#include "qsslsocket.h"
-#include "qsslcertificate_p.h"
-#include "qsslcipher_p.h"
-
-#include <QtCore/QCoreApplication>
-#include <QtCore/QSysInfo>
-#include <QtCore/qfunctions_winrt.h>
-#include <private/qnativesocketengine_winrt_p.h>
-#include <private/qeventdispatcher_winrt_p.h>
-
-#include <windows.networking.h>
-#include <windows.networking.sockets.h>
-#include <windows.security.cryptography.certificates.h>
-#include <robuffer.h>
-
-using namespace Microsoft::WRL;
-using namespace Microsoft::WRL::Wrappers;
-using namespace ABI::Windows::Foundation;
-using namespace ABI::Windows::Foundation::Collections;
-using namespace ABI::Windows::Networking;
-using namespace ABI::Windows::Networking::Sockets;
-using namespace ABI::Windows::Security::Cryptography::Certificates;
-using namespace ABI::Windows::Storage::Streams;
-
-QT_BEGIN_NAMESPACE
-
-bool QSslSocketPrivate::s_libraryLoaded = true;
-bool QSslSocketPrivate::s_loadRootCertsOnDemand = true;
-bool QSslSocketPrivate::s_loadedCiphersAndCerts = false;
-
-struct SslSocketGlobal
-{
- SslSocketGlobal()
- {
- HRESULT hr;
- hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_HostName).Get(),
- &hostNameFactory);
- Q_ASSERT_SUCCEEDED(hr);
-
- ComPtr<ICertificateStoresStatics> certificateStores;
- hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Security_Cryptography_Certificates_CertificateStores).Get(),
- &certificateStores);
- Q_ASSERT_SUCCEEDED(hr);
-
- hr = certificateStores->get_TrustedRootCertificationAuthorities(&rootStore);
- Q_ASSERT_SUCCEEDED(hr);
-
- ComPtr<IAsyncOperation<IVectorView<Certificate *> *>> op;
- hr = certificateStores->FindAllAsync(&op);
- Q_ASSERT_SUCCEEDED(hr);
- ComPtr<IVectorView<Certificate *>> certificates;
- hr = QWinRTFunctions::await(op, certificates.GetAddressOf());
- Q_ASSERT_SUCCEEDED(hr);
- quint32 size;
- hr = certificates->get_Size(&size);
- Q_ASSERT_SUCCEEDED(hr);
- for (quint32 i = 0; i < size; ++i) {
- ComPtr<ICertificate> certificate;
- hr = certificates->GetAt(i, &certificate);
- Q_ASSERT_SUCCEEDED(hr);
- systemCaCertificates.append(QSslCertificatePrivate::QSslCertificate_from_Certificate(certificate.Get()));
- }
- }
-
- void syncCaCertificates(const QSet<QSslCertificate> &add, const QSet<QSslCertificate> &remove)
- {
- QMutexLocker locker(&certificateMutex);
- for (const QSslCertificate &certificate : add) {
- QHash<QSslCertificate, QAtomicInt>::iterator it = additionalCertificates.find(certificate);
- if (it != additionalCertificates.end()) {
- it.value().ref(); // Add a reference
- } else {
- // install certificate
- HRESULT hr;
- hr = rootStore->Add(static_cast<ICertificate *>(certificate.handle()));
- Q_ASSERT_SUCCEEDED(hr);
- additionalCertificates.insert(certificate, 1);
- }
- }
- for (const QSslCertificate &certificate : remove) {
- QHash<QSslCertificate, QAtomicInt>::iterator it = additionalCertificates.find(certificate);
- if (it != additionalCertificates.end() && !it.value().deref()) {
- // no more references, remove certificate
- HRESULT hr;
- hr = rootStore->Delete(static_cast<ICertificate *>(certificate.handle()));
- Q_ASSERT_SUCCEEDED(hr);
- additionalCertificates.erase(it);
- }
- }
- }
-
- ComPtr<IHostNameFactory> hostNameFactory;
- QList<QSslCertificate> systemCaCertificates;
-
-private:
- QMutex certificateMutex;
- ComPtr<ICertificateStore> rootStore;
- QHash<QSslCertificate, QAtomicInt> additionalCertificates;
-};
-Q_GLOBAL_STATIC(SslSocketGlobal, g)
-
-// Called on the socket's thread to avoid cross-thread deletion
-void QSslSocketConnectionHelper::disconnectSocketFromHost()
-{
- if (d->plainSocket)
- d->plainSocket->disconnectFromHost();
-}
-
-QSslSocketBackendPrivate::QSslSocketBackendPrivate()
- : connectionHelper(new QSslSocketConnectionHelper(this))
-{
-}
-
-QSslSocketBackendPrivate::~QSslSocketBackendPrivate()
-{
- g->syncCaCertificates(QSet<QSslCertificate>(), previousCaCertificates);
-}
-
-bool QSslSocketPrivate::supportsSsl()
-{
- return true;
-}
-
-void QSslSocketPrivate::ensureInitialized()
-{
- if (s_loadedCiphersAndCerts)
- return;
- s_loadedCiphersAndCerts = true;
- resetDefaultCiphers();
-}
-
-long QSslSocketPrivate::sslLibraryVersionNumber()
-{
- // ### Qt 6: Find a proper replacement for the deprecated method below.
- return QSysInfo::windowsVersion();
-}
-
-QString QSslSocketPrivate::sslLibraryVersionString()
-{
- return QStringLiteral("Windows Runtime, ") + QSysInfo::prettyProductName();
-}
-
-long QSslSocketPrivate::sslLibraryBuildVersionNumber()
-{
- Q_UNIMPLEMENTED();
- return 0;
-}
-
-QString QSslSocketPrivate::sslLibraryBuildVersionString()
-{
- Q_UNIMPLEMENTED();
- return QString::number(sslLibraryBuildVersionNumber());
-}
-
-void QSslSocketPrivate::resetDefaultCiphers()
-{
- setDefaultSupportedCiphers(QSslSocketBackendPrivate::defaultCiphers());
- setDefaultCiphers(QSslSocketBackendPrivate::defaultCiphers());
-}
-
-
-QList<QSslCipher> QSslSocketBackendPrivate::defaultCiphers()
-{
- QList<QSslCipher> ciphers;
- const QString protocolStrings[] = { QStringLiteral("TLSv1"),
- QStringLiteral("TLSv1.1"), QStringLiteral("TLSv1.2") };
- const QSsl::SslProtocol protocols[] = { QSsl::TlsV1_0, QSsl::TlsV1_1, QSsl::TlsV1_2 };
- const int size = static_cast<int>(ARRAYSIZE(protocols));
- ciphers.reserve(size);
- for (int i = 0; i < size; ++i) {
- QSslCipher cipher;
- cipher.d->isNull = false;
- cipher.d->name = QStringLiteral("WINRT");
- cipher.d->protocol = protocols[i];
- cipher.d->protocolString = protocolStrings[i];
- ciphers.append(cipher);
- }
- return ciphers;
-}
-
-QList<QSslCertificate> QSslSocketPrivate::systemCaCertificates()
-{
- return g->systemCaCertificates;
-}
-
-void QSslSocketBackendPrivate::startClientEncryption()
-{
- Q_Q(QSslSocket);
-
- QSsl::SslProtocol protocol = q->protocol();
- switch (q->protocol()) {
- case QSsl::AnyProtocol:
- protectionLevel = SocketProtectionLevel_Tls10;
- break;
- case QSsl::TlsV1_0:
- protectionLevel = SocketProtectionLevel_Tls10;
- break;
- case QSsl::TlsV1_1:
- protectionLevel = SocketProtectionLevel_Tls11;
- break;
- case QSsl::TlsV1_2:
- protectionLevel = SocketProtectionLevel_Tls12;
- break;
- case QSsl::TlsV1_0OrLater:
- case QSsl::TlsV1_1OrLater:
- case QSsl::TlsV1_2OrLater:
- case QSsl::TlsV1_3:
- case QSsl::TlsV1_3OrLater:
- // TlsV1_0OrLater, TlsV1_1OrLater and TlsV1_2OrLater are disabled on WinRT
- // because there is no good way to map them to the native API.
- setErrorAndEmit(QAbstractSocket::SslInvalidUserDataError,
- QStringLiteral("unsupported protocol"));
- return;
- case QSsl::SecureProtocols:
- // SocketProtectionLevel_Tls12 actually means "use TLS1.0, 1.1 or 1.2"
- // https://docs.microsoft.com/en-us/uwp/api/windows.networking.sockets.socketprotectionlevel
- protectionLevel = SocketProtectionLevel_Tls12;
- break;
- default:
- protectionLevel = SocketProtectionLevel_Tls12; // default to highest
- protocol = QSsl::TlsV1_2;
- break;
- }
-
- // Sync custom certificates
- const QSet<QSslCertificate> caCertificates(configuration.caCertificates.constBegin(), configuration.caCertificates.constEnd());
- const QSet<QSslCertificate> newCertificates = caCertificates - previousCaCertificates;
- const QSet<QSslCertificate> oldCertificates = previousCaCertificates - caCertificates;
- g->syncCaCertificates(newCertificates, oldCertificates);
- previousCaCertificates = caCertificates;
-
- continueHandshake();
-}
-
-void QSslSocketBackendPrivate::startServerEncryption()
-{
- Q_UNIMPLEMENTED();
-}
-
-void QSslSocketBackendPrivate::transmit()
-{
- Q_Q(QSslSocket);
-
- if (connectionEncrypted && !writeBuffer.isEmpty()) {
- qint64 totalBytesWritten = 0;
- int nextDataBlockSize;
- while ((nextDataBlockSize = writeBuffer.nextDataBlockSize()) > 0) {
- int writtenBytes = plainSocket->write(writeBuffer.readPointer(), nextDataBlockSize);
- writtenBytes = nextDataBlockSize;
-
- writeBuffer.free(writtenBytes);
- totalBytesWritten += writtenBytes;
-
- if (writtenBytes < nextDataBlockSize)
- break;
- }
-
- if (totalBytesWritten > 0) {
- // Don't emit bytesWritten() recursively.
- if (!emittedBytesWritten) {
- emittedBytesWritten = true;
- emit q->bytesWritten(totalBytesWritten);
- emittedBytesWritten = false;
- }
- emit q->channelBytesWritten(0, totalBytesWritten);
- }
- }
-
- // Check if we've got any data to be read from the socket.
- int pendingBytes;
- bool bytesRead = false;
- while ((pendingBytes = plainSocket->bytesAvailable()) > 0) {
- char *ptr = buffer.reserve(pendingBytes);
- int readBytes = plainSocket->read(ptr, pendingBytes);
- buffer.chop(pendingBytes - readBytes);
- bytesRead = true;
- }
-
- if (bytesRead) {
- if (readyReadEmittedPointer)
- *readyReadEmittedPointer = true;
- emit q->readyRead();
- emit q->channelReadyRead(0);
- }
-
- if (pendingClose) {
- pendingClose = false;
- q->disconnectFromHost();
- }
-}
-
-void QSslSocketBackendPrivate::disconnectFromHost()
-{
- QMetaObject::invokeMethod(connectionHelper.data(), "disconnectSocketFromHost", Qt::QueuedConnection);
-}
-
-void QSslSocketBackendPrivate::disconnected()
-{
-}
-
-QSslCipher QSslSocketBackendPrivate::sessionCipher() const
-{
- return configuration.sessionCipher;
-}
-
-QSsl::SslProtocol QSslSocketBackendPrivate::sessionProtocol() const
-{
- return configuration.sessionCipher.protocol();
-}
-
-void QSslSocketBackendPrivate::continueHandshake()
-{
- IStreamSocket *socket = reinterpret_cast<IStreamSocket *>(plainSocket->socketDescriptor());
- if (qintptr(socket) == -1) {
- setErrorAndEmit(QAbstractSocket::SslInternalError,
- QStringLiteral("At attempt was made to continue the handshake on an invalid socket."));
- return;
- }
-
- HRESULT hr;
- ComPtr<IHostName> hostName;
- const QString host = verificationPeerName.isEmpty() ? plainSocket->peerName()
- : verificationPeerName;
- if (host.isEmpty()) {
- ComPtr<IStreamSocketInformation> info;
- hr = socket->get_Information(&info);
- Q_ASSERT_SUCCEEDED(hr);
- hr = info->get_RemoteAddress(&hostName);
- } else {
- HStringReference hostRef(reinterpret_cast<LPCWSTR>(host.utf16()), host.length());
- hr = g->hostNameFactory->CreateHostName(hostRef.Get(), &hostName);
- Q_ASSERT_SUCCEEDED(hr);
- }
- if (FAILED(hr)) {
- setErrorAndEmit(QAbstractSocket::SslInvalidUserDataError, qt_error_string(hr));
- return;
- }
-
- ComPtr<IStreamSocketControl> control;
- hr = socket->get_Control(&control);
- Q_ASSERT_SUCCEEDED(hr);
-
- ComPtr<IStreamSocketControl2> control2;
- hr = control.As(&control2);
- ComPtr<IVector<ChainValidationResult>> ignoreList;
- hr = control2->get_IgnorableServerCertificateErrors(&ignoreList);
- Q_ASSERT_SUCCEEDED(hr);
-
- QSet<QSslError> ignoreErrors(ignoreErrorsList.constBegin(), ignoreErrorsList.constEnd());
- for (int i = ChainValidationResult_Untrusted; i < ChainValidationResult_OtherErrors + 1; ++i) {
- // Populate the native ignore list - break to add, continue to skip
- switch (i) {
- case ChainValidationResult_Revoked:
- case ChainValidationResult_InvalidSignature:
- case ChainValidationResult_BasicConstraintsError:
- case ChainValidationResult_InvalidCertificateAuthorityPolicy:
- case ChainValidationResult_UnknownCriticalExtension:
- case ChainValidationResult_OtherErrors:
- continue; // The above errors can't be ignored in the handshake
- case ChainValidationResult_Untrusted:
- if (ignoreAllSslErrors || ignoreErrors.contains(QSslError::CertificateUntrusted))
- break;
- continue;
- case ChainValidationResult_Expired:
- if (ignoreAllSslErrors || ignoreErrors.contains(QSslError::CertificateExpired))
- break;
- continue;
- case ChainValidationResult_IncompleteChain:
- if (ignoreAllSslErrors
- || ignoreErrors.contains(QSslError::InvalidCaCertificate)
- || ignoreErrors.contains(QSslError::UnableToVerifyFirstCertificate)
- || ignoreErrors.contains(QSslError::UnableToGetIssuerCertificate)) {
- break;
- }
- continue;
- case ChainValidationResult_WrongUsage:
- if (ignoreAllSslErrors || ignoreErrors.contains(QSslError::InvalidPurpose))
- break;
- continue;
- case ChainValidationResult_InvalidName:
- if (ignoreAllSslErrors
- || ignoreErrors.contains(QSslError::HostNameMismatch)
- || ignoreErrors.contains(QSslError::SubjectIssuerMismatch)) {
- break;
- }
- continue;
- case ChainValidationResult_RevocationInformationMissing:
- case ChainValidationResult_RevocationFailure:
- default:
- if (ignoreAllSslErrors)
- break;
- continue;
- }
- hr = ignoreList->Append(static_cast<ChainValidationResult>(i));
- Q_ASSERT_SUCCEEDED(hr);
- }
-
- ComPtr<IAsyncAction> op;
- hr = socket->UpgradeToSslAsync(protectionLevel, hostName.Get(), &op);
- if (FAILED(hr)) {
- setErrorAndEmit(QAbstractSocket::SslInternalError,
- QSslSocket::tr("Error creating SSL session: %1").arg(qt_error_string(hr)));
- return;
- }
-
- hr = QEventDispatcherWinRT::runOnXamlThread([this, op]() {
- HRESULT hr = op->put_Completed(Callback<IAsyncActionCompletedHandler>(
- this, &QSslSocketBackendPrivate::onSslUpgrade).Get());
- return hr;
- });
- Q_ASSERT_SUCCEEDED(hr);
-}
-
-HRESULT QSslSocketBackendPrivate::onSslUpgrade(IAsyncAction *action, AsyncStatus)
-{
- Q_Q(QSslSocket);
-
- if (wasDeleted) {
- qCWarning(lcSsl,
- "SSL upgrade callback received after the delegate was deleted. "
- "This may be indicative of an internal bug in the WinRT SSL implementation.");
- return S_OK;
- }
-
- HRESULT hr = action->GetResults();
- QSet<QSslError> errors;
- switch (hr) {
- case SEC_E_INVALID_TOKEN: // Occurs when the server doesn't support the requested protocol
- setErrorAndEmit(QAbstractSocket::SslHandshakeFailedError, qt_error_string(hr));
- q->disconnectFromHost();
- return S_OK;
- default:
- if (FAILED(hr))
- qErrnoWarning(hr, "error"); // Unhandled error; let sslErrors take care of it
- break;
- }
-
- IStreamSocket *socket = reinterpret_cast<IStreamSocket *>(plainSocket->socketDescriptor());
- if (qintptr(socket) == -1) {
- qCWarning(lcSsl,
- "The underlying TCP socket used by the SSL socket is invalid. "
- "This may be indicative of an internal bug in the WinRT SSL implementation.");
- return S_OK;
- }
-
- ComPtr<IStreamSocketInformation> info;
- hr = socket->get_Information(&info);
- Q_ASSERT_SUCCEEDED(hr);
- ComPtr<IStreamSocketInformation2> info2;
- hr = info.As(&info2);
- Q_ASSERT_SUCCEEDED(hr);
-
- // Cipher
- QSsl::SslProtocol protocol;
- SocketProtectionLevel protectionLevel;
- hr = info->get_ProtectionLevel(&protectionLevel);
- switch (protectionLevel) {
- default:
- protocol = QSsl::UnknownProtocol;
- break;
- case SocketProtectionLevel_Ssl:
- protocol = QSsl::SslV3;
- break;
- case SocketProtectionLevel_Tls10:
- protocol = QSsl::TlsV1_0;
- break;
- case SocketProtectionLevel_Tls11:
- protocol = QSsl::TlsV1_1;
- break;
- case SocketProtectionLevel_Tls12:
- protocol = QSsl::TlsV1_2;
- break;
- }
- configuration.sessionCipher = QSslCipher(QStringLiteral("WINRT"), protocol); // The actual cipher name is not accessible
-
- // Certificate & chain
- ComPtr<ICertificate> certificate;
- hr = info2->get_ServerCertificate(&certificate);
- Q_ASSERT_SUCCEEDED(hr);
-
- QList<QSslCertificate> peerCertificateChain;
- if (certificate) {
- ComPtr<IAsyncOperation<CertificateChain *>> op;
- hr = certificate->BuildChainAsync(nullptr, &op);
- Q_ASSERT_SUCCEEDED(hr);
- ComPtr<ICertificateChain> certificateChain;
- hr = QWinRTFunctions::await(op, certificateChain.GetAddressOf());
- Q_ASSERT_SUCCEEDED(hr);
-
- ComPtr<IVectorView<Certificate *>> certificates;
- hr = certificateChain->GetCertificates(true, &certificates);
- Q_ASSERT_SUCCEEDED(hr);
- quint32 certificatesLength;
- hr = certificates->get_Size(&certificatesLength);
- Q_ASSERT_SUCCEEDED(hr);
- for (quint32 i = 0; i < certificatesLength; ++i) {
- ComPtr<ICertificate> chainCertificate;
- hr = certificates->GetAt(i, &chainCertificate);
- Q_ASSERT_SUCCEEDED(hr);
- peerCertificateChain.append(QSslCertificatePrivate::QSslCertificate_from_Certificate(chainCertificate.Get()));
- }
- }
-
- configuration.peerCertificate = certificate ? QSslCertificatePrivate::QSslCertificate_from_Certificate(certificate.Get())
- : QSslCertificate();
- configuration.peerCertificateChain = peerCertificateChain;
-
- // Errors
- ComPtr<IVectorView<ChainValidationResult>> chainValidationResults;
- hr = info2->get_ServerCertificateErrors(&chainValidationResults);
- Q_ASSERT_SUCCEEDED(hr);
- quint32 size;
- hr = chainValidationResults->get_Size(&size);
- Q_ASSERT_SUCCEEDED(hr);
- for (quint32 i = 0; i < size; ++i) {
- ChainValidationResult result;
- hr = chainValidationResults->GetAt(i, &result);
- Q_ASSERT_SUCCEEDED(hr);
- switch (result) {
- case ChainValidationResult_Success:
- break;
- case ChainValidationResult_Untrusted:
- errors.insert(QSslError::CertificateUntrusted);
- break;
- case ChainValidationResult_Revoked:
- errors.insert(QSslError::CertificateRevoked);
- break;
- case ChainValidationResult_Expired:
- errors.insert(QSslError::CertificateExpired);
- break;
- case ChainValidationResult_IncompleteChain:
- errors.insert(QSslError::UnableToGetIssuerCertificate);
- break;
- case ChainValidationResult_InvalidSignature:
- errors.insert(QSslError::CertificateSignatureFailed);
- break;
- case ChainValidationResult_WrongUsage:
- errors.insert(QSslError::InvalidPurpose);
- break;
- case ChainValidationResult_InvalidName:
- errors.insert(QSslError::HostNameMismatch);
- break;
- case ChainValidationResult_InvalidCertificateAuthorityPolicy:
- errors.insert(QSslError::InvalidCaCertificate);
- break;
- default:
- errors.insert(QSslError::UnspecifiedError);
- break;
- }
- }
-
- sslErrors = QList<QSslError>(errors.constBegin(), errors.constEnd());
-
- // Peer validation
- if (!configuration.peerCertificate.isNull()) {
- const QString peerName = verificationPeerName.isEmpty() ? q->peerName() : verificationPeerName;
- if (!isMatchingHostname(configuration.peerCertificate, peerName)) {
- // No matches in common names or alternate names.
- const QSslError error(QSslError::HostNameMismatch, configuration.peerCertificate);
- const int index = sslErrors.indexOf(QSslError::HostNameMismatch);
- if (index >= 0) // Replace the existing error
- sslErrors[index] = error;
- else
- sslErrors.append(error);
- emit q->peerVerifyError(error);
- }
-
- // Peer validation required, but no certificate is present
- } else if (configuration.peerVerifyMode == QSslSocket::VerifyPeer
- || configuration.peerVerifyMode == QSslSocket::AutoVerifyPeer) {
- QSslError error(QSslError::NoPeerCertificate);
- sslErrors.append(error);
- emit q->peerVerifyError(error);
- }
-
- // Peer chain validation
- for (const QSslCertificate &certificate : qAsConst(peerCertificateChain)) {
- if (!QSslCertificatePrivate::isBlacklisted(certificate))
- continue;
-
- QSslError error(QSslError::CertificateBlacklisted, certificate);
- sslErrors.append(error);
- emit q->peerVerifyError(error);
- }
-
- if (!sslErrors.isEmpty()) {
- emit q->sslErrors(sslErrors);
- setErrorAndEmit(QAbstractSocket::SslHandshakeFailedError, sslErrors.constFirst().errorString());
-
- // Disconnect if there are any non-ignorable errors
- for (const QSslError &error : qAsConst(sslErrors)) {
- if (ignoreErrorsList.contains(error))
- continue;
- q->disconnectFromHost();
- return S_OK;
- }
- }
-
- if (readBufferMaxSize)
- plainSocket->setReadBufferSize(readBufferMaxSize);
-
- connectionEncrypted = true;
- emit q->encrypted();
-
- // The write buffer may already have data written to it, so we need to call transmit.
- // This has to be done in 'q's thread, and not in the current thread (the XAML thread).
- QMetaObject::invokeMethod(q, [this](){ transmit(); });
-
- if (pendingClose) {
- pendingClose = false;
- q->disconnectFromHost();
- }
-
- return S_OK;
-}
-
-QList<QSslError> QSslSocketBackendPrivate::verify(const QList<QSslCertificate> &certificateChain, const QString &hostName)
-{
- Q_UNIMPLEMENTED();
- Q_UNUSED(certificateChain)
- Q_UNUSED(hostName)
- QList<QSslError> errors;
-
- return errors;
-}
-
-bool QSslSocketBackendPrivate::importPkcs12(QIODevice *device,
- QSslKey *key, QSslCertificate *cert,
- QList<QSslCertificate> *caCertificates,
- const QByteArray &passPhrase)
-{
- Q_UNIMPLEMENTED();
- Q_UNUSED(device)
- Q_UNUSED(key)
- Q_UNUSED(cert)
- Q_UNUSED(caCertificates)
- Q_UNUSED(passPhrase)
- return false;
-}
-
-QT_END_NAMESPACE
diff --git a/src/network/ssl/qsslsocket_winrt_p.h b/src/network/ssl/qsslsocket_winrt_p.h
deleted file mode 100644
index 030db6d4fa..0000000000
--- a/src/network/ssl/qsslsocket_winrt_p.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtNetwork module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QSSLSOCKET_WINRT_P_H
-#define QSSLSOCKET_WINRT_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists for the convenience
-// of the QtNetwork library. This header file may change from
-// version to version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtNetwork/private/qtnetworkglobal_p.h>
-#include "qsslsocket_p.h"
-
-#include <wrl.h>
-#include <windows.networking.sockets.h>
-
-QT_BEGIN_NAMESPACE
-
-class QSslSocketConnectionHelper : public QObject
-{
- Q_OBJECT
-public:
- QSslSocketConnectionHelper(QSslSocketBackendPrivate *d)
- : d(d) { }
-
- Q_INVOKABLE void disconnectSocketFromHost();
-
-private:
- QSslSocketBackendPrivate *d;
-};
-
-class QSslSocketBackendPrivate : public QSslSocketPrivate
-{
- Q_DECLARE_PUBLIC(QSslSocket)
-public:
- QSslSocketBackendPrivate();
- ~QSslSocketBackendPrivate();
-
- // Platform specific functions
- void startClientEncryption() override;
- void startServerEncryption() override;
- void transmit() override;
- void disconnectFromHost() override;
- void disconnected() override;
- QSslCipher sessionCipher() const override;
- QSsl::SslProtocol sessionProtocol() const override;
- void continueHandshake() override;
-
- static QList<QSslCipher> defaultCiphers();
- static QList<QSslError> verify(const QList<QSslCertificate> &certificateChain, const QString &hostName);
- static bool importPkcs12(QIODevice *device,
- QSslKey *key, QSslCertificate *cert,
- QList<QSslCertificate> *caCertificates,
- const QByteArray &passPhrase);
-
-private:
- HRESULT onSslUpgrade(ABI::Windows::Foundation::IAsyncAction *,
- ABI::Windows::Foundation::AsyncStatus);
-
- QScopedPointer<QSslSocketConnectionHelper> connectionHelper;
- ABI::Windows::Networking::Sockets::SocketProtectionLevel protectionLevel;
- QSet<QSslCertificate> previousCaCertificates;
-};
-
-QT_END_NAMESPACE
-
-#endif // QSSLSOCKET_WINRT_P_H
diff --git a/src/network/ssl/ssl.pri b/src/network/ssl/ssl.pri
index dfbf539303..1310435eb9 100644
--- a/src/network/ssl/ssl.pri
+++ b/src/network/ssl/ssl.pri
@@ -42,16 +42,6 @@ qtConfig(ssl) {
ssl/qsslpresharedkeyauthenticator.cpp \
ssl/qocspresponse.cpp
- winrt {
- HEADERS += ssl/qsslsocket_winrt_p.h
- SOURCES += ssl/qsslcertificate_winrt.cpp \
- ssl/qssldiffiehellmanparameters_dummy.cpp \
- ssl/qsslkey_qt.cpp \
- ssl/qsslkey_winrt.cpp \
- ssl/qsslsocket_winrt.cpp \
- ssl/qsslellipticcurve_dummy.cpp
- }
-
qtConfig(schannel) {
HEADERS += ssl/qsslsocket_schannel_p.h
SOURCES += ssl/qsslsocket_schannel.cpp \
diff --git a/src/platformsupport/fontdatabases/.prev_CMakeLists.txt b/src/platformsupport/fontdatabases/.prev_CMakeLists.txt
index 5ac6c097a0..be84811a9e 100644
--- a/src/platformsupport/fontdatabases/.prev_CMakeLists.txt
+++ b/src/platformsupport/fontdatabases/.prev_CMakeLists.txt
@@ -35,7 +35,7 @@ qt_extend_target(FontDatabaseSupport CONDITION QT_FEATURE_fontconfig
Fontconfig::Fontconfig
)
-qt_extend_target(FontDatabaseSupport CONDITION WIN32 AND NOT WINRT
+qt_extend_target(FontDatabaseSupport CONDITION WIN32
SOURCES
windows/qwindowsfontdatabase.cpp windows/qwindowsfontdatabase_p.h
windows/qwindowsfontdatabasebase.cpp windows/qwindowsfontdatabasebase_p.h
@@ -50,21 +50,21 @@ qt_extend_target(FontDatabaseSupport CONDITION WIN32 AND NOT WINRT
Qt::GuiPrivate
)
-qt_extend_target(FontDatabaseSupport CONDITION QT_FEATURE_freetype AND WIN32 AND NOT WINRT
+qt_extend_target(FontDatabaseSupport CONDITION QT_FEATURE_freetype AND WIN32
SOURCES
windows/qwindowsfontdatabase_ft.cpp windows/qwindowsfontdatabase_ft_p.h
LIBRARIES
WrapFreetype::WrapFreetype
)
-qt_extend_target(FontDatabaseSupport CONDITION QT_FEATURE_direct2d AND QT_FEATURE_directwrite AND WIN32 AND NOT WINRT
+qt_extend_target(FontDatabaseSupport CONDITION QT_FEATURE_direct2d AND QT_FEATURE_directwrite AND WIN32
SOURCES
windows/qwindowsfontenginedirectwrite.cpp windows/qwindowsfontenginedirectwrite_p.h
LIBRARIES
d2d1
)
-qt_extend_target(FontDatabaseSupport CONDITION QT_FEATURE_direct2d AND QT_FEATURE_directwrite AND QT_FEATURE_directwrite3 AND WIN32 AND NOT WINRT
+qt_extend_target(FontDatabaseSupport CONDITION QT_FEATURE_direct2d AND QT_FEATURE_directwrite AND QT_FEATURE_directwrite3 AND WIN32
SOURCES
windows/qwindowsdirectwritefontdatabase.cpp windows/qwindowsdirectwritefontdatabase_p.h
DEFINES
@@ -74,36 +74,24 @@ qt_extend_target(FontDatabaseSupport CONDITION QT_FEATURE_direct2d AND QT_FEATUR
dwrite_3
)
-qt_extend_target(FontDatabaseSupport CONDITION QT_FEATURE_direct2d AND QT_FEATURE_directwrite AND QT_FEATURE_directwrite2 AND WIN32 AND NOT QT_FEATURE_directwrite3 AND NOT WINRT
+qt_extend_target(FontDatabaseSupport CONDITION QT_FEATURE_direct2d AND QT_FEATURE_directwrite AND QT_FEATURE_directwrite2 AND WIN32 AND NOT QT_FEATURE_directwrite3
DEFINES
QT_USE_DIRECTWRITE2
LIBRARIES
dwrite_2
)
-qt_extend_target(FontDatabaseSupport CONDITION QT_FEATURE_direct2d AND QT_FEATURE_directwrite AND WIN32 AND NOT QT_FEATURE_directwrite2 AND NOT QT_FEATURE_directwrite3 AND NOT WINRT
+qt_extend_target(FontDatabaseSupport CONDITION QT_FEATURE_direct2d AND QT_FEATURE_directwrite AND WIN32 AND NOT QT_FEATURE_directwrite2 AND NOT QT_FEATURE_directwrite3
LIBRARIES
dwrite
)
-qt_extend_target(FontDatabaseSupport CONDITION WIN32 AND NOT WINRT AND (NOT QT_FEATURE_direct2d OR NOT QT_FEATURE_directwrite)
+qt_extend_target(FontDatabaseSupport CONDITION WIN32 AND (NOT QT_FEATURE_direct2d OR NOT QT_FEATURE_directwrite)
DEFINES
QT_NO_DIRECTWRITE
)
-qt_extend_target(FontDatabaseSupport CONDITION MINGW AND WIN32 AND NOT WINRT
+qt_extend_target(FontDatabaseSupport CONDITION MINGW AND WIN32
LIBRARIES
uuid
)
-
-qt_extend_target(FontDatabaseSupport CONDITION WINRT
- SOURCES
- winrt/qwinrtfontdatabase.cpp winrt/qwinrtfontdatabase_p.h
- DEFINES
- __WRL_NO_DEFAULT_LIB__
- LIBRARIES
- dwrite_1
- ws2_32
- PUBLIC_LIBRARIES
- Qt::GuiPrivate
-)
diff --git a/src/platformsupport/fontdatabases/CMakeLists.txt b/src/platformsupport/fontdatabases/CMakeLists.txt
index 32efd33a5f..8b37257ded 100644
--- a/src/platformsupport/fontdatabases/CMakeLists.txt
+++ b/src/platformsupport/fontdatabases/CMakeLists.txt
@@ -47,7 +47,7 @@ if(TARGET WrapFreetype::WrapFreetype)
endif()
# special case end
-qt_extend_target(FontDatabaseSupport CONDITION WIN32 AND NOT WINRT
+qt_extend_target(FontDatabaseSupport CONDITION WIN32
SOURCES
windows/qwindowsfontdatabase.cpp windows/qwindowsfontdatabase_p.h
windows/qwindowsfontdatabasebase.cpp windows/qwindowsfontdatabasebase_p.h
@@ -62,21 +62,21 @@ qt_extend_target(FontDatabaseSupport CONDITION WIN32 AND NOT WINRT
Qt::GuiPrivate
)
-qt_extend_target(FontDatabaseSupport CONDITION QT_FEATURE_freetype AND WIN32 AND NOT WINRT
+qt_extend_target(FontDatabaseSupport CONDITION QT_FEATURE_freetype AND WIN32
SOURCES
windows/qwindowsfontdatabase_ft.cpp windows/qwindowsfontdatabase_ft_p.h
LIBRARIES
WrapFreetype::WrapFreetype
)