summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/CMakeLists.txt128
-rw-r--r--src/corelib/Qt6AndroidMacros.cmake432
-rw-r--r--src/corelib/Qt6CTestMacros.cmake148
-rw-r--r--src/corelib/Qt6CoreConfigExtras.cmake.in1
-rw-r--r--src/corelib/Qt6CoreMacros.cmake499
-rw-r--r--src/corelib/Qt6WasmMacros.cmake13
-rw-r--r--src/corelib/QtCore.dynlist2
-rw-r--r--src/corelib/animation/qabstractanimation.cpp9
-rw-r--r--src/corelib/animation/qabstractanimation_p.h1
-rw-r--r--src/corelib/animation/qanimationgroup.cpp2
-rw-r--r--src/corelib/compat/removed_api.cpp25
-rw-r--r--src/corelib/configure.cmake3
-rw-r--r--src/corelib/debug_script.py2
-rw-r--r--src/corelib/doc/images/resources.pngbin49998 -> 0 bytes
-rw-r--r--src/corelib/doc/include/jni.h1
-rw-r--r--src/corelib/doc/qtcore.qdocconf6
-rw-r--r--src/corelib/doc/snippets/cmake-macros/examples.cmake46
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp4
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_io_qdir.cpp13
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_io_qfileinfo.cpp17
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_kernel_qproperty.cpp37
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_text_qbytearrayview.cpp23
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_text_qlocale.cpp20
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_text_qregularexpression.cpp12
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_thread_qfuture.cpp12
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qpoint.cpp4
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qscopedpointer.cpp2
-rw-r--r--src/corelib/doc/snippets/code/src_gui_dialogs_qmessagebox.cpp4
-rw-r--r--src/corelib/doc/snippets/permissions/permissions.cpp141
-rw-r--r--src/corelib/doc/snippets/qmetatype/registerConverters.cpp101
-rw-r--r--src/corelib/doc/snippets/resource-system/CMakeLists.txt31
-rw-r--r--src/corelib/doc/snippets/resource-system/application.pro25
-rw-r--r--src/corelib/doc/snippets/resource-system/application.qrc18
-rw-r--r--src/corelib/doc/snippets/resource-system/images/copy.pngbin0 -> 67 bytes
-rw-r--r--src/corelib/doc/snippets/resource-system/images/cut.pngbin0 -> 67 bytes
-rw-r--r--src/corelib/doc/snippets/resource-system/images/new.pngbin0 -> 67 bytes
-rw-r--r--src/corelib/doc/snippets/resource-system/images/open.pngbin0 -> 67 bytes
-rw-r--r--src/corelib/doc/snippets/resource-system/images/paste.pngbin0 -> 67 bytes
-rw-r--r--src/corelib/doc/snippets/resource-system/images/save.pngbin0 -> 67 bytes
-rw-r--r--src/corelib/doc/snippets/resource-system/main.cpp75
-rw-r--r--src/corelib/doc/src/cmake-macros.qdoc651
-rw-r--r--src/corelib/doc/src/cmake/cmake-commands.qdoc40
-rw-r--r--src/corelib/doc/src/cmake/cmake-properties.qdoc (renamed from src/corelib/doc/src/cmake-properties.qdoc)39
-rw-r--r--src/corelib/doc/src/cmake/cmake-variables.qdoc (renamed from src/corelib/doc/src/cmake-variables.qdoc)55
-rw-r--r--src/corelib/doc/src/cmake/qt_add_big_resources.qdoc67
-rw-r--r--src/corelib/doc/src/cmake/qt_add_binary_resources.qdoc65
-rw-r--r--src/corelib/doc/src/cmake/qt_add_executable.qdoc121
-rw-r--r--src/corelib/doc/src/cmake/qt_add_library.qdoc99
-rw-r--r--src/corelib/doc/src/cmake/qt_add_plugin.qdoc88
-rw-r--r--src/corelib/doc/src/cmake/qt_add_resources.qdoc115
-rw-r--r--src/corelib/doc/src/cmake/qt_allow_non_utf8_sources.qdoc56
-rw-r--r--src/corelib/doc/src/cmake/qt_android_add_apk_target.qdoc74
-rw-r--r--src/corelib/doc/src/cmake/qt_android_apply_arch_suffix.qdoc58
-rw-r--r--src/corelib/doc/src/cmake/qt_android_generate_deployment_settings.qdoc105
-rw-r--r--src/corelib/doc/src/cmake/qt_disable_unicode_defines.qdoc56
-rw-r--r--src/corelib/doc/src/cmake/qt_extract_metatypes.qdoc78
-rw-r--r--src/corelib/doc/src/cmake/qt_finalize_target.qdoc111
-rw-r--r--src/corelib/doc/src/cmake/qt_generate_moc.qdoc67
-rw-r--r--src/corelib/doc/src/cmake/qt_import_plugins.qdoc101
-rw-r--r--src/corelib/doc/src/cmake/qt_set_finalizer_mode.qdoc113
-rw-r--r--src/corelib/doc/src/cmake/qt_wrap_cpp.qdoc76
-rw-r--r--src/corelib/doc/src/containers.qdoc2
-rw-r--r--src/corelib/doc/src/external-resources.qdoc5
-rw-r--r--src/corelib/doc/src/includes/cmake-find-package-core.qdocinc5
-rw-r--r--src/corelib/doc/src/json.qdoc2
-rw-r--r--src/corelib/doc/src/objectmodel/bindableproperties.qdoc2
-rw-r--r--src/corelib/doc/src/qt6-changes.qdoc6
-rw-r--r--src/corelib/doc/src/qtcore-index.qdoc6
-rw-r--r--src/corelib/doc/src/resource-system.qdoc361
-rw-r--r--src/corelib/global/minimum-linux.S81
-rw-r--r--src/corelib/global/minimum-linux_p.h27
-rw-r--r--src/corelib/global/q20algorithm.h116
-rw-r--r--src/corelib/global/q20functional.h (renamed from src/corelib/kernel/qapplicationpermission.h)67
-rw-r--r--src/corelib/global/qcompilerdetection.h44
-rw-r--r--src/corelib/global/qconfig-bootstrapped.h2
-rw-r--r--src/corelib/global/qconfig.cpp.in4
-rw-r--r--src/corelib/global/qendian.h4
-rw-r--r--src/corelib/global/qfloat16.cpp42
-rw-r--r--src/corelib/global/qfloat16.h2
-rw-r--r--src/corelib/global/qfloat16_f16c.c88
-rw-r--r--src/corelib/global/qglobal.cpp194
-rw-r--r--src/corelib/global/qglobal.h31
-rw-r--r--src/corelib/global/qglobal_p.h5
-rw-r--r--src/corelib/global/qglobalstatic.h5
-rw-r--r--src/corelib/global/qlibraryinfo.cpp34
-rw-r--r--src/corelib/global/qlogging.cpp44
-rw-r--r--src/corelib/global/qnamespace.h1
-rw-r--r--src/corelib/global/qnamespace.qdoc15
-rw-r--r--src/corelib/global/qnativeinterface.h8
-rw-r--r--src/corelib/global/qoperatingsystemversion.cpp7
-rw-r--r--src/corelib/global/qoperatingsystemversion_win.cpp16
-rw-r--r--src/corelib/global/qprocessordetection.h4
-rw-r--r--src/corelib/global/qrandom.cpp4
-rw-r--r--src/corelib/global/qsimd_p.h5
-rw-r--r--src/corelib/global/qt_pch.h2
-rw-r--r--src/corelib/global/qtypeinfo.h19
-rw-r--r--src/corelib/global/qversiontagging.cpp1
-rw-r--r--src/corelib/io/qabstractfileengine.cpp2
-rw-r--r--src/corelib/io/qdebug.cpp32
-rw-r--r--src/corelib/io/qdebug.h63
-rw-r--r--src/corelib/io/qdir.cpp18
-rw-r--r--src/corelib/io/qfile.cpp40
-rw-r--r--src/corelib/io/qfile.h71
-rw-r--r--src/corelib/io/qfileinfo.cpp6
-rw-r--r--src/corelib/io/qfilesystemengine_p.h1
-rw-r--r--src/corelib/io/qfilesystemengine_unix.cpp9
-rw-r--r--src/corelib/io/qfilesystemengine_win.cpp17
-rw-r--r--src/corelib/io/qfilesystemiterator_win.cpp2
-rw-r--r--src/corelib/io/qfilesystemwatcher_win.cpp3
-rw-r--r--src/corelib/io/qfsfileengine_p.h6
-rw-r--r--src/corelib/io/qfsfileengine_unix.cpp11
-rw-r--r--src/corelib/io/qfsfileengine_win.cpp9
-rw-r--r--src/corelib/io/qiodevice.cpp168
-rw-r--r--src/corelib/io/qiodevice_p.h1
-rw-r--r--src/corelib/io/qipaddress.cpp7
-rw-r--r--src/corelib/io/qloggingregistry.cpp31
-rw-r--r--src/corelib/io/qloggingregistry_p.h33
-rw-r--r--src/corelib/io/qprocess_p.h1
-rw-r--r--src/corelib/io/qprocess_win.cpp14
-rw-r--r--src/corelib/io/qresource.cpp6
-rw-r--r--src/corelib/io/qsettings.cpp2
-rw-r--r--src/corelib/io/qstandardpaths_unix.cpp4
-rw-r--r--src/corelib/io/qstandardpaths_win.cpp2
-rw-r--r--src/corelib/io/qstorageinfo_unix.cpp20
-rw-r--r--src/corelib/io/qtemporaryfile.cpp2
-rw-r--r--src/corelib/io/qurl.cpp95
-rw-r--r--src/corelib/io/qurl.h17
-rw-r--r--src/corelib/io/qurl_p.h5
-rw-r--r--src/corelib/io/qurlidna.cpp2863
-rw-r--r--src/corelib/io/qurlrecode.cpp81
-rw-r--r--src/corelib/io/qwindowspipereader.cpp24
-rw-r--r--src/corelib/io/qwindowspipereader_p.h1
-rw-r--r--src/corelib/io/qwindowspipewriter.cpp151
-rw-r--r--src/corelib/io/qwindowspipewriter_p.h16
-rw-r--r--src/corelib/itemmodels/qitemselectionmodel.cpp7
-rw-r--r--src/corelib/itemmodels/qitemselectionmodel.h2
-rw-r--r--src/corelib/itemmodels/qsortfilterproxymodel.cpp3
-rw-r--r--src/corelib/kernel/qapplicationpermission.qdoc100
-rw-r--r--src/corelib/kernel/qbasictimer.cpp2
-rw-r--r--src/corelib/kernel/qcfsocketnotifier.cpp2
-rw-r--r--src/corelib/kernel/qcore_mac_p.h2
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp243
-rw-r--r--src/corelib/kernel/qcoreapplication.h15
-rw-r--r--src/corelib/kernel/qcoreapplication_p.h22
-rw-r--r--src/corelib/kernel/qcoreapplication_platform.h12
-rw-r--r--src/corelib/kernel/qcoreevent.cpp4
-rw-r--r--src/corelib/kernel/qcoreglobaldata_p.h3
-rw-r--r--src/corelib/kernel/qdeadlinetimer.cpp2
-rw-r--r--src/corelib/kernel/qeventdispatcher_cf.mm2
-rw-r--r--src/corelib/kernel/qeventdispatcher_wasm.cpp587
-rw-r--r--src/corelib/kernel/qeventdispatcher_wasm_p.h127
-rw-r--r--src/corelib/kernel/qeventloop.cpp4
-rw-r--r--src/corelib/kernel/qfunctions_winrt_p.h27
-rw-r--r--src/corelib/kernel/qjnienvironment.h2
-rw-r--r--src/corelib/kernel/qjniobject.h2
-rw-r--r--src/corelib/kernel/qmath.h2
-rw-r--r--src/corelib/kernel/qmetacontainer.h2
-rw-r--r--src/corelib/kernel/qmetaobject.cpp108
-rw-r--r--src/corelib/kernel/qmetaobjectbuilder_p.h1
-rw-r--r--src/corelib/kernel/qmetatype.cpp37
-rw-r--r--src/corelib/kernel/qmetatype.h64
-rw-r--r--src/corelib/kernel/qmetatype_p.h8
-rw-r--r--src/corelib/kernel/qmimedata.cpp2
-rw-r--r--src/corelib/kernel/qobject.cpp57
-rw-r--r--src/corelib/kernel/qobject.h36
-rw-r--r--src/corelib/kernel/qobject_p.h39
-rw-r--r--src/corelib/kernel/qobjectdefs_impl.h9
-rw-r--r--src/corelib/kernel/qproperty.cpp459
-rw-r--r--src/corelib/kernel/qproperty.h18
-rw-r--r--src/corelib/kernel/qproperty_p.h265
-rw-r--r--src/corelib/kernel/qpropertyprivate.h20
-rw-r--r--src/corelib/kernel/qtimer.cpp2
-rw-r--r--src/corelib/kernel/qtranslator.cpp2
-rw-r--r--src/corelib/kernel/qvariant.cpp16
-rw-r--r--src/corelib/kernel/qvariant.h13
-rw-r--r--src/corelib/kernel/qwineventnotifier.cpp4
-rw-r--r--src/corelib/mimetypes/mimetypes_resources.cmake2
-rw-r--r--src/corelib/mimetypes/qmimeglobpattern.cpp108
-rw-r--r--src/corelib/mimetypes/qmimeglobpattern_p.h19
-rw-r--r--src/corelib/mimetypes/qmimeprovider.cpp1
-rw-r--r--src/corelib/platform/android/qandroidextras.cpp33
-rw-r--r--src/corelib/platform/android/qandroidextras_p.h2
-rw-r--r--src/corelib/platform/android/qandroidnativeinterface.cpp2
-rw-r--r--src/corelib/platform/wasm/qstdweb_p.h2
-rw-r--r--src/corelib/plugin/qelfparser_p.cpp880
-rw-r--r--src/corelib/plugin/qelfparser_p.h42
-rw-r--r--src/corelib/plugin/qfactoryloader.cpp168
-rw-r--r--src/corelib/plugin/qfactoryloader_p.h63
-rw-r--r--src/corelib/plugin/qlibrary.cpp306
-rw-r--r--src/corelib/plugin/qlibrary_p.h17
-rw-r--r--src/corelib/plugin/qlibrary_unix.cpp2
-rw-r--r--src/corelib/plugin/qlibrary_win.cpp3
-rw-r--r--src/corelib/plugin/qmachparser.cpp60
-rw-r--r--src/corelib/plugin/qmachparser_p.h6
-rw-r--r--src/corelib/plugin/qplugin.h158
-rw-r--r--src/corelib/plugin/qplugin_p.h61
-rw-r--r--src/corelib/plugin/qpluginloader.cpp26
-rw-r--r--src/corelib/plugin/quuid.cpp65
-rw-r--r--src/corelib/plugin/quuid.h7
-rw-r--r--src/corelib/serialization/qcborarray.cpp2
-rw-r--r--src/corelib/serialization/qcborcommon.cpp18
-rw-r--r--src/corelib/serialization/qcbordiagnostic.cpp2
-rw-r--r--src/corelib/serialization/qcbormap.cpp4
-rw-r--r--src/corelib/serialization/qcborstreamreader.cpp4
-rw-r--r--src/corelib/serialization/qcborstreamwriter.cpp9
-rw-r--r--src/corelib/serialization/qcborvalue.cpp12
-rw-r--r--src/corelib/serialization/qdatastream.cpp9
-rw-r--r--src/corelib/serialization/qdatastream.h88
-rw-r--r--src/corelib/serialization/qjsonparser.cpp16
-rw-r--r--src/corelib/serialization/qjsonvalue.cpp2
-rw-r--r--src/corelib/serialization/qjsonwriter.cpp6
-rw-r--r--src/corelib/serialization/qxmlstream.cpp2
-rw-r--r--src/corelib/serialization/qxmlstream.h2
-rw-r--r--src/corelib/text/qanystringview.qdoc10
-rw-r--r--src/corelib/text/qbytearray.cpp314
-rw-r--r--src/corelib/text/qbytearray.h25
-rw-r--r--src/corelib/text/qbytearrayalgorithms.h16
-rw-r--r--src/corelib/text/qbytearraymatcher.cpp39
-rw-r--r--src/corelib/text/qbytearraymatcher.h9
-rw-r--r--src/corelib/text/qbytearrayview.h22
-rw-r--r--src/corelib/text/qbytearrayview.qdoc322
-rw-r--r--src/corelib/text/qbytedata_p.h2
-rw-r--r--src/corelib/text/qchar.cpp12
-rw-r--r--src/corelib/text/qchar.h10
-rw-r--r--src/corelib/text/qcollator_p.h4
-rw-r--r--src/corelib/text/qcollator_win.cpp25
-rw-r--r--src/corelib/text/qlocale.cpp429
-rw-r--r--src/corelib/text/qlocale.h11
-rw-r--r--src/corelib/text/qlocale.qdoc28
-rw-r--r--src/corelib/text/qlocale_mac.mm93
-rw-r--r--src/corelib/text/qlocale_p.h183
-rw-r--r--src/corelib/text/qlocale_tools.cpp369
-rw-r--r--src/corelib/text/qlocale_tools_p.h40
-rw-r--r--src/corelib/text/qlocale_unix.cpp19
-rw-r--r--src/corelib/text/qlocale_win.cpp106
-rw-r--r--src/corelib/text/qregularexpression.cpp93
-rw-r--r--src/corelib/text/qregularexpression.h7
-rw-r--r--src/corelib/text/qstring.cpp658
-rw-r--r--src/corelib/text/qstring.h51
-rw-r--r--src/corelib/text/qstringconverter.cpp89
-rw-r--r--src/corelib/text/qstringconverter_p.h54
-rw-r--r--src/corelib/text/qstringliteral.h18
-rw-r--r--src/corelib/text/qstringtokenizer.h4
-rw-r--r--src/corelib/text/qstringview.cpp193
-rw-r--r--src/corelib/text/qstringview.h19
-rw-r--r--src/corelib/text/qt_attribution.json6
-rw-r--r--src/corelib/text/qunicodetables.cpp27886
-rw-r--r--src/corelib/text/qunicodetables_p.h23
-rw-r--r--src/corelib/text/qunicodetools.cpp44
-rw-r--r--src/corelib/text/qutf8stringview.h5
-rw-r--r--src/corelib/text/qutf8stringview.qdoc37
-rw-r--r--src/corelib/thread/qfutex_p.h5
-rw-r--r--src/corelib/thread/qfuture.qdoc96
-rw-r--r--src/corelib/thread/qfutureinterface.cpp30
-rw-r--r--src/corelib/thread/qfutureinterface.h5
-rw-r--r--src/corelib/thread/qfuturewatcher.cpp4
-rw-r--r--src/corelib/thread/qgenericatomic.h2
-rw-r--r--src/corelib/thread/qlocking_p.h4
-rw-r--r--src/corelib/thread/qmutex.h4
-rw-r--r--src/corelib/thread/qpromise.h6
-rw-r--r--src/corelib/thread/qreadwritelock.cpp2
-rw-r--r--src/corelib/thread/qresultstore.h4
-rw-r--r--src/corelib/thread/qsemaphore.cpp21
-rw-r--r--src/corelib/thread/qthread.cpp2
-rw-r--r--src/corelib/thread/qthread.h7
-rw-r--r--src/corelib/thread/qthread_p.h3
-rw-r--r--src/corelib/thread/qthread_unix.cpp12
-rw-r--r--src/corelib/thread/qthreadpool.cpp151
-rw-r--r--src/corelib/thread/qthreadpool.h3
-rw-r--r--src/corelib/thread/qthreadpool_p.h1
-rw-r--r--src/corelib/thread/qthreadstorage.cpp2
-rw-r--r--src/corelib/thread/qwaitcondition_p.h26
-rw-r--r--src/corelib/time/qcalendar.cpp879
-rw-r--r--src/corelib/time/qcalendar.h9
-rw-r--r--src/corelib/time/qcalendarbackend_p.h23
-rw-r--r--src/corelib/time/qdatetime.cpp123
-rw-r--r--src/corelib/time/qdatetimeparser.cpp46
-rw-r--r--src/corelib/time/qdatetimeparser_p.h16
-rw-r--r--src/corelib/time/qgregoriancalendar.cpp15
-rw-r--r--src/corelib/time/qgregoriancalendar_p.h2
-rw-r--r--src/corelib/time/qhijricalendar_p.h3
-rw-r--r--src/corelib/time/qislamiccivilcalendar.cpp21
-rw-r--r--src/corelib/time/qislamiccivilcalendar_p.h2
-rw-r--r--src/corelib/time/qjalalicalendar.cpp15
-rw-r--r--src/corelib/time/qjalalicalendar_p.h2
-rw-r--r--src/corelib/time/qjuliancalendar.cpp9
-rw-r--r--src/corelib/time/qjuliancalendar_p.h2
-rw-r--r--src/corelib/time/qmilankoviccalendar.cpp9
-rw-r--r--src/corelib/time/qmilankoviccalendar_p.h2
-rw-r--r--src/corelib/time/qromancalendar_p.h3
-rw-r--r--src/corelib/time/qtimezone.cpp12
-rw-r--r--src/corelib/time/qtimezoneprivate.cpp206
-rw-r--r--src/corelib/time/qtimezoneprivate_android.cpp2
-rw-r--r--src/corelib/time/qtimezoneprivate_data_p.h34
-rw-r--r--src/corelib/time/qtimezoneprivate_icu.cpp14
-rw-r--r--src/corelib/time/qtimezoneprivate_p.h6
-rw-r--r--src/corelib/time/qtimezoneprivate_tz.cpp16
-rw-r--r--src/corelib/tools/qarraydataops.h18
-rw-r--r--src/corelib/tools/qcontiguouscache.h5
-rw-r--r--src/corelib/tools/qcryptographichash.cpp5
-rw-r--r--src/corelib/tools/qduplicatetracker_p.h2
-rw-r--r--src/corelib/tools/qeasingcurve.cpp2
-rw-r--r--src/corelib/tools/qhash.cpp223
-rw-r--r--src/corelib/tools/qhash.h79
-rw-r--r--src/corelib/tools/qlist.h174
-rw-r--r--src/corelib/tools/qlist.qdoc2
-rw-r--r--src/corelib/tools/qmap.h36
-rw-r--r--src/corelib/tools/qmap.qdoc40
-rw-r--r--src/corelib/tools/qmultimap.qdoc36
-rw-r--r--src/corelib/tools/qoffsetstringarray_p.h203
-rw-r--r--src/corelib/tools/qringbuffer.cpp12
-rw-r--r--src/corelib/tools/qringbuffer_p.h19
-rw-r--r--src/corelib/tools/qscopedpointer.h9
-rw-r--r--src/corelib/tools/qscopeguard.h2
-rw-r--r--src/corelib/tools/qset.h11
-rw-r--r--src/corelib/tools/qset.qdoc10
-rw-r--r--src/corelib/tools/qsharedpointer_impl.h16
-rw-r--r--src/corelib/tools/qvarlengtharray.h21
-rw-r--r--src/corelib/tools/qvarlengtharray.qdoc26
-rw-r--r--src/corelib/tools/qversionnumber.cpp6
-rw-r--r--src/corelib/tools/qversionnumber.h12
321 files changed, 28992 insertions, 18843 deletions
diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt
index b77cf35b92..0301acfa97 100644
--- a/src/corelib/CMakeLists.txt
+++ b/src/corelib/CMakeLists.txt
@@ -61,6 +61,8 @@ qt_internal_add_module(Core
global/qsystemdetection.h
global/qtypeinfo.h
global/qvolatile_p.h
+ global/q20algorithm.h
+ global/q20functional.h
io/qabstractfileengine.cpp io/qabstractfileengine_p.h
io/qbuffer.cpp io/qbuffer.h
io/qdataurl.cpp io/qdataurl_p.h
@@ -121,7 +123,6 @@ qt_internal_add_module(Core
kernel/qobjectcleanuphandler.cpp kernel/qobjectcleanuphandler.h
kernel/qobjectdefs.h
kernel/qobjectdefs_impl.h
- kernel/qapplicationpermission.h
kernel/qpointer.cpp kernel/qpointer.h
kernel/qproperty.cpp kernel/qproperty.h kernel/qproperty_p.h
kernel/qpropertyprivate.h
@@ -287,6 +288,8 @@ add_dependencies(Core qmodule_pri)
if (NOT QT_NAMESPACE STREQUAL "")
target_compile_definitions(Core PUBLIC "QT_NAMESPACE=${QT_NAMESPACE}")
+ set_target_properties(Core PROPERTIES _qt_namespace "${QT_NAMESPACE}")
+ set_property(TARGET Core APPEND PROPERTY EXPORT_PROPERTIES _qt_namespace)
endif()
qt_generate_qconfig_cpp(global/qconfig.cpp.in global/qconfig.cpp)
@@ -295,7 +298,7 @@ set_target_properties(Core PROPERTIES INTERFACE_QT_COORD_TYPE "${QT_COORD_TYPE}"
set_property(TARGET Core APPEND PROPERTY COMPATIBLE_INTERFACE_STRING QT_COORD_TYPE)
# Handle qtConfig(thread): CONFIG += thread like in qt.prf.
-# Aka if the feature is enabled, publically link against the threading library.
+# Aka if the feature is enabled, publicly link against the threading library.
# This also ensures the link flag is in the .prl file.
if(QT_FEATURE_thread)
target_link_libraries(Platform INTERFACE Threads::Threads)
@@ -316,11 +319,10 @@ set_source_files_properties(${qobject_moc_files} PROPERTIES HEADER_FILE_ONLY ON)
set(core_metatype_args MANUAL_MOC_JSON_FILES ${core_qobject_metatypes_json_list})
-set(metatypes_install_dir ${INSTALL_LIBDIR}/metatypes)
-if (NOT QT_WILL_INSTALL)
- list(APPEND core_metatype_args __QT_INTERNAL_NO_INSTALL)
-else()
- list(APPEND core_metatype_args INSTALL_DIR "${metatypes_install_dir}")
+if(QT_WILL_INSTALL)
+ set(metatypes_install_dir ${INSTALL_LIBDIR}/metatypes)
+ list(APPEND core_metatype_args
+ __QT_INTERNAL_INSTALL __QT_INTERNAL_INSTALL_DIR "${metatypes_install_dir}")
endif()
# Use qt6_extract_metatypes instead of GENERATE_METATYPES so that we can manually pass the
# additional json files.
@@ -383,7 +385,6 @@ endif()
# INSTALLS = "ctest_qt5_module_files" "cmake_qt5_umbrella_module_files"
# MODULE = "core"
# MODULE_CONFIG = "moc" "resources"
-# QMAKE_DSYM_DEBUG_SCRIPT = "$$PWD/debug_script.py"
# QMAKE_PKGCONFIG_VARIABLES = "host_bins" "qt_conf"
# QMAKE_SUBSTITUTES = "ctest_macros_file" "cmake_umbrella_config_file" "cmake_umbrella_config_module_location" "cmake_umbrella_config_module_location_for_install" "cmake_umbrella_config_version_file" "cmake_extras_mkspec_dir" "cmake_extras_mkspec_dir_for_install"
# cmake_extras_mkspec_dir.input = "$$PWD/Qt5CoreConfigExtrasMkspecDir.cmake.in"
@@ -558,23 +559,6 @@ qt_internal_extend_target(Core CONDITION GCC AND (CMAKE_CXX_COMPILER_VERSION VER
# CMAKE_INSTALL_DATA_DIR = "$$[QT_HOST_DATA]/"
# CMAKE_INSTALL_DATA_DIR_IS_ABSOLUTE = "True"
-#### Keys ignored in scope 20:.:global:global/global.pri:QT_CPU_FEATURES__ss_QT_ARCH___contains___f16c:
-# f16c_cxx = "true"
-
-#### Keys ignored in scope 22:.:global:global/global.pri:CLANG OR intel_icl OR ICC:
-# f16c_cxx = "false"
-
-#### Keys ignored in scope 24:.:global:global/global.pri:GCC AND f16c AND x86SimdAlways:
-# f16c_cxx = "true"
-
-#### 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 27:.:global:global/global.pri:else:
-# f16c_cxx = "false"
-
-# qt_internal_extend_target(Core CONDITION _ss_f16c_cxx ... # special case remove: Handled manually
-
# special case begin
# Remove this because it's handled manually
#qt_internal_extend_target(Core CONDITION NOT _x_-armcc_x_ AND NOT cross_compile AND NOT static AND (hurd_x_ OR linux_x_)
@@ -590,23 +574,6 @@ qt_internal_extend_target(Core CONDITION LINUX AND QT_BUILD_SHARED_LIBS
global/minimum-linux_p.h
)
-#### 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}"
-# no_pch_assembler.dependency_type = "TYPE_C"
-# no_pch_assembler.input = "NO_PCH_ASM"
-# 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 35:.:global:global/global.pri:silent:
-# no_pch_assembler.commands = "@echo" "compiling[no_pch]" "${QMAKE_FILE_IN}" "&&"
-
-qt_internal_extend_target(Core CONDITION LINUX AND NOT precompile_header AND QT_BUILD_SHARED_LIBS
- SOURCES
- global/minimum-linux.S
-)
-
qt_internal_extend_target(Core CONDITION QT_FEATURE_slog2
LIBRARIES
Slog2::Slog2
@@ -622,7 +589,7 @@ target_sources(Core PRIVATE ${core_version_tagging_files})
# Disable LTO, as the symbols disappear somehow under GCC
# (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48200)
-if(GCC AND FEATURE_ltcg)
+if(GCC)
set_source_files_properties(${core_version_tagging_files}
PROPERTIES COMPILE_OPTIONS "-fno-lto")
endif()
@@ -690,12 +657,6 @@ qt_internal_extend_target(Core CONDITION QT_FEATURE_std_atomic64
WrapAtomic::WrapAtomic
)
-qt_internal_extend_target(Core CONDITION ICC
- COMPILE_OPTIONS
- -fp-model
- strict
-)
-
qt_internal_extend_target(Core CONDITION QT_FEATURE_system_zlib
LIBRARIES
WrapZLIB::WrapZLIB
@@ -776,7 +737,7 @@ qt_internal_extend_target(Core CONDITION QT_FEATURE_easingcurve
tools/qtimeline.cpp tools/qtimeline.h
)
-qt_internal_extend_target(Core CONDITION UNIX AND NOT HAIKU AND NOT INTEGRITY AND NOT VXWORKS AND NOT WASM AND (NOT ICC OR NOT MACOS)
+qt_internal_extend_target(Core CONDITION UNIX AND NOT HAIKU AND NOT INTEGRITY AND NOT VXWORKS AND NOT WASM AND NOT MACOS
LIBRARIES
m
)
@@ -791,11 +752,17 @@ qt_internal_extend_target(Core CONDITION UNIX AND (NACL OR NOT APPLE)
text/qlocale_unix.cpp
)
-qt_internal_extend_target(Core CONDITION WIN32 AND (NACL OR NOT APPLE)
+qt_internal_extend_target(Core CONDITION WIN32
SOURCES
text/qlocale_win.cpp
)
+# On MS-Win, clang has two flavors, one of which immitates MSVC (so claims to be it)
+qt_internal_extend_target(Core CONDITION WIN32 AND MSVC AND NOT CLANG
+ LIBRARIES
+ runtimeobject
+)
+
qt_internal_extend_target(Core CONDITION QT_FEATURE_icu
SOURCES
text/qcollator_icu.cpp
@@ -855,27 +822,27 @@ qt_internal_extend_target(Core CONDITION APPLE AND QT_FEATURE_timezone AND NOT N
time/qtimezoneprivate_mac.mm
)
-qt_internal_extend_target(Core CONDITION ANDROID AND QT_FEATURE_timezone AND NOT ANDROID_EMBEDDED AND (NACL OR NOT APPLE)
+qt_internal_extend_target(Core CONDITION QT_FEATURE_timezone AND ANDROID AND (NACL OR NOT APPLE)
SOURCES
time/qtimezoneprivate_android.cpp
)
-qt_internal_extend_target(Core CONDITION QT_FEATURE_timezone AND UNIX AND (ANDROID_EMBEDDED OR NOT ANDROID) AND (NACL OR NOT APPLE)
+qt_internal_extend_target(Core CONDITION QT_FEATURE_timezone AND UNIX AND NOT ANDROID AND (NACL OR NOT APPLE)
SOURCES
time/qtimezoneprivate_tz.cpp
)
-qt_internal_extend_target(Core CONDITION QT_FEATURE_icu AND QT_FEATURE_timezone AND UNIX AND (ANDROID_EMBEDDED OR NOT ANDROID) AND (NACL OR NOT APPLE)
+qt_internal_extend_target(Core CONDITION QT_FEATURE_icu AND QT_FEATURE_timezone AND UNIX AND NOT ANDROID AND (NACL OR NOT APPLE)
SOURCES
time/qtimezoneprivate_icu.cpp
)
-qt_internal_extend_target(Core CONDITION QT_FEATURE_icu AND QT_FEATURE_timezone AND WIN32 AND (ANDROID_EMBEDDED OR NOT ANDROID) AND (NACL OR NOT APPLE)
+qt_internal_extend_target(Core CONDITION QT_FEATURE_icu AND QT_FEATURE_timezone AND WIN32 AND NOT ANDROID AND (NACL OR NOT APPLE)
SOURCES
time/qtimezoneprivate_icu.cpp
)
-qt_internal_extend_target(Core CONDITION QT_FEATURE_timezone AND WIN32 AND NOT QT_FEATURE_icu AND (ANDROID_EMBEDDED OR NOT ANDROID) AND (NACL OR NOT APPLE)
+qt_internal_extend_target(Core CONDITION QT_FEATURE_timezone AND WIN32 AND NOT QT_FEATURE_icu AND NOT ANDROID AND (NACL OR NOT APPLE)
SOURCES
time/qtimezoneprivate_win.cpp
)
@@ -979,7 +946,7 @@ qt_internal_extend_target(Core CONDITION UNIX AND NOT APPLE
kernel/qelapsedtimer_unix.cpp
)
-qt_internal_extend_target(Core CONDITION ANDROID AND NOT ANDROID_EMBEDDED
+qt_internal_extend_target(Core CONDITION ANDROID
SOURCES
io/qstandardpaths_android.cpp
io/qstorageinfo_unix.cpp
@@ -990,7 +957,7 @@ qt_internal_extend_target(Core CONDITION ANDROID AND NOT ANDROID_EMBEDDED
platform/android/qandroidnativeinterface.cpp
)
-qt_internal_extend_target(Core CONDITION HAIKU AND (ANDROID_EMBEDDED OR NOT ANDROID)
+qt_internal_extend_target(Core CONDITION HAIKU AND NOT ANDROID
SOURCES
io/qstandardpaths_haiku.cpp
io/qstorageinfo_unix.cpp
@@ -998,7 +965,7 @@ qt_internal_extend_target(Core CONDITION HAIKU AND (ANDROID_EMBEDDED OR NOT ANDR
be
)
-qt_internal_extend_target(Core CONDITION UNIX AND NOT APPLE AND NOT HAIKU AND (ANDROID_EMBEDDED OR NOT ANDROID)
+qt_internal_extend_target(Core CONDITION UNIX AND NOT APPLE AND NOT HAIKU AND NOT ANDROID
SOURCES
io/qstandardpaths_unix.cpp
io/qstorageinfo_unix.cpp
@@ -1288,23 +1255,9 @@ endif()
qt_internal_extend_target(Core CONDITION WASM
SOURCES
platform/wasm/qstdweb.cpp platform/wasm/qstdweb_p.h
+ kernel/qeventdispatcher_wasm.cpp kernel/qeventdispatcher_wasm_p.h
)
-# special case begin
-# needs refinement for the other compiler specific cases.
-if(TEST_arch_${TEST_architecture_arch}_subarch_f16c)
- # Equivalent to contains(QT_CPU_FEATURES.$$QT_ARCH, f16c)
- qt_internal_extend_target(Core
- DEFINES
- QFLOAT16_INCLUDE_FAST
- )
-else()
- qt_internal_add_simd_part(Core SIMD f16c
- SOURCES
- global/qfloat16_f16c.c
- )
-endif()
-
set_source_files_properties(
thread/qmutex_mac.cpp
thread/qmutex_unix.cpp
@@ -1371,4 +1324,29 @@ endif()
qt_internal_add_optimize_full_flags()
-# special case end
+# Copy / install an lldb python script into the QtCore.framework.dSYM bundle which searches
+# for the latest installed Qt Creator and loads its lldbbridge.py script.
+# When debugging a Qt app, lldb will prompt the developer to explicitly import the shim script.
+# It will then enable Qt C++ type pretty printers when using command-line lldb or Xcode
+# (e.g. show contents of QString).
+if(APPLE AND QT_FEATURE_framework AND QT_FEATURE_separate_debug_info)
+ qt_internal_module_info(dsym_module_name "Core")
+
+ set(dsym_dir "${dsym_module_name}.framework.dSYM")
+ set(script_name "${dsym_module_name}.py")
+ set(dsym_script_dir_suffix "${INSTALL_LIBDIR}/${dsym_dir}/Contents/Resources/Python")
+ set(dsym_script_build_path "${QT_BUILD_DIR}/${dsym_script_dir_suffix}/${script_name}")
+
+ qt_path_join(dsym_script_install_dir
+ ${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX} ${dsym_script_dir_suffix})
+
+ configure_file(
+ "${CMAKE_CURRENT_SOURCE_DIR}/debug_script.py"
+ "${dsym_script_build_path}"
+ @ONLY
+ )
+ qt_install(FILES
+ "${dsym_script_build_path}"
+ DESTINATION "${dsym_script_install_dir}"
+ )
+endif()
diff --git a/src/corelib/Qt6AndroidMacros.cmake b/src/corelib/Qt6AndroidMacros.cmake
index e37ce287bd..74f5fc1913 100644
--- a/src/corelib/Qt6AndroidMacros.cmake
+++ b/src/corelib/Qt6AndroidMacros.cmake
@@ -19,6 +19,23 @@ endfunction()
# Generate the deployment settings json file for a cmake target.
function(qt6_android_generate_deployment_settings target)
+ # When parsing JSON file format backslashes and follow up symbols are regarded as special
+ # characters. This puts Windows path format into a trouble.
+ # _qt_internal_android_format_deployment_paths converts sensitive paths to the CMake format
+ # that is supported by JSON as well. The function should be called as many times as
+ # qt6_android_generate_deployment_settings, because users may change properties that contain
+ # paths in between the calls.
+ _qt_internal_android_format_deployment_paths(${target})
+
+ # Avoid calling the function body twice because of 'file(GENERATE'.
+ get_target_property(is_called ${target} _qt_is_android_generate_deployment_settings_called)
+ if(is_called)
+ return()
+ endif()
+ set_target_properties(${target} PROPERTIES
+ _qt_is_android_generate_deployment_settings_called TRUE
+ )
+
# Information extracted from mkspecs/features/android/android_deployment_settings.prf
if (NOT TARGET ${target})
message(SEND_ERROR "${target} is not a cmake target")
@@ -53,9 +70,9 @@ function(qt6_android_generate_deployment_settings target)
file(GLOB plugin_dir_files LIST_DIRECTORIES FALSE "${glob_expression}")
if (NOT plugin_dir_files)
message(SEND_ERROR
- "Detected Qt installation does not contain qtforandroid_${CMAKE_ANDROID_ARCH_ABI}.so in the following dir:"
- "${android_plugin_dir_path}"
- "This is most likely due to the installation not being a Qt for Android build."
+ "Detected Qt installation does not contain qtforandroid_${CMAKE_ANDROID_ARCH_ABI}.so in the following dir:\n"
+ "${android_plugin_dir_path}\n"
+ "This is most likely due to the installation not being a Qt for Android build. "
"Please recheck your build configuration.")
return()
else()
@@ -64,10 +81,30 @@ function(qt6_android_generate_deployment_settings target)
endif()
endif()
- set(qt_android_install_dir "${QT6_INSTALL_PREFIX}")
+ set(abi_records "")
+ get_target_property(qt_android_abis ${target} _qt_android_abis)
+ if(qt_android_abis)
+ foreach(abi IN LISTS qt_android_abis)
+ _qt_internal_get_android_abi_path(qt_abi_path ${abi})
+ file(TO_CMAKE_PATH "${qt_abi_path}" qt_android_install_dir_native)
+ list(APPEND abi_records "\"${abi}\": \"${qt_android_install_dir_native}\"")
+ endforeach()
+ endif()
+
+ # Required to build unit tests in developer build
+ if(QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX)
+ set(qt_android_install_dir "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}")
+ else()
+ set(qt_android_install_dir "${QT6_INSTALL_PREFIX}")
+ endif()
file(TO_CMAKE_PATH "${qt_android_install_dir}" qt_android_install_dir_native)
+ list(APPEND abi_records "\"${CMAKE_ANDROID_ARCH_ABI}\": \"${qt_android_install_dir_native}\"")
+
+ list(JOIN abi_records "," qt_android_install_dir_records)
+ set(qt_android_install_dir_records "{${qt_android_install_dir_records}}")
+
string(APPEND file_contents
- " \"qt\": \"${qt_android_install_dir_native}\",\n")
+ " \"qt\": ${qt_android_install_dir_records},\n")
# Android SDK path
file(TO_CMAKE_PATH "${ANDROID_SDK_ROOT}" android_sdk_root_native)
@@ -75,9 +112,12 @@ function(qt6_android_generate_deployment_settings target)
" \"sdk\": \"${android_sdk_root_native}\",\n")
# Android SDK Build Tools Revision
- _qt_internal_android_get_sdk_build_tools_revision(QT_ANDROID_SDK_BUILD_TOOLS_REVISION)
+ get_target_property(android_sdk_build_tools ${target} QT_ANDROID_SDK_BUILD_TOOLS_REVISION)
+ if (NOT android_sdk_build_tools)
+ _qt_internal_android_get_sdk_build_tools_revision(android_sdk_build_tools)
+ endif()
string(APPEND file_contents
- " \"sdkBuildToolsRevision\": \"${QT_ANDROID_SDK_BUILD_TOOLS_REVISION}\",\n")
+ " \"sdkBuildToolsRevision\": \"${android_sdk_build_tools}\",\n")
# Android NDK
file(TO_CMAKE_PATH "${CMAKE_ANDROID_NDK}" android_ndk_root_native)
@@ -100,100 +140,67 @@ function(qt6_android_generate_deployment_settings target)
string(APPEND file_contents
" \"ndk-host\": \"${ANDROID_NDK_HOST_SYSTEM_NAME}\",\n")
- if (CMAKE_ANDROID_ARCH_ABI STREQUAL "x86")
- set(arch_value "i686-linux-android")
- elseif (CMAKE_ANDROID_ARCH_ABI STREQUAL "x86_64")
- set(arch_value "x86_64-linux-android")
- elseif (CMAKE_ANDROID_ARCH_ABI STREQUAL "arm64-v8a")
- set(arch_value "aarch64-linux-android")
- else()
- set(arch_value "arm-linux-androideabi")
- endif()
+ set(architecture_record_list "")
+ foreach(abi IN LISTS qt_android_abis CMAKE_ANDROID_ARCH_ABI)
+ if(abi STREQUAL "x86")
+ set(arch_value "i686-linux-android")
+ elseif(abi STREQUAL "x86_64")
+ set(arch_value "x86_64-linux-android")
+ elseif(abi STREQUAL "arm64-v8a")
+ set(arch_value "aarch64-linux-android")
+ elseif(abi)
+ set(arch_value "arm-linux-androideabi")
+ endif()
+ list(APPEND architecture_record_list "\"${abi}\":\"${arch_value}\"")
+ endforeach()
+ list(JOIN architecture_record_list "," architecture_records)
# Architecture
string(APPEND file_contents
- " \"architectures\": { \"${CMAKE_ANDROID_ARCH_ABI}\" : \"${arch_value}\" },\n")
+ " \"architectures\": { ${architecture_records} },\n")
# deployment dependencies
- get_target_property(android_deployment_dependencies
- ${target} QT_ANDROID_DEPLOYMENT_DEPENDENCIES)
- if (android_deployment_dependencies)
- list(JOIN android_deployment_dependencies "," android_deployment_dependencies)
- string(APPEND file_contents
- " \"deployment-dependencies\": \"${android_deployment_dependencies}\",\n")
- endif()
+ _qt_internal_add_android_deployment_multi_value_property(file_contents ${target}
+ "QT_ANDROID_DEPLOYMENT_DEPENDENCIES" "dependencies")
# Extra plugins
- get_target_property(android_extra_plugins ${target} QT_ANDROID_EXTRA_PLUGINS)
- if (android_extra_plugins)
- list(JOIN android_extra_plugins "," android_extra_plugins)
- string(APPEND file_contents
- " \"android-extra-plugins\": \"${android_extra_plugins}\",\n")
- endif()
+ _qt_internal_add_android_deployment_multi_value_property(file_contents ${target}
+ "QT_ANDROID_EXTRA_PLUGINS" "android-extra-plugins")
# Extra libs
- get_target_property(android_extra_libs ${target} QT_ANDROID_EXTRA_LIBS)
- if (android_extra_libs)
- list(JOIN android_extra_libs "," android_extra_libs)
- string(APPEND file_contents
- " \"android-extra-libs\": \"${android_extra_libs}\",\n")
- endif()
+ _qt_internal_add_android_deployment_multi_value_property(file_contents ${target}
+ "QT_ANDROID_EXTRA_LIBS" "android-extra-libs")
# package source dir
- get_target_property(android_package_source_dir ${target} QT_ANDROID_PACKAGE_SOURCE_DIR)
- if (android_package_source_dir)
- file(TO_CMAKE_PATH "${android_package_source_dir}" android_package_source_dir_native)
- string(APPEND file_contents
- " \"android-package-source-directory\": \"${android_package_source_dir_native}\",\n")
- endif()
+ _qt_internal_add_android_deployment_property(file_contents ${target}
+ "_qt_android_native_package_source_dir" "android-package-source-directory")
# version code
- get_target_property(android_version_code ${target} QT_ANDROID_VERSION_CODE)
- if (android_version_code)
- string(APPEND file_contents
- " \"android-version-code\": \"${android_version_code}\",\n")
- endif()
+ _qt_internal_add_android_deployment_property(file_contents ${target}
+ "QT_ANDROID_VERSION_CODE" "android-version-code")
# version name
- get_target_property(android_version_name ${target} QT_ANDROID_VERSION_NAME)
- if (android_version_name)
- string(APPEND file_contents
- " \"android-version-name\": \"${android_version_name}\",\n")
- endif()
+ _qt_internal_add_android_deployment_property(file_contents ${target}
+ "QT_ANDROID_VERSION_NAME" "android-version-name")
# minimum SDK version
- get_target_property(android_min_sdk_version ${target} QT_ANDROID_MIN_SDK_VERSION)
- if(android_min_sdk_version)
- string(APPEND file_contents
- " \"android-min-sdk-version\": \"${android_min_sdk_version}\",\n")
- endif()
+ _qt_internal_add_android_deployment_property(file_contents ${target}
+ "QT_ANDROID_MIN_SDK_VERSION" "android-min-sdk-version")
# target SDK version
- get_target_property(android_target_sdk_version ${target} QT_ANDROID_TARGET_SDK_VERSION)
- if(android_target_sdk_version)
- string(APPEND file_contents
- " \"android-target-sdk-version\": \"${android_target_sdk_version}\",\n")
- endif()
+ _qt_internal_add_android_deployment_property(file_contents ${target}
+ "QT_ANDROID_TARGET_SDK_VERSION" "android-target-sdk-version")
- get_target_property(qml_import_path ${target} QT_QML_IMPORT_PATH)
- if (qml_import_path)
- set(_import_paths "")
- foreach(_path IN LISTS qml_import_path)
- file(TO_CMAKE_PATH "${_path}" _path)
- list(APPEND _import_paths ${_path})
- endforeach()
- list(JOIN _import_paths "," _import_paths)
- string(APPEND file_contents
- " \"qml-import-paths\": \"${_import_paths}\",\n")
- endif()
+ # QML import paths
+ _qt_internal_add_android_deployment_multi_value_property(file_contents ${target}
+ "_qt_native_qml_import_paths" "qml-import-paths")
- get_target_property(qml_root_path ${target} QT_QML_ROOT_PATH)
- if(NOT qml_root_path)
- set(qml_root_path "${target_source_dir}")
- endif()
- file(TO_CMAKE_PATH "${qml_root_path}" qml_root_path_native)
- string(APPEND file_contents
- " \"qml-root-path\": \"${qml_root_path_native}\",\n")
+ # QML root paths
+ file(TO_CMAKE_PATH "${target_source_dir}" native_target_source_dir)
+ set_property(TARGET ${target} APPEND PROPERTY
+ _qt_android_native_qml_root_paths "${native_target_source_dir}")
+ _qt_internal_add_android_deployment_list_property(file_contents ${target}
+ "_qt_android_native_qml_root_paths" "qml-root-path")
# App binary
string(APPEND file_contents
@@ -227,13 +234,29 @@ function(qt6_android_generate_deployment_settings target)
foreach(prefix IN LISTS CMAKE_FIND_ROOT_PATH)
if (NOT "${prefix}" STREQUAL "${qt_android_install_dir_native}"
AND NOT "${prefix}" STREQUAL "${android_ndk_root_native}")
- list(APPEND extra_prefix_list \"${prefix}\")
+ file(TO_CMAKE_PATH "${prefix}" prefix)
+ list(APPEND extra_prefix_list "\"${prefix}\"")
endif()
endforeach()
string (REPLACE ";" "," extra_prefix_list "${extra_prefix_list}")
string(APPEND file_contents
" \"extraPrefixDirs\" : [ ${extra_prefix_list} ],\n")
+ # Extra library paths that could be used as a dependency lookup path by androiddeployqt.
+ #
+ # Unlike 'extraPrefixDirs', the 'extraLibraryDirs' key doesn't expect the 'lib' subfolder
+ # when looking for dependencies.
+ _qt_internal_add_android_deployment_list_property(file_contents ${target}
+ "_qt_android_extra_library_dirs" "extraLibraryDirs")
+
+ if(QT_FEATURE_zstd)
+ set(is_zstd_enabled "true")
+ else()
+ set(is_zstd_enabled "false")
+ endif()
+ string(APPEND file_contents
+ " \"zstdCompression\": ${is_zstd_enabled},\n")
+
# Last item in json file
# base location of stdlibc++, will be suffixed by androiddeploy qt
@@ -245,7 +268,7 @@ function(qt6_android_generate_deployment_settings target)
# content end
string(APPEND file_contents "}\n")
- file(WRITE ${deploy_file} ${file_contents})
+ file(GENERATE OUTPUT ${deploy_file} CONTENT ${file_contents})
set_target_properties(${target}
PROPERTIES
@@ -296,13 +319,23 @@ function(qt6_android_add_apk_target target)
set(apk_intermediate_file_path "${apk_intermediate_dir}/${apk_file_name}")
set(dep_intermediate_file_path "${apk_intermediate_dir}/${dep_file_name}")
+ # Temporary location of the library target file. If the library is built as an external project
+ # inside multi-abi build the QT_ANDROID_ABI_TARGET_PATH variable will point to the ABI related
+ # folder in the top-level build directory.
+ set(copy_target_path "${apk_final_dir}/libs/${CMAKE_ANDROID_ARCH_ABI}")
+ if(QT_IS_ANDROID_MULTI_ABI_EXTERNAL_PROJECT AND QT_ANDROID_ABI_TARGET_PATH)
+ set(copy_target_path "${QT_ANDROID_ABI_TARGET_PATH}")
+ endif()
+
# This target is used by Qt Creator's Android support and by the ${target}_make_apk target
# in case DEPFILEs are not supported.
+ # Also the target is used to copy the library that belongs to ${target} when building multi-abi
+ # apk to the abi-specific directory.
add_custom_target(${target}_prepare_apk_dir ALL
DEPENDS ${target}
COMMAND ${CMAKE_COMMAND}
-E copy_if_different $<TARGET_FILE:${target}>
- "${apk_final_dir}/libs/${CMAKE_ANDROID_ARCH_ABI}/$<TARGET_FILE_NAME:${target}>"
+ "${copy_target_path}/$<TARGET_FILE_NAME:${target}>"
COMMENT "Copying ${target} binary to apk folder"
)
@@ -342,6 +375,8 @@ function(qt6_android_add_apk_target target)
COMMENT "Creating APK for ${target}"
)
endif()
+ set_property(GLOBAL APPEND PROPERTY _qt_apk_targets ${target})
+ _qt_internal_collect_target_apk_dependencies_defer(${target})
endfunction()
function(_qt_internal_create_global_apk_target)
@@ -355,6 +390,89 @@ function(_qt_internal_create_global_apk_target)
endif()
endfunction()
+# The function collects all known non-imported shared libraries that are created in the build tree.
+# It uses the CMake DEFER CALL feature if the CMAKE_VERSION is greater
+# than or equal to 3.18.
+# Note: Users that use cmake version less that 3.18 need to call qt_finalize_project
+# in the end of a project's top-level CMakeLists.txt.
+function(_qt_internal_collect_target_apk_dependencies_defer target)
+ # User opted-out the functionality
+ if(QT_NO_COLLECT_BUILD_TREE_APK_DEPS)
+ return()
+ endif()
+
+ get_property(is_called GLOBAL PROPERTY _qt_is_collect_target_apk_dependencies_defer_called)
+ if(is_called) # Already scheduled
+ return()
+ endif()
+ set_property(GLOBAL PROPERTY _qt_is_collect_target_apk_dependencies_defer_called TRUE)
+
+ if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.18")
+ cmake_language(EVAL CODE "cmake_language(DEFER DIRECTORY \"${CMAKE_SOURCE_DIR}\"
+ CALL _qt_internal_collect_target_apk_dependencies ${target})")
+ else()
+ # User don't want to see the warning
+ if(NOT QT_NO_WARN_BUILD_TREE_APK_DEPS)
+ message(WARNING "CMake version you use is less than 3.18. APK dependencies, that are a"
+ " part of the project tree, might not be collected correctly."
+ " Please call qt_finalize_project in the end of a project's top-level"
+ " CMakeLists.txt file to make sure that all the APK dependencies are"
+ " collected correctly."
+ " You can pass -DQT_NO_WARN_BUILD_TREE_APK_DEPS=ON when configuring the project"
+ " to silence the warning.")
+ endif()
+ endif()
+endfunction()
+
+# The function collects shared libraries from the build system tree, that might be dependencies for
+# the main apk targets.
+function(_qt_internal_collect_target_apk_dependencies target)
+ # User opted-out the functionality
+ if(QT_NO_COLLECT_BUILD_TREE_APK_DEPS)
+ return()
+ endif()
+
+ get_property(is_called GLOBAL PROPERTY _qt_is_collect_target_apk_dependencies_called)
+ if(is_called)
+ return()
+ endif()
+ set_property(GLOBAL PROPERTY _qt_is_collect_target_apk_dependencies_called TRUE)
+
+ get_property(apk_targets GLOBAL PROPERTY _qt_apk_targets)
+
+ _qt_internal_collect_buildsystem_shared_libraries(libs "${CMAKE_SOURCE_DIR}")
+
+ foreach(lib IN LISTS libs)
+ if(NOT lib IN_LIST apk_targets)
+ list(APPEND extra_prefix_dirs "$<TARGET_FILE_DIR:${lib}>")
+ endif()
+ endforeach()
+
+ set_target_properties(${target} PROPERTIES _qt_android_extra_library_dirs "${extra_prefix_dirs}")
+endfunction()
+
+# The function recursively goes through the project subfolders and collects targets that supposed to
+# be shared libraries of any kind.
+function(_qt_internal_collect_buildsystem_shared_libraries out_var subdir)
+ set(result "")
+ get_directory_property(buildsystem_targets DIRECTORY ${subdir} BUILDSYSTEM_TARGETS)
+ foreach(buildsystem_target IN LISTS buildsystem_targets)
+ if(buildsystem_target AND TARGET ${buildsystem_target})
+ get_target_property(target_type ${buildsystem_target} TYPE)
+ if(target_type STREQUAL "SHARED_LIBRARY" OR target_type STREQUAL "MODULE_LIBRARY")
+ list(APPEND result ${buildsystem_target})
+ endif()
+ endif()
+ endforeach()
+
+ get_directory_property(subdirs DIRECTORY "${subdir}" SUBDIRECTORIES)
+ foreach(dir IN LISTS subdirs)
+ _qt_internal_collect_buildsystem_shared_libraries(result_inner "${dir}")
+ endforeach()
+ list(APPEND result ${result_inner})
+ set(${out_var} "${result}" PARENT_SCOPE)
+endfunction()
+
# This function allows deciding whether apks should be built as part of the ALL target at first
# add_executable call point, rather than when the 'apk' target is created as part of the
# find_package(Core) call.
@@ -388,8 +506,156 @@ function(_qt_internal_create_global_apk_all_target_if_needed)
endif()
endfunction()
+# The function converts the target property to a json record and appends it to the output
+# variable.
+function(_qt_internal_add_android_deployment_property out_var target property json_key)
+ set(property_genex "$<TARGET_PROPERTY:${target},${property}>")
+ string(APPEND ${out_var}
+ "$<$<BOOL:${property_genex}>:"
+ " \"${json_key}\": \"${property_genex}\"\,\n"
+ ">"
+ )
+
+ set(${out_var} "${${out_var}}" PARENT_SCOPE)
+endfunction()
+
+# The function converts the target list property to a json list record and appends it to the output
+# variable.
+# The generated JSON object is the normal JSON array, e.g.:
+# "qml-root-path": ["qml/root/path1","qml/root/path2"],
+function(_qt_internal_add_android_deployment_list_property out_var target property json_key)
+ set(property_genex
+ "$<TARGET_PROPERTY:${target},${property}>"
+ )
+ set(add_quote_genex
+ "$<$<BOOL:${property_genex}>:\">"
+ )
+ string(JOIN "" list_join_genex
+ "${add_quote_genex}"
+ "$<JOIN:"
+ "$<GENEX_EVAL:${property_genex}>,"
+ "\",\""
+ ">"
+ "${add_quote_genex}"
+ )
+ string(APPEND ${out_var}
+ " \"${json_key}\" : [ ${list_join_genex} ],\n")
+ set(${out_var} "${${out_var}}" PARENT_SCOPE)
+endfunction()
+
+# The function converts the target list property to a json multi-value string record and appends it
+# to the output variable.
+# The generated JSON object is a simple string with the list property items separated by commas,
+# e.g:
+# "android-extra-plugins": "plugin1,plugin2",
+function(_qt_internal_add_android_deployment_multi_value_property out_var target property json_key)
+ set(property_genex
+ "$<TARGET_PROPERTY:${target},${property}>"
+ )
+ string(JOIN "" list_join_genex
+ "$<JOIN:"
+ "$<GENEX_EVAL:${property_genex}>,"
+ ","
+ ">"
+ )
+ string(APPEND ${out_var}
+ "$<$<BOOL:${property_genex}>:"
+ " \"${json_key}\" : \"${list_join_genex}\",\n"
+ ">"
+ )
+
+ set(${out_var} "${${out_var}}" PARENT_SCOPE)
+endfunction()
+
+# The function converts paths to the CMake format to make them acceptable for JSON.
+# It doesn't overwrite public properties, but instead writes formatted values to internal
+# properties.
+function(_qt_internal_android_format_deployment_paths target)
+ _qt_internal_android_format_deployment_path_property(${target}
+ QT_QML_IMPORT_PATH _qt_android_native_qml_import_paths)
+
+ _qt_internal_android_format_deployment_path_property(${target}
+ QT_QML_ROOT_PATH _qt_android_native_qml_root_paths)
+
+ _qt_internal_android_format_deployment_path_property(${target}
+ QT_ANDROID_PACKAGE_SOURCE_DIR _qt_android_native_package_source_dir)
+endfunction()
+
+# The function converts the value of target property to JSON compatible path and writes the
+# result to out_property. Property might be either single value, semicolon separated list or system
+# path spec.
+function(_qt_internal_android_format_deployment_path_property target property out_property)
+ get_target_property(_paths ${target} ${property})
+ if(_paths)
+ set(native_paths "")
+ foreach(_path IN LISTS _paths)
+ file(TO_CMAKE_PATH "${_path}" _path)
+ list(APPEND native_paths "${_path}")
+ endforeach()
+ set_target_properties(${target} PROPERTIES
+ ${out_property} "${native_paths}")
+ endif()
+endfunction()
+
if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
function(qt_android_add_apk_target)
qt6_android_add_apk_target(${ARGV})
endfunction()
endif()
+
+# The function returns the installation path to Qt for Android for the specified ${abi}.
+# By default function expects to find a layout as is installed by the Qt online installer:
+# Qt_install_dir/Version/
+# |__ gcc_64
+# |__ android_arm64_v8a
+# |__ android_armv7
+# |__ android_x86
+# |__ android_x86_64
+function(_qt_internal_get_android_abi_path out_path abi)
+ if(DEFINED QT_PATH_ANDROID_ABI_${abi})
+ get_filename_component(${out_path} "${QT_PATH_ANDROID_ABI_${abi}}" ABSOLUTE)
+ else()
+ # Map the ABI value to the Qt for Android folder.
+ if (abi STREQUAL "x86")
+ set(abi_directory_suffix "${abi}")
+ elseif (abi STREQUAL "x86_64")
+ set(abi_directory_suffix "${abi}")
+ elseif (abi STREQUAL "arm64-v8a")
+ set(abi_directory_suffix "arm64_v8a")
+ else()
+ set(abi_directory_suffix "armv7")
+ endif()
+
+ get_filename_component(${out_path}
+ "${_qt_cmake_dir}/../../../android_${abi_directory_suffix}" ABSOLUTE)
+ endif()
+ set(${out_path} "${${out_path}}" PARENT_SCOPE)
+endfunction()
+
+# The function collects list of existing Qt for Android using _qt_internal_get_android_abi_path
+# and pre-defined set of known Android ABIs. The result is written to QT_DEFAULT_ANDROID_ABIS
+# cache variable.
+# Note that QT_DEFAULT_ANDROID_ABIS is not intended to be set outside the function and will be
+# rewritten.
+function(_qt_internal_collect_default_android_abis)
+ set(known_android_abis armeabi-v7a arm64-v8a x86 x86_64)
+
+ set(default_abis)
+ foreach(abi IN LISTS known_android_abis)
+ _qt_internal_get_android_abi_path(qt_abi_path ${abi})
+ # It's expected that Qt for Android contains ABI specific toolchain file.
+ if(EXISTS "${qt_abi_path}/lib/cmake/${QT_CMAKE_EXPORT_NAMESPACE}/qt.toolchain.cmake"
+ OR CMAKE_ANDROID_ARCH_ABI STREQUAL abi)
+ list(APPEND default_abis ${abi})
+ endif()
+ endforeach()
+ set(QT_DEFAULT_ANDROID_ABIS "${default_abis}" CACHE STRING
+ "The list of autodetected Qt for Android ABIs" FORCE
+ )
+ set(QT_ANDROID_ABIS "${CMAKE_ANDROID_ARCH_ABI}" CACHE STRING
+ "The list of Qt for Android ABIs used to build the project apk"
+ )
+ set(QT_ANDROID_BUILD_ALL_ABIS FALSE CACHE BOOL
+ "Build project using the list of autodetected Qt for Android ABIs"
+ )
+endfunction()
diff --git a/src/corelib/Qt6CTestMacros.cmake b/src/corelib/Qt6CTestMacros.cmake
index 13d794024a..8b4e5c6e4b 100644
--- a/src/corelib/Qt6CTestMacros.cmake
+++ b/src/corelib/Qt6CTestMacros.cmake
@@ -126,6 +126,20 @@ endfunction()
# Checks if the test project can be built successfully. Arguments:
#
+# NO_CLEAN_STEP: Skips calling 'clean' target before building.
+#
+# NO_BUILD_PROJECT_ARG: Skips adding --build-project argument. Useful when using Xcode generator.
+#
+# GENERATOR: Use a custom generator. When not specified, uses existing CMAKE_GENERATOR value.
+#
+# NO_IOS_DEFAULT_ARGS: Skips setting default iOS-specific options like the generator to be used.
+#
+# MAKE_PROGRAM: Specify a different make program. Can be useful with a custom make or ninja wrapper.
+#
+# BUILD_TYPE: Specify a different CMake build type. Defaults to CMAKE_BUILD_TYPE if it is not empty.
+# Which means no build type is passed if the top-level project is configured with a
+# multi-config generator.
+#
# SIMULATE_IN_SOURCE: If the option is specified, the function copies sources of the tests to the
# CMAKE_CURRENT_BINARY_DIR directory, creates internal build directory in the
# copied sources and uses this directory to build and test the project.
@@ -147,31 +161,126 @@ endfunction()
# BUILD_OPTIONS: a list of -D style CMake definitions to pass to ctest's --build-options (which
# are ultimately passed to the CMake invocation of the test project)
macro(_qt_internal_test_expect_pass _dir)
- set(_test_option_args
+ set(_test_option_args
SIMULATE_IN_SOURCE
- )
- set(_test_single_args
+ NO_CLEAN_STEP
+ NO_BUILD_PROJECT_ARG
+ NO_IOS_DEFAULT_ARGS
+ )
+ set(_test_single_args
BINARY
TESTNAME
BUILD_DIR
- )
- set(_test_multi_args
+ GENERATOR
+ MAKE_PROGRAM
+ BUILD_TYPE
+ )
+ set(_test_multi_args
BUILD_OPTIONS
BINARY_ARGS
- )
- cmake_parse_arguments(_ARGS
+ )
+ cmake_parse_arguments(_ARGS
"${_test_option_args}"
"${_test_single_args}"
"${_test_multi_args}"
${ARGN}
- )
- if(_ARGS_TESTNAME)
+ )
+
+ if(NOT _ARGS_NO_IOS_DEFAULT_ARGS AND IOS)
+ set(_ARGS_NO_BUILD_PROJECT_ARG TRUE)
+ set(_ARGS_GENERATOR Xcode)
+ set(_ARGS_MAKE_PROGRAM xcodebuild)
+ endif()
+
+ if(_ARGS_TESTNAME)
set(testname "${_ARGS_TESTNAME}")
- else()
+ else()
string(REPLACE "(" "_" testname "${_dir}")
string(REPLACE ")" "_" testname "${testname}")
string(REPLACE "/" "_" testname "${testname}")
- endif()
+ endif()
+
+ # Allow setting a different generator. Needed for iOS.
+ set(generator "${CMAKE_GENERATOR}")
+ if(_ARGS_GENERATOR)
+ set(generator "${_ARGS_GENERATOR}")
+ endif()
+
+ # Allow setting a different make program.
+ set(make_program "${CMAKE_MAKE_PROGRAM}")
+ if(_ARGS_MAKE_PROGRAM)
+ set(make_program "${_ARGS_MAKE_PROGRAM}")
+ endif()
+
+ # Only pass build config if it was specified during the initial tests/auto project
+ # configuration. Important when using Qt multi-config builds which won't have CMAKE_BUILD_TYPE
+ # set.
+ set(build_type "")
+
+ if(_ARGS_BUILD_TYPE)
+ set(build_type "${_ARGS_BUILD_TYPE}")
+ elseif(CMAKE_BUILD_TYPE)
+ set(build_type "${CMAKE_BUILD_TYPE}")
+ endif()
+ if(build_type)
+ set(build_type "--build-config" "${build_type}")
+ endif()
+
+ # Allow skipping clean step.
+ set(build_no_clean "")
+ if(_ARGS_NO_CLEAN_STEP)
+ set(build_no_clean "--build-noclean")
+ endif()
+
+ # Allow omitting the --build-project arg. It's relevant for xcode projects where the project
+ # name on disk is different from the project source dir name.
+ if(NOT _ARGS_NO_BUILD_PROJECT_ARG)
+ set(build_project "--build-project" "${_dir}")
+ else()
+ set(build_project)
+ endif()
+
+ # Allow omitting test command if no binary or binary args are provided.
+ set(test_command "")
+ if(_ARGS_BINARY)
+ list(APPEND test_command ${_ARGS_BINARY} ${_ARGS_BINARY_ARGS})
+ endif()
+ if(test_command)
+ set(test_command "--test-command" ${test_command})
+ endif()
+
+ set(additional_configure_args "")
+
+ # Allow passing additional configure options to all projects via either a cache var or env var.
+ # Can be useful for certain catch-all scenarios.
+ if(QT_CMAKE_TESTS_ADDITIONAL_CONFIGURE_OPTIONS)
+ list(APPEND additional_configure_args ${QT_CMAKE_TESTS_ADDITIONAL_CONFIGURE_OPTIONS})
+ endif()
+ if(DEFINED ENV{QT_CMAKE_TESTS_ADDITIONAL_CONFIGURE_OPTIONS})
+ list(APPEND additional_configure_args $ENV{QT_CMAKE_TESTS_ADDITIONAL_CONFIGURE_OPTIONS})
+ endif()
+
+ # When building an iOS CMake test in the CI using a universal Qt build, target the simulator
+ # sdk, because the CI currently doesn't have a proper setup for signing device binaries
+ # (missing a working signing certificate and provisioning profile). Allow opt-out.
+ if(IOS)
+ set(osx_arch_count 0)
+ if(QT_OSX_ARCHITECTURES)
+ list(LENGTH QT_OSX_ARCHITECTURES osx_arch_count)
+ endif()
+
+ set(build_environment "")
+ if(DEFINED ENV{QT_BUILD_ENVIRONMENT})
+ set(build_environment "$ENV{QT_BUILD_ENVIRONMENT}")
+ endif()
+ if(build_environment STREQUAL "ci"
+ AND osx_arch_count GREATER_EQUAL 2
+ AND NOT QT_UIKIT_SDK
+ AND NOT QT_NO_IOS_BUILD_ADJUSTMENT_IN_CI)
+ list(APPEND additional_configure_args
+ -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_OSX_SYSROOT=iphonesimulator)
+ endif()
+ endif()
set(__expect_pass_prefixes "${CMAKE_PREFIX_PATH}")
string(REPLACE ";" "\;" __expect_pass_prefixes "${__expect_pass_prefixes}")
@@ -214,13 +323,14 @@ macro(_qt_internal_test_expect_pass _dir)
--build-and-test
"${__expect_pass_source_dir}"
"${__expect_pass_build_dir}"
- --build-config "${CMAKE_BUILD_TYPE}"
- --build-generator "${CMAKE_GENERATOR}"
- --build-makeprogram "${CMAKE_MAKE_PROGRAM}"
- --build-project "${_dir}"
+ ${build_type}
+ ${build_no_clean}
+ --build-generator "${generator}"
+ --build-makeprogram "${make_program}"
+ ${build_project}
--build-options "-DCMAKE_PREFIX_PATH=${__expect_pass_prefixes}" ${BUILD_OPTIONS_LIST}
- ${_ARGS_BUILD_OPTIONS}
- --test-command ${_ARGS_BINARY} ${_ARGS_BINARY_ARGS}
+ ${_ARGS_BUILD_OPTIONS} ${additional_configure_args}
+ ${test_command}
)
add_test(${testname} ${CMAKE_CTEST_COMMAND} ${ctest_command_args})
if(_ARGS_SIMULATE_IN_SOURCE)
@@ -262,7 +372,7 @@ list(APPEND CMAKE_PREFIX_PATH \"${CMAKE_PREFIX_PATH}\")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/failbuild/${_dir}/CMakeLists.txt"
"
- cmake_minimum_required(VERSION 3.14)
+ cmake_minimum_required(VERSION 3.16)
project(${_dir})
try_compile(Result \${CMAKE_CURRENT_BINARY_DIR}/${_dir}
@@ -336,7 +446,7 @@ function(_qt_internal_test_module_includes)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/module_includes/CMakeLists.txt"
"
- cmake_minimum_required(VERSION 3.14)
+ cmake_minimum_required(VERSION 3.16)
project(module_includes)
${packages_string}
diff --git a/src/corelib/Qt6CoreConfigExtras.cmake.in b/src/corelib/Qt6CoreConfigExtras.cmake.in
index f86d4ad5bf..8980f1bfa6 100644
--- a/src/corelib/Qt6CoreConfigExtras.cmake.in
+++ b/src/corelib/Qt6CoreConfigExtras.cmake.in
@@ -47,6 +47,7 @@ set(_Qt6CTestMacros "${_Qt6CoreConfigDir}/Qt6CTestMacros.cmake")
if(ANDROID_PLATFORM)
include("${CMAKE_CURRENT_LIST_DIR}/@QT_CMAKE_EXPORT_NAMESPACE@AndroidMacros.cmake")
_qt_internal_create_global_apk_target()
+ _qt_internal_collect_default_android_abis()
endif()
if(EMSCRIPTEN)
diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake
index 42116cba69..7673ce673d 100644
--- a/src/corelib/Qt6CoreMacros.cmake
+++ b/src/corelib/Qt6CoreMacros.cmake
@@ -104,7 +104,8 @@ macro(_qt_internal_get_moc_flags _moc_flags)
endmacro()
# helper macro to set up a moc rule
-function(_qt_internal_create_moc_command infile outfile moc_flags moc_options moc_target moc_depends)
+function(_qt_internal_create_moc_command infile outfile moc_flags moc_options
+ moc_target moc_depends out_json_file)
# Pass the parameters in a file. Set the working directory to
# be that containing the parameters file and reference it by
# just the file name. This is necessary because the moc tool on
@@ -117,6 +118,11 @@ function(_qt_internal_create_moc_command infile outfile moc_flags moc_options mo
endif()
set (_moc_parameters_file ${outfile}_parameters)
set (_moc_parameters ${moc_flags} ${moc_options} -o "${outfile}" "${infile}")
+ if(out_json_file)
+ list(APPEND _moc_parameters --output-json)
+ set(extra_output_files "${outfile}.json")
+ set(${out_json_file} "${extra_output_files}" PARENT_SCOPE)
+ endif()
string (REPLACE ";" "\n" _moc_parameters "${_moc_parameters}")
if(moc_target)
@@ -139,7 +145,7 @@ function(_qt_internal_create_moc_command infile outfile moc_flags moc_options mo
endif()
set(_moc_extra_parameters_file @${_moc_parameters_file})
- add_custom_command(OUTPUT ${outfile}
+ add_custom_command(OUTPUT ${outfile} ${extra_output_files}
COMMAND ${QT_CMAKE_EXPORT_NAMESPACE}::moc ${_moc_extra_parameters_file}
DEPENDS ${infile} ${moc_depends}
${_moc_working_dir}
@@ -160,7 +166,10 @@ function(qt6_generate_moc infile outfile )
if ("x${ARGV2}" STREQUAL "xTARGET")
set(moc_target ${ARGV3})
endif()
- _qt_internal_create_moc_command(${abs_infile} ${_outfile} "${moc_flags}" "" "${moc_target}" "")
+ _qt_internal_create_moc_command(${abs_infile} ${_outfile} "${moc_flags}" "" "${moc_target}"
+ "" # moc_depends
+ "" # out_json_file
+ )
endfunction()
if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
@@ -181,7 +190,10 @@ function(qt6_wrap_cpp outfiles )
_qt_internal_get_moc_flags(moc_flags)
set(options)
- set(oneValueArgs TARGET)
+ set(oneValueArgs
+ TARGET
+ __QT_INTERNAL_OUTPUT_MOC_JSON_FILES
+ )
set(multiValueArgs OPTIONS DEPENDS)
cmake_parse_arguments(_WRAP_CPP "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
@@ -191,14 +203,31 @@ function(qt6_wrap_cpp outfiles )
set(moc_target ${_WRAP_CPP_TARGET})
set(moc_depends ${_WRAP_CPP_DEPENDS})
+ set(metatypes_json_list "")
+
foreach(it ${moc_files})
get_filename_component(it ${it} ABSOLUTE)
_qt_internal_make_output_file(${it} moc_ cpp outfile)
+
+ set(out_json_file_var "")
+ if(_WRAP_CPP___QT_INTERNAL_OUTPUT_MOC_JSON_FILES)
+ set(out_json_file_var "out_json_file")
+ endif()
+
_qt_internal_create_moc_command(
- ${it} ${outfile} "${moc_flags}" "${moc_options}" "${moc_target}" "${moc_depends}")
+ ${it} ${outfile} "${moc_flags}" "${moc_options}" "${moc_target}" "${moc_depends}"
+ "${out_json_file_var}")
list(APPEND ${outfiles} ${outfile})
+ if(_WRAP_CPP___QT_INTERNAL_OUTPUT_MOC_JSON_FILES)
+ list(APPEND metatypes_json_list "${${out_json_file_var}}")
+ endif()
endforeach()
set(${outfiles} ${${outfiles}} PARENT_SCOPE)
+
+ if(metatypes_json_list)
+ set(${_WRAP_CPP___QT_INTERNAL_OUTPUT_MOC_JSON_FILES}
+ "${metatypes_json_list}" PARENT_SCOPE)
+ endif()
endfunction()
# This will override the CMake upstream command, because that one is for Qt 3.
@@ -355,7 +384,12 @@ if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6)
qt6_add_resources("${outfiles}" ${ARGN})
endif()
- if(NOT TARGET ${outfiles})
+ if(TARGET ${outfiles})
+ cmake_parse_arguments(PARSE_ARGV 1 arg "" "OUTPUT_TARGETS" "")
+ if (arg_OUTPUT_TARGETS)
+ set(${arg_OUTPUT_TARGETS} ${${arg_OUTPUT_TARGETS}} PARENT_SCOPE)
+ endif()
+ else()
set("${outfiles}" "${${outfiles}}" PARENT_SCOPE)
endif()
endfunction()
@@ -409,6 +443,7 @@ function(qt6_add_big_resources outfiles )
VERBATIM)
add_custom_target(big_resources_${outfilename} ALL DEPENDS ${tmpoutfile})
add_library(rcc_object_${outfilename} OBJECT ${tmpoutfile})
+ _qt_internal_set_up_static_runtime_library(rcc_object_${outfilename})
target_compile_definitions(rcc_object_${outfilename} PUBLIC "$<TARGET_PROPERTY:Qt6::Core,INTERFACE_COMPILE_DEFINITIONS>")
set_target_properties(rcc_object_${outfilename} PROPERTIES AUTOMOC OFF)
set_target_properties(rcc_object_${outfilename} PROPERTIES AUTOUIC OFF)
@@ -486,6 +521,7 @@ function(qt6_add_executable target)
cmake_parse_arguments(PARSE_ARGV 1 arg "MANUAL_FINALIZATION" "" "")
_qt_internal_create_executable("${target}" ${arg_UNPARSED_ARGUMENTS})
+ target_link_libraries("${target}" PRIVATE Qt6::Core)
if(arg_MANUAL_FINALIZATION)
# Caller says they will call qt6_finalize_target() themselves later
@@ -506,9 +542,10 @@ function(qt6_add_executable target)
endfunction()
function(_qt_internal_create_executable target)
+ cmake_parse_arguments(arg "" "" "ANDROID_ABIS" ${ARGN})
if(ANDROID)
- list(REMOVE_ITEM ARGN "WIN32" "MACOSX_BUNDLE")
- add_library("${target}" MODULE ${ARGN})
+ list(REMOVE_ITEM arg_UNPARSED_ARGUMENTS "WIN32" "MACOSX_BUNDLE")
+ add_library("${target}" MODULE ${arg_UNPARSED_ARGUMENTS})
# On our qmake builds we do don't compile the executables with
# visibility=hidden. Not having this flag set will cause the
# executable to have main() hidden and can then no longer be loaded
@@ -519,11 +556,85 @@ function(_qt_internal_create_executable target)
set_property(TARGET "${target}" PROPERTY OBJCXX_VISIBILITY_PRESET default)
qt6_android_apply_arch_suffix("${target}")
set_property(TARGET "${target}" PROPERTY _qt_is_android_executable TRUE)
+ # Build per-abi binaries for android
+ if(NOT QT_IS_ANDROID_MULTI_ABI_EXTERNAL_PROJECT)
+ if(QT_ANDROID_BUILD_ALL_ABIS)
+ # Use autodetected Qt for Android ABIs.
+ set(android_abis ${QT_DEFAULT_ANDROID_ABIS})
+ elseif(arg_ANDROID_ABIS)
+ # Use target-specific Qt for Android ABIs.
+ set(android_abis ${arg_ANDROID_ABIS})
+ elseif(QT_ANDROID_ABIS)
+ # Use project-wide Qt for Android ABIs.
+ set(android_abis ${QT_ANDROID_ABIS})
+ else()
+ # User have an empty list of Qt for Android ABIs.
+ message(FATAL_ERROR
+ "The list of Android ABIs is empty, when building ${target}.\n"
+ "You have the following options to select ABIs for a target:\n"
+ " - Set the QT_ANDROID_ABIS variable before calling qt6_add_executable\n"
+ " - Add the ANDROID_ABIS parameter to the qt6_add_executable call\n"
+ " - Set QT_ANDROID_BUILD_ALL_ABIS flag to try building with\n"
+ " the list of autodetected Qt for Android:\n ${QT_DEFAULT_ANDROID_ABIS}"
+ )
+ endif()
+
+ set(missing_qt_abi_toolchains "")
+ # Create external projects for each android ABI except the main one.
+ list(REMOVE_ITEM android_abis "${CMAKE_ANDROID_ARCH_ABI}")
+ include(ExternalProject)
+ foreach(abi IN ITEMS ${android_abis})
+ if(NOT "${abi}" IN_LIST QT_DEFAULT_ANDROID_ABIS)
+ list(APPEND missing_qt_abi_toolchains ${abi})
+ list(REMOVE_ITEM android_abis "${abi}")
+ continue()
+ endif()
+
+ _qt_internal_get_android_abi_path(qt_abi_path ${abi})
+ set(qt_abi_toolchain_path
+ "${qt_abi_path}/lib/cmake/${QT_CMAKE_EXPORT_NAMESPACE}/qt.toolchain.cmake")
+ set(abi_copy_target_path "${CMAKE_CURRENT_BINARY_DIR}/android-build/libs/${abi}")
+ ExternalProject_Add("${target}_${abi}"
+ SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}"
+ BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/${target}_${abi}"
+ CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${qt_abi_toolchain_path}"
+ "-DQT_IS_ANDROID_MULTI_ABI_EXTERNAL_PROJECT=ON"
+ "-DQT_ANDROID_ABI_TARGET_PATH=${abi_copy_target_path}"
+ STEP_TARGETS build
+ EXCLUDE_FROM_ALL TRUE
+ BUILD_COMMAND "${CMAKE_COMMAND}"
+ "--build" "${CMAKE_CURRENT_BINARY_DIR}/${target}_${abi}"
+ "--target" "${target}_prepare_apk_dir"
+ )
+ add_dependencies(${target} "${target}_${abi}-build")
+ endforeach()
+
+ if(missing_qt_abi_toolchains)
+ list(JOIN missing_qt_abi_toolchains ", " missing_qt_abi_toolchains_string)
+ message(FATAL_ERROR "Cannot find toolchain files for the manually specified Android"
+ " ABIs: ${missing_qt_abi_toolchains_string}"
+ "\nSkipping these ABIs."
+ "\nNote that you also may manually specify the path to the required Qt for"
+ " Android ABI using QT_PATH_ANDROID_ABI_<abi> CMake variable.\n")
+ endif()
+
+ list(JOIN android_abis ", " android_abis_string)
+ if(android_abis_string)
+ set(android_abis_string "${CMAKE_ANDROID_ARCH_ABI}(default), ${android_abis_string}")
+ else()
+ set(android_abis_string "${CMAKE_ANDROID_ARCH_ABI}(default)")
+ endif()
+ if(NOT QT_NO_ANDROID_ABI_STATUS_MESSAGE)
+ message(STATUS "Configuring '${target}' for the following Android ABIs:"
+ " ${android_abis_string}")
+ endif()
+ set_target_properties(${target} PROPERTIES _qt_android_abis "${android_abis}")
+ endif()
else()
- add_executable("${target}" ${ARGN})
+ add_executable("${target}" ${arg_UNPARSED_ARGUMENTS})
endif()
- target_link_libraries("${target}" PRIVATE Qt6::Core)
+ _qt_internal_set_up_static_runtime_library("${target}")
endfunction()
function(_qt_internal_finalize_executable target)
@@ -582,7 +693,7 @@ function(_qt_internal_finalize_executable target)
qt6_android_add_apk_target("${target}")
endif()
if(EMSCRIPTEN)
- qt_wasm_add_target_helpers("${target}")
+ _qt_internal_wasm_add_target_helpers("${target}")
endif()
if(IOS)
_qt_internal_finalize_ios_app("${target}")
@@ -602,7 +713,34 @@ function(_qt_internal_finalize_executable target)
set_target_properties(${target} PROPERTIES _qt_executable_is_finalized TRUE)
endfunction()
+# If a task needs to run before any targets are finalized in the current directory
+# scope, call this function and pass the ID of that task as the argument.
+function(_qt_internal_delay_finalization_until_after defer_id)
+ set_property(DIRECTORY APPEND PROPERTY qt_internal_finalizers_wait_for_ids "${defer_id}")
+endfunction()
+
function(qt6_finalize_target target)
+ if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.19")
+ cmake_language(DEFER GET_CALL_IDS ids_queued)
+ get_directory_property(wait_for_ids qt_internal_finalizers_wait_for_ids)
+ while(wait_for_ids)
+ list(GET wait_for_ids 0 id_to_wait_for)
+ if(id_to_wait_for IN_LIST ids_queued)
+ # Something else needs to run before we finalize targets.
+ # Try again later by re-deferring ourselves, which effectively
+ # puts us at the end of the current list of deferred actions.
+ cmake_language(EVAL CODE "cmake_language(DEFER CALL ${CMAKE_CURRENT_FUNCTION} ${ARGV})")
+ set_directory_properties(PROPERTIES
+ qt_internal_finalizers_wait_for_ids "${wait_for_ids}"
+ )
+ return()
+ endif()
+ list(POP_FRONT wait_for_ids)
+ endwhile()
+ # No other deferred tasks to wait for
+ set_directory_properties(PROPERTIES qt_internal_finalizers_wait_for_ids "")
+ endif()
+
if(NOT TARGET "${target}")
message(FATAL_ERROR "No target '${target}' found in current scope.")
endif()
@@ -665,6 +803,8 @@ function(_qt_internal_find_ios_development_team_id out_var)
string(STRIP "${team_id}" team_id)
set_property(GLOBAL PROPERTY _qt_internal_ios_development_team_id "${team_id}")
set("${out_var}" "${team_id}" PARENT_SCOPE)
+ else()
+ set("${out_var}" "" PARENT_SCOPE)
endif()
endfunction()
@@ -699,9 +839,11 @@ function(_qt_internal_get_ios_bundle_identifier_prefix out_var)
message(DEBUG "Failed to extract the default bundle indentifier prefix.")
endif()
- if(prefix)
+ if(prefix AND NOT prefix_error)
set_property(GLOBAL PROPERTY _qt_internal_ios_bundle_identifier_prefix "${prefix}")
set("${out_var}" "${prefix}" PARENT_SCOPE)
+ else()
+ set("${out_var}" "" PARENT_SCOPE)
endif()
endfunction()
@@ -713,6 +855,30 @@ function(_qt_internal_get_default_ios_bundle_identifier out_var)
set("${out_var}" "${prefix}.\${PRODUCT_NAME:rfc1034identifier}" PARENT_SCOPE)
endfunction()
+function(_qt_internal_set_placeholder_apple_bundle_version target)
+ # If user hasn't provided neither a bundle version nor a bundle short version string for the
+ # app, set a placeholder value for both which will add them to the generated Info.plist file.
+ # This is required so that the app launches in the simulator (but apparently not for running
+ # on-device).
+ get_target_property(bundle_version "${target}" MACOSX_BUNDLE_BUNDLE_VERSION)
+ get_target_property(bundle_short_version "${target}" MACOSX_BUNDLE_SHORT_VERSION_STRING)
+
+ if(NOT MACOSX_BUNDLE_BUNDLE_VERSION AND
+ NOT MACOSX_BUNDLE_SHORT_VERSION_STRING AND
+ NOT bundle_version AND
+ NOT bundle_short_version AND
+ NOT QT_NO_SET_XCODE_BUNDLE_VERSION
+ )
+ set(bundle_version "0.0.1")
+ set(bundle_short_version "0.0.1")
+ set_target_properties("${target}"
+ PROPERTIES
+ MACOSX_BUNDLE_BUNDLE_VERSION "${bundle_version}"
+ MACOSX_BUNDLE_SHORT_VERSION_STRING "${bundle_short_version}"
+ )
+ endif()
+endfunction()
+
function(_qt_internal_finalize_ios_app target)
# If user hasn't provided a development team id, try to find the first one specified
# in the Xcode preferences.
@@ -747,6 +913,8 @@ function(_qt_internal_finalize_ios_app target)
"${bundle_id}")
endif()
endif()
+
+ _qt_internal_set_placeholder_apple_bundle_version("${target}")
endfunction()
if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
@@ -797,25 +965,6 @@ function(_qt_internal_disable_static_default_plugins target)
set_target_properties(${target} PROPERTIES QT_DEFAULT_PLUGINS 0)
endfunction()
-# This function is used to indicate which plug-ins are going to be
-# used by a given target.
-# This allows static linking to a correct set of plugins.
-# Options :
-# NO_DEFAULT: disable linking against any plug-in by default for that target, e.g. no platform plug-in.
-# INCLUDE <list of additional plug-ins to be linked against>
-# EXCLUDE <list of plug-ins to be removed from the default set>
-# INCLUDE_BY_TYPE <type> <included plugins>
-# EXCLUDE_BY_TYPE <type to be excluded>
-#
-# Example :
-# qt_import_plugins(myapp
-# INCLUDE Qt::QCocoaIntegrationPlugin
-# EXCLUDE Qt::QMinimalIntegrationPlugin
-# INCLUDE_BY_TYPE imageformats Qt::QGifPlugin Qt::QJpegPlugin
-# EXCLUDE_BY_TYPE sqldrivers
-# )
-
-# TODO : support qml plug-ins.
function(qt6_import_plugins target)
cmake_parse_arguments(arg "NO_DEFAULT" "" "INCLUDE;EXCLUDE;INCLUDE_BY_TYPE;EXCLUDE_BY_TYPE" ${ARGN})
@@ -879,62 +1028,35 @@ if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
endfunction()
endif()
-# This function allows enabling or disabling the finalizer mode of plugin importing in static Qt
-# builds.
-#
-# When finalizer mode is enabled, all plugins initializer object libraries are directly linked to
-# the given '${target}' (executable or shared library).
-# This prevents cycles between Qt provided static libraries and reduces link time, due to the
-# libraries not being repeated because they are not part of a cycle anymore.
-#
-# When finalizer mode is disabled, each plugin initializer is propagated via usage requirements
-# of its associated module.
-#
-# Finalizer mode is enabled by default if:
-# - the project calls qt_finalize_target explicitly at the end of the project file or
-# - the project uses qt_add_executable and a CMake version greater than or equal to 3.19
-# (which will DEFER CALL qt_finalize_target)
-function(qt6_enable_import_plugins_finalizer_mode target enabled)
- if(enabled)
- set(enabled "TRUE")
- else()
- set(enabled "FALSE")
+# This function is currently in Technical Preview. It's signature may change or be removed entirely.
+function(qt6_set_finalizer_mode target)
+ cmake_parse_arguments(arg "ENABLE;DISABLE" "" "MODES" ${ARGN})
+ if(NOT arg_ENABLE AND NOT arg_DISABLE)
+ message(FATAL_ERROR "No option was specified whether to enable or disable the modes.")
+ elseif(arg_ENABLE AND arg_DISABLE)
+ message(FATAL_ERROR "Both ENABLE and DISABLE options were specified.")
+ endif()
+ if(NOT arg_MODES)
+ message(FATAL_ERROR "No modes were specified in qt6_set_finalizer_mode() call.")
endif()
- set_property(TARGET "${target}" PROPERTY _qt_static_plugins_use_finalizer_mode "${enabled}")
-endfunction()
-if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
- function(qt_enable_import_plugins_finalizer_mode)
- qt6_enable_import_plugins_finalizer_mode(${ARGV})
- endfunction()
-endif()
+ if(arg_ENABLE)
+ set(value "TRUE")
+ elseif(arg_DISABLE)
+ set(value "FALSE")
+ endif()
-# This function allows enabling or disabling the finalizer mode of resource objects linking in
-# static Qt builds.
-# It makes sense to manually disable the finalizer of the resource object if you are using
-# linkers other than ld, since the dependencies between resource objects and static libraries
-# are resolved correctly by them.
-function(qt6_enable_object_libraries_finalizer_mode target enabled)
- __qt_internal_enable_finalizer_mode(${target} object_libraries ${enabled})
+ foreach(mode ${arg_MODES})
+ __qt_internal_enable_finalizer_mode("${target}" "${mode}" "${value}")
+ endforeach()
endfunction()
if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
- function(qt_enable_object_libraries_finalizer_mode)
- qt6_enable_object_libraries_finalizer_mode(${ARGV})
+ function(qt_set_finalizer_mode)
+ qt6_set_finalizer_mode(${ARGV})
endfunction()
endif()
-# Extracts metatypes from a Qt target and generates a metatypes.json for it.
-# By default we check whether AUTOMOC has been enabled and we extract the information from the
-# target's AUTOMOC supporting files.
-# Should you not wish to use automoc you need to pass in all the generated json files via the
-# MANUAL_MOC_JSON_FILES parameter. The latter can be obtained by running moc with
-# the --output-json parameter.
-# Params:
-# INSTALL_DIR: Location where to install the metatypes file. For public consumption,
-# defaults to a ${CMAKE_INSTALL_PREFIX}/${INSTALL_LIBDIR}/metatypes directory.
-# Executable metatypes files are never installed.
-# __QT_INTERNAL_NO_INSTALL: When passed, will skip installation of the metatype file.
function(qt6_extract_metatypes target)
get_target_property(existing_meta_types_file ${target} INTERFACE_QT_META_TYPES_BUILD_FILE)
@@ -942,8 +1064,34 @@ function(qt6_extract_metatypes target)
return()
endif()
+ set(args_option
+ # TODO: Remove this once all leaf module usages of it are removed. It's now a no-op.
+ # It's original purpose was to skip installation of the metatypes file.
+ __QT_INTERNAL_NO_INSTALL
+
+ # TODO: Move this into a separate internal function, so it doesn't pollute the public one.
+ # When given, metatypes files will be installed into the default Qt
+ # metatypes folder. Only to be used by the Qt build.
+ __QT_INTERNAL_INSTALL
+ )
+ set(args_single
+ # TODO: Move this into a separate internal function, so it doesn't pollute the public one.
+ # Location where to install the metatypes file. Only used if
+ # __QT_INTERNAL_INSTALL is given. It defaults to the
+ # ${CMAKE_INSTALL_PREFIX}/${INSTALL_LIBDIR}/metatypes directory.
+ # Executable metatypes files are never installed.
+ __QT_INTERNAL_INSTALL_DIR
+
+ OUTPUT_FILES
+ )
+ set(args_multi
+ MANUAL_MOC_JSON_FILES
+ )
+
cmake_parse_arguments(arg
- "__QT_INTERNAL_NO_INSTALL" "INSTALL_DIR" "MANUAL_MOC_JSON_FILES" ${ARGN})
+ "${args_option}"
+ "${args_single}"
+ "${args_multi}" ${ARGN})
get_target_property(target_type ${target} TYPE)
if (target_type STREQUAL "INTERFACE_LIBRARY")
@@ -1114,13 +1262,24 @@ function(qt6_extract_metatypes target)
COMMENT "Running moc --collect-json for target ${target}"
)
+ # We can't rely on policy CMP0118 since user project controls it
+ set(scope_args)
+ if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.18")
+ set(scope_args TARGET_DIRECTORY ${target})
+ endif()
+ set_source_files_properties(${metatypes_file_gen} ${metatypes_file} ${scope_args}
+ PROPERTIES GENERATED TRUE
+ )
+
# We still need to add this file as a source of the target, otherwise the file
# rule above is not triggered. INTERFACE_SOURCES do not properly register
# as dependencies to build the current target.
# TODO: Can we pass ${metatypes_file} instead of ${metatypes_file_gen} as a source?
# TODO: Do we still need the _gen variant at all?
target_sources(${target} PRIVATE ${metatypes_file_gen})
- set_source_files_properties(${metatypes_file} PROPERTIES HEADER_FILE_ONLY TRUE)
+ set_source_files_properties(${metatypes_file} ${scope_args}
+ PROPERTIES HEADER_FILE_ONLY TRUE
+ )
set_target_properties(${target} PROPERTIES
INTERFACE_QT_MODULE_HAS_META_TYPES YES
@@ -1134,39 +1293,50 @@ function(qt6_extract_metatypes target)
)
target_sources(${target} INTERFACE ${metatypes_file_genex_build})
- # Chech whether the generated json file needs to be installed.
+ if(arg_OUTPUT_FILES)
+ set(${arg_OUTPUT_FILES} "${metatypes_file}" PARENT_SCOPE)
+ endif()
+
+ # Check whether the generated json file needs to be installed.
# Executable metatypes.json files should not be installed. Qt non-prefix builds should also
# not install the files.
- set(should_install TRUE)
- if (target_type STREQUAL "EXECUTABLE" OR arg___QT_INTERNAL_NO_INSTALL)
- set(should_install "FALSE")
+ set(should_install FALSE)
+
+ if(NOT target_type STREQUAL "EXECUTABLE" AND arg___QT_INTERNAL_INSTALL)
+ set(should_install TRUE)
endif()
# Automatically fill default install args when not specified.
- if (NOT arg_INSTALL_DIR)
+ if(NOT arg___QT_INTERNAL_INSTALL_DIR)
# INSTALL_LIBDIR is not set when QtBuildInternals is not loaded (when not doing a Qt build).
# Default to a hardcoded location for user projects.
if(INSTALL_LIBDIR)
- set(arg_INSTALL_DIR "${INSTALL_LIBDIR}/metatypes")
+ set(install_dir "${INSTALL_LIBDIR}/metatypes")
else()
- set(arg_INSTALL_DIR "lib/metatypes")
+ set(install_dir "lib/metatypes")
endif()
+ else()
+ set(install_dir "${arg___QT_INTERNAL_INSTALL_DIR}")
endif()
if(should_install)
- set(metatypes_file_install_path "${arg_INSTALL_DIR}/${metatypes_file_name}")
+ set(metatypes_file_install_path "${install_dir}/${metatypes_file_name}")
set(metatypes_file_install_path_genex "$<INSTALL_PREFIX>/${metatypes_file_install_path}")
set(metatypes_file_genex_install
"$<INSTALL_INTERFACE:$<${consumes_metatypes}:${metatypes_file_install_path_genex}>>"
)
target_sources(${target} INTERFACE ${metatypes_file_genex_install})
- install(FILES "${metatypes_file}" DESTINATION "${arg_INSTALL_DIR}")
+ install(FILES "${metatypes_file}" DESTINATION "${install_dir}")
endif()
endfunction()
if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
function(qt_extract_metatypes)
qt6_extract_metatypes(${ARGV})
+ cmake_parse_arguments(PARSE_ARGV 0 arg "" "OUTPUT_FILES" "")
+ if(arg_OUTPUT_FILES)
+ set(${arg_OUTPUT_FILES} "${${arg_OUTPUT_FILES}}" PARENT_SCOPE)
+ endif()
endfunction()
endif()
@@ -1379,6 +1549,11 @@ END
target_link_libraries(${target} PRIVATE $<TARGET_OBJECTS:${target}_rc>)
endif()
+ set(scope_args)
+ if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.18")
+ set(scope_args TARGET_DIRECTORY ${end_target})
+ endif()
+
while(outputs)
list(POP_FRONT cfgs cfg)
list(POP_FRONT outputs output)
@@ -1387,6 +1562,10 @@ END
DEPENDS "${input}"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${input}" "${output}"
)
+ # We can't rely on policy CMP0118 since user project controls it
+ set_source_files_properties(${output} ${scope_args}
+ PROPERTIES GENERATED TRUE
+ )
target_sources(${end_target} PRIVATE "$<$<CONFIG:${cfg}>:${output}>")
endwhile()
endif()
@@ -1427,7 +1606,7 @@ function(__qt_internal_propagate_object_library target object_library)
# All object libraries mark themselves with the _is_qt_propagated_object_library property.
# Using a finalizer approach we walk through the target dependencies and look for libraries
# using the _is_qt_propagated_object_library property. Then, objects of the collected libraries
- # are moved to the beginnig of the linker line using target_sources.
+ # are moved to the beginning of the linker line using target_sources.
#
# Note: target_link_libraries works well with linkers other than ld. If user didn't enforce
# a finalizer we rely on linker to resolve circular dependencies between objects and static
@@ -1506,7 +1685,7 @@ function(__qt_internal_propagate_object_library target object_library)
":${objects}>"
)
# target_link_options works well since CMake 3.17 which has policy CMP0099 set to NEW for the
- # minimum required CMake version greated than or equal 3.17. The default is OLD. See
+ # minimum required CMake version greater than or equal to 3.17. The default is OLD. See
# https://cmake.org/cmake/help/git-master/policy/CMP0099.html for details.
# This provides yet another way of linking object libraries if user sets the policy to NEW
# before calling find_package(Qt...).
@@ -1596,6 +1775,14 @@ function(_qt_internal_expose_source_file_to_ide target file)
set(ide_target ${target}_other_files)
if(NOT TARGET ${ide_target})
add_custom_target(${ide_target} SOURCES "${file}")
+
+ # The new Xcode build system requires a common target to drive the generation of files,
+ # otherwise project configuration fails.
+ # By adding ${target} as a dependency of ${target}_other_files,
+ # it becomes the common target, so project configuration succeeds.
+ if(CMAKE_GENERATOR STREQUAL "Xcode")
+ add_dependencies(${ide_target} ${target})
+ endif()
else()
set_property(TARGET ${ide_target} APPEND PROPERTY SOURCES "${file}")
endif()
@@ -1625,7 +1812,6 @@ function(_qt_internal_process_resource target resourceName)
string(REPLACE "/" "_" resourceName ${resourceName})
string(REPLACE "." "_" resourceName ${resourceName})
- set(output_targets "")
set(resource_files ${rcc_FILES})
if(NOT "${rcc_BASE}" STREQUAL "")
get_filename_component(abs_base "${rcc_BASE}" ABSOLUTE)
@@ -1639,6 +1825,12 @@ function(_qt_internal_process_resource target resourceName)
endforeach()
endif()
+ if(ANDROID)
+ if(COMMAND _qt_internal_collect_qml_root_paths)
+ _qt_internal_collect_qml_root_paths(${target} ${resource_files})
+ endif()
+ endif()
+
if(NOT rcc_PREFIX)
get_target_property(rcc_PREFIX ${target} QT_RESOURCE_PREFIX)
if (NOT rcc_PREFIX)
@@ -1648,13 +1840,11 @@ function(_qt_internal_process_resource target resourceName)
if (NOT resource_files)
if (rcc_OUTPUT_TARGETS)
- set(${rcc_OUTPUT_TARGETS} "${output_target_quick}" PARENT_SCOPE)
+ set(${rcc_OUTPUT_TARGETS} "" PARENT_SCOPE)
endif()
return()
endif()
- list(APPEND output_targets ${output_target_quick})
- set(generatedBaseName "${resourceName}")
- set(generatedResourceFile "${CMAKE_CURRENT_BINARY_DIR}/.rcc/${generatedBaseName}.qrc")
+ set(generatedResourceFile "${CMAKE_CURRENT_BINARY_DIR}/.rcc/${resourceName}.qrc")
# Generate .qrc file:
@@ -1721,7 +1911,7 @@ function(_qt_internal_process_resource target resourceName)
# Set output file name for rcc command
if(isBinary)
- set(generatedOutfile "${CMAKE_CURRENT_BINARY_DIR}/${generatedBaseName}.rcc")
+ set(generatedOutfile "${CMAKE_CURRENT_BINARY_DIR}/${resourceName}.rcc")
if(rcc_DESTINATION)
# Add .rcc suffix if it's not specified by user
get_filename_component(destinationRccExt "${rcc_DESTINATION}" LAST_EXT)
@@ -1747,18 +1937,35 @@ function(_qt_internal_process_resource target resourceName)
COMMENT "Running rcc for resource ${resourceName}"
VERBATIM)
+ set(output_targets "")
if(isBinary)
# Add generated .rcc target to 'all' set
- add_custom_target(binary_resource_${generatedBaseName} ALL DEPENDS "${generatedOutfile}")
+ add_custom_target(binary_resource_${resourceName} ALL DEPENDS "${generatedOutfile}")
else()
- set_property(SOURCE "${generatedOutfile}" PROPERTY SKIP_AUTOGEN ON)
+ # We can't rely on policy CMP0118 since user project controls it.
+ # We also want SKIP_AUTOGEN known in the target's scope, where we can.
+ set(scope_args)
+ if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.18")
+ set(scope_args TARGET_DIRECTORY ${target})
+ endif()
+ set_source_files_properties(${generatedOutfile} ${scope_args} PROPERTIES
+ SKIP_AUTOGEN TRUE
+ GENERATED TRUE
+ )
+ get_target_property(target_source_dir ${target} SOURCE_DIR)
+ if(NOT target_source_dir STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+ # We have to create a separate target in this scope that depends on
+ # the generated file, otherwise the original target won't have the
+ # required dependencies in place to ensure correct build order.
+ add_custom_target(${target}_${resourceName} DEPENDS ${generatedOutfile})
+ add_dependencies(${target} ${target}_${resourceName})
+ endif()
set_property(TARGET ${target} APPEND PROPERTY _qt_generated_qrc_files "${generatedResourceFile}")
- __qt_propagate_generated_resource(${target} ${resourceName} "${generatedOutfile}" output_target)
- list(APPEND output_targets ${output_target})
- if (rcc_OUTPUT_TARGETS)
- set(${rcc_OUTPUT_TARGETS} "${output_targets}" PARENT_SCOPE)
- endif()
+ __qt_propagate_generated_resource(${target} ${resourceName} "${generatedOutfile}" output_targets)
+ endif()
+ if (rcc_OUTPUT_TARGETS)
+ set(${rcc_OUTPUT_TARGETS} "${output_targets}" PARENT_SCOPE)
endif()
endfunction()
@@ -1766,17 +1973,21 @@ macro(_qt_internal_get_add_plugin_keywords option_args single_args multi_args)
set(${option_args}
STATIC
SHARED
+ __QT_INTERNAL_NO_PROPAGATE_PLUGIN_INITIALIZER
)
set(${single_args}
+ # TODO: For backward compatibility / transitional use only, remove once all repos no longer
+ # use it
TYPE
+
+ PLUGIN_TYPE # Internal use only, may be changed or removed
CLASS_NAME
- OUTPUT_NAME
+ OUTPUT_NAME # Internal use only, may be changed or removed
+ OUTPUT_TARGETS
)
set(${multi_args})
endmacro()
-# This function is currently in Technical Preview.
-# It's signature and behavior might change.
function(qt6_add_plugin target)
_qt_internal_get_add_plugin_keywords(opt_args single_args multi_args)
@@ -1798,6 +2009,20 @@ function(qt6_add_plugin target)
unset(arg_CLASSNAME)
endif()
+ # Handle the inconsistent TYPE/PLUGIN_TYPE keyword naming between commands
+ if(arg_TYPE)
+ if(arg_PLUGIN_TYPE AND NOT arg_TYPE STREQUAL arg_PLUGIN_TYPE)
+ message(FATAL_ERROR
+ "Both TYPE and PLUGIN_TYPE were given and were different. "
+ "Only one of the two should be used."
+ )
+ endif()
+ message(AUTHOR_WARNING
+ "The TYPE keyword is deprecated and will be removed soon. Please use PLUGIN_TYPE instead.")
+ set(arg_PLUGIN_TYPE "${arg_TYPE}")
+ unset(arg_TYPE)
+ endif()
+
if(arg_STATIC AND arg_SHARED)
message(FATAL_ERROR
"Both STATIC and SHARED options were given. Only one of the two should be used."
@@ -1842,13 +2067,13 @@ function(qt6_add_plugin target)
if (ANDROID)
set_target_properties(${target}
PROPERTIES
- LIBRARY_OUTPUT_NAME "plugins_${arg_TYPE}_${output_name}"
+ LIBRARY_OUTPUT_NAME "plugins_${arg_PLUGIN_TYPE}_${output_name}"
)
endif()
# Derive the class name from the target name if it's not explicitly specified.
set(plugin_class_name "")
- if (NOT "${arg_TYPE}" STREQUAL "qml_plugin")
+ if (NOT "${arg_PLUGIN_TYPE}" STREQUAL "qml_plugin")
if (NOT arg_CLASS_NAME)
set(plugin_class_name "${target}")
else()
@@ -1866,6 +2091,32 @@ function(qt6_add_plugin target)
set_target_properties(${target} PROPERTIES QT_PLUGIN_CLASS_NAME "${plugin_class_name}")
+ # Create a plugin initializer object library for static plugins.
+ # It contains a Q_IMPORT_PLUGIN(QT_PLUGIN_CLASS_NAME) call.
+ # Project targets will automatically link to the plugin initializer whenever they link to the
+ # plugin target.
+ # The plugin init target name is stored in OUTPUT_TARGETS, so projects may install them.
+ # Qml plugin inits are handled in Qt6QmlMacros.
+ if(NOT "${arg_PLUGIN_TYPE}" STREQUAL "qml_plugin"
+ AND target_type STREQUAL "STATIC_LIBRARY")
+ __qt_internal_add_static_plugin_init_object_library("${target}" plugin_init_target)
+
+ if(arg_OUTPUT_TARGETS)
+ set(${arg_OUTPUT_TARGETS} ${plugin_init_target} PARENT_SCOPE)
+ endif()
+
+ # We don't automatically propagate the plugin init library for Qt provided plugins, because
+ # there are 2 other code paths that take care of that, one involving finalizers and the
+ # other regular usage requirements.
+ if(NOT arg___QT_INTERNAL_NO_PROPAGATE_PLUGIN_INITIALIZER)
+ __qt_internal_propagate_object_library("${target}" "${plugin_init_target}")
+ endif()
+ else()
+ if(arg_OUTPUT_TARGETS)
+ set(${arg_OUTPUT_TARGETS} "" PARENT_SCOPE)
+ endif()
+ endif()
+
target_compile_definitions(${target} PRIVATE
QT_PLUGIN
QT_DEPRECATED_WARNINGS
@@ -1875,6 +2126,10 @@ endfunction()
if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
function(qt_add_plugin)
qt6_add_plugin(${ARGV})
+ cmake_parse_arguments(PARSE_ARGV 1 arg "" "OUTPUT_TARGETS" "")
+ if(arg_OUTPUT_TARGETS)
+ set(${arg_OUTPUT_TARGETS} ${${arg_OUTPUT_TARGETS}} PARENT_SCOPE)
+ endif()
endfunction()
endif()
@@ -1957,6 +2212,7 @@ function(_qt_internal_add_library target)
endif()
add_library(${target} ${type_to_create} ${arg_UNPARSED_ARGUMENTS})
+ _qt_internal_set_up_static_runtime_library(${target})
if(NOT type_to_create STREQUAL "INTERFACE" AND NOT type_to_create STREQUAL "OBJECT")
_qt_internal_apply_win_prefix_and_suffix("${target}")
@@ -1979,9 +2235,6 @@ if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
endfunction()
endif()
-# By default Qt6 forces usage of utf8 sources for consumers of Qt.
-# Users can opt out of utf8 sources by calling this function with the target name of their
-# application or library.
function(qt6_allow_non_utf8_sources target)
set_target_properties("${target}" PROPERTIES QT_NO_UTF8_SOURCE TRUE)
endfunction()
@@ -2081,12 +2334,32 @@ properties of both types."
endforeach()
endfunction()
-# Disables the default unicode definitions for the target
function(qt6_disable_unicode_defines target)
set_target_properties(${target} PROPERTIES QT_NO_UNICODE_DEFINES TRUE)
endfunction()
+# Finalizer function for the top-level user projects.
+#
+# This function is currently in Technical Preview.
+# Its signature and behavior might change.
+function(qt6_finalize_project)
+ if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
+ message("qt6_finalize_project is called not in the top-level CMakeLists.txt.")
+ endif()
+ if(ANDROID)
+ _qt_internal_collect_target_apk_dependencies()
+ endif()
+endfunction()
+
if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
+ function(qt_finalize_project)
+ if(QT_DEFAULT_MAJOR_VERSION EQUAL 6)
+ qt6_finalize_project()
+ else()
+ message(FATAL_ERROR "qt_finalize_project() is only available in Qt 6.")
+ endif()
+ endfunction()
+
function(qt_disable_unicode_defines)
qt6_disable_unicode_defines(${ARGV})
endfunction()
diff --git a/src/corelib/Qt6WasmMacros.cmake b/src/corelib/Qt6WasmMacros.cmake
index e9c19160a3..2c915b3903 100644
--- a/src/corelib/Qt6WasmMacros.cmake
+++ b/src/corelib/Qt6WasmMacros.cmake
@@ -1,6 +1,5 @@
-
-function(qt6_wasm_add_target_helpers target)
- # copy in Qt HTML/JS launch files for apps
+# Copy in Qt HTML/JS launch files for apps.
+function(_qt_internal_wasm_add_target_helpers target)
get_target_property(targetType "${target}" TYPE)
if("${targetType}" STREQUAL "EXECUTABLE")
@@ -21,11 +20,3 @@ function(qt6_wasm_add_target_helpers target)
endif()
endfunction()
-
-if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
- function(qt_wasm_add_target_helpers)
- if(QT_DEFAULT_MAJOR_VERSION EQUAL 6)
- qt6_wasm_add_target_helpers(${ARGV})
- endif()
- endfunction()
-endif()
diff --git a/src/corelib/QtCore.dynlist b/src/corelib/QtCore.dynlist
index 51e4c5a34e..cefd7aef37 100644
--- a/src/corelib/QtCore.dynlist
+++ b/src/corelib/QtCore.dynlist
@@ -1,8 +1,6 @@
{
extern "C" {
"qt_startup_hook";
- "qt_addObject";
- "qt_removeObject";
};
extern "C++" {
"QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)";
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index 16621036e2..1e887bfb54 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -219,7 +219,7 @@ Q_GLOBAL_STATIC(QThreadStorage<QUnifiedTimer *>, unifiedTimer)
QUnifiedTimer::QUnifiedTimer() :
QObject(), defaultDriver(this), lastTick(0), timingInterval(DEFAULT_TIMER_INTERVAL),
currentAnimationIdx(0), insideTick(false), insideRestart(false), consistentTiming(false), slowMode(false),
- startTimersPending(false), stopTimerPending(false),
+ startTimersPending(false), stopTimerPending(false), allowNegativeDelta(false),
slowdownFactor(5.0f), profilerCallback(nullptr),
driverStartTime(0), temporalDrift(0)
{
@@ -315,7 +315,7 @@ void QUnifiedTimer::updateAnimationTimers()
// when the CPU load is high
//* it might happen in some cases that the delta is negative because the animation driver
// advances faster than time.elapsed()
- if (delta > 0) {
+ if (delta != 0 && (allowNegativeDelta || delta > 0)) {
QScopedValueRollback<bool> guard(insideTick, true);
if (profilerCallback)
profilerCallback(delta);
@@ -517,6 +517,8 @@ void QUnifiedTimer::installAnimationDriver(QAnimationDriver *d)
if (running)
stopAnimationDriver();
driver = d;
+ if (driver)
+ allowNegativeDelta = driver->property("allowNegativeDelta").toBool();
if (running)
startAnimationDriver();
}
@@ -532,6 +534,7 @@ void QUnifiedTimer::uninstallAnimationDriver(QAnimationDriver *d)
if (running)
stopAnimationDriver();
driver = &defaultDriver;
+ allowNegativeDelta = false;
if (running)
startAnimationDriver();
}
@@ -792,7 +795,7 @@ void QAnimationDriver::advanceAnimation()
/*!
- Advances the animation. This function should be continously called
+ Advances the animation. This function should be continuously called
by the driver while the animation is running.
*/
diff --git a/src/corelib/animation/qabstractanimation_p.h b/src/corelib/animation/qabstractanimation_p.h
index 6a94d2bb8a..6b033de4c7 100644
--- a/src/corelib/animation/qabstractanimation_p.h
+++ b/src/corelib/animation/qabstractanimation_p.h
@@ -224,6 +224,7 @@ private:
bool slowMode;
bool startTimersPending;
bool stopTimerPending;
+ bool allowNegativeDelta;
// This factor will be used to divide the DEFAULT_TIMER_INTERVAL at each tick
// when slowMode is enabled. Setting it to 0 or higher than DEFAULT_TIMER_INTERVAL (16)
diff --git a/src/corelib/animation/qanimationgroup.cpp b/src/corelib/animation/qanimationgroup.cpp
index 729f55d68f..f86e927e8c 100644
--- a/src/corelib/animation/qanimationgroup.cpp
+++ b/src/corelib/animation/qanimationgroup.cpp
@@ -247,7 +247,7 @@ QAbstractAnimation *QAnimationGroup::takeAnimation(int index)
}
QAbstractAnimation *animation = d->animations.at(index);
QAbstractAnimationPrivate::get(animation)->group = nullptr;
- // ### removing from list before doing setParent to avoid inifinite recursion
+ // ### removing from list before doing setParent to avoid infinite recursion
// in ChildRemoved event
d->animations.removeAt(index);
animation->setParent(nullptr);
diff --git a/src/corelib/compat/removed_api.cpp b/src/corelib/compat/removed_api.cpp
index d5d71ce75a..b2e758d2ca 100644
--- a/src/corelib/compat/removed_api.cpp
+++ b/src/corelib/compat/removed_api.cpp
@@ -59,6 +59,31 @@ QByteArray QCryptographicHash::hash(const QByteArray &data, Algorithm method)
#include "quuid.h"
+QUuid::QUuid(const QString &text)
+ : QUuid{qToAnyStringViewIgnoringNull(text)}
+{
+}
+
+QUuid::QUuid(const char *text)
+ : QUuid{QAnyStringView(text)}
+{
+}
+
+QUuid::QUuid(const QByteArray &text)
+ : QUuid{qToAnyStringViewIgnoringNull(text)}
+{
+}
+
+QUuid QUuid::fromString(QStringView string) noexcept
+{
+ return fromString(QAnyStringView{string});
+}
+
+QUuid QUuid::fromString(QLatin1String string) noexcept
+{
+ return fromString(QAnyStringView{string});
+}
+
QUuid QUuid::fromRfc4122(const QByteArray &bytes)
{
return fromRfc4122(qToByteArrayViewIgnoringNull(bytes));
diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake
index 9ff06f0792..08d1e0d976 100644
--- a/src/corelib/configure.cmake
+++ b/src/corelib/configure.cmake
@@ -120,7 +120,7 @@ int pipes[2];
# special case begin
# cxx11_future
-if (UNIX AND NOT ANDROID AND NOT QNX)
+if (UNIX AND NOT ANDROID AND NOT QNX AND NOT INTEGRITY)
set(cxx11_future_TEST_LIBRARIES pthread)
endif()
qt_config_compile_test(cxx11_future
@@ -901,6 +901,7 @@ qt_feature("timezone" PUBLIC
SECTION "Utilities"
LABEL "QTimeZone"
PURPOSE "Provides support for time-zone handling."
+ CONDITION NOT WASM
)
qt_feature("datetimeparser" PRIVATE
SECTION "Utilities"
diff --git a/src/corelib/debug_script.py b/src/corelib/debug_script.py
index 7aaa1a79d1..c66549ceaa 100644
--- a/src/corelib/debug_script.py
+++ b/src/corelib/debug_script.py
@@ -38,6 +38,8 @@ def import_bridge(path, debugger, session_dict, reload_module=False):
if not reload_module and MODULE_NAME in sys.modules:
del sys.modules[MODULE_NAME]
+ if sys.version_info[0] >= 3:
+ sys.path.append(os.path.dirname(path))
bridge = imp.load_source(MODULE_NAME, path)
if not hasattr(bridge, '__lldb_init_module'):
diff --git a/src/corelib/doc/images/resources.png b/src/corelib/doc/images/resources.png
deleted file mode 100644
index eb7af96d77..0000000000
--- a/src/corelib/doc/images/resources.png
+++ /dev/null
Binary files differ
diff --git a/src/corelib/doc/include/jni.h b/src/corelib/doc/include/jni.h
index 03b289a229..0e7560cf61 100644
--- a/src/corelib/doc/include/jni.h
+++ b/src/corelib/doc/include/jni.h
@@ -60,5 +60,6 @@ struct _jobject;
typedef _jobject* jobject;
typedef int jint;
typedef int jmethodID;
+typedef int jfieldID;
typedef void* JavaVM;
#endif
diff --git a/src/corelib/doc/qtcore.qdocconf b/src/corelib/doc/qtcore.qdocconf
index 750c5d2762..cb622647e8 100644
--- a/src/corelib/doc/qtcore.qdocconf
+++ b/src/corelib/doc/qtcore.qdocconf
@@ -18,9 +18,6 @@ qhp.QtCore.virtualFolder = qtcore
qhp.QtCore.indexTitle = Qt Core
qhp.QtCore.indexRoot =
-qhp.QtCore.filterAttributes = qtcore $QT_VERSION qtrefdoc
-qhp.QtCore.customFilters.Qt.name = QtCore $QT_VERSION
-qhp.QtCore.customFilters.Qt.filterAttributes = qtcore $QT_VERSION
qhp.QtCore.subprojects = classes
qhp.QtCore.subprojects.classes.title = C++ Classes
qhp.QtCore.subprojects.classes.indexTitle = Qt Core C++ Classes
@@ -56,3 +53,6 @@ excludefiles += ../kernel/qtestsupport_core.cpp
navigation.landingpage = "Qt Core"
navigation.cppclassespage = "Qt Core C++ Classes"
+
+# Fail the documentation build if there are more warnings than the limit
+warninglimit = 0
diff --git a/src/corelib/doc/snippets/cmake-macros/examples.cmake b/src/corelib/doc/snippets/cmake-macros/examples.cmake
index 56d667914d..a4def96600 100644
--- a/src/corelib/doc/snippets/cmake-macros/examples.cmake
+++ b/src/corelib/doc/snippets/cmake-macros/examples.cmake
@@ -1,21 +1,9 @@
-#! [qt5_wrap_cpp]
-set(SOURCES myapp.cpp main.cpp)
-qt5_wrap_cpp(SOURCES myapp.h)
-add_executable(myapp ${SOURCES})
-#! [qt5_wrap_cpp]
-
#! [qt_wrap_cpp]
set(SOURCES myapp.cpp main.cpp)
qt_wrap_cpp(SOURCES myapp.h)
add_executable(myapp ${SOURCES})
#! [qt_wrap_cpp]
-#! [qt5_add_resources]
-set(SOURCES main.cpp)
-qt5_add_resources(SOURCES example.qrc)
-add_executable(myapp ${SOURCES})
-#! [qt5_add_resources]
-
#! [qt_add_resources]
set(SOURCES main.cpp)
qt_add_resources(SOURCES example.qrc)
@@ -29,54 +17,28 @@ qt_add_resources(myapp "images"
FILES image1.png image2.png)
#! [qt_add_resources_target]
-#! [qt5_add_big_resources]
-set(SOURCES main.cpp)
-qt5_add_big_resources(SOURCES big_resource.qrc)
-add_executable(myapp ${SOURCES})
-#! [qt5_add_big_resources]
-
#! [qt_add_big_resources]
set(SOURCES main.cpp)
qt_add_big_resources(SOURCES big_resource.qrc)
add_executable(myapp ${SOURCES})
#! [qt_add_big_resources]
-#! [qt5_add_binary_resources]
-qt5_add_binary_resources(resources project.qrc OPTIONS -no-compress)
-add_dependencies(myapp resources)
-#! [qt5_add_binary_resources]
-
#! [qt_add_binary_resources]
qt_add_binary_resources(resources project.qrc OPTIONS -no-compress)
add_dependencies(myapp resources)
#! [qt_add_binary_resources]
-#! [qt5_generate_moc]
-qt5_generate_moc(main.cpp main.moc TARGET myapp)
-#! [qt5_generate_moc]
-
#! [qt_generate_moc]
qt_generate_moc(main.cpp main.moc TARGET myapp)
#! [qt_generate_moc]
-#! [qt5_import_plugins]
-add_executable(myapp main.cpp)
-target_link_libraries(myapp Qt5::Gui Qt5::Sql)
-qt5_import_plugins(myapp
- INCLUDE Qt5::QCocoaIntegrationPlugin
- EXCLUDE Qt5::QMinimalIntegrationPlugin
- INCLUDE_BY_TYPE imageformats Qt5::QGifPlugin Qt5::QJpegPlugin
- EXCLUDE_BY_TYPE sqldrivers
-)
-#! [qt5_import_plugins]
-
#! [qt_import_plugins]
add_executable(myapp main.cpp)
-target_link_libraries(myapp Qt5::Gui Qt5::Sql)
+target_link_libraries(myapp Qt::Gui Qt::Sql)
qt_import_plugins(myapp
- INCLUDE Qt5::QCocoaIntegrationPlugin
- EXCLUDE Qt5::QMinimalIntegrationPlugin
- INCLUDE_BY_TYPE imageformats Qt5::QGifPlugin Qt5::QJpegPlugin
+ INCLUDE Qt::QCocoaIntegrationPlugin
+ EXCLUDE Qt::QMinimalIntegrationPlugin
+ INCLUDE_BY_TYPE imageformats Qt::QGifPlugin Qt::QJpegPlugin
EXCLUDE_BY_TYPE sqldrivers
)
#! [qt_import_plugins]
diff --git a/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp b/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp
index ced30cf32a..55ce52a2e7 100644
--- a/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp
@@ -203,7 +203,7 @@ int boundedValue = qBound(minValue, myValue, maxValue);
//! [16]
-#if QT_VERSION >= 0x040100
+#if QT_VERSION >= QT_VERSION_CHECK(4, 1, 0)
QIcon icon = style()->standardIcon(QStyle::SP_TrashIcon);
#else
QPixmap pixmap = style()->standardPixmap(QStyle::SP_TrashIcon);
@@ -718,7 +718,7 @@ bool readConfiguration(const QFile &file)
//! [qt-version-check]
#include <QtGlobal>
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#include <QtWidgets>
#else
#include <QtGui>
diff --git a/src/corelib/doc/snippets/code/src_corelib_io_qdir.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qdir.cpp
index 4e5e25a64a..3b9435f022 100644
--- a/src/corelib/doc/snippets/code/src_corelib_io_qdir.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_io_qdir.cpp
@@ -182,4 +182,17 @@ namespace MyNamespace
Q_CLEANUP_RESOURCE(myapp);
//! [15]
+//! [16]
+QString absolute = "/local/bin";
+QString relative = "local/bin";
+QFileInfo absFile(absolute);
+QFileInfo relFile(relative);
+
+QDir::setCurrent(QDir::rootPath());
+// absFile and relFile now point to the same file
+
+QDir::setCurrent("/tmp");
+// absFile now points to "/local/bin",
+// while relFile points to "/tmp/local/bin"
+//! [16]
}
diff --git a/src/corelib/doc/snippets/code/src_corelib_io_qfileinfo.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qfileinfo.cpp
index 036625370e..d81360ee5b 100644
--- a/src/corelib/doc/snippets/code/src_corelib_io_qfileinfo.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_io_qfileinfo.cpp
@@ -90,19 +90,16 @@ info2.size(); // returns 63942
//! [2]
-QString absolute = "/local/bin";
-QString relative = "local/bin";
-QFileInfo absFile(absolute);
-QFileInfo relFile(relative);
+QFileInfo info("/usr/bin/env");
-QDir::setCurrent(QDir::rootPath());
-// absFile and relFile now point to the same file
+QString path = info.absolutePath(); // path = /usr/bin
+QString base = info.baseName(); // base = env
-QDir::setCurrent("/tmp");
-// absFile now points to "/local/bin",
-// while relFile points to "/tmp/local/bin"
-//! [2]
+info.setFile("/etc/hosts");
+path = info.absolutePath(); // path = /etc
+base = info.baseName(); // base = hosts
+//! [2]
//! [3]
QFileInfo fi("/tmp/archive.tar.gz");
diff --git a/src/corelib/doc/snippets/code/src_corelib_kernel_qproperty.cpp b/src/corelib/doc/snippets/code/src_corelib_kernel_qproperty.cpp
index 3d63abe590..ae1d2202e7 100644
--- a/src/corelib/doc/snippets/code/src_corelib_kernel_qproperty.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_kernel_qproperty.cpp
@@ -160,3 +160,40 @@ int main()
#include "main.moc"
//! [4]
+
+//! [5]
+class Client{};
+
+class MyClassPrivate : public QObjectPrivate
+{
+public:
+ QList<Client> clients;
+ bool hasClientsActualCalculation() const { return clients.size() > 0; }
+ Q_OBJECT_COMPUTED_PROPERTY(MyClassPrivate, bool, hasClientsData,
+ &MyClassPrivate::hasClientsActualCalculation)
+};
+
+class MyClass : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(bool hasClients READ hasClients STORED false BINDABLE bindableHasClients)
+public:
+ QBindable<bool> bindableHasClients()
+ {
+ return QBindable<bool>(&d_func()->hasClientsData);
+ }
+ bool hasClients() const
+ {
+ return d_func()->hasClientsData.value();
+ }
+ void addClient(const Client &c)
+ {
+ Q_D(MyClass);
+ d->clients.push_back(c);
+ // notify that the value could have changed
+ d->hasClientsData.markDirty();
+ }
+private:
+ Q_DECLARE_PRIVATE(MyClass)
+};
+//! [5]
diff --git a/src/corelib/doc/snippets/code/src_corelib_text_qbytearrayview.cpp b/src/corelib/doc/snippets/code/src_corelib_text_qbytearrayview.cpp
index d70caa2650..519f609790 100644
--- a/src/corelib/doc/snippets/code/src_corelib_text_qbytearrayview.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_text_qbytearrayview.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2020 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
@@ -58,3 +58,24 @@
void fun(QByteArrayView bv);
void fun(char ch) { fun(QByteArrayView(&ch, 1)); }
//! [1]
+
+//! [2]
+QByteArrayView str("FF");
+bool ok;
+int hex = str.toInt(&ok, 16); // hex == 255, ok == true
+int dec = str.toInt(&ok, 10); // dec == 0, ok == false
+//! [2]
+
+//! [3]
+QByteArrayView str("FF");
+bool ok;
+long hex = str.toLong(&ok, 16); // hex == 255, ok == true
+long dec = str.toLong(&ok, 10); // dec == 0, ok == false
+//! [3]
+
+//! [4]
+QByteArrayView string("1234.56 Volt");
+bool ok;
+float a = str.toFloat(&ok); // a == 0, ok == false
+a = string.first(7).toFloat(&ok); // a == 1234.56, ok == true
+//! [4]
diff --git a/src/corelib/doc/snippets/code/src_corelib_text_qlocale.cpp b/src/corelib/doc/snippets/code/src_corelib_text_qlocale.cpp
index 58a7502346..0ef5f1b82d 100644
--- a/src/corelib/doc/snippets/code/src_corelib_text_qlocale.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_text_qlocale.cpp
@@ -62,17 +62,19 @@ int i = egyptian.toInt(s2);
bool ok;
double d;
-QLocale::setDefault(QLocale::C);
-d = QString("1234,56").toDouble(&ok); // ok == false, d == 0
-d = QString("1234.56").toDouble(&ok); // ok == true, d == 1234.56
+QLocale::setDefault(QLocale::C); // uses '.' as a decimal point
+QLocale cLocale; // default-constructed C locale
+d = cLocale.toDouble("1234,56", &ok); // ok == false, d == 0
+d = cLocale.toDouble("1234.56", &ok); // ok == true, d == 1234.56
-QLocale::setDefault(QLocale::German);
-d = QString("1234,56").toDouble(&ok); // ok == false, d == 0
-d = QString("1234.56").toDouble(&ok); // ok == true, d == 1234.56
+QLocale::setDefault(QLocale::German); // uses ',' as a decimal point
+QLocale german; // default-constructed German locale
+d = german.toDouble("1234,56", &ok); // ok == true, d == 1234.56
+d = german.toDouble("1234.56", &ok); // ok == false, d == 0
-QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedStates));
-QString str = QString("%1 %L2 %L3")
- .arg(12345).arg(12345).arg(12345, 0, 16);
+QLocale::setDefault(QLocale::English);
+// Default locale now uses ',' as a group separator.
+QString str = QString("%1 %L2 %L3").arg(12345).arg(12345).arg(12345, 0, 16);
// str == "12345 12,345 3039"
//! [1]
diff --git a/src/corelib/doc/snippets/code/src_corelib_text_qregularexpression.cpp b/src/corelib/doc/snippets/code/src_corelib_text_qregularexpression.cpp
index 8bf67a9e2d..3bb9727ca6 100644
--- a/src/corelib/doc/snippets/code/src_corelib_text_qregularexpression.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_text_qregularexpression.cpp
@@ -374,4 +374,16 @@ QRegularExpression re(R"(\d\d \w+)");
//! [35]
}
+{
+//! [36]
+QRegularExpression re("([a-z]+)|([A-Z]+)");
+QRegularExpressionMatch m = re.match("UPPERCASE");
+if (m.hasMatch()) {
+ qDebug() << m.hasCaptured(0); // true
+ qDebug() << m.hasCaptured(1); // false
+ qDebug() << m.hasCaptured(2); // true
+}
+//! [36]
+}
+
}
diff --git a/src/corelib/doc/snippets/code/src_corelib_thread_qfuture.cpp b/src/corelib/doc/snippets/code/src_corelib_thread_qfuture.cpp
index a53ca13cc6..f4278abcbc 100644
--- a/src/corelib/doc/snippets/code/src_corelib_thread_qfuture.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_thread_qfuture.cpp
@@ -114,10 +114,10 @@ QFuture<int> future = ...;
//! [5]
//! [6]
-QFuture<int> parentFuture = ...;
-auto continuation = parentFuture.then([](int res1){ ... }).then([](int res2){ ... })...
+QFuture<int> future = ...;
+auto continuation = future.then([](int res1){ ... }).then([](int res2){ ... })...
...
-// parentFuture throws an exception
+// future throws an exception
try {
auto result = continuation.result();
} catch (QException &e) {
@@ -286,9 +286,9 @@ auto future = QtConcurrent::run([] {
//! [20]
QObject *context = ...;
-auto parentFuture = cachedResultsReady ? QtFuture::makeReadyFuture(results)
- : QtConcurrent::run([] { /* compute results */});
-auto future = parentFuture.then(context, [] (Results results) {
+auto future = cachedResultsReady ? QtFuture::makeReadyFuture(results)
+ : QtConcurrent::run([] { /* compute results */});
+auto continuation = future.then(context, [] (Results results) {
// Runs in the context's thread
}).then([] {
// May or may not run in the context's thread
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qpoint.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qpoint.cpp
index fd4db5580f..7171f4b2ea 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qpoint.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qpoint.cpp
@@ -92,7 +92,7 @@ p *= 2.5; // p becomes (-3, 10)
//! [16]
QPoint p( 3, 7);
QPoint q(-1, 4);
-int lengthSquared = QPoint::dotProduct(p, q); // lengthSquared becomes 25
+int dotProduct = QPoint::dotProduct(p, q); // dotProduct becomes 25
//! [16]
@@ -169,5 +169,5 @@ p /= 2.5; // p becomes (-1.1, 4.1)
//! [17]
QPointF p( 3.1, 7.1);
QPointF q(-1.0, 4.1);
-int lengthSquared = QPointF::dotProduct(p, q); // lengthSquared becomes 26.01
+qreal dotProduct = QPointF::dotProduct(p, q); // dotProduct becomes 26.01
//! [17]
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qscopedpointer.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qscopedpointer.cpp
index dde9a92129..d074a9a967 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qscopedpointer.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qscopedpointer.cpp
@@ -122,7 +122,7 @@ public:
private:
Q_DISABLE_COPY(MyClass) // OK - copy constructor and assignment operators
- // are now disabled, so the compiler won't implicitely
+ // are now disabled, so the compiler won't implicitly
// generate them.
};
//! [4]
diff --git a/src/corelib/doc/snippets/code/src_gui_dialogs_qmessagebox.cpp b/src/corelib/doc/snippets/code/src_gui_dialogs_qmessagebox.cpp
index 82f916581e..7ec2203e5f 100644
--- a/src/corelib/doc/snippets/code/src_gui_dialogs_qmessagebox.cpp
+++ b/src/corelib/doc/snippets/code/src_gui_dialogs_qmessagebox.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
@@ -108,7 +108,7 @@ if (messageBox.clickedButton() == disconnectButton) {
int main(int argc, char *argv[])
{
- QT_REQUIRE_VERSION(argc, argv, "4.0.2")
+ QT_REQUIRE_VERSION(argc, argv, "6.1.2")
QApplication app(argc, argv);
...
diff --git a/src/corelib/doc/snippets/permissions/permissions.cpp b/src/corelib/doc/snippets/permissions/permissions.cpp
deleted file mode 100644
index a2c05db423..0000000000
--- a/src/corelib/doc/snippets/permissions/permissions.cpp
+++ /dev/null
@@ -1,141 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2021 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtCore/qcoreapplication.h>
-#include <QtCore/qdebug.h>
-#include <QtCore/qstring.h>
-
-void takeSelfie() {};
-
-void requestCameraPermissionAndroid()
-{
-//! [Request camera permission on Android]
- QCoreApplication::requestPermission(QStringLiteral("android.permission.CAMERA"))
- .then([=](QApplicationPermission::PermissionResult result) {
- if (result == QApplicationPermission::Authorized)
- takeSelfie();
- });
-//! [Request camera permission on Android]
-}
-
-void requestCameraPermission()
-{
-//! [Request camera permission]
- QCoreApplication::requestPermission(QApplicationPermission::Camera)
- .then([=](QApplicationPermission::PermissionResult result) {
- if (result == QApplicationPermission::Authorized)
- takeSelfie();
- });
-//! [Request camera permission]
-}
-
-void requestCameraPermissionSyncAndroid()
-{
-//! [Request camera permission sync on Android]
- auto future = QCoreApplication::requestPermission(QStringLiteral("android.permission.CAMERA"));
- auto result = future.result(); // blocks and waits for the result to be ready
- if (result == QApplicationPermission::Authorized)
- takeSelfie();
-//! [Request camera permission sync on Android]
-}
-
-void requestCameraPermissionSync()
-{
-//! [Request camera permission sync]
- auto future = QCoreApplication::requestPermission(QApplicationPermission::Camera);
- auto result = future.result(); // blocks and waits for the result to be ready
- if (result == QApplicationPermission::Authorized)
- takeSelfie();
-//! [Request camera permission sync]
-}
-
-void checkCameraPermissionAndroid()
-{
-//! [Check camera permission on Android]
- QCoreApplication::checkPermission(QStringLiteral("android.permission.CAMERA"))
- .then([=](QApplicationPermission::PermissionResult result) {
- if (result == QApplicationPermission::Authorized)
- takeSelfie();
- });
-//! [Check camera permission on Android]
-}
-
-void checkCameraPermission()
-{
-//! [Check camera permission]
- QCoreApplication::checkPermission(QApplicationPermission::Camera)
- .then([=](QApplicationPermission::PermissionResult result) {
- if (result == QApplicationPermission::Authorized)
- takeSelfie();
- });
-//! [Check camera permission]
-}
-
-void checkCameraPermissionAndroidSync()
-{
-//! [Check camera permission sync on Android]
- auto future = QCoreApplication::checkPermission(QStringLiteral("android.permission.CAMERA"));
- // may block and wait for the result to be ready on some platforms
- auto result = future.result();
- if (result == QApplicationPermission::Authorized)
- takeSelfie();
-//! [Check camera permission sync on Android]
-}
-
-void checkCameraPermissionSync()
-{
-//! [Check camera permission sync]
- auto future = QCoreApplication::checkPermission(QApplicationPermission::Camera);
- // may block and wait for the result to be ready on some platforms
- auto result = future.result();
- if (result == QApplicationPermission::Authorized)
- takeSelfie();
-//! [Check camera permission sync]
-}
diff --git a/src/corelib/doc/snippets/qmetatype/registerConverters.cpp b/src/corelib/doc/snippets/qmetatype/registerConverters.cpp
new file mode 100644
index 0000000000..11e9ce1bfc
--- /dev/null
+++ b/src/corelib/doc/snippets/qmetatype/registerConverters.cpp
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** 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.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QMetaType>
+#include <QString>
+
+int main() {
+ //! [member]
+ struct Coordinates {
+ int x;
+ int y;
+ int z;
+
+ QString toString() const { return u"[x: %1; y: %2, z: %3]"_qs.arg(QString::number(x),
+ QString::number(y),
+ QString::number(z)); }
+ };
+ QMetaType::registerConverter<Coordinates, QString>(&Coordinates::toString);
+ //! [member]
+
+ //! [memberOk]
+ struct BigNumber {
+ long long l;
+
+ int toInt(bool *ok = nullptr) const {
+ const bool canConvertSafely = l < std::numeric_limits<int>::max();
+ if (ok)
+ *ok = canConvertSafely;
+ return l;
+ }
+ };
+ QMetaType::registerConverter<BigNumber, int>(&BigNumber::toInt);
+ //! [memberOk]
+
+ //! [implicit]
+ class Counter {
+ int number = 0;
+ public:
+ int value() const { return number; }
+ operator int() const { return value(); }
+ void increment() {++number;}
+ };
+ QMetaType::registerConverter<Counter, int>();
+ //! [implicit]
+
+ struct CustomStringType {
+ const char *data() const {return nullptr;}
+ };
+ //! [unaryfunc]
+ QMetaType::registerConverter<CustomStringType, QString>([](const CustomStringType &str) {
+ return QString::fromUtf8(str.data());
+ });
+ //! [unaryfunc]
+}
diff --git a/src/corelib/doc/snippets/resource-system/CMakeLists.txt b/src/corelib/doc/snippets/resource-system/CMakeLists.txt
index 29727bd958..a488d869e6 100644
--- a/src/corelib/doc/snippets/resource-system/CMakeLists.txt
+++ b/src/corelib/doc/snippets/resource-system/CMakeLists.txt
@@ -1,23 +1,38 @@
project(my_app)
cmake_minimum_required(VERSION 3.16)
-find_package(Qt6 REQUIRED COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS Widgets Qml REQUIRED)
#! [AUTORCC]
set(CMAKE_AUTORCC ON)
qt_add_executable(my_app
application.qrc
- mainwindow.cpp)
+ main.cpp
+)
#! [AUTORCC]
#! [qt_add_resources]
qt_add_resources(my_app "app_images"
PREFIX "/"
FILES
- "images/copy.png"
- "images/cut.png"
- "images/new.png"
- "images/open.png"
- "images/paste.png"
- "images/save.png")
+ images/copy.png
+ images/cut.png
+ images/new.png
+ images/open.png
+ images/paste.png
+ images/save.png
+)
#! [qt_add_resources]
+
+#! [qt_add_big_resources]
+qt_add_big_resources(SOURCES application.qrc)
+target_sources(my_app PRIVATE ${SOURCES})
+#! [qt_add_big_resources]
+
+#! [qt_add_binary_resources]
+qt_add_binary_resources(resources application.qrc DESTINATION application.rcc)
+add_dependencies(my_app resources)
+#! [qt_add_binary_resources]
+
+target_link_libraries(my_app
+ PRIVATE Qt6::Qml Qt6::Widgets)
diff --git a/src/corelib/doc/snippets/resource-system/application.pro b/src/corelib/doc/snippets/resource-system/application.pro
index ecf4ce1093..4b1f1d7635 100644
--- a/src/corelib/doc/snippets/resource-system/application.pro
+++ b/src/corelib/doc/snippets/resource-system/application.pro
@@ -1,3 +1,26 @@
+TEMPLATE = app
+
+QT += qml widgets
+
#! [0]
-RESOURCES = application.qrc
+RESOURCES = application.qrc
#! [0]
+
+#! [1]
+resources.files = \
+ images/copy.png \
+ images/cut.png \
+ images/new.png \
+ images/open.png \
+ images/paste.png \
+ images/save.png
+resources.prefix = /
+
+RESOURCES = resources
+#! [1]
+
+#! [2]
+CONFIG += resources_big
+#! [2]
+
+SOURCES += main.cpp
diff --git a/src/corelib/doc/snippets/resource-system/application.qrc b/src/corelib/doc/snippets/resource-system/application.qrc
index 0a776fab4d..3eef379234 100644
--- a/src/corelib/doc/snippets/resource-system/application.qrc
+++ b/src/corelib/doc/snippets/resource-system/application.qrc
@@ -1,10 +1,10 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource>
- <file>images/copy.png</file>
- <file>images/cut.png</file>
- <file>images/new.png</file>
- <file>images/open.png</file>
- <file>images/paste.png</file>
- <file>images/save.png</file>
-</qresource>
+<RCC>
+ <qresource prefix="/">
+ <file>images/copy.png</file>
+ <file>images/cut.png</file>
+ <file>images/new.png</file>
+ <file>images/open.png</file>
+ <file>images/paste.png</file>
+ <file>images/save.png</file>
+ </qresource>
</RCC>
diff --git a/src/corelib/doc/snippets/resource-system/images/copy.png b/src/corelib/doc/snippets/resource-system/images/copy.png
new file mode 100644
index 0000000000..91a99b94e2
--- /dev/null
+++ b/src/corelib/doc/snippets/resource-system/images/copy.png
Binary files differ
diff --git a/src/corelib/doc/snippets/resource-system/images/cut.png b/src/corelib/doc/snippets/resource-system/images/cut.png
new file mode 100644
index 0000000000..91a99b94e2
--- /dev/null
+++ b/src/corelib/doc/snippets/resource-system/images/cut.png
Binary files differ
diff --git a/src/corelib/doc/snippets/resource-system/images/new.png b/src/corelib/doc/snippets/resource-system/images/new.png
new file mode 100644
index 0000000000..91a99b94e2
--- /dev/null
+++ b/src/corelib/doc/snippets/resource-system/images/new.png
Binary files differ
diff --git a/src/corelib/doc/snippets/resource-system/images/open.png b/src/corelib/doc/snippets/resource-system/images/open.png
new file mode 100644
index 0000000000..91a99b94e2
--- /dev/null
+++ b/src/corelib/doc/snippets/resource-system/images/open.png
Binary files differ
diff --git a/src/corelib/doc/snippets/resource-system/images/paste.png b/src/corelib/doc/snippets/resource-system/images/paste.png
new file mode 100644
index 0000000000..91a99b94e2
--- /dev/null
+++ b/src/corelib/doc/snippets/resource-system/images/paste.png
Binary files differ
diff --git a/src/corelib/doc/snippets/resource-system/images/save.png b/src/corelib/doc/snippets/resource-system/images/save.png
new file mode 100644
index 0000000000..91a99b94e2
--- /dev/null
+++ b/src/corelib/doc/snippets/resource-system/images/save.png
Binary files differ
diff --git a/src/corelib/doc/snippets/resource-system/main.cpp b/src/corelib/doc/snippets/resource-system/main.cpp
new file mode 100644
index 0000000000..892f29d01d
--- /dev/null
+++ b/src/corelib/doc/snippets/resource-system/main.cpp
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** 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.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QQmlApplicationEngine>
+#include <QAction>
+#include <QIcon>
+#include <QApplication>
+#include <QWidget>
+
+class DummyWidget : public QWidget {
+ Q_OBJECT
+
+ QAction *cutAct;
+
+ DummyWidget() {
+ //! [QAction]
+ cutAct = new QAction(QIcon(":/images/cut.png"), tr("Cu&t"), this);
+ //! [QAction]
+ }
+};
+
+int main()
+{
+//! [url]
+ QQmlApplicationEngine engine;
+ engine.load(QUrl("qrc:/myapp/main.qml"));
+//! [url]
+}
diff --git a/src/corelib/doc/src/cmake-macros.qdoc b/src/corelib/doc/src/cmake-macros.qdoc
deleted file mode 100644
index 9b486712f7..0000000000
--- a/src/corelib/doc/src/cmake-macros.qdoc
+++ /dev/null
@@ -1,651 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
-\page qt_wrap_cpp.html
-\ingroup cmake-macros-qtcore
-
-\title qt_wrap_cpp
-\target qt6_wrap_cpp
-
-\brief Creates \c{.moc} files from sources.
-
-\section1 Synopsis
-
-\badcode
-qt_wrap_cpp(<VAR> src_file1 [src_file2 ...]
- [TARGET target]
- [OPTIONS ...]
- [DEPENDS ...])
-
-qt6_wrap_cpp(<VAR> src_file1 [src_file2 ...]
- [TARGET target]
- [OPTIONS ...]
- [DEPENDS ...])
-\endcode
-
-\section1 Description
-
-Creates rules for calling the \l{moc}{Meta-Object Compiler (moc)} on the given
-source files. For each input file, an output file is generated in the build
-directory. The paths of the generated files are added to \c{<VAR>}.
-
-\note This is a low-level macro. See the \l{CMake AUTOMOC Documentation} for a
-more convenient way to let source files be processed with \c{moc}.
-
-\section1 Arguments
-
-You can set an explicit \c{TARGET}. This will make sure that the target
-properties \c{INCLUDE_DIRECTORIES} and \c{COMPILE_DEFINITIONS} are also used
-when scanning the source files with \c{moc}.
-
-You can set additional \c{OPTIONS} that should be added to the \c{moc} calls.
-You can find possible options in the \l{moc}{moc documentation}.
-
-\c{DEPENDS} allows you to add additional dependencies for recreation of the
-generated files. This is useful when the sources have implicit dependencies,
-like code for a Qt plugin that includes a \c{.json} file using the
-Q_PLUGIN_METADATA() macro.
-
-\section1 Examples
-
-\snippet cmake-macros/examples.cmake qt_wrap_cpp
-*/
-
-/*!
-\page qt_add_resources.html
-\ingroup cmake-macros-qtcore
-
-\title qt_add_resources
-\target qt6_add_resources
-
-\brief Compiles binary resources into source code.
-
-\section1 Synopsis
-
-\badcode
-qt_add_resources(<VAR> file1.qrc [file2.qrc ...]
- [OPTIONS ...])
-
-qt6_add_resources(<VAR> file1.qrc [file2.qrc ...]
- [OPTIONS ...])
-\endcode
-
-Since 6.0:
-
-\badcode
-qt_add_resources(<TARGET> <RESOURCE_NAME>
- [PREFIX <PATH>]
- [LANG <LANGUAGE>]
- [BASE <PATH>]
- [FILES ...] [OPTIONS ...])
-
-qt6_add_resources(<TARGET> <RESOURCE_NAME>
- [PREFIX <PATH>]
- [LANG <LANGUAGE>]
- [BASE <PATH>]
- [FILES ...] [OPTIONS ...])
-\endcode
-
-\section1 Description
-
-To add resources, you can pass either a variable name or a target as the first
-argument of the command.
-
-When passing a variable name as first argument, \c qt_add_resources creates
-source code from Qt resource files using the \l{Resource Compiler (rcc)}. Paths
-to the generated source files are added to \c{<VAR>}.
-
-When passing a target as first argument, the function creates a resource with
-the name \c{RESOURCE_NAME}, containing the specified \c{FILES}. The resource is
-automatically linked into \c{TARGET}.
-
-For embedding bigger resources, see \l qt_add_big_resources.
-
-See \l{The Qt Resource System} for a general description of Qt resources.
-
-\section1 Arguments of the target-based variant
-
-\c PREFIX specifies a path prefix under which all files of this resource are
-accessible from C++ code. This corresponds to the XML attribute \c prefix of the
-\c .qrc file format. If \c PREFIX is not given, the target property
-\l{cmake-target-property-QT_RESOURCE_PREFIX}{QT_RESOURCE_PREFIX} is used.
-
-\c LANG specifies the locale of this resource. This corresponds to the XML
-attribute \c lang of the \c .qrc file format.
-
-\c BASE is a path prefix that denotes the root point of the file's alias. For
-example, if \c BASE is \c{"assets"} and \c FILES is
-\c{"assets/images/logo.png"}, then the alias of that file is
-\c{"images/logo.png"}.
-
-Alias settings for files need to be set via the \c QT_RESOURCE_ALIAS source file
-property.
-
-\section1 Arguments of both variants
-
-You can set additional \c{OPTIONS} that should be added to the \c{rcc} calls.
-You can find possible options in the \l{rcc}{rcc documentation}.
-
-\section1 Examples
-
-Variable variant, using a .qrc file:
-\snippet cmake-macros/examples.cmake qt_add_resources
-
-Target variant, using immediate resources:
-\snippet cmake-macros/examples.cmake qt_add_resources_target
-
-\section1 Caveats
-
-When adding multiple resources, \c{RESOURCE_NAME} must be unique across all
-resources linked into the final target.
-
-This especially affects static builds. There, the same resource name in
-different static libraries conflict in the consuming target.
-*/
-
-/*!
-\page qt_add_bigresources.html
-\ingroup cmake-macros-qtcore
-
-\title qt_add_big_resources
-\target qt6_add_big_resources
-
-\brief Compiles big binary resources into object code.
-
-\section1 Synopsis
-
-\badcode
-qt_add_big_resources(<VAR> file1.qrc [file2.qrc ...]
- [OPTIONS ...])
-
-qt6_add_big_resources(<VAR> file1.qrc [file2.qrc ...]
- [OPTIONS ...])
-\endcode
-
-\section1 Description
-
-Creates compiled object files from Qt resource files using the
-\l{Resource Compiler (rcc)}. Paths to the generated files are added to
-\c{<VAR>}.
-
-This is similar to \l qt_add_resources, but directly
-generates object files (\c .o, \c .obj) files instead of C++ source code.
-This allows to embed bigger resources, where compiling to C++ sources and then
-to binaries would be too time consuming or memory intensive.
-
-\note This macro is only available if using \c{CMake} 3.9 or later.
-
-\section1 Arguments
-
-You can set additional \c{OPTIONS} that should be added to the \c{rcc} calls.
-You can find possible options in the \l{rcc}{rcc documentation}.
-
-\section1 Examples
-
-\snippet cmake-macros/examples.cmake qt_add_big_resources
-*/
-
-/*!
-\page qt_add_binary_resources.html
-\ingroup cmake-macros-qtcore
-
-\title qt_add_binary_resources
-\target qt6_add_binary_resources
-
-\brief Creates an \c{RCC} file from a list of Qt resource files.
-
-\section1 Synopsis
-
-\badcode
-qt_add_binary_resources(target file1.qrc [file2.qrc ...]
- [DESTINATION ...]
- [OPTIONS ...])
-
-qt6_add_binary_resources(target file1.qrc [file2.qrc ...]
- [DESTINATION ...]
- [OPTIONS ...])
-\endcode
-
-\section1 Description
-
-Adds a custom \c target that compiles Qt resource files into a binary \c{.rcc}
-file.
-
-\section1 Arguments
-
-\c{DESTINATION} sets the path of the generated \c{.rcc} file. The default is
-\c{${CMAKE_CURRENT_BINARY_DIR}/${target}.rcc}.
-
-You can set additional \c{OPTIONS} that should be added to the \c{rcc} calls.
-You can find possible options in the \l{rcc}{rcc documentation}.
-
-\section1 Examples
-
-\snippet cmake-macros/examples.cmake qt_add_binary_resources
-*/
-
-/*!
-\page qt_generate_moc.html
-\ingroup cmake-macros-qtcore
-
-\title qt_generate_moc
-\target qt6_generate_moc
-
-\brief Calls moc on an input file.
-
-\section1 Synopsis
-
-\badcode
-qt_generate_moc(src_file dest_file
- [TARGET target])
-
-qt6_generate_moc(src_file dest_file
- [TARGET target])
-\endcode
-
-\section1 Description
-
-Creates a rule to call the \l{moc}{Meta-Object Compiler (moc)} on \c src_file
-and store the output in \c dest_file.
-
-\note This is a low-level macro. See the \l{CMake AUTOMOC Documentation} for a
-more convenient way to let source files be processed with \c{moc}.
-\l qt_wrap_cpp is also similar, but automatically generates a temporary file
-path for you.
-
-\section1 Arguments
-
-You can set an explicit \c{TARGET}. This will make sure that the target
-properties \c{INCLUDE_DIRECTORIES} and \c{COMPILE_DEFINITIONS} are also used
-when scanning the source files with \c{moc}.
-
-\section1 Examples
-
-\snippet cmake-macros/examples.cmake qt_generate_moc
-*/
-
-/*!
-\page qt_import_plugins.html
-\ingroup cmake-macros-qtcore
-
-\title qt_import_plugins
-\target qt6_import_plugins
-
-\brief Specifies a custom set of plugins to import for a static Qt build.
-
-\section1 Synopsis
-
-\badcode
-qt_import_plugins(target
- [INCLUDE plugin ...]
- [EXCLUDE plugin ...]
- [INCLUDE_BY_TYPE plugin_type plugin ...]
- [EXCLUDE_BY_TYPE plugin_type])
-
-qt6_import_plugins(target
- [INCLUDE plugin ...]
- [EXCLUDE plugin ...]
- [INCLUDE_BY_TYPE plugin_type plugin ...]
- [EXCLUDE_BY_TYPE plugin_type])
-\endcode
-
-\section1 Description
-
-Specifies a custom set of plugins to import. The optional arguments:
-\c INCLUDE, \c EXCLUDE, \c INCLUDE_BY_TYPE, and \c EXCLUDE_BY_TYPE,
-can be used more than once.
-
-\list
-\li \c INCLUDE -- can be used to specify a list of plugins to import.
-\li \c EXCLUDE -- can be used to specify a list of plugins to exclude.
-\li \c INCLUDE_BY_TYPE -- can be used to override the list of plugins to
- import for a certain plugin type.
-\li \c EXCLUDE_BY_TYPE -- can be used to specify a plugin type to exclude;
- then no plugins of that type are imported.
-\endlist
-
-Qt provides plugin types such as \c imageformats, \c platforms,
-and \c sqldrivers.
-
-If the command isn't used the target automatically links against
-a sane set of default plugins, for each Qt module that the target is linked
-against. For more information, see
-\l{CMake target_link_libraries Documentation}{target_link_libraries}.
-
-Each plugin comes with a C++ stub file that automatically
-initializes the plugin. Consequently, any target that links against a plugin
-has this C++ file added to its \c SOURCES.
-
-\note This command imports plugins from static Qt builds only.
-On shared builds, it does nothing.
-
-\section1 Examples
-
-\snippet cmake-macros/examples.cmake qt_import_plugins
-
-In the snippet above, the following occurs with the executable \c myapp:
-
-\list
-\li The \c Qt6::QCocoaIntegrationPlugin is imported into myapp.
-\li The \c Qt6::QMinimalIntegrationPlugin plugin is
- excluded from being automatically imported into myapp.
-\li The default list of plugins for \c imageformats is
- overridden to only include Qt6::QGifPlugin and Qt6::QJpegPlugin.
-\li All \c sqldrivers plugins are excluded from automatic importing.
-\endlist
-*/
-
-/*!
-\page qt_add_executable.html
-\ingroup cmake-macros-qtcore
-
-\title qt_add_executable
-\target qt6_add_executable
-
-\brief Creates and finalizes an application target of a platform-specific type.
-
-\preliminarycmakecommand
-
-\section1 Synopsis
-
-\badcode
-qt_add_executable(target
- [WIN32] [MACOSX_BUNDLE]
- [MANUAL_FINALIZATION]
- sources...)
-
-qt6_add_executable(target
- [WIN32] [MACOSX_BUNDLE]
- [MANUAL_FINALIZATION]
- sources...)
-\endcode
-
-\section1 Description
-
-This command performs the following tasks:
-
-\list
-\li Create a CMake target of the appropriate type for the target platform.
-\li Link the target to the \c{Qt::Core} library.
-\li Handle finalization of the CMake target.
-\endlist
-
-\section2 Target Creation
-
-On all platforms except Android, an executable target will be created.
-All arguments will be passed through to the standard CMake \c{add_executable()}
-command, except \c{MANUAL_FINALIZATION} (if present). On Android, a \c{MODULE}
-library will be created and any \c{WIN32} or \c{MACOSX_BUNDLE} options will be
-ignored. Some target properties will also be set for Android:
-
-\list
-\li The \c{SUFFIX} target property will be set to give the library file name an
- architecture-specific suffix.
-\li Various \c{<lang>_VISIBILITY_PRESET} target properties will be set to
- \c{default} to ensure that the \c{main()} function is visible in the
- resultant binary.
-\endlist
-
-\section2 Linking Qt::Core
-
-Since all Qt applications need to link to the \c{Qt::Core} library, this is done
-for you as a convenience.
-
-\section2 Finalization
-
-After a target is created, further processing or \e{finalization} steps are
-commonly needed. The steps to perform depend on the platform and on various
-properties of the target. The finalization processing is implemented by the
-\l{qt6_finalize_target}{qt_finalize_target()} command.
-
-Finalization can occur either as part of this call or be deferred to sometime
-after this command returns (but it should still be in the same directory scope).
-When using CMake 3.19 or later, finalization is automatically deferred to the
-end of the current directory scope. This gives the caller an opportunity to
-modify properties of the created target before it is finalized. When using
-CMake versions earlier than 3.19, automatic deferral isn't supported. In that
-case, finalization is performed immediately before this command returns.
-
-Regardless of the CMake version, the \c{MANUAL_FINALIZATION} keyword can be given to
-indicate that you will explicitly call \l{qt6_finalize_target}{qt_finalize_target()}
-yourself instead at some later time. In general, \c MANUAL_FINALIZATION should
-not be needed unless the project has to support CMake 3.18 or earlier.
-
-\sa {qt6_finalize_target}{qt_finalize_target()}
-
-\section1 Examples
-
-In the following simple case, finalization is handled automatically. If using a
-CMake version earlier than 3.19, finalization will be performed immediately as
-part of the call. When using CMake 3.19 or later, finalization will occur at the
-end of the current directory scope.
-
-\snippet cmake-macros/examples.cmake qt_add_executable_simple
-
-The following example shows a scenario where finalization must be deferred.
-The \c OUTPUT_NAME target property affects deployment settings on Android, but
-those settings are written out as part of finalizing the target. In order to
-support using CMake versions earlier than 3.19, we take over responsibility
-for finalizing the target by adding the \c{MANUAL_FINALIZATION} keyword.
-
-\snippet cmake-macros/examples.cmake qt_add_executable_deferred
-*/
-
-/*!
-\page qt_finalize_target.html
-\ingroup cmake-macros-qtcore
-
-\title qt_finalize_target
-\target qt6_finalize_target
-
-\brief Handles various common platform-specific tasks associated with Qt targets.
-
-\preliminarycmakecommand
-
-\section1 Synopsis
-
-\badcode
-qt_finalize_target(target)
-
-qt6_finalize_target(target)
-\endcode
-
-\section1 Description
-
-After a target is created, further processing or \e{finalization} steps are
-commonly needed. The steps to perform depend on the platform and on various
-properties of the target. These steps are expected to be performed within the
-same directory scope as the one in which the \c{target} was created, so this
-command should also be called from that same directory scope.
-
-This command implements the following, as appropriate for the platform and
-target provided:
-
-\list
-\li When targeting Android, generate a deployment settings file for the target.
-\li Create a build target for generating an APK if building for Android.
-\endlist
-
-This command is ordinarily invoked as part of a call to
-\l{qt6_add_executable}{qt_add_executable()}. The timing of when that call takes
-place and when it might need to be called explicitly by a project is discussed
-in the documentation of that command.
-*/
-
-/*!
-\page qt_android_apply_arch_suffix.html
-\ingroup cmake-macros-qtcore
-
-\title qt_android_apply_arch_suffix
-\target qt6_android_apply_arch_suffix
-
-\brief Configures the target binary's name to include an architecture-specific suffix.
-
-\preliminarycmakecommand
-\cmakecommandandroidonly
-
-\section1 Synopsis
-
-\badcode
-qt_android_apply_arch_suffix(target)
-
-qt6_android_apply_arch_suffix(target)
-\endcode
-
-\section1 Description
-
-The CMake \c{SUFFIX} target property controls the suffix used on the file name
-of the target's built binary. This command is a convenience for setting that
-property to an architecture-specific value. This is useful when installing
-multiple builds for different Android architectures into the same install
-location, as it prevents the libraries for different architectures from
-overwriting each other.
-*/
-
-/*!
-\page qt_android_generate_deployment_settings.html
-\ingroup cmake-macros-qtcore
-
-\title qt_android_generate_deployment_settings
-\target qt6_android_generate_deployment_settings
-
-\brief Generates the deployment settings file needed by androiddeployqt.
-
-\preliminarycmakecommand
-\cmakecommandandroidonly
-
-\section1 Synopsis
-
-\badcode
-qt_android_generate_deployment_settings(target)
-
-qt6_android_generate_deployment_settings(target)
-\endcode
-
-\section1 Description
-
-The \c{androiddeployqt} tool expects a deployment settings file as input. This
-command reads CMake variables and properties of the \c{target} to generate such
-a file in the target's binary directory. Upon return, the full path to this file
-is available in the target's \c{QT_ANDROID_DEPLOYMENT_SETTINGS_FILE} property.
-
-\section2 CMake Variables
-
-A number of variables are used while generating the deployment settings file.
-Some are provided by Qt, others by CMake or the Android NDK.
-
-\list
-\li \l{cmake-variable-ANDROID_NDK_HOST_SYSTEM_NAME}{ANDROID_NDK_HOST_SYSTEM_NAME}
-\li \l{cmake-variable-ANDROID_SDK_ROOT}{ANDROID_SDK_ROOT}
-\li \c{CMAKE_ANDROID_ARCH_ABI}
-\li \c{CMAKE_ANDROID_NDK}
-\li \c{CMAKE_SYSROOT}
-\li \l{cmake-variable-QT_ANDROID_APPLICATION_ARGUMENTS}{QT_ANDROID_APPLICATION_ARGUMENTS}
-\li \l{cmake-variable-QT_HOST_PATH}{QT_HOST_PATH}
-\endlist
-
-\section2 Target Properties
-
-The properties below will be read from the specified \c{target}. Note that this
-command is called as part of target finalization (see
-\l{qt6_finalize_target}{qt_finalize_target()}). If you are using
-\l{qt6_add_executable}{qt_add_executable()} to create the target and you need to
-modify some of these target properties, you need to ensure that target
-finalization is deferred. See \l{qt6_add_executable}{qt_add_executable()} for
-how to accomplish this.
-
-\list
-\li \l{cmake-target-property-QT_ANDROID_DEPLOYMENT_DEPENDENCIES}{QT_ANDROID_DEPLOYMENT_DEPENDENCIES}
-\li \l{cmake-target-property-QT_ANDROID_EXTRA_LIBS}{QT_ANDROID_EXTRA_LIBS}
-\li \l{cmake-target-property-QT_ANDROID_EXTRA_PLUGINS}{QT_ANDROID_EXTRA_PLUGINS}
-\li \l{cmake-target-property-QT_ANDROID_MIN_SDK_VERSION}{QT_ANDROID_MIN_SDK_VERSION}
-\li \l{cmake-target-property-QT_ANDROID_PACKAGE_SOURCE_DIR}{QT_ANDROID_PACKAGE_SOURCE_DIR}
-\li \l{cmake-target-property-QT_ANDROID_TARGET_SDK_VERSION}{QT_ANDROID_TARGET_SDK_VERSION}
-\li \l{cmake-target-property-QT_ANDROID_VERSION_NAME}{QT_ANDROID_VERSION_NAME}
-\li \l{cmake-target-property-QT_ANDROID_VERSION_CODE}{QT_ANDROID_VERSION_CODE}
-\li \l{cmake-target-property-QT_QML_IMPORT_PATH}{QT_QML_IMPORT_PATH}
-\li \l{cmake-target-property-QT_QML_ROOT_PATH}{QT_QML_ROOT_PATH}
-\li \l{cmake-target-property-qt_no_entrypoint}{qt_no_entrypoint}
-\endlist
-
-Upon return, the \c{QT_ANDROID_DEPLOYMENT_SETTINGS_FILE} target property will
-contain the location of the generated deployment settings file.
-
-\sa {qt6_android_add_apk_target}{qt_android_add_apk_target()},
- {qt6_finalize_target}{qt_finalize_target()}
-
-\section1 Example
-
-\snippet cmake-macros/examples.cmake qt_android_deploy_basic
-*/
-
-/*!
-\page qt_android_add_apk_target.html
-\ingroup cmake-macros-qtcore
-
-\title qt_android_add_apk_target
-\target qt6_android_add_apk_target
-
-\brief Defines a build target that runs androiddeployqt to produce an APK.
-
-\preliminarycmakecommand
-\cmakecommandandroidonly
-
-\section1 Synopsis
-
-\badcode
-qt_android_add_apk_target(target)
-
-qt6_android_add_apk_target(target)
-\endcode
-
-\section1 Description
-
-The \c{<target>_make_apk} custom target created by this command takes an Android
-deployment settings file and generates an APK by running \c{androiddeployqt}.
-The location of the settings file is taken from the \c{target}'s
-\c{QT_ANDROID_DEPLOYMENT_SETTINGS_FILE} property. This file is typically created by
-\l{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}.
-The \c{.apk} file will be generated in an \c{android-build} subdirectory below
-the CMake build directory of the \c{target}.
-
-The \c{<target>_make_apk} target will be automatically added as a dependency of
-the \c{apk} build target, which will be created if it doesn't already exist.
-This can be disabled by setting the \c{QT_NO_GLOBAL_APK_TARGET} variable to true.
-
-\sa {qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()},
- {qt6_finalize_target}{qt_finalize_target()}
-
-\section1 Example
-
-\snippet cmake-macros/examples.cmake qt_android_deploy_basic
-
-The above commands define the build targets \c{myapp_make_apk} and \c{apk},
-which can be used to generate just the \c{myapp} APK or all APKs in the project
-respectively.
-*/
diff --git a/src/corelib/doc/src/cmake/cmake-commands.qdoc b/src/corelib/doc/src/cmake/cmake-commands.qdoc
new file mode 100644
index 0000000000..63edcbe10d
--- /dev/null
+++ b/src/corelib/doc/src/cmake/cmake-commands.qdoc
@@ -0,0 +1,40 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\group cmake-commands-qtcore
+\title CMake Commands in Qt6 Core
+
+The following CMake commands are defined when Qt6::Core is loaded, for instance
+with
+
+\code
+find_package(Qt6 COMPONENTS Core REQUIRED)
+\endcode
+
+\sa{CMake Command Reference}
+*/
diff --git a/src/corelib/doc/src/cmake-properties.qdoc b/src/corelib/doc/src/cmake/cmake-properties.qdoc
index 9627187bec..d379eed9c1 100644
--- a/src/corelib/doc/src/cmake-properties.qdoc
+++ b/src/corelib/doc/src/cmake/cmake-properties.qdoc
@@ -26,6 +26,16 @@
****************************************************************************/
/*!
+\group cmake-target-properties-qtcore
+\title CMake Target Properties in Qt6 Core
+
+\l{CMake Commands in Qt6 Core}{CMake Commands} know about the following CMake
+target properties:
+
+\sa{CMake Property Reference}
+*/
+
+/*!
\page cmake-target-property-QT_ANDROID_DEPLOYMENT_DEPENDENCIES.html
\ingroup cmake-properties-qtcore
\ingroup cmake-target-properties-qtcore
@@ -63,7 +73,7 @@ is listed before its dependencies, it will fail to load on some devices.
\title QT_ANDROID_EXTRA_LIBS
\target cmake-target-property-QT_ANDROID_EXTRA_LIBS
-\brief Extra libraries to deploy with the target.
+\summary {Extra libraries to deploy with the target.}
\preliminarycmakeproperty
\cmakepropertyandroidonly
@@ -84,7 +94,7 @@ to enable OpenSSL in your application. For more information, see
\title QT_ANDROID_EXTRA_PLUGINS
\target cmake-target-property-QT_ANDROID_EXTRA_PLUGINS
-\brief Extra Qt plugins to deploy with the target.
+\summary {Extra Qt plugins to deploy with the target.}
\preliminarycmakeproperty
\cmakepropertyandroidonly
@@ -102,11 +112,6 @@ convention similar to Qt plugins, that is, \e {plugins/<plugin name>}.
The plugins libraries should have the name format
\e {libplugins_<type>_<name>_<abi>.so}. This will ensure that the correct name
mangling is applied to the plugin library.
-\omit
-TODO: Not yet documented, API still under review - see QTBUG-88763
-See the \l{qt6_add_plugin}{qt_add_plugin()} command for the easiest way to achieve
-that.
-\endomit
\sa{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}
*/
@@ -119,7 +124,7 @@ that.
\title QT_ANDROID_MIN_SDK_VERSION
\target cmake-target-property-QT_ANDROID_MIN_SDK_VERSION
-\brief Minimum Android SDK version.
+\summary {Minimum Android SDK version.}
\preliminarycmakeproperty
\cmakepropertyandroidonly
@@ -137,7 +142,7 @@ Specifies the minimum Android API level for the target.
\title QT_ANDROID_PACKAGE_SOURCE_DIR
\target cmake-target-property-QT_ANDROID_PACKAGE_SOURCE_DIR
-\brief Path to a custom Android package template.
+\summary {Path to a custom Android package template.}
\preliminarycmakeproperty
\cmakepropertyandroidonly
@@ -169,7 +174,7 @@ then place this directly into the directory specified by this variable.
\title QT_ANDROID_TARGET_SDK_VERSION
\target cmake-target-property-QT_ANDROID_TARGET_SDK_VERSION
-\brief Android target SDK version.
+\summary {Android target SDK version.}
\preliminarycmakeproperty
\cmakepropertyandroidonly
@@ -187,7 +192,7 @@ Specifies the target Android API level for the target.
\title QT_ANDROID_VERSION_CODE
\target cmake-target-property-QT_ANDROID_VERSION_CODE
-\brief Internal Android app version.
+\summary {Internal Android app version.}
\preliminarycmakeproperty
\cmakepropertyandroidonly
@@ -208,7 +213,7 @@ For more information, see \l{Android: App Versioning}{Android App Versioning}.
\title QT_ANDROID_VERSION_NAME
\target cmake-target-property-QT_ANDROID_VERSION_NAME
-\brief Human-readable Android app version.
+\summary {Human-readable Android app version.}
\preliminarycmakeproperty
\cmakepropertyandroidonly
@@ -229,7 +234,7 @@ For more information, see \l{Android: App Versioning}{Android App Versioning}.
\title QT_QML_ROOT_PATH
\target cmake-target-property-QT_QML_ROOT_PATH
-\brief Overrides the location of the application's qml directory.
+\summary {Overrides the location of the application's qml directory.}
\preliminarycmakeproperty
@@ -249,7 +254,7 @@ will be used instead.
\title QT_QML_IMPORT_PATH
\target cmake-target-property-QT_QML_IMPORT_PATH
-\brief Specifies a list of directories to search for QML imports.
+\summary {Specifies a list of directories to search for QML imports.}
\preliminarycmakeproperty
@@ -270,7 +275,7 @@ For application-specific QML imports, use
\title QT_ANDROID_DEPLOYMENT_SETTINGS_FILE
\target cmake-target-property-QT_ANDROID_DEPLOYMENT_SETTINGS_FILE
-\brief Specifies the location of a target's generated deployment settings file.
+\summary {Specifies the location of a target's generated deployment settings file.}
\preliminarycmakeproperty
\cmakepropertyandroidonly
@@ -289,7 +294,7 @@ and overwritten by that command.
\title qt_no_entrypoint
\target cmake-target-property-qt_no_entrypoint
-\brief Specifies to inhibit linking against Qt's entrypoint lib.
+\summary {Specifies to inhibit linking against Qt's entrypoint lib.}
\preliminarycmakeproperty
@@ -307,7 +312,7 @@ On targets that must provide their own entry point, set the property \c qt_no_en
\title QT_RESOURCE_PREFIX
\target cmake-target-property-QT_RESOURCE_PREFIX
-\brief Specifies the default Qt resource prefix.
+\summary {Specifies the default Qt resource prefix.}
\preliminarycmakeproperty
diff --git a/src/corelib/doc/src/cmake-variables.qdoc b/src/corelib/doc/src/cmake/cmake-variables.qdoc
index d3f73ab918..af7a8b7aca 100644
--- a/src/corelib/doc/src/cmake-variables.qdoc
+++ b/src/corelib/doc/src/cmake/cmake-variables.qdoc
@@ -26,6 +26,20 @@
****************************************************************************/
/*!
+\group cmake-variables-qtcore
+\title CMake Variables in Qt6 Core
+
+The following CMake variables are defined when Qt6::Core is loaded, for instance
+with
+
+\badcode
+find_package(Qt6 COMPONENTS Core REQUIRED)
+\endcode
+
+\sa{CMake Variable Reference}
+*/
+
+*/*!
\page cmake-variable-ANDROID_NDK_HOST_SYSTEM_NAME.html
\ingroup cmake-variables
\ingroup cmake-variables-qtcore
@@ -33,7 +47,7 @@
\title ANDROID_NDK_HOST_SYSTEM_NAME
\target cmake-variable-ANDROID_NDK_HOST_SYSTEM_NAME
-\brief Android-specific architecture of the host system.
+\summary {Android-specific architecture of the host system.}
\preliminarycmakevariable
\cmakevariableandroidonly
@@ -52,7 +66,7 @@ part of the deployment settings for a target.
\title ANDROID_SDK_ROOT
\target cmake-variable-ANDROID_SDK_ROOT
-\brief Location of the Android SDK.
+\summary {Location of the Android SDK.}
\preliminarycmakevariable
\cmakevariableandroidonly
@@ -71,7 +85,7 @@ It is written out as part of the deployment settings for a target.
\title QT_ANDROID_APPLICATION_ARGUMENTS
\target cmake-variable-QT_ANDROID_APPLICATION_ARGUMENTS
-\brief List of arguments to pass to Android applications.
+\summary {List of arguments to pass to Android applications.}
\preliminarycmakevariable
\cmakevariableandroidonly
@@ -90,7 +104,7 @@ out as part of the deployment settings for a target.
\title QT_HOST_PATH
\target cmake-variable-QT_HOST_PATH
-\brief Location of the host Qt installation when cross-compiling.
+\summary {Location of the host Qt installation when cross-compiling.}
\preliminarycmakevariable
@@ -98,3 +112,36 @@ When cross-compiling, this must be set to the install location of Qt for the hos
platform. It is used to locate tools to be run on the host (\l{moc}, \l{rcc},
\l{androiddeployqt}, and so on).
*/
+
+/*!
+\page cmake-variable-QT_NO_SET_XCODE_DEVELOPMENT_TEAM_ID.html
+\ingroup cmake-variables
+\ingroup cmake-variables-qtcore
+
+\title QT_NO_SET_XCODE_DEVELOPMENT_TEAM_ID
+\target cmake-variable-QT_NO_SET_XCODE_DEVELOPMENT_TEAM_ID
+
+\summary {Disables providing a fallback team ID during target finalization on iOS.}
+
+When finalizing an executable target on iOS,
+\l{qt6_finalize_target}{qt_finalize_target()} will populate the target's
+\c XCODE_ATTRIBUTE_DEVELOPMENT_TEAM property if it hasn't been set.
+Set \c QT_NO_SET_XCODE_DEVELOPMENT_TEAM_ID to true if you want to prevent this.
+*/
+
+/*!
+\page cmake-variable-QT_NO_SET_XCODE_BUNDLE_IDENTIFIER.html
+\ingroup cmake-variables
+\ingroup cmake-variables-qtcore
+
+\title QT_NO_SET_XCODE_BUNDLE_IDENTIFIER
+\target cmake-variable-QT_NO_SET_XCODE_BUNDLE_IDENTIFIER
+
+\summary {Disables providing a fallback app bundle ID during target finalization on iOS.}
+
+When finalizing an executable target on iOS,
+\l{qt6_finalize_target}{qt_finalize_target()} will populate the target's
+\c XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER and
+\c MACOSX_BUNDLE_GUI_IDENTIFIER properties if they haven't been set.
+Set \c QT_NO_SET_XCODE_BUNDLE_IDENTIFIER to true if you want to prevent this.
+*/
diff --git a/src/corelib/doc/src/cmake/qt_add_big_resources.qdoc b/src/corelib/doc/src/cmake/qt_add_big_resources.qdoc
new file mode 100644
index 0000000000..be3617a034
--- /dev/null
+++ b/src/corelib/doc/src/cmake/qt_add_big_resources.qdoc
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qt_add_bigresources.html
+\ingroup cmake-commands-qtcore
+
+\title qt_add_big_resources
+\target qt6_add_big_resources
+
+\summary {Compiles big binary resources into object code.}
+
+\include cmake-find-package-core.qdocinc
+
+\section1 Synopsis
+
+\badcode
+qt_add_big_resources(<VAR> file1.qrc [file2.qrc ...]
+ [OPTIONS ...])
+\endcode
+
+\versionlessCMakeCommandsNote qt6_add_big_resources()
+
+\section1 Description
+
+Creates compiled object files from Qt resource files using the
+\l{Resource Compiler (rcc)}. Paths to the generated files are added to
+\c{<VAR>}.
+
+This is similar to \l qt_add_resources, but directly
+generates object files (\c .o, \c .obj) files instead of C++ source code.
+This allows to embed bigger resources, where compiling to C++ sources and then
+to binaries would be too time consuming or memory intensive.
+
+\section1 Arguments
+
+You can set additional \c{OPTIONS} that should be added to the \c{rcc} calls.
+You can find possible options in the \l{rcc}{rcc documentation}.
+
+\section1 Examples
+
+\snippet cmake-macros/examples.cmake qt_add_big_resources
+*/
diff --git a/src/corelib/doc/src/cmake/qt_add_binary_resources.qdoc b/src/corelib/doc/src/cmake/qt_add_binary_resources.qdoc
new file mode 100644
index 0000000000..b601093942
--- /dev/null
+++ b/src/corelib/doc/src/cmake/qt_add_binary_resources.qdoc
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qt_add_binary_resources.html
+\ingroup cmake-commands-qtcore
+
+\title qt_add_binary_resources
+\target qt6_add_binary_resources
+
+\summary {Creates an RCC file from a list of Qt resource files.}
+
+\include cmake-find-package-core.qdocinc
+
+\section1 Synopsis
+
+\badcode
+qt_add_binary_resources(target file1.qrc [file2.qrc ...]
+ [DESTINATION ...]
+ [OPTIONS ...])
+\endcode
+
+\versionlessCMakeCommandsNote qt6_add_binary_resources()
+
+\section1 Description
+
+Adds a custom \c target that compiles Qt resource files into a binary \c{.rcc}
+file.
+
+\section1 Arguments
+
+\c{DESTINATION} sets the path of the generated \c{.rcc} file. The default is
+\c{${CMAKE_CURRENT_BINARY_DIR}/${target}.rcc}.
+
+You can set additional \c{OPTIONS} that should be added to the \c{rcc} calls.
+You can find possible options in the \l{rcc}{rcc documentation}.
+
+\section1 Examples
+
+\snippet cmake-macros/examples.cmake qt_add_binary_resources
+*/
diff --git a/src/corelib/doc/src/cmake/qt_add_executable.qdoc b/src/corelib/doc/src/cmake/qt_add_executable.qdoc
new file mode 100644
index 0000000000..4302ea9ebe
--- /dev/null
+++ b/src/corelib/doc/src/cmake/qt_add_executable.qdoc
@@ -0,0 +1,121 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qt_add_executable.html
+\ingroup cmake-commands-qtcore
+
+\title qt_add_executable
+\target qt6_add_executable
+
+\summary {Creates and finalizes an application target of a platform-specific type.}
+
+\include cmake-find-package-core.qdocinc
+
+\section1 Synopsis
+
+\badcode
+qt_add_executable(target
+ [WIN32] [MACOSX_BUNDLE]
+ [MANUAL_FINALIZATION]
+ sources...)
+\endcode
+
+\versionlessCMakeCommandsNote qt6_add_executable()
+
+\section1 Description
+
+This command performs the following tasks:
+
+\list
+\li Create a CMake target of the appropriate type for the target platform.
+\li Link the target to the \c{Qt::Core} library.
+\li Handle finalization of the CMake target.
+\endlist
+
+\section2 Target Creation
+
+On all platforms except Android, an executable target will be created.
+All arguments will be passed through to the standard CMake \c{add_executable()}
+command, except \c{MANUAL_FINALIZATION} (if present). On Android, a \c{MODULE}
+library will be created and any \c{WIN32} or \c{MACOSX_BUNDLE} options will be
+ignored. Some target properties will also be set for Android:
+
+\list
+\li The \c{SUFFIX} target property will be set to give the library file name an
+ architecture-specific suffix.
+\li Various \c{<lang>_VISIBILITY_PRESET} target properties will be set to
+ \c{default} to ensure that the \c{main()} function is visible in the
+ resultant binary.
+\endlist
+
+\section2 Linking Qt::Core
+
+Since all Qt applications need to link to the \c{Qt::Core} library, this is done
+for you as a convenience.
+
+\section2 Finalization
+
+After a target is created, further processing or \e{finalization} steps are
+commonly needed. The steps to perform depend on the platform and on various
+properties of the target. The finalization processing is implemented by the
+\l{qt6_finalize_target}{qt_finalize_target()} command.
+
+Finalization can occur either as part of this call or be deferred to sometime
+after this command returns (but it should still be in the same directory scope).
+When using CMake 3.19 or later, finalization is automatically deferred to the
+end of the current directory scope. This gives the caller an opportunity to
+modify properties of the created target before it is finalized. When using
+CMake versions earlier than 3.19, automatic deferral isn't supported. In that
+case, finalization is performed immediately before this command returns.
+
+Regardless of the CMake version, the \c{MANUAL_FINALIZATION} keyword can be given to
+indicate that you will explicitly call \l{qt6_finalize_target}{qt_finalize_target()}
+yourself instead at some later time. In general, \c MANUAL_FINALIZATION should
+not be needed unless the project has to support CMake 3.18 or earlier.
+
+\sa {qt6_finalize_target}{qt_finalize_target()},
+ {qt6_set_finalizer_mode}{qt_set_finalizer_mode()},
+ {qt6_add_library}{qt_add_library()}
+
+\section1 Examples
+
+In the following simple case, finalization is handled automatically. If using a
+CMake version earlier than 3.19, finalization will be performed immediately as
+part of the call. When using CMake 3.19 or later, finalization will occur at the
+end of the current directory scope.
+
+\snippet cmake-macros/examples.cmake qt_add_executable_simple
+
+The following example shows a scenario where finalization must be deferred.
+The \c OUTPUT_NAME target property affects deployment settings on Android, but
+those settings are written out as part of finalizing the target. In order to
+support using CMake versions earlier than 3.19, we take over responsibility
+for finalizing the target by adding the \c{MANUAL_FINALIZATION} keyword.
+
+\snippet cmake-macros/examples.cmake qt_add_executable_deferred
+*/
diff --git a/src/corelib/doc/src/cmake/qt_add_library.qdoc b/src/corelib/doc/src/cmake/qt_add_library.qdoc
new file mode 100644
index 0000000000..4865a5df93
--- /dev/null
+++ b/src/corelib/doc/src/cmake/qt_add_library.qdoc
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qt_add_library.html
+\ingroup cmake-commands-qtcore
+
+\title qt_add_library
+\target qt6_add_library
+
+\summary {Creates and finalizes a library.}
+
+\include cmake-find-package-core.qdocinc
+
+\section1 Synopsis
+
+\badcode
+qt_add_library(target
+ [STATIC | SHARED | MODULE | INTERFACE | OBJECT]
+ [MANUAL_FINALIZATION]
+ sources...
+)
+\endcode
+
+\versionlessCMakeCommandsNote qt6_add_library()
+
+\section1 Description
+
+\c{qt_add_library()} is a wrapper around CMake's built-in
+\c{add_library()} command. It performs the following tasks:
+
+\list
+\li Create a CMake target of an appropriate library type.
+\li Handle finalization of the CMake target.
+\endlist
+
+\section2 Target Creation
+
+The type of library created can be specified explicitly with one of the
+\c STATIC, \c SHARED, \c MODULE, \c INTERFACE or \c OBJECT keywords, just as
+one might for \c{add_library()}. If none of these keywords are given, the
+library type created depends on how Qt was built. If Qt was built statically,
+a static library will be created. Otherwise, a shared library will
+be created. Note that this is different to how CMake's \c{add_library()}
+command works, where the \c BUILD_SHARED_LIBS variable controls the type of
+library created. The \c{qt_add_library()} command does not consider
+\c BUILD_SHARED_LIBS when deciding the library type.
+
+Any \c{sources} provided will be passed through to the internal call to
+\c{add_library()}.
+
+\section2 Finalization
+
+After a target is created, further processing or \e{finalization} steps may be
+needed. The finalization processing is implemented by the
+\l{qt6_finalize_target}{qt_finalize_target()} command.
+
+Finalization can occur either as part of this call or be deferred to sometime
+after this command returns (but it should still be in the same directory scope).
+When using CMake 3.19 or later, finalization is automatically deferred to the
+end of the current directory scope. This gives the caller an opportunity to
+modify properties of the created target before it is finalized. When using
+CMake versions earlier than 3.19, automatic deferral isn't supported. In that
+case, finalization is performed immediately before this command returns.
+
+Regardless of the CMake version, the \c{MANUAL_FINALIZATION} keyword can be
+given to indicate that you will explicitly call
+\l{qt6_finalize_target}{qt_finalize_target()} yourself instead at some later
+time. In general, \c MANUAL_FINALIZATION should not be needed unless the
+project has to support CMake 3.18 or earlier.
+
+\sa {qt6_finalize_target}{qt_finalize_target()},
+ {qt6_add_executable}{qt_add_executable()}
+
+*/
diff --git a/src/corelib/doc/src/cmake/qt_add_plugin.qdoc b/src/corelib/doc/src/cmake/qt_add_plugin.qdoc
new file mode 100644
index 0000000000..f20b4c5afc
--- /dev/null
+++ b/src/corelib/doc/src/cmake/qt_add_plugin.qdoc
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qt_add_plugin.html
+\ingroup cmake-commands-qtcore
+
+\title qt_add_plugin
+\target qt6_add_plugin
+
+\summary {Creates a Qt plugin target.}
+
+\include cmake-find-package-core.qdocinc
+
+\section1 Synopsis
+
+\badcode
+qt_add_plugin(target
+ [SHARED | STATIC]
+ [CLASS_NAME class_name]
+ [OUTPUT_TARGETS variable_name]
+)
+\endcode
+
+\versionlessCMakeCommandsNote qt6_add_plugin()
+
+\section1 Description
+
+Qt plugin targets have additional requirements over and above an ordinary CMake
+library target. The \c{qt_add_plugin()} command adds the necessary handling to
+ensure these requirements are met. It should be called rather than the built-in
+CMake \c{add_library()} command when defining a Qt plugin target.
+
+By default, the plugin will be created as a \c STATIC library if Qt was built
+statically, or as a \c MODULE library otherwise. You can override this default
+by explicitly providing the \c STATIC or \c SHARED option.
+
+\note Non-static plugins are meant to be loaded dynamically at runtime, not
+linked to at build time. CMake differentiates between these two scenarios by
+providing the \c MODULE library type for dynamically loaded libraries, and
+the \c SHARED library type for libraries that may be linked to directly. This
+distinction is important for some toolchains (notably Visual Studio), due to
+the way symbol exports are handled. It may not be possible to link to
+\c MODULE libraries, and generating a \c SHARED library with no exported
+symbols can result in build-time errors. If the \c SHARED option is passed to
+\c{qt_add_plugin()}, it will therefore create a \c MODULE library rather than a
+\c SHARED library.
+
+Every Qt plugin has a class name. By default, this will be the same as the
+\c target, but it can be overridden with the \c CLASS_NAME option. The class
+name corresponds to the name of the C++ class that declares the metadata for
+the plugin. For static plugins, it is also the name passed to
+\l Q_IMPORT_PLUGIN, which imports the plugin into an application and ensures it
+is available at run time.
+
+If the plugin is built statically, \c{qt_add_plugin()} may define additional
+internal targets. These facilitate automatic importing of the plugin for any
+executable or shared library that links to the plugin. If the project installs
+the plugin and intends to make it available for other projects to link to, the
+project should also install these internal targets. The names of these targets
+can be obtained by providing the \c OUTPUT_TARGETS option, followed by the name
+of a variable in which to return the target list.
+
+*/
diff --git a/src/corelib/doc/src/cmake/qt_add_resources.qdoc b/src/corelib/doc/src/cmake/qt_add_resources.qdoc
new file mode 100644
index 0000000000..c3709a9bf3
--- /dev/null
+++ b/src/corelib/doc/src/cmake/qt_add_resources.qdoc
@@ -0,0 +1,115 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qt_add_resources.html
+\ingroup cmake-commands-qtcore
+
+\title qt_add_resources
+\target qt6_add_resources
+
+\summary {Compiles binary resources into source code.}
+
+\include cmake-find-package-core.qdocinc
+
+\section1 Synopsis
+
+\badcode
+qt_add_resources(<VAR> file1.qrc [file2.qrc ...]
+ [OPTIONS ...])
+\endcode
+
+\versionlessCMakeCommandsNote qt6_add_resources()
+
+Since 6.0:
+
+\badcode
+qt_add_resources(<TARGET> <RESOURCE_NAME>
+ [PREFIX <PATH>]
+ [LANG <LANGUAGE>]
+ [BASE <PATH>]
+ [FILES ...] [OPTIONS ...])
+\endcode
+
+\versionlessCMakeCommandsNote qt6_add_resources()
+
+\section1 Description
+
+To add resources, you can pass either a variable name or a target as the first
+argument of the command.
+
+When passing a variable name as first argument, \c qt_add_resources creates
+source code from Qt resource files using the \l{Resource Compiler (rcc)}. Paths
+to the generated source files are added to \c{<VAR>}.
+
+When passing a target as first argument, the function creates a resource with
+the name \c{RESOURCE_NAME}, containing the specified \c{FILES}. The resource is
+automatically linked into \c{TARGET}.
+
+For embedding bigger resources, see \l qt_add_big_resources.
+
+See \l{The Qt Resource System} for a general description of Qt resources.
+
+\section1 Arguments of the target-based variant
+
+\c PREFIX specifies a path prefix under which all files of this resource are
+accessible from C++ code. This corresponds to the XML attribute \c prefix of the
+\c .qrc file format. If \c PREFIX is not given, the target property
+\l{cmake-target-property-QT_RESOURCE_PREFIX}{QT_RESOURCE_PREFIX} is used.
+
+\c LANG specifies the locale of this resource. This corresponds to the XML
+attribute \c lang of the \c .qrc file format.
+
+\c BASE is a path prefix that denotes the root point of the file's alias. For
+example, if \c BASE is \c{"assets"} and \c FILES is
+\c{"assets/images/logo.png"}, then the alias of that file is
+\c{"images/logo.png"}.
+
+Alias settings for files need to be set via the \c QT_RESOURCE_ALIAS source file
+property.
+
+\section1 Arguments of both variants
+
+You can set additional \c{OPTIONS} that should be added to the \c{rcc} calls.
+You can find possible options in the \l{rcc}{rcc documentation}.
+
+\section1 Examples
+
+Variable variant, using a .qrc file:
+\snippet cmake-macros/examples.cmake qt_add_resources
+
+Target variant, using immediate resources:
+\snippet cmake-macros/examples.cmake qt_add_resources_target
+
+\section1 Caveats
+
+When adding multiple resources, \c{RESOURCE_NAME} must be unique across all
+resources linked into the final target.
+
+This especially affects static builds. There, the same resource name in
+different static libraries conflict in the consuming target.
+*/
diff --git a/src/corelib/doc/src/cmake/qt_allow_non_utf8_sources.qdoc b/src/corelib/doc/src/cmake/qt_allow_non_utf8_sources.qdoc
new file mode 100644
index 0000000000..1f65d298f7
--- /dev/null
+++ b/src/corelib/doc/src/cmake/qt_allow_non_utf8_sources.qdoc
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qt_allow_non_utf8_sources.html
+\ingroup cmake-commands-qtcore
+
+\title qt_allow_non_utf8_sources
+\target qt6_allow_non_utf8_sources
+
+\summary {Prevents forcing source files to be treated as UTF-8 for Windows.}
+
+\include cmake-find-package-core.qdocinc
+
+\section1 Synopsis
+
+\badcode
+qt_allow_non_utf8_sources(target)
+\endcode
+
+\versionlessCMakeCommandsNote qt6_allow_non_utf8_sources()
+
+\section1 Description
+
+When building with some compilers for Windows, targets that link to a Qt library
+will use flags that force the compiler to treat its source files as UTF-8. This
+is currently implemented for Visual Studio and Intel compilers. You can disable
+this behavior on a per-target basis by calling \c{qt_allow_non_utf8_sources()}
+and passing the target as the argument.
+
+\sa {qt6_disable_unicode_defines}{qt_disable_unicode_defines()}
+*/
diff --git a/src/corelib/doc/src/cmake/qt_android_add_apk_target.qdoc b/src/corelib/doc/src/cmake/qt_android_add_apk_target.qdoc
new file mode 100644
index 0000000000..f07fb1bd8f
--- /dev/null
+++ b/src/corelib/doc/src/cmake/qt_android_add_apk_target.qdoc
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qt_android_add_apk_target.html
+\ingroup cmake-commands-qtcore
+
+\title qt_android_add_apk_target
+\target qt6_android_add_apk_target
+
+\summary {Defines a build target that runs androiddeployqt to produce an APK.}
+
+\include cmake-find-package-core.qdocinc
+
+\preliminarycmakecommand
+\cmakecommandandroidonly
+
+\section1 Synopsis
+
+\badcode
+qt_android_add_apk_target(target)
+\endcode
+
+\versionlessCMakeCommandsNote qt6_android_add_apk_target()
+
+\section1 Description
+
+The \c{<target>_make_apk} custom target created by this command takes an Android
+deployment settings file and generates an APK by running \c{androiddeployqt}.
+The location of the settings file is taken from the \c{target}'s
+\c{QT_ANDROID_DEPLOYMENT_SETTINGS_FILE} property. This file is typically created by
+\l{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}.
+The \c{.apk} file will be generated in an \c{android-build} subdirectory below
+the CMake build directory of the \c{target}.
+
+The \c{<target>_make_apk} target will be automatically added as a dependency of
+the \c{apk} build target, which will be created if it doesn't already exist.
+This can be disabled by setting the \c{QT_NO_GLOBAL_APK_TARGET} variable to true.
+
+\sa {qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()},
+ {qt6_finalize_target}{qt_finalize_target()}
+
+\section1 Example
+
+\snippet cmake-macros/examples.cmake qt_android_deploy_basic
+
+The above commands define the build targets \c{myapp_make_apk} and \c{apk},
+which can be used to generate just the \c{myapp} APK or all APKs in the project
+respectively.
+*/
diff --git a/src/corelib/doc/src/cmake/qt_android_apply_arch_suffix.qdoc b/src/corelib/doc/src/cmake/qt_android_apply_arch_suffix.qdoc
new file mode 100644
index 0000000000..570de072c4
--- /dev/null
+++ b/src/corelib/doc/src/cmake/qt_android_apply_arch_suffix.qdoc
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qt_android_apply_arch_suffix.html
+\ingroup cmake-commands-qtcore
+
+\title qt_android_apply_arch_suffix
+\target qt6_android_apply_arch_suffix
+
+\summary {Configures the target binary's name to include an architecture-specific suffix.}
+
+\include cmake-find-package-core.qdocinc
+
+\preliminarycmakecommand
+\cmakecommandandroidonly
+
+\section1 Synopsis
+
+\badcode
+qt_android_apply_arch_suffix(target)
+\endcode
+
+\versionlessCMakeCommandsNote qt6_android_apply_arch_suffix()
+
+\section1 Description
+
+The CMake \c{SUFFIX} target property controls the suffix used on the file name
+of the target's built binary. This command is a convenience for setting that
+property to an architecture-specific value. This is useful when installing
+multiple builds for different Android architectures into the same install
+location, as it prevents the libraries for different architectures from
+overwriting each other.
+*/
diff --git a/src/corelib/doc/src/cmake/qt_android_generate_deployment_settings.qdoc b/src/corelib/doc/src/cmake/qt_android_generate_deployment_settings.qdoc
new file mode 100644
index 0000000000..aa48820386
--- /dev/null
+++ b/src/corelib/doc/src/cmake/qt_android_generate_deployment_settings.qdoc
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qt_android_generate_deployment_settings.html
+\ingroup cmake-commands-qtcore
+
+\title qt_android_generate_deployment_settings
+\target qt6_android_generate_deployment_settings
+
+\summary {Generates the deployment settings file needed by androiddeployqt.}
+
+\include cmake-find-package-core.qdocinc
+
+\preliminarycmakecommand
+\cmakecommandandroidonly
+
+\section1 Synopsis
+
+\badcode
+qt_android_generate_deployment_settings(target)
+\endcode
+
+\versionlessCMakeCommandsNote qt6_android_generate_deployment_settings()
+
+\section1 Description
+
+The \c{androiddeployqt} tool expects a deployment settings file as input. This
+command reads CMake variables and properties of the \c{target} to generate such
+a file in the target's binary directory. Upon return, the full path to this file
+is available in the target's \c{QT_ANDROID_DEPLOYMENT_SETTINGS_FILE} property.
+
+\section2 CMake Variables
+
+A number of variables are used while generating the deployment settings file.
+Some are provided by Qt, others by CMake or the Android NDK.
+
+\list
+\li \l{cmake-variable-ANDROID_NDK_HOST_SYSTEM_NAME}{ANDROID_NDK_HOST_SYSTEM_NAME}
+\li \l{cmake-variable-ANDROID_SDK_ROOT}{ANDROID_SDK_ROOT}
+\li \c{CMAKE_ANDROID_ARCH_ABI}
+\li \c{CMAKE_ANDROID_NDK}
+\li \c{CMAKE_SYSROOT}
+\li \l{cmake-variable-QT_ANDROID_APPLICATION_ARGUMENTS}{QT_ANDROID_APPLICATION_ARGUMENTS}
+\li \l{cmake-variable-QT_HOST_PATH}{QT_HOST_PATH}
+\endlist
+
+\section2 Target Properties
+
+The properties below will be read from the specified \c{target}. Note that this
+command is called as part of target finalization (see
+\l{qt6_finalize_target}{qt_finalize_target()}). If you are using
+\l{qt6_add_executable}{qt_add_executable()} to create the target and you need to
+modify some of these target properties, you need to ensure that target
+finalization is deferred. See \l{qt6_add_executable}{qt_add_executable()} for
+how to accomplish this.
+
+\list
+\li \l{cmake-target-property-QT_ANDROID_DEPLOYMENT_DEPENDENCIES}{QT_ANDROID_DEPLOYMENT_DEPENDENCIES}
+\li \l{cmake-target-property-QT_ANDROID_EXTRA_LIBS}{QT_ANDROID_EXTRA_LIBS}
+\li \l{cmake-target-property-QT_ANDROID_EXTRA_PLUGINS}{QT_ANDROID_EXTRA_PLUGINS}
+\li \l{cmake-target-property-QT_ANDROID_MIN_SDK_VERSION}{QT_ANDROID_MIN_SDK_VERSION}
+\li \l{cmake-target-property-QT_ANDROID_PACKAGE_SOURCE_DIR}{QT_ANDROID_PACKAGE_SOURCE_DIR}
+\li \l{cmake-target-property-QT_ANDROID_TARGET_SDK_VERSION}{QT_ANDROID_TARGET_SDK_VERSION}
+\li \l{cmake-target-property-QT_ANDROID_VERSION_NAME}{QT_ANDROID_VERSION_NAME}
+\li \l{cmake-target-property-QT_ANDROID_VERSION_CODE}{QT_ANDROID_VERSION_CODE}
+\li \l{cmake-target-property-QT_QML_IMPORT_PATH}{QT_QML_IMPORT_PATH}
+\li \l{cmake-target-property-QT_QML_ROOT_PATH}{QT_QML_ROOT_PATH}
+\li \l{cmake-target-property-qt_no_entrypoint}{qt_no_entrypoint}
+\endlist
+
+Upon return, the \c{QT_ANDROID_DEPLOYMENT_SETTINGS_FILE} target property will
+contain the location of the generated deployment settings file.
+
+\sa {qt6_android_add_apk_target}{qt_android_add_apk_target()},
+ {qt6_finalize_target}{qt_finalize_target()}
+
+\section1 Example
+
+\snippet cmake-macros/examples.cmake qt_android_deploy_basic
+*/
diff --git a/src/corelib/doc/src/cmake/qt_disable_unicode_defines.qdoc b/src/corelib/doc/src/cmake/qt_disable_unicode_defines.qdoc
new file mode 100644
index 0000000000..956a272d6f
--- /dev/null
+++ b/src/corelib/doc/src/cmake/qt_disable_unicode_defines.qdoc
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qt_disable_unicode_defines.html
+\ingroup cmake-commands-qtcore
+
+\title qt_disable_unicode_defines
+\target qt6_disable_unicode_defines
+
+\summary {Prevents some unicode-related compiler definitions being set automatically on a target.}
+
+\include cmake-find-package-core.qdocinc
+
+\section1 Synopsis
+
+\badcode
+qt_disable_unicode_defines(target)
+\endcode
+
+\versionlessCMakeCommandsNote qt6_disable_unicode_defines()
+
+\section1 Description
+
+In Qt 6, the \c UNICODE and \c{_UNICODE} compiler definitions are set by
+default for targets that link against Qt modules. This is in line with the
+qmake behavior, but it is a change compared to the CMake API behavior in Qt 5.
+Calling \c{qt_disable_unicode_defines()} on a \c target prevents these compiler
+definitions from being automatically set.
+
+\sa {qt6_allow_non_utf8_sources}{qt_allow_non_utf8_sources()}
+*/
diff --git a/src/corelib/doc/src/cmake/qt_extract_metatypes.qdoc b/src/corelib/doc/src/cmake/qt_extract_metatypes.qdoc
new file mode 100644
index 0000000000..ccc81bdd2b
--- /dev/null
+++ b/src/corelib/doc/src/cmake/qt_extract_metatypes.qdoc
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qt_extract_metatypes.html
+\ingroup cmake-macros-qtcore
+
+\title qt_extract_metatypes
+\target qt6_extract_metatypes
+
+\summary {Extracts metatypes from a Qt target and generates an associated metatypes.json file.}
+
+\preliminarycmakecommand
+
+\section1 Synopsis
+
+\badcode
+qt_extract_metatypes(target
+ [MANUAL_MOC_JSON_FILES json_files...]
+ [OUTPUT_FILES variable_name]
+)
+\endcode
+
+\versionlessCMakeCommandsNote qt6_extract_metatypes()
+
+\section1 Description
+
+Certain operations rely on metatype information being generated and collected
+on targets. This is typically handled internally by Qt commands, but for
+scenarios where this is not the case, \c{qt_extract_metatypes()} can be called
+to force the collection of this information for a specific \c target.
+
+Metatype information is generated for a target's source files in one of the
+following ways:
+
+\list
+\li Automatically by AUTOMOC. The \c{qt_extract_metatypes()} command detects
+ when AUTOMOC is enabled on the \c target and will automatically extract the
+ information it needs.
+\li Manually by invoking \c moc with the \c{--output-json} option. The project
+ is responsible for keeping track of all the JSON files generated using this
+ method and passing them to \c{qt_extract_metatypes()} with the
+ \c MANUAL_MOC_JSON_FILES option.
+\endlist
+
+\c{qt_extract_metatypes()} produces a target-specific metatypes JSON file which
+collects all the metatype details from the AUTOMOC and manual moc inputs.
+It does this by calling \c moc with the \c{--collect-json} option.
+If you need to know where to find the resultant metatypes JSON file (for
+example, to pass it to another command or to install it), use the
+\c OUTPUT_FILES option to provide the name of a variable in which to store its
+absolute path.
+
+*/
diff --git a/src/corelib/doc/src/cmake/qt_finalize_target.qdoc b/src/corelib/doc/src/cmake/qt_finalize_target.qdoc
new file mode 100644
index 0000000000..eb3e7a479b
--- /dev/null
+++ b/src/corelib/doc/src/cmake/qt_finalize_target.qdoc
@@ -0,0 +1,111 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qt_finalize_target.html
+\ingroup cmake-commands-qtcore
+
+\title qt_finalize_target
+\target qt6_finalize_target
+
+\summary {Handles various common platform-specific tasks associated with Qt targets.}
+
+\include cmake-find-package-core.qdocinc
+
+\section1 Synopsis
+
+\badcode
+qt_finalize_target(target)
+\endcode
+
+\versionlessCMakeCommandsNote qt6_finalize_target()
+
+\section1 Description
+
+After a target is created, further processing or \e{finalization} steps are
+sometimes needed. The steps to perform depend on the platform, the type of
+target, and on various properties of the target. These steps are expected to be
+performed within the same directory scope as the one in which the \c{target}
+was created, so this command should also be called from that same directory
+scope.
+
+This command is ordinarily invoked as part of a call to
+\l{qt6_add_executable}{qt_add_executable()} or
+\l{qt6_add_library}{qt_add_library()}. The timing of when that call takes
+place and when it might need to be called explicitly by a project is discussed
+in the documentation of those commands.
+
+\sa {qt6_set_finalizer_mode}{qt_set_finalizer_mode()}
+
+\section1 Executable Targets
+
+For executable targets, \c{qt_finalize_target()} implements the logic described
+in the subsections below, as appropriate for the platform and target provided.
+Later Qt releases may expand finalization processing further.
+
+\section2 All Platforms
+
+Some internal processing is performed to facilitate automatic linking of Qt
+plugins. This is especially important if using a statically built Qt or a
+CMake version earlier than 3.21.
+
+\section2 Android
+
+\list
+\li Generate a deployment settings file for the \c target.
+\li Create a build target for generating an APK.
+\endlist
+
+\section2 WASM
+
+Create \c{${target}.html} (a target-specific \c{wasm_shell.html} file),
+\c{qtloader.js} and \c{qtlogo.svg} files in the \c{CMAKE_CURRENT_BINARY_DIR}.
+
+\section2 iOS
+
+Finalization attempts to provide sensible values for the following target
+properties if they are not already set, and their corresponding \c{CMAKE_...}
+variable is also not set:
+
+\list
+\li \c XCODE_ATTRIBUTE_DEVELOPMENT_TEAM
+\li \c XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER
+\li \c MACOSX_BUNDLE_GUI_IDENTIFIER
+\endlist
+
+If required, the \l QT_NO_SET_XCODE_DEVELOPMENT_TEAM_ID variable can be used to
+disable setting \c XCODE_ATTRIBUTE_DEVELOPMENT_TEAM, and the
+\l QT_NO_SET_XCODE_BUNDLE_IDENTIFIER variable can be used to disable setting
+\c XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER and \c MACOSX_BUNDLE_GUI_IDENTIFIER.
+
+\section1 Library Targets
+
+As of this Qt version, finalization for library targets does not perform any
+processing. Future Qt versions may add finalization processing for libraries,
+so you should ensure finalization is still invoked in the expected way.
+
+*/
diff --git a/src/corelib/doc/src/cmake/qt_generate_moc.qdoc b/src/corelib/doc/src/cmake/qt_generate_moc.qdoc
new file mode 100644
index 0000000000..c51001e3eb
--- /dev/null
+++ b/src/corelib/doc/src/cmake/qt_generate_moc.qdoc
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qt_generate_moc.html
+\ingroup cmake-commands-qtcore
+
+\title qt_generate_moc
+\target qt6_generate_moc
+
+\summary {Calls moc on an input file.}
+
+\include cmake-find-package-core.qdocinc
+
+\section1 Synopsis
+
+\badcode
+qt_generate_moc(src_file dest_file
+ [TARGET target])
+\endcode
+
+\versionlessCMakeCommandsNote qt6_generate_moc()
+
+\section1 Description
+
+Creates a rule to call the \l{moc}{Meta-Object Compiler (moc)} on \c src_file
+and store the output in \c dest_file.
+
+\note This is a low-level macro. See the \l{CMake AUTOMOC Documentation} for a
+more convenient way to let source files be processed with \c{moc}.
+\l qt_wrap_cpp is also similar, but automatically generates a temporary file
+path for you.
+
+\section1 Arguments
+
+You can set an explicit \c{TARGET}. This will make sure that the target
+properties \c{INCLUDE_DIRECTORIES} and \c{COMPILE_DEFINITIONS} are also used
+when scanning the source files with \c{moc}.
+
+\section1 Examples
+
+\snippet cmake-macros/examples.cmake qt_generate_moc
+*/
diff --git a/src/corelib/doc/src/cmake/qt_import_plugins.qdoc b/src/corelib/doc/src/cmake/qt_import_plugins.qdoc
new file mode 100644
index 0000000000..98e81bfeff
--- /dev/null
+++ b/src/corelib/doc/src/cmake/qt_import_plugins.qdoc
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qt_import_plugins.html
+\ingroup cmake-commands-qtcore
+
+\title qt_import_plugins
+\target qt6_import_plugins
+
+\summary {Specifies a custom set of plugins to import for a static Qt build.}
+
+\include cmake-find-package-core.qdocinc
+
+\section1 Synopsis
+
+\badcode
+qt_import_plugins(target
+ [INCLUDE plugin ...]
+ [EXCLUDE plugin ...]
+ [INCLUDE_BY_TYPE plugin_type plugin ...]
+ [EXCLUDE_BY_TYPE plugin_type]
+ [NO_DEFAULT]
+)
+\endcode
+
+\versionlessCMakeCommandsNote qt6_import_plugins()
+
+\section1 Description
+
+Specifies a custom set of plugins to import. The optional arguments:
+\c INCLUDE, \c EXCLUDE, \c INCLUDE_BY_TYPE, and \c EXCLUDE_BY_TYPE,
+can be used more than once.
+
+\list
+\li \c INCLUDE -- can be used to specify a list of plugins to import.
+\li \c EXCLUDE -- can be used to specify a list of plugins to exclude.
+\li \c INCLUDE_BY_TYPE -- can be used to override the list of plugins to
+ import for a certain plugin type.
+\li \c EXCLUDE_BY_TYPE -- can be used to specify a plugin type to exclude;
+ then no plugins of that type are imported.
+\li \c NO_DEFAULT -- prevent the default plugins from being included
+ automatically (for example, the default platform plugin).
+\endlist
+
+Qt provides plugin types such as \c imageformats, \c platforms,
+and \c sqldrivers.
+
+If the command isn't used the target automatically links against
+a sane set of default plugins, for each Qt module that the target is linked
+against. For more information, see
+\l{CMake target_link_libraries Documentation}{target_link_libraries}.
+
+Each plugin comes with a C++ stub file that automatically
+initializes the plugin. Consequently, any target that links against a plugin
+has this C++ file added to its \c SOURCES.
+
+\note This command imports plugins from static Qt builds only.
+On shared builds, it does nothing.
+
+\section1 Examples
+
+\snippet cmake-macros/examples.cmake qt_import_plugins
+
+In the snippet above, the following occurs with the executable \c myapp:
+
+\list
+\li The \c Qt6::QCocoaIntegrationPlugin is imported into myapp.
+\li The \c Qt6::QMinimalIntegrationPlugin plugin is
+ excluded from being automatically imported into myapp.
+\li The default list of plugins for \c imageformats is
+ overridden to only include Qt6::QGifPlugin and Qt6::QJpegPlugin.
+\li All \c sqldrivers plugins are excluded from automatic importing.
+\endlist
+
+\sa{qt6_import_qml_plugins}{qt_import_qml_plugins()}
+*/
diff --git a/src/corelib/doc/src/cmake/qt_set_finalizer_mode.qdoc b/src/corelib/doc/src/cmake/qt_set_finalizer_mode.qdoc
new file mode 100644
index 0000000000..2210e86fa6
--- /dev/null
+++ b/src/corelib/doc/src/cmake/qt_set_finalizer_mode.qdoc
@@ -0,0 +1,113 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qt_set_finalizer_mode.html
+\ingroup cmake-macros-qtcore
+
+\title qt_set_finalizer_mode
+\target qt6_set_finalizer_mode
+
+\summary {Customizes aspects of a target's finalization.}
+
+\preliminarycmakecommand
+
+\section1 Synopsis
+
+\badcode
+qt_set_finalizer_mode(target
+ ENABLE | DISABLE
+ MODES modes...
+)
+\endcode
+
+\versionlessCMakeCommandsNote qt6_set_finalizer_mode()
+
+\section1 Description
+
+This command is used to customize some aspects of the finalization of a
+specific \c target. It only has an effect if called before \c target is
+finalized, which occurs in one of the following scenarios:
+
+\list
+\li The project explicitly calls \l{qt6_finalize_target}{qt_finalize_target()}
+ for the \c target. This usually means the \c MANUAL_FINALIZATION keyword was
+ passed to \l{qt6_add_executable}{qt_add_executable()} when the \c target
+ was defined.
+\li CMake 3.17 or earlier is being used, in which case finalization always
+ occurs immediately as part of the call to
+ \l{qt6_add_executable}{qt_add_executable()}.
+\li CMake 3.18 or later is being used, the \c MANUAL_FINALIZATION keyword was
+ not passed to \l{qt6_add_executable}{qt_add_executable()} when the \c target
+ was defined, and deferred finalization has been completed at the end of the
+ \c target's directory scope.
+\endlist
+
+\c{qt_set_finalizer_mode()} is used to enable or disable a list of \e modes,
+where a mode corresponds to a specific aspect of finalization. The currently
+supported finalization modes are:
+
+\table
+\header
+ \li Mode
+ \li Default
+ \li Finalization behavior
+\row
+ \li \c static_plugins
+ \li Enabled
+ \li When Qt is built statically, it creates initializer object libraries
+ for its static plugins. If \c target is an executable and this
+ finalization mode is enabled, any plugin initializer object libraries
+ needed by the \c target will be directly linked to it. This
+ prevents cycles between Qt-provided static libraries and may reduce
+ link time. When this finalizer mode is disabled, each plugin
+ initializer is instead propagated via usage requirements of its
+ associated Qt library, which may cause cycles. If Qt is not built
+ statically, this finalizer mode is not relevant and isn't used.
+\endtable
+
+\sa {qt6_finalize_target}{qt_finalize_target()}
+
+\section1 Example
+
+The following example assumes you are using CMake 3.19 or later (required for
+deferred finalization):
+
+\badcode
+qt_add_executable(my_app main.cpp)
+qt_set_finalizer_mode(my_app ENABLE MODES static_plugins)
+\endcode
+
+The same example using manual finalization might look like this:
+
+\badcode
+qt_add_executable(my_app MANUAL_FINALIZATION main.cpp)
+qt_set_finalizer_mode(my_app ENABLE MODES static_plugins)
+qt_finalize_target(my_app)
+\endcode
+
+*/
diff --git a/src/corelib/doc/src/cmake/qt_wrap_cpp.qdoc b/src/corelib/doc/src/cmake/qt_wrap_cpp.qdoc
new file mode 100644
index 0000000000..f1731ed825
--- /dev/null
+++ b/src/corelib/doc/src/cmake/qt_wrap_cpp.qdoc
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qt_wrap_cpp.html
+\ingroup cmake-commands-qtcore
+
+\title qt_wrap_cpp
+\target qt6_wrap_cpp
+
+\summary {Creates .moc files from sources.}
+
+\include cmake-find-package-core.qdocinc
+
+\section1 Synopsis
+
+\badcode
+qt_wrap_cpp(<VAR> src_file1 [src_file2 ...]
+ [TARGET target]
+ [OPTIONS ...]
+ [DEPENDS ...])
+\endcode
+
+\versionlessCMakeCommandsNote qt6_wrap_cpp()
+
+\section1 Description
+
+Creates rules for calling the \l{moc}{Meta-Object Compiler (moc)} on the given
+source files. For each input file, an output file is generated in the build
+directory. The paths of the generated files are added to \c{<VAR>}.
+
+\note This is a low-level macro. See the \l{CMake AUTOMOC Documentation} for a
+more convenient way to let source files be processed with \c{moc}.
+
+\section1 Arguments
+
+You can set an explicit \c{TARGET}. This will make sure that the target
+properties \c{INCLUDE_DIRECTORIES} and \c{COMPILE_DEFINITIONS} are also used
+when scanning the source files with \c{moc}.
+
+You can set additional \c{OPTIONS} that should be added to the \c{moc} calls.
+You can find possible options in the \l{moc}{moc documentation}.
+
+\c{DEPENDS} allows you to add additional dependencies for recreation of the
+generated files. This is useful when the sources have implicit dependencies,
+like code for a Qt plugin that includes a \c{.json} file using the
+Q_PLUGIN_METADATA() macro.
+
+\section1 Examples
+
+\snippet cmake-macros/examples.cmake qt_wrap_cpp
+*/
diff --git a/src/corelib/doc/src/containers.qdoc b/src/corelib/doc/src/containers.qdoc
index 5d4b9a2215..1050223791 100644
--- a/src/corelib/doc/src/containers.qdoc
+++ b/src/corelib/doc/src/containers.qdoc
@@ -539,7 +539,7 @@
If you do not use Q_DECLARE_TYPEINFO,
Qt will use
\l {https://en.cppreference.com/w/cpp/types/is_trivial} {std::is_trivial_v<T>}
- to indentify primitive
+ to identify primitive
types and it will require both
\l {https://en.cppreference.com/w/cpp/types/is_trivially_copyable} {std::is_trivially_copyable_v<T>}
and
diff --git a/src/corelib/doc/src/external-resources.qdoc b/src/corelib/doc/src/external-resources.qdoc
index 62e6b7ea1d..50a19a4e09 100644
--- a/src/corelib/doc/src/external-resources.qdoc
+++ b/src/corelib/doc/src/external-resources.qdoc
@@ -47,11 +47,6 @@
*/
/*!
- \externalpage http://www.ietf.org/rfc/rfc4648.txt
- \title RFC 4648
-*/
-
-/*!
\externalpage http://www.iana.org/assignments/character-sets/character-sets.xml
\title IANA character-sets encoding file
*/
diff --git a/src/corelib/doc/src/includes/cmake-find-package-core.qdocinc b/src/corelib/doc/src/includes/cmake-find-package-core.qdocinc
new file mode 100644
index 0000000000..4bf3892aa2
--- /dev/null
+++ b/src/corelib/doc/src/includes/cmake-find-package-core.qdocinc
@@ -0,0 +1,5 @@
+The command is defined in the \c Core component of the \c Qt6 package. Load the package with:
+
+\code
+find_package(Qt6 COMPONENTS Core REQUIRED)
+\endcode
diff --git a/src/corelib/doc/src/json.qdoc b/src/corelib/doc/src/json.qdoc
index e7d60841b0..9b1070ec67 100644
--- a/src/corelib/doc/src/json.qdoc
+++ b/src/corelib/doc/src/json.qdoc
@@ -43,7 +43,7 @@
modify and save JSON data.
More details about the JSON data format can be found at \l{http://json.org}{json.org}
- and in \l{http://tools.ietf.org/html/rfc4627}{RFC-4627}.
+ and in \l {RFC 4627}.
\tableofcontents
diff --git a/src/corelib/doc/src/objectmodel/bindableproperties.qdoc b/src/corelib/doc/src/objectmodel/bindableproperties.qdoc
index 5c9685656a..dc83c01e3d 100644
--- a/src/corelib/doc/src/objectmodel/bindableproperties.qdoc
+++ b/src/corelib/doc/src/objectmodel/bindableproperties.qdoc
@@ -191,7 +191,7 @@
}
\endcode
- All the common rules and recomendations regarding writing to bindable
+ All the common rules and recommendations regarding writing to bindable
properties also apply here. As soon as the base class implementation is
called, all the observers are notified about the change to the property.
This means that class invariants must be met before calling the base
diff --git a/src/corelib/doc/src/qt6-changes.qdoc b/src/corelib/doc/src/qt6-changes.qdoc
index b443346ccd..0b21ecca45 100644
--- a/src/corelib/doc/src/qt6-changes.qdoc
+++ b/src/corelib/doc/src/qt6-changes.qdoc
@@ -468,6 +468,10 @@
code that was using QFuture with QtConcurrent. Only the code that was using
it with the undocumented \c QFutureInterface may be affected.
+ \li QFutureWatcher::isFinished() now reflects the finished-state of the
+ QFuture rather than returning false until QFutureWatcher::finished() has
+ been emitted.
+
\endlist
\section2 The QPromise class
@@ -518,7 +522,7 @@
\li \c QVariant::isNull() now only returns \c true if the \c QVariant is empty or contains a
\c nullptr. In Qt 5, it also returned true for classes in qtbase which had an \c isNull method
themselves if that one returned true. Code relying on the old behavior needs to check whether
- the contained value returs isNull – however such code is unlikely to occur in practice, as
+ the contained value returns isNull – however such code is unlikely to occur in practice, as
\c isNull() is rarely the property one is interested in (compare \c QString::isEmpty() / \c isNull()
and \c QTime::isValid / \c isNull).
diff --git a/src/corelib/doc/src/qtcore-index.qdoc b/src/corelib/doc/src/qtcore-index.qdoc
index c74f173562..390c44ab63 100644
--- a/src/corelib/doc/src/qtcore-index.qdoc
+++ b/src/corelib/doc/src/qtcore-index.qdoc
@@ -136,6 +136,12 @@
\li \l{Input/Output and Networking}{Input/Output Classes}
\li \l{Event Classes}
\endlist
+ \li CMake API
+ \list
+ \li \l{CMake Commands in Qt6 Core}{CMake Commands}
+ \li \l{CMake Variables in Qt6 Core}{CMake Variables}
+ \li \l{CMake Target Properties in Qt6 Core}{CMake Target Properties}
+ \endlist
\endlist
*/
diff --git a/src/corelib/doc/src/resource-system.qdoc b/src/corelib/doc/src/resource-system.qdoc
index e8ca4f5828..6e22757857 100644
--- a/src/corelib/doc/src/resource-system.qdoc
+++ b/src/corelib/doc/src/resource-system.qdoc
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
@@ -28,154 +28,235 @@
/*!
\page resources.html
\title The Qt Resource System
- \brief A platform-independent mechanism for storing binary files in an application.
+ \brief A platform-independent mechanism for shipping resource files in an
+ application.
\keyword resource system
- The Qt resource system is a platform-independent mechanism for
- storing binary files in the application's executable. This is
- useful if your application always needs a certain set of files
- (icons, translation files, etc.) and you don't want to run the
- risk of losing the files.
+ The Qt resource system is a platform-independent mechanism for shipping
+ resource files in an application. Use it if your application always needs a
+ certain set of files (like icons, translation files, images), and you don't
+ want to use system-specific means to package and locate these resources.
- The resource system is based on tight cooperation between the build system,
- \l rcc (Qt's resource compiler), and QFile.
+ Most commonly, the resource files are embedded into your application
+ executable, or in libraries and plugins that are loaded by the application
+ executable. Alternatively, the resource files can also be stored in an
+ \l{External Resource Files}{exernal resource file}.
- \section1 Resource Collection Files (\c{.qrc})
+ The resource system is based on tight cooperation between Qt's \l rcc
+ resource compiler, the build system, and the Qt runtime API.
+
+ \note Currently, the Qt resource system does not make use of any
+ system-specific capabilities for handling resources, such as the ones on
+ Windows, \macos, and iOS. This might change in a future Qt release.
+
+ \section1 The Qt Resource Compiler (rcc)
+
+ The \l{Resource Compiler (rcc)} command line tool reads resource files and
+ generates either a C++ or Python source file, or an \c .rcc file.
+
+ The list of files and related metadata is passed to \c rcc in the form of a
+ \l{Qt Resource Collection File}.
+
+ By default, rcc will generate C++ source code that is then compiled as part
+ of an executable or library. The \c{-g python} option generates Python
+ source code instead. The \c -binary option generates a binary archive that
+ is by convention saved in an \c .rcc file and can be loaded at runtime.
+
+ \note While it is possible to run \c rcc from the command line, this is
+ typically best left to a build system. See also the sections about
+ \l{qmake} and \l{CMake} below.
+
+ \section1 Qt Resource Collection File (.qrc)
+ \target {Qt Resource Collection File}
\target {Resource Collection Files}
- The resources associated with an application are specified in a
- \c .qrc file, an XML-based file format that lists files on the
- disk and optionally assigns them a resource name that the
- application must use to access the resource.
+ A \c .qrc file is an XML document that enumerates local files to be
+ included as runtime resources. It serves as input to \c{rcc}.
Here's an example \c .qrc file:
\quotefile resource-system/application.qrc
- The resource files listed in the \c .qrc file are files that are
- part of the application's source tree. The specified paths are
- relative to the directory containing the \c .qrc file. Note that
- the listed resource files must be located in the same directory as
- the \c .qrc file, or one of its subdirectories.
-
- Resource data can either be compiled into the binary and thus accessed
- immediately in application code, or a binary resource can be created
- and at a later point in application code registered with the resource
- system.
-
- By default, resources are accessible in the application under the
- same file name as they have in the source tree, with a \c :/ prefix,
- or by a \l{QUrl}{URL} with a \c qrc scheme.
-
- For example, the file path \c :/images/cut.png or the URL
- \c qrc:///images/cut.png would give access to the
- \c cut.png file, whose location in the application's source tree
- is \c images/cut.png. This can be changed using the \c file tag's
- \c alias attribute:
+ Each \c <file> element in the XML identifies a file in the application's
+ source tree. The path is resolved relative to the directory containing
+ the \c .qrc file.
- \snippet code/doc_src_resources.qdoc 0
+ The path is also used by default to identify the file's content at runtime.
+ That is, the file \c copy.png will be available in the resource system as
+ \c{:/images/copy.png} or \c{qrc:/images/copy.png}.
+ To override this default run-time name, see \l{Prefixes} and \l{Aliases}.
- The file is then accessible as \c :/cut-img.png from the
- application. It is also possible to specify a path prefix for all
- files in the \c .qrc file using the \c qresource tag's \c prefix
- attribute:
+ \e{Qt Creator}, \e{Qt Design Studio}, \QD, and \e{Qt Visual Studio Tools}
+ allow you to create, inspect and edit \c .qrc files through a convenient
+ user interface. Except for \QD, they also provide wizards for projects
+ using the Qt resource system.
- \snippet code/doc_src_resources.qdoc 1
+ \section1 Build System Integration
- In this case, the file is accessible as \c
- :/myresources/cut-img.png.
+ The processing of resource files with \c rcc is typically done at the time
+ the application is built. Several build tools have dedicated support for
+ this, including \l CMake and \l qmake.
- Some resources need to change based on the user's locale,
- such as translation files or icons. This is done by adding a \c lang
- attribute to the \c qresource tag, specifying a suitable locale
- string. For example:
+ \section2 CMake
- \snippet code/doc_src_resources.qdoc 2
+ If \c CMAKE_AUTORCC is enabled, you can just add \c .qrc files as sources
+ to your executable or library. The referenced resource files will then be
+ embedded into the binary:
- If the user's locale is French (i.e., QLocale::system().name() returns
- "fr_FR"), \c :/cut.jpg becomes a reference to the \c cut_fr.jpg
- image. For other locales, \c cut.jpg is used.
+ \snippet resource-system/CMakeLists.txt AUTORCC
- See the QLocale documentation for a description of the format to use
- for locale strings.
+ See \l {https://cmake.org/cmake/help/latest/prop_tgt/AUTORCC.html}
+ {CMake's AUTORCC documentation} for more details about AUTORCC.
- See QFileSelector for an additional mechanism to select locale-specific
- resources, in addition to the ability to select OS-specific and other
- features.
+ An alternative to AUTORCC is using Qt6Core's CMake function
+ \l qt_add_resources, which gives more control over the creation of
+ resources. For example, it allows you to specify the content of the
+ resource directly in the project file without writing a \c .qrc file first:
- \section2 External Binary Resources
+ \snippet resource-system/CMakeLists.txt qt_add_resources
- For an external binary resource to be created you must create the resource
- data (commonly given the \c .rcc extension) by passing the -binary switch to
- \l rcc. Once the binary resource is created you can register the resource
- with the QResource API.
+ Finally, \l qt_add_qml_module allows you to embed Qt Quick resources into
+ the resource system of your application. The function is defined in the
+ \c Qml component of the \c Qt6 CMake package.
- For example, a set of resource data specified in a \c .qrc file can be
- compiled in the following way:
+ \section2 qmake
- \snippet code/doc_src_resources.qdoc 3
+ \l{qmake Manual}{qmake} supports handing resources with the \l{RESOURCES}
+ variable. If you add a \c .qrc file path to the variable, the listed
+ resource files will be embedded into the generated library or executable:
- In the application, this resource would be registered with code like this:
+ \snippet resource-system/application.pro 0
- \snippet code/doc_src_resources.cpp 4
+ For simple applications, it is also possible to let qmake generate the
+ \c .qrc file for you, avoiding the need for an additional file to be
+ maintained:
- \section2 Compiled-In Resources
+ \snippet resource-system/application.pro 1
- For a resource to be compiled into the binary, the \c .qrc file must be
- mentioned in the application's project file so that the build tool knows
- about it.
+ \section1 Runtime API
- In CMake projects, one can use CMake's built-in \c AUTORCC feature to add \c
- .qrc files directly as source files:
+ Qt API that deals with iterating and reading files has built-in support for
+ the Qt Resource System. You can pass a resource path instead of a local
+ file path to QFile and QDir, but also for instance to the QIcon, QImage, and
+ QPixmap constructors:
- \snippet resource-system/CMakeLists.txt AUTORCC
+ \snippet resource-system/mainwindow.cpp 21
- See \l {https://cmake.org/cmake/help/latest/prop_tgt/AUTORCC.html}
- {CMake's AUTORCC documentation}.
+ The \c : prefix makes it explicit that "/images/cut.png" should be loaded
+ from the Qt Resource System.
- Qt's own CMake function \l qt_add_resources allows more control over the
- creation of resources. For example, it allows to specify the content of the
- resource directly in the project file without writing a \c .qrc file first:
+ You can also reference the Qt resource system through a QUrl. Use the
+ \c qrc scheme in this case:
- \snippet resource-system/CMakeLists.txt qt_add_resources
+ \snippet resource-system/main.cpp url
- In qmake projects, assign the \c .qrc files to the \l RESOURCES variable:
+ See the \l{mainwindows/application}{Application} example for an actual
+ application that uses Qt's resource system to store its icons.
- \snippet resource-system/application.pro 0
+ \section1 Advanced Topics
+
+ \section2 Prefixes
+
+ A \c .qrc file can set a prefix to be added to each local file name, given
+ in a \c <file> element, to get the name by which the file shall be known
+ within the resource system.
- \c qmake will produce make rules to generate a file called \c
- qrc_application.cpp that is linked into the application. This
- file contains all the data for the images and other resources as
- static C++ arrays of compressed binary data. The \c
- qrc_application.cpp file is automatically regenerated whenever
- the \c .qrc file changes or one of the files that it refers to
- changes. If you don't use \c .pro files, you can either invoke
- \c rcc manually or add build rules to your build system.
+ Prefixes allow you to structure the resources, avoiding clashes between
+ resource files added through different \c .qrc files in different libraries
+ or plugins.
- \image resources.png Building resources into an application
+ \note The \c /qt and \c /qt-project.org prefixes are reserved for documented
+ use cases in Qt. The \l{Using qt.conf}{qt.conf} file is for instance looked
+ up in \c{:/qt/etc/qt.conf} or \c{qrc:/qt/etc/qt.conf}.
- Currently, Qt always stores the data directly in the executable,
- even on Windows, \macos, and iOS, where the operating system provides
- native support for resources. This might change in a future Qt
- release.
+ \section2 Aliases
+
+ Sometimes it is convenient to make a resource file available under a
+ different path at runtime. \c .qrc files allow this by setting an
+ \c alias attribute:
+
+ \snippet code/doc_src_resources.qdoc 0
+
+ The file is from the application then only accessible as \c :/cut-img.png
+ or \c{qrc:/cut-img.png}.
+
+ \section2 Language Selectors
+
+ Some resources need to change based on the user's locale, such as
+ translation files or icons. \l{Resource Collection Files} support this
+ through a \c lang attribute to the \c qresource tag, specifying a suitable
+ locale string. For example:
+
+ \snippet code/doc_src_resources.qdoc 2
- \section2 Resources in a Qt for Python application
+ If the user's locale is French (i.e., QLocale::system().language() is
+ French), \c :/cut.jpg or \c qrc:/cut.jpg becomes a reference to the
+ \c cut_fr.jpg image. For other locales, \c cut.jpg is used.
- The resource collection file is converted to a Python module by using
- the resource compiler \l rcc:
+ See the QLocale documentation for a description of the format to use for
+ locale strings.
+
+ See QFileSelector for an additional mechanism to select locale-specific
+ resources.
+
+ \section2 Embedding Large Files
+
+ By default, \c rcc embeds the resource files into executables in the form
+ of C++ arrays. This can be problematic especially for large resources.
+
+ If the compiler takes too long, or even fails because of memory overflow,
+ you can opt into a special mode where the resources are embedded as part of
+ a two-step process. The C++ compiler only reserves enough space in the
+ target executable or library for the resources. The actual embedding of the
+ resource file's content and metadata is then done after the compilation and
+ linking phase, through another rcc call.
+
+ For qmake, this is enabled by adding \c resources_big to the \c CONFIG
+ variable:
+
+ \snippet resource-system/application.pro 2
+
+ For CMake, you need to use the \l{qt_add_big_resources} function:
+
+ \snippet resource-system/CMakeLists.txt qt_add_big_resources
+
+ \section2 External Resource Files
+
+ An alternative to embedding the resource files into the binary is to store
+ them in a separate \c .rcc file. \c rcc allows this with the \c -binary
+ option. Such a \c .rcc file must then be loaded at runtime with QResource.
+
+ For example, a set of resource data specified in a \c .qrc file can be
+ compiled in the following way:
+
+ \snippet code/doc_src_resources.qdoc 3
+
+ In the application, this resource would be registered with code like this:
+
+ \snippet code/doc_src_resources.cpp 4
+
+ If you use CMake, you can use the \l{qt_add_binary_resources} function
+ to schedule the \c rcc call above:
+
+ \snippet resource-system/CMakeLists.txt qt_add_binary_resources
+
+ \section2 Resources in a Qt for Python application
+
+ The resource collection file is converted to a Python module by using the
+ resource compiler \l rcc:
\code
rcc -g python application.qrc > application_rc.py
\endcode
- The module needs to be imported in the application:
+ The module can then be imported in the application:
\code
import application_rc.py
\endcode
- \section1 Compression
+ \section2 Compression
\c rcc attempts to compress the content to optimize disk space usage in the
final binaries. By default, it will perform a heuristic check to determine
@@ -192,7 +273,7 @@
The default value is "70", indicating that the compressed file must be 70%
smaller than the original (no more than 30% of the original file size).
- It is possible to turn off compression, if desired. This can be useful if
+ It is possible to turn off compression if desired. This can be useful if
your resources already contain a compressed format, such as \c .png files,
and you do not want to incur the CPU cost at build time to confirm that it
can't be compressed. Another reason is if disk usage is not a problem and
@@ -225,25 +306,25 @@
levels:
\list
- \li \c{best}: use the best algorithm among the ones below, at its highest
+ \li \c best: use the best algorithm among the ones below, at its highest
compression level, to achieve the most compression at the expense of
using a lot of CPU time during compilation. This value is useful in the
XML file to indicate a file should be most compressed, regardless of
which algorithms \c rcc supports.
- \li \c{zstd}: use the \l{Zstandard Site}{Zstandard} library to compress
+ \li \c zstd: use the \l{Zstandard Site}{Zstandard} library to compress
contents. Valid compression levels range from 1 to 19, 1 is least
compression (least CPU time) and 19 is the most compression (most CPU
- time). The default level is 14. A special value of 0 tells the \c{zstd}
+ time). The default level is 14. A special value of 0 tells the \c zstd
library to choose an implementation-defined default.
- \li \c{zlib}: use the \l{https://zlib.net}{zlib} library to compress
+ \li \c zlib: use the \l{https://zlib.net}{zlib} library to compress
contents. Valid compression levels range from 1 to 9, with 1 applying
the least compression (least CPU time) and 9 the most compression (most
CPU time). The special value 0 means "no compression" and should not be
used. The default is implementation-defined, but usually is level 6.
- \li \c{none}: no compression. This is the same as the \c{-no-compress}
+ \li \c none: no compression. This is the same as the \c -no-compress
option.
\endlist
@@ -252,67 +333,27 @@
that library will result in an error. The default compression algorithm is
\c zstd if it is enabled, \c zlib if not.
- \section1 Using Resources in the Application
-
- In the application, resource paths can be used in most places
- instead of ordinary file system paths. In particular, you can
- pass a resource path instead of a file name to the QIcon, QImage,
- or QPixmap constructor:
-
- \snippet resource-system/mainwindow.cpp 21
-
- See the \l{mainwindows/application}{Application} example for an
- actual application that uses Qt's resource system to store its
- icons.
+ \section2 Explicit Loading and Unloading of Embedded Resources
- In memory, resources are represented by a tree of resource
- objects. The tree is automatically built at startup and used by
- QFile for resolving paths to resources. You can use a QDir initialized
- with ":/" to navigate through the resource tree from the root.
+ Resources embedded in C++ executable or library code are automatically
+ registered to the Qt resource system in a constructor of an internal
+ global variable. Since the global variables are initialized before
+ main() runs, the resources are available when the program starts to
+ run.
- Qt's resources support the concept of a search path list. If you then
- refer to a resource with \c : instead of \c :/ as the prefix, the
- resource will be looked up using the search path list. The search
- path list is empty at startup; call QDir::addSearchPath() to
- add paths to it.
-
- \section1 Using Resources in a Library
-
- If you have resources in a library, you need to force initialization
- of your resources by calling \l Q_INIT_RESOURCE() with the base name
- of the \c .qrc file. For example:
+ When embedding resources in \e{static} libraries, the C++ linker might
+ remove the static variables that register the resources. If you
+ embed resources in a static library, you therefore need to explicitly
+ register your resources by calling \l Q_INIT_RESOURCE() with the base
+ name of the \c .qrc file.
+ For example:
\snippet code/doc_src_resources.cpp 5
- This ensures that the resources are linked into the final application
- binary in the case of static linking. You should put the initialization
- code close to where the resources are used in your library, so that
- clients of your library will only link in the resources if they use
- the feature of the library that depends on them.
+ You can also explicitly remove registered resources from the application,
+ for instance when unloading a plugin. Use \l Q_CLEANUP_RESOURCE() for this.
Note: As the resource initializers generated by rcc are declared in the
- global namespace, your calls to \l Q_INIT_RESOURCE() also need to be done
- outside of any namespace.
-
- If the library includes resources that are not used internally, but
- instead exposed to clients of the library, the initialization needs
- to happen in the application code. For example:
-
- \snippet code/doc_src_resources.cpp 6
-
- As before, this ensures that the resources are linked into the final
- application binary in the case of static linking, but also triggers
- loading of the library in the case of dynamic linking, such as plugins.
-
- Similarly, if you must unload a set of resources explicitly
- (because a plugin is being unloaded or the resources are not valid
- any longer), you can force removal of your resources by calling
- \l Q_CLEANUP_RESOURCE() with the same base name as above.
-
- \note The use of \l Q_INIT_RESOURCE() and \l Q_CLEANUP_RESOURCE() is
- not necessary in the following cases:
- \list
- \li When the resource is built as part of the application.
- \li When the resource is built with CMake as part of a static library.
- \endlist
+ global namespace, your calls to \l Q_INIT_RESOURCE() and
+ \l Q_CLEANUP_RESOURCE() need to be done outside any namespace.
*/
diff --git a/src/corelib/global/minimum-linux.S b/src/corelib/global/minimum-linux.S
deleted file mode 100644
index e324379efc..0000000000
--- a/src/corelib/global/minimum-linux.S
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Intel Corporation.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "minimum-linux_p.h"
-
-/* Copied from #include <elf.h>:
- */
-#define ELF_NOTE_GNU "GNU"
-#define NT_GNU_ABI_TAG 1
-#define ELF_NOTE_OS_LINUX 0
-
-#ifdef __arm__
-# define progbits %progbits
-# define note %note
-#else
-# define progbits @progbits
-# define note @note
-#endif
-
-/* Add information for the ELF dynamic linker what the minimum Linux version
- * required for Qt is.
- *
- * The .note.ABI-tag note section is defined at
- * https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/noteabitag.html
- */
-
- .section ".note.GNU-stack", "", progbits
- .section ".note.ABI-tag", "a", note
- .balign 4 /* we have 32-bit data */
-
-/* * For the format of the note section's contents, see Elf32_Nhdr / Elf64_Nhdr */
- .long .Lnameend-.Lname /* n_namesz */
- .long 16 /* n_descsz(16 bytes, normative) */
- .long NT_GNU_ABI_TAG /* n_type */
-
-.Lname:
- .asciz ELF_NOTE_GNU
-.Lnameend:
-
-/* Operating systems: */
- .long ELF_NOTE_OS_LINUX
-
- .long MINLINUX_MAJOR
- .long MINLINUX_MINOR
- .long MINLINUX_PATCH
diff --git a/src/corelib/global/minimum-linux_p.h b/src/corelib/global/minimum-linux_p.h
index 5112015663..291e6965b8 100644
--- a/src/corelib/global/minimum-linux_p.h
+++ b/src/corelib/global/minimum-linux_p.h
@@ -83,24 +83,25 @@ QT_BEGIN_NAMESPACE
// falls back to stat() for us.
// (Using QT_CONFIG(glibc) instead of __GLIBC__ because the macros aren't
// defined in assembler mode)
-# define MINLINUX_MAJOR 4
-# define MINLINUX_MINOR 11
-# define MINLINUX_PATCH 0
+# define QT_ELF_NOTE_OS_MAJOR 4
+# define QT_ELF_NOTE_OS_MINOR 11
+# define QT_ELF_NOTE_OS_PATCH 0
#elif QT_CONFIG(getentropy)
-# define MINLINUX_MAJOR 3
-# define MINLINUX_MINOR 17
-# define MINLINUX_PATCH 0
+# define QT_ELF_NOTE_OS_MAJOR 3
+# define QT_ELF_NOTE_OS_MINOR 17
+# define QT_ELF_NOTE_OS_PATCH 0
#elif QT_CONFIG(renameat2)
-# define MINLINUX_MAJOR 3
-# define MINLINUX_MINOR 16
-# define MINLINUX_PATCH 0
+# define QT_ELF_NOTE_OS_MAJOR 3
+# define QT_ELF_NOTE_OS_MINOR 16
+# define QT_ELF_NOTE_OS_PATCH 0
#else
-# define MINLINUX_MAJOR 2
-# define MINLINUX_MINOR 6
-# define MINLINUX_PATCH 28
+# define QT_ELF_NOTE_OS_MAJOR 2
+# define QT_ELF_NOTE_OS_MINOR 6
+# define QT_ELF_NOTE_OS_PATCH 28
#endif
-#define MINIMUM_LINUX_VERSION QT_VERSION_CHECK(MINLINUX_MAJOR, MINLINUX_MINOR, MINLINUX_PATCH)
+/* you must include <elf.h> */
+#define QT_ELF_NOTE_OS_TYPE ELF_NOTE_OS_LINUX
QT_END_NAMESPACE
diff --git a/src/corelib/global/q20algorithm.h b/src/corelib/global/q20algorithm.h
new file mode 100644
index 0000000000..3024e89c6d
--- /dev/null
+++ b/src/corelib/global/q20algorithm.h
@@ -0,0 +1,116 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com>
+** Contact: http://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 Q20ALGORITHM_H
+#define Q20ALGORITHM_H
+
+#include <QtCore/qglobal.h>
+
+#include <algorithm>
+#include <QtCore/q20functional.h>
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. Types and functions defined
+// in this file will behave exactly as their std counterparts. You
+// may use these definitions in your own code, but be aware that we
+// will remove them once Qt depends on the C++ version that supports
+// them in namespace std. There will be NO deprecation warning, the
+// definitions will JUST go away.
+//
+// If you can't agree to these terms, don't use these definitions!
+//
+// We mean it.
+//
+
+QT_BEGIN_NAMESPACE
+
+namespace q20::ranges {
+// like std::ranges::{any,all,none}_of, just unconstrained, so no range-overload
+#ifdef __cpp_lib_ranges
+using std::ranges::any_of;
+using std::ranges::all_of;
+using std::ranges::none_of;
+#else
+[[maybe_unused]] inline constexpr struct { // Niebloid
+ template <typename InputIterator, typename Sentinel,
+ typename Predicate, typename Projection = q20::identity>
+ constexpr bool operator()(InputIterator first, Sentinel last, Predicate pred, Projection proj = {}) const
+ {
+ while (first != last) {
+ if (std::invoke(pred, std::invoke(proj, *first)))
+ return true;
+ ++first;
+ }
+ return false;
+ }
+} any_of;
+[[maybe_unused]] inline constexpr struct { // Niebloid
+ template <typename InputIterator, typename Sentinel,
+ typename Predicate, typename Projection = q20::identity>
+ constexpr bool operator()(InputIterator first, Sentinel last, Predicate pred, Projection proj = {}) const
+ {
+ while (first != last) {
+ if (!std::invoke(pred, std::invoke(proj, *first)))
+ return false;
+ ++first;
+ }
+ return true;
+ }
+} all_of;
+[[maybe_unused]] inline constexpr struct { // Niebloid
+ template <typename InputIterator, typename Sentinel,
+ typename Predicate, typename Projection = q20::identity>
+ constexpr bool operator()(InputIterator first, Sentinel last, Predicate pred, Projection proj = {}) const
+ {
+ while (first != last) {
+ if (std::invoke(pred, std::invoke(proj, *first)))
+ return false;
+ ++first;
+ }
+ return true;
+ }
+} none_of;
+#endif // __cpp_lib_ranges
+} // namespace q20::ranges
+
+QT_END_NAMESPACE
+
+#endif /* Q20ALGORITHM_H */
diff --git a/src/corelib/kernel/qapplicationpermission.h b/src/corelib/global/q20functional.h
index 1e09b03fc3..300c4b8dd8 100644
--- a/src/corelib/kernel/qapplicationpermission.h
+++ b/src/corelib/global/q20functional.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2021 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
+** Copyright (C) 2021 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com>
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
**
@@ -36,44 +36,45 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-
-#ifndef QAPPLICATIONPERMISSION_H
-#define QAPPLICATIONPERMISSION_H
+#ifndef Q20FUNCTIONAL_H
+#define Q20FUNCTIONAL_H
#include <QtCore/qglobal.h>
-QT_BEGIN_NAMESPACE
+#include <functional>
-namespace QApplicationPermission
-{
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. Types and functions defined
+// in this file will behave exactly as their std counterparts. You
+// may use these definitions in your own code, but be aware that we
+// will remove them once Qt depends on the C++ version that supports
+// them in namespace std. There will be NO deprecation warning, the
+// definitions will JUST go away.
+//
+// If you can't agree to these terms, don't use these definitions!
+//
+// We mean it.
+//
-enum PermissionType {
- Camera,
- Microphone,
- Bluetooth,
- Location,
- PreciseLocation,
- BackgroundLocation,
- PreciseBackgroundLocation,
- BodySensors,
- PhysicalActivity,
- Contacts,
- Storage,
- // TODO: remove after usages in other modules are renamed.
- WriteStorage,
- Calendar
-};
+QT_BEGIN_NAMESPACE
-enum PermissionResult {
- Undetermined,
- Authorized,
- Denied
+namespace q20 {
+// like std::identity
+#ifdef __cpp_lib_ranges
+using std::identity;
+#else
+struct identity
+{
+ struct is_transparent {};
+ template <typename T>
+ constexpr T &&operator()(T&& t) const noexcept { return std::forward<T>(t); }
};
-} // QApplicationPermission
-
-// TODO: remove after usages in other modules are renamed.
-namespace QPermission = QApplicationPermission;
+#endif // __cpp_lib_ranges
+} // namespace q20
QT_END_NAMESPACE
-#endif // QAPPLICATIONPERMISSION_H
+#endif /* Q20FUNCTIONAL_H */
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index 584f1f79b9..bfa4f89105 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -409,15 +409,6 @@
documentation. It also follows conventions like _BOOL and this documented */
# elif defined(sinix)
# define Q_CC_CDS
-
-/* The MIPSpro compiler defines __EDG */
-# elif defined(__sgi)
-# define Q_CC_MIPS
-# define Q_NO_TEMPLATE_FRIENDS
-# if defined(_COMPILER_VERSION) && (_COMPILER_VERSION >= 740)
-# define Q_OUTOFLINE_TEMPLATE inline
-# pragma set woff 3624,3625,3649 /* turn off some harmless warnings */
-# endif
# endif
/* VxWorks' DIAB toolchain has an additional EDG type C++ compiler
@@ -446,9 +437,6 @@
# if __SUNPRO_CC >= 0x550
# define Q_DECL_EXPORT __global
# endif
-# if __SUNPRO_CC < 0x5a0
-# define Q_NO_TEMPLATE_FRIENDS
-# endif
# if !defined(_BOOL)
# error "Compiler not supported"
# endif
@@ -467,26 +455,6 @@
# endif
# define Q_BROKEN_TEMPLATE_SPECIALIZATION
-#elif defined(Q_OS_HPUX)
-/* __HP_aCC was not defined in first aCC releases */
-# if defined(__HP_aCC) || __cplusplus >= 199707L
-# define Q_NO_TEMPLATE_FRIENDS
-# define Q_CC_HPACC
-# define Q_FUNC_INFO __PRETTY_FUNCTION__
-# if __HP_aCC-0 < 060000
-# define QT_NO_TEMPLATE_TEMPLATE_PARAMETERS
-# define Q_DECL_EXPORT __declspec(dllexport)
-# define Q_DECL_IMPORT __declspec(dllimport)
-# endif
-# if __HP_aCC-0 >= 062000
-# define Q_DECL_EXPORT __attribute__((visibility("default")))
-# define Q_DECL_HIDDEN __attribute__((visibility("hidden")))
-# define Q_DECL_IMPORT Q_DECL_EXPORT
-# endif
-# else
-# error "Compiler not supported"
-# endif
-
#else
# error "Qt has not been tested with this compiler - see http://www.qt-project.org/"
#endif
@@ -1146,10 +1114,8 @@
# define Q_DECL_DEPRECATED_X(x) [[deprecated(x)]]
#endif
-#if defined(__cpp_enumerator_attributes) && __cpp_enumerator_attributes >= 201411
-# define Q_DECL_ENUMERATOR_DEPRECATED Q_DECL_DEPRECATED
-# define Q_DECL_ENUMERATOR_DEPRECATED_X(x) Q_DECL_DEPRECATED_X(x)
-#endif
+#define Q_DECL_ENUMERATOR_DEPRECATED Q_DECL_DEPRECATED
+#define Q_DECL_ENUMERATOR_DEPRECATED_X(x) Q_DECL_DEPRECATED_X(x)
/*
* Fallback macros to certain compiler features
@@ -1185,12 +1151,6 @@
#ifndef Q_DECL_DEPRECATED_X
# define Q_DECL_DEPRECATED_X(text) Q_DECL_DEPRECATED
#endif
-#ifndef Q_DECL_ENUMERATOR_DEPRECATED
-# define Q_DECL_ENUMERATOR_DEPRECATED
-#endif
-#ifndef Q_DECL_ENUMERATOR_DEPRECATED_X
-# define Q_DECL_ENUMERATOR_DEPRECATED_X(x)
-#endif
#ifndef Q_DECL_EXPORT
# define Q_DECL_EXPORT
#endif
diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h
index 4d3f88e071..090dde8312 100644
--- a/src/corelib/global/qconfig-bootstrapped.h
+++ b/src/corelib/global/qconfig-bootstrapped.h
@@ -136,6 +136,8 @@
#define QT_NO_TRANSLATION
#define QT_FEATURE_translation -1
+#define QT_NO_COMPRESS
+
// rcc.pro will DEFINES+= this
#ifndef QT_FEATURE_zstd
#define QT_FEATURE_zstd -1
diff --git a/src/corelib/global/qconfig.cpp.in b/src/corelib/global/qconfig.cpp.in
index e6a85feffd..f6ce335599 100644
--- a/src/corelib/global/qconfig.cpp.in
+++ b/src/corelib/global/qconfig.cpp.in
@@ -1,6 +1,6 @@
/* This file is used to generate the Qt configuration info for the Core library.
* The 'qt_generate_qconfig_cpp' cmake routine
- * contains variables that replace '@' entires in this file. It's important to
+ * contains variables that replace '@' entries in this file. It's important to
* align these values with the following:
*
* - QLibraryInfo::LibraryPath enum in qtbase/src/corelib/global/qlibraryinfo.h
@@ -10,8 +10,6 @@
* qt_configure_strs. Also qtConfEntries are strongly bound to QLibraryInfo::LibraryPath.
*/
-/* Installation date */
-static const char qt_configure_installation [12+11] = "qt_instdate=2012-12-20";
/* Installation Info */
static const char qt_configure_prefix_path_str [12+256] = "qt_prfxpath=@QT_CONFIGURE_PREFIX_PATH_STR@";
static const short qt_configure_str_offsets[] = {
diff --git a/src/corelib/global/qendian.h b/src/corelib/global/qendian.h
index c874c5e47a..759b3b09ec 100644
--- a/src/corelib/global/qendian.h
+++ b/src/corelib/global/qendian.h
@@ -127,7 +127,7 @@ inline constexpr quint8 qbswap_helper(quint8 source)
/*
* T qbswap(T source).
- * Changes the byte order of a value from big endian to little endian or vice versa.
+ * Changes the byte order of a value from big-endian to little-endian or vice versa.
* This function can be used if you are not concerned about alignment issues,
* and it is therefore a bit more convenient and in most cases more efficient.
*/
@@ -164,7 +164,7 @@ inline double qbswap(double source)
/*
* qbswap(const T src, const void *dest);
- * Changes the byte order of \a src from big endian to little endian or vice versa
+ * Changes the byte order of \a src from big-endian to little-endian or vice versa
* and stores the result in \a dest.
* There is no alignment requirements for \a dest.
*/
diff --git a/src/corelib/global/qfloat16.cpp b/src/corelib/global/qfloat16.cpp
index 9ef197b3a1..834d82e0ea 100644
--- a/src/corelib/global/qfloat16.cpp
+++ b/src/corelib/global/qfloat16.cpp
@@ -197,17 +197,36 @@ static inline bool hasFastF16()
return qCpuHasFeature(F16C) && qCpuHasFeature(AVX);
}
-extern "C" {
-#ifdef QFLOAT16_INCLUDE_FAST
-# define f16cextern static
-#else
-# define f16cextern extern
-#endif
-
-f16cextern void qFloatToFloat16_fast(quint16 *out, const float *in, qsizetype len) noexcept;
-f16cextern void qFloatFromFloat16_fast(float *out, const quint16 *in, qsizetype len) noexcept;
+QT_FUNCTION_TARGET(F16C)
+void qFloatToFloat16_fast(quint16 *out, const float *in, qsizetype len) Q_DECL_NOEXCEPT
+{
+ qsizetype i = 0;
+ int epilog_i;
+ for (; i < len - 7; i += 8)
+ _mm_storeu_si128((__m128i *)(out + i), _mm256_cvtps_ph(_mm256_loadu_ps(in + i), 0));
+ if (i < len - 3) {
+ _mm_storel_epi64((__m128i *)(out + i), _mm_cvtps_ph(_mm_loadu_ps(in + i), 0));
+ i += 4;
+ }
+ // Inlining "qfloat16::qfloat16(float f)":
+ for (epilog_i = 0; i < len && epilog_i < 3; ++i, ++epilog_i)
+ out[i] = _mm_extract_epi16(_mm_cvtps_ph(_mm_set_ss(in[i]), 0), 0);
+}
-#undef f16cextern
+QT_FUNCTION_TARGET(F16C)
+void qFloatFromFloat16_fast(float *out, const quint16 *in, qsizetype len) Q_DECL_NOEXCEPT
+{
+ qsizetype i = 0;
+ int epilog_i;
+ for (; i < len - 7; i += 8)
+ _mm256_storeu_ps(out + i, _mm256_cvtph_ps(_mm_loadu_si128((const __m128i *)(in + i))));
+ if (i < len - 3) {
+ _mm_storeu_ps(out + i, _mm_cvtph_ps(_mm_loadl_epi64((const __m128i *)(in + i))));
+ i += 4;
+ }
+ // Inlining "qfloat16::operator float()":
+ for (epilog_i = 0; i < len && epilog_i < 3; ++i, ++epilog_i)
+ out[i] = _mm_cvtss_f32(_mm_cvtph_ps(_mm_cvtsi32_si128(in[i])));
}
#elif defined(__ARM_FP16_FORMAT_IEEE) && defined(__ARM_NEON__) && (__ARM_FP & 2)
@@ -292,6 +311,3 @@ Q_CORE_EXPORT void qFloatFromFloat16(float *out, const qfloat16 *in, qsizetype l
QT_END_NAMESPACE
#include "qfloat16tables.cpp"
-#ifdef QFLOAT16_INCLUDE_FAST
-# include "qfloat16_f16c.c"
-#endif
diff --git a/src/corelib/global/qfloat16.h b/src/corelib/global/qfloat16.h
index c2e5379eb4..59739fdcc1 100644
--- a/src/corelib/global/qfloat16.h
+++ b/src/corelib/global/qfloat16.h
@@ -333,7 +333,7 @@ template <> inline auto qHypot(qfloat16 x, qfloat16 y)
return qfloat16(qHypot(float(x), float(y)));
#endif
}
-#if __cpp_lib_hypot >= 201603L // Expected to be true
+#if defined(__cpp_lib_hypot) && __cpp_lib_hypot >= 201603L // Expected to be true
// If any are not qfloat16, convert each qfloat16 to float:
/* (The following splits the some-but-not-all-qfloat16 cases up, using
(X|Y|Z)&~(X&Y&Z) = X ? ~(Y&Z) : Y|Z = X&~(Y&Z) | ~X&Y | ~X&~Y&Z,
diff --git a/src/corelib/global/qfloat16_f16c.c b/src/corelib/global/qfloat16_f16c.c
deleted file mode 100644
index d60a021bdb..0000000000
--- a/src/corelib/global/qfloat16_f16c.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "private/qsimd_p.h"
-
-// The x86 F16C instructions operate on AVX registers, so AVX support is
-// required.
-#if QT_COMPILER_SUPPORTS_HERE(AVX)
-
-#ifdef __cplusplus
-QT_BEGIN_NAMESPACE
-extern "C" {
-#endif
-
-QT_FUNCTION_TARGET(F16C)
-void qFloatToFloat16_fast(quint16 *out, const float *in, qsizetype len) Q_DECL_NOEXCEPT
-{
- qsizetype i = 0;
- int epilog_i;
- for (; i < len - 7; i += 8)
- _mm_storeu_si128((__m128i *)(out + i), _mm256_cvtps_ph(_mm256_loadu_ps(in + i), 0));
- if (i < len - 3) {
- _mm_storel_epi64((__m128i *)(out + i), _mm_cvtps_ph(_mm_loadu_ps(in + i), 0));
- i += 4;
- }
- // Inlining "qfloat16::qfloat16(float f)":
- for (epilog_i = 0; i < len && epilog_i < 3; ++i, ++epilog_i)
- out[i] = _mm_extract_epi16(_mm_cvtps_ph(_mm_set_ss(in[i]), 0), 0);
-}
-
-QT_FUNCTION_TARGET(F16C)
-void qFloatFromFloat16_fast(float *out, const quint16 *in, qsizetype len) Q_DECL_NOEXCEPT
-{
- qsizetype i = 0;
- int epilog_i;
- for (; i < len - 7; i += 8)
- _mm256_storeu_ps(out + i, _mm256_cvtph_ps(_mm_loadu_si128((const __m128i *)(in + i))));
- if (i < len - 3) {
- _mm_storeu_ps(out + i, _mm_cvtph_ps(_mm_loadl_epi64((const __m128i *)(in + i))));
- i += 4;
- }
- // Inlining "qfloat16::operator float()":
- for (epilog_i = 0; i < len && epilog_i < 3; ++i, ++epilog_i)
- out[i] = _mm_cvtss_f32(_mm_cvtph_ps(_mm_cvtsi32_si128(in[i])));
-}
-
-#ifdef __cplusplus
-} // extern "C"
-QT_END_NAMESPACE
-#endif
-
-#endif // QT_COMPILER_SUPPORTS_HERE(AVX)
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 00538d6798..d455f887ed 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -40,6 +40,7 @@
#include "qplatformdefs.h"
#include "qstring.h"
+#include "qbytearrayview.h"
#include "qlist.h"
#include "qdir.h"
#include "qdatetime.h"
@@ -78,7 +79,7 @@
# include <envLib.h>
#endif
-#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
+#ifdef Q_OS_ANDROID
#include <qjniobject.h>
#endif
@@ -353,7 +354,7 @@ static_assert(sizeof(qint64) == 8, "Internal error, qint64 is misdefined");
/*!
\fn template <typename Enum> QFlags &QFlags<Enum>::operator=(const QFlags &other)
- Assigns \a other to this object and returns a reference to this
+ Assigns \e other to this object and returns a reference to this
object.
*/
@@ -582,7 +583,7 @@ static_assert(sizeof(qint64) == 8, "Internal error, qint64 is misdefined");
\relates QFlags
Calculates the hash for the flags \a flags, using \a seed
- to seed the calcualtion.
+ to seed the calculation.
*/
/*!
@@ -767,7 +768,7 @@ static_assert(sizeof(qint64) == 8, "Internal error, qint64 is misdefined");
the value rounded up to the nearest integer and 64-bit integer
respectively, the qInstallMessageHandler() function which installs
the given QtMessageHandler, and the qVersion() function which
- returns the version number of Qt at run-time as a string.
+ returns the version number of Qt at runtime as a string.
\section1 Macros
@@ -800,9 +801,9 @@ static_assert(sizeof(qint64) == 8, "Internal error, qint64 is misdefined");
The QT_POINTER_SIZE macro expands to the size of a pointer in bytes.
- The macros QT_VERSION and QT_VERSION_STR expand to a numeric value
- or a string, respectively, that specifies the version of Qt that the
- application is compiled against.
+ The macros QT_VERSION and QT_VERSION_STR expand to a numeric value or a
+ string, respectively. These identify the version of Qt that the application
+ is compiled with.
\sa <QtAlgorithms>, QSysInfo
*/
@@ -1301,17 +1302,24 @@ static_assert(sizeof(qint64) == 8, "Internal error, qint64 is misdefined");
*/
/*!
- \macro QT_VERSION_CHECK
+ \macro QT_VERSION_CHECK(major, minor, patch)
\relates <QtGlobal>
- Turns the major, minor and patch numbers of a version into an
- integer, 0xMMNNPP (MM = major, NN = minor, PP = patch). This can
- be compared with another similarly processed version id.
+ Turns the \a major, \a minor and \a patch numbers of a version into an
+ integer that encodes all three. When expressed in hexadecimal, this integer
+ is of form \c 0xMMNNPP wherein \c{0xMM ==} \a major, \c{0xNN ==} \a minor,
+ and \c{0xPP ==} \a patch. This can be compared with another similarly
+ processed version ID.
Example:
\snippet code/src_corelib_global_qglobal.cpp qt-version-check
+ \note the parameters are read as integers in the normal way, so should
+ normally be written in decimal (so a \c 0x prefix must be used if writing
+ them in hexadecimal). Thuse \c{QT_VERSION_CHECK(5, 15, 0)} is equal to \c
+ 0x050e00, which could equally be written \c{QT_VERSION_CHECK(5, 0xe, 0)}.
+
\sa QT_VERSION
*/
@@ -1319,28 +1327,32 @@ static_assert(sizeof(qint64) == 8, "Internal error, qint64 is misdefined");
\macro QT_VERSION
\relates <QtGlobal>
- This macro expands a numeric value of the form 0xMMNNPP (MM =
- major, NN = minor, PP = patch) that specifies Qt's version
- number. For example, if you compile your application against Qt
- 4.1.2, the QT_VERSION macro will expand to 0x040102.
+ This macro expands to a numeric value of the same form as \l
+ QT_VERSION_CHECK() constructs, that specifies the version of Qt with which
+ code using it is compiled. For example, if you compile your application with
+ Qt 6.1.2, the QT_VERSION macro will expand to \c 0x060102, the same as
+ \c{QT_VERSION_CHECK(6, 1, 2)}. Note that this need not agree with the
+ version the application will find itself using at \e runtime.
- You can use QT_VERSION to use the latest Qt features where
- available.
+ You can use QT_VERSION to select the latest Qt features where available
+ while falling back to older implementations otherwise. Using
+ QT_VERSION_CHECK() for the value to compare with is recommended.
Example:
\snippet code/src_corelib_global_qglobal.cpp 16
- \sa QT_VERSION_STR, qVersion()
+ \sa QT_VERSION_STR, QT_VERSION_CHECK(), qVersion()
*/
/*!
\macro QT_VERSION_STR
\relates <QtGlobal>
- This macro expands to a string that specifies Qt's version number
- (for example, "4.1.2"). This is the version against which the
- application is compiled.
+ This macro expands to a string that specifies Qt's version number (for
+ example, "6.1.2"). This is the version with which the application is
+ compiled. This may be a different version than the version the application
+ will find itself using at \e runtime.
\sa qVersion(), QT_VERSION
*/
@@ -1348,9 +1360,9 @@ static_assert(sizeof(qint64) == 8, "Internal error, qint64 is misdefined");
/*!
\relates <QtGlobal>
- Returns the version number of Qt at run-time as a string (for
- example, "4.1.2"). This may be a different version than the
- version the application was compiled against.
+ Returns the version number of Qt at runtime as a string (for example,
+ "6.1.2"). This may be a different version than the version the application
+ was \e compiled with.
\sa QT_VERSION_STR, QLibraryInfo::version()
*/
@@ -1423,42 +1435,42 @@ bool qSharedBuild() noexcept
\relates <QtGlobal>
Deprecated synonym for \c Q_OS_DARWIN. Do not use.
- */
+*/
/*!
\macro Q_OS_OSX
\relates <QtGlobal>
Deprecated synonym for \c Q_OS_MACOS. Do not use.
- */
+*/
/*!
\macro Q_OS_MACOS
\relates <QtGlobal>
Defined on \macos.
- */
+*/
/*!
\macro Q_OS_IOS
\relates <QtGlobal>
Defined on iOS.
- */
+*/
/*!
\macro Q_OS_WATCHOS
\relates <QtGlobal>
Defined on watchOS.
- */
+*/
/*!
\macro Q_OS_TVOS
\relates <QtGlobal>
Defined on tvOS.
- */
+*/
/*!
\macro Q_OS_WIN
@@ -2064,14 +2076,15 @@ bool qSharedBuild() noexcept
a specified version of Qt or any earlier version. The default version number is 5.0,
meaning that functions deprecated in or before Qt 5.0 will not be included.
- For instance, when using a future release of Qt 5, set
- \c{QT_DISABLE_DEPRECATED_BEFORE=0x050100} to disable functions deprecated in
- Qt 5.1 and earlier. In any release, set
- \c{QT_DISABLE_DEPRECATED_BEFORE=0x000000} to enable all functions, including
- the ones deprecated in Qt 5.0.
+ For instance, when preparing to upgrade to Qt 6.3, setting
+ \c{QT_DISABLE_DEPRECATED_BEFORE=0x0602ff} will disable functions deprecated in
+ Qt 6.2 and earlier, making it easy to find changes worth making before the
+ upgrade. In any release, set \c{QT_DISABLE_DEPRECATED_BEFORE=0x000000} to
+ enable all functions, including the ones deprecated in Qt 5.0 (although most
+ of those have by now been removed entirely).
\sa QT_DEPRECATED_WARNINGS
- */
+*/
/*!
@@ -2083,7 +2096,7 @@ bool qSharedBuild() noexcept
deprecated by Qt is used.
\sa QT_DISABLE_DEPRECATED_BEFORE, QT_NO_DEPRECATED_WARNINGS
- */
+*/
/*!
\macro QT_NO_DEPRECATED_WARNINGS
@@ -2202,7 +2215,17 @@ static const char *osVer_helper(QOperatingSystemVersion version = QOperatingSyst
#define Q_WINVER(major, minor) (major << 8 | minor)
switch (Q_WINVER(osver.dwMajorVersion, osver.dwMinorVersion)) {
case Q_WINVER(10, 0):
- return workstation ? "10" : "Server 2016";
+ if (workstation) {
+ if (osver.dwBuildNumber >= 22000)
+ return "11";
+ return "10";
+ }
+ // else: Server
+ if (osver.dwBuildNumber >= 20348)
+ return "Server 2022";
+ if (osver.dwBuildNumber >= 17763)
+ return "Server 2019";
+ return "Server 2016";
}
#undef Q_WINVER
// unknown, future version
@@ -2407,7 +2430,7 @@ static bool findUnixOsVersion(QUnixOSVersion &v)
# endif // USE_ETC_OS_RELEASE
#endif // Q_OS_UNIX
-#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
+#ifdef Q_OS_ANDROID
static const char *osVer_helper(QOperatingSystemVersion)
{
/* Data:
@@ -2438,7 +2461,7 @@ Marshmallow
Nougat
Nougat
Oreo
- */
+*/
static const char versions_string[] =
"\0"
"Cupcake\0"
@@ -2538,7 +2561,7 @@ QString QSysInfo::buildCpuArchitecture()
\endlist
\sa QSysInfo::buildAbi(), QSysInfo::buildCpuArchitecture()
- */
+*/
QString QSysInfo::currentCpuArchitecture()
{
#if defined(Q_OS_WIN)
@@ -2874,7 +2897,7 @@ QString QSysInfo::productVersion()
*/
QString QSysInfo::prettyProductName()
{
-#if (defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)) || defined(Q_OS_DARWIN) || defined(Q_OS_WIN)
+#if defined(Q_OS_ANDROID) || defined(Q_OS_DARWIN) || defined(Q_OS_WIN)
const auto version = QOperatingSystemVersion::current();
const int majorVersion = version.majorVersion();
const QString versionString = QString::number(majorVersion) + QLatin1Char('.')
@@ -2924,7 +2947,7 @@ QString QSysInfo::prettyProductName()
This function returns the same as QHostInfo::localHostName().
\sa QHostInfo::localDomainName, machineUniqueId()
- */
+*/
QString QSysInfo::machineHostName()
{
// the hostname can change, so we can't cache it
@@ -3231,7 +3254,7 @@ QByteArray QSysInfo::bootUniqueId()
\tt{const TInputType& myMin(const TInputType&, const TInputType&) [with TInputType = int] was called with value1: 3 value2: 4}
If this macro is used outside a function, the behavior is undefined.
- */
+*/
/*!
\internal
@@ -3346,6 +3369,35 @@ time_t qMkTime(struct tm *when)
return mktime(when);
}
+void qAbort()
+{
+#ifdef Q_OS_WIN
+ // std::abort() in the MSVC runtime will call _exit(3) if the abort
+ // behavior is _WRITE_ABORT_MSG - see also _set_abort_behavior(). This is
+ // the default for a debug-mode build of the runtime. Worse, MinGW's
+ // std::abort() implementation (in msvcrt.dll) is basically a call to
+ // _exit(3) too. Unfortunately, _exit() and _Exit() *do* run the static
+ // destructors of objects in DLLs, a violation of the C++ standard (see
+ // [support.start.term]). So we bypass std::abort() and directly
+ // terminate the application.
+
+# if defined(Q_CC_MSVC) && !defined(Q_CC_INTEL)
+ if (IsProcessorFeaturePresent(PF_FASTFAIL_AVAILABLE))
+ __fastfail(FAST_FAIL_FATAL_APP_EXIT);
+# else
+ RaiseFailFastException(nullptr, nullptr, 0);
+# endif
+
+ // Fallback
+ TerminateProcess(GetCurrentProcess(), STATUS_FATAL_APP_EXIT);
+
+ // Tell the compiler the application has stopped.
+ Q_UNREACHABLE_IMPL();
+#else // !Q_OS_WIN
+ std::abort();
+#endif
+}
+
// Also specified to behave as if they call tzset():
// localtime() -- but not localtime_r(), which we use when threaded
// strftime() -- not used (except in tests)
@@ -3529,6 +3581,7 @@ int qEnvironmentVariableIntValue(const char *varName, bool *ok) noexcept
(std::numeric_limits<uint>::digits + NumBinaryDigitsPerOctalDigit - 1) / NumBinaryDigitsPerOctalDigit;
const auto locker = qt_scoped_lock(environmentMutex);
+ size_t size;
#ifdef Q_CC_MSVC
// we provide a buffer that can hold any int value:
char buffer[MaxDigitsForOctalInt + 2]; // +1 for NUL +1 for optional '-'
@@ -3538,45 +3591,16 @@ int qEnvironmentVariableIntValue(const char *varName, bool *ok) noexcept
*ok = false;
return 0;
}
+ size = strlen(buffer);
#else
const char * const buffer = ::getenv(varName);
- if (!buffer || strlen(buffer) > MaxDigitsForOctalInt + 2) {
+ if (!buffer || (size = strlen(buffer)) > MaxDigitsForOctalInt + 2) {
if (ok)
*ok = false;
return 0;
}
#endif
- bool ok_ = true;
- const char *endptr;
- const qlonglong value = qstrtoll(buffer, &endptr, 0, &ok_);
-
- // Keep the following checks in sync with QByteArray::toInt()
- if (!ok_) {
- if (ok)
- *ok = false;
- return 0;
- }
-
- if (*endptr != '\0') {
- while (ascii_isspace(*endptr))
- ++endptr;
- }
-
- if (*endptr != '\0') {
- // we stopped at a non-digit character after converting some digits
- if (ok)
- *ok = false;
- return 0;
- }
-
- if (int(value) != value) {
- if (ok)
- *ok = false;
- return 0;
- } else if (ok) {
- *ok = ok_;
- }
- return int(value);
+ return QByteArrayView(buffer, size).toInt(ok, 0);
}
/*!
@@ -4180,7 +4204,7 @@ bool qunsetenv(const char *varName)
Qt will try to detect the class of a type using
\l {https://en.cppreference.com/w/cpp/types/is_trivial} {std::is_trivial_v<T>}
- to indentify primitive
+ to identify primitive
types and it will require both
\l {https://en.cppreference.com/w/cpp/types/is_trivially_copyable} {std::is_trivially_copyable_v<T>}
and
@@ -4446,7 +4470,7 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters)
The two numbers are compared in a relative way, where the
exactness is stronger the smaller the numbers are.
- */
+*/
/*!
\fn bool qFuzzyCompare(float p1, float p2)
@@ -4459,7 +4483,7 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters)
The two numbers are compared in a relative way, where the
exactness is stronger the smaller the numbers are.
- */
+*/
/*!
\fn bool qFuzzyIsNull(double d)
@@ -4484,14 +4508,14 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters)
\relates <QtGlobal>
This macro can be used to ensure that the application is run
- against a recent enough version of Qt. This is especially useful
+ with a recent enough version of Qt. This is especially useful
if your application depends on a specific bug fix introduced in a
- bug-fix release (e.g., 4.0.2).
+ bug-fix release (for example, 6.1.2).
The \a argc and \a argv parameters are the \c main() function's
\c argc and \c argv parameters. The \a version parameter is a
string literal that specifies which version of Qt the application
- requires (e.g., "4.0.2").
+ requires (for example, "6.1.2").
Example:
@@ -4574,7 +4598,7 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters)
puts a single space between each item, and outputs a newline at
the end. It supports many C++ and Qt types.
- To suppress the output at run-time, install your own message handler
+ To suppress the output at runtime, install your own message handler
with qInstallMessageHandler().
\sa qInfo(), qWarning(), qCritical(), qFatal(), qInstallMessageHandler(),
@@ -4612,8 +4636,8 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters)
puts a single space between each item, and outputs a newline at
the end. It supports many C++ and Qt types.
- To suppress the output at run-time, install your own message handler
- with qInstallMessageHandler().
+ To suppress the output at runtime, install your own message handler
+ using qInstallMessageHandler().
\sa qDebug(), qWarning(), qCritical(), qFatal(), qInstallMessageHandler(),
{Debugging Techniques}
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 8bc7181633..dd137c879a 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -53,11 +53,11 @@
#endif
/*
- QT_VERSION is (major << 16) + (minor << 8) + patch.
+ QT_VERSION is (major << 16) | (minor << 8) | patch.
*/
#define QT_VERSION QT_VERSION_CHECK(QT_VERSION_MAJOR, QT_VERSION_MINOR, QT_VERSION_PATCH)
/*
- can be used like #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0))
+ can be used like #if (QT_VERSION >= QT_VERSION_CHECK(6, 4, 0))
*/
#define QT_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch))
@@ -97,6 +97,15 @@
# endif
#endif // __cplusplus
+#if defined(__cplusplus) && defined(Q_CC_MSVC)
+// On MSVC we require /permissive- set by user code. Check that we are
+// under its rules -- for instance, check that std::nullptr_t->bool is
+// not an implicit conversion, as per
+// https://docs.microsoft.com/en-us/cpp/overview/cpp-conformance-improvements?view=msvc-160#nullptr_t-is-only-convertible-to-bool-as-a-direct-initialization
+static_assert(!std::is_convertible_v<std::nullptr_t, bool>,
+ "On MSVC you must pass the /permissive- option to the compiler.");
+#endif
+
#if defined (__ELF__)
# define Q_OF_ELF
#endif
@@ -459,7 +468,7 @@ typedef double qreal;
// removed_api/some.cpp
#define QT_BUILD_REMOVED_API
- #include <qglobal.h>
+ #include <QtCore/qglobal.h>
#include <someheader.h>
@@ -859,7 +868,7 @@ constexpr inline QTypeTraits::Promoted<T, U> qBound(const U &min, const T &val,
# ifdef __OBJC__
# define Q_FORWARD_DECLARE_OBJC_CLASS(classname) @class classname
# else
-# define Q_FORWARD_DECLARE_OBJC_CLASS(classname) typedef struct objc_object classname
+# define Q_FORWARD_DECLARE_OBJC_CLASS(classname) class classname
# endif
#endif
#ifndef Q_FORWARD_DECLARE_CF_TYPE
@@ -1204,6 +1213,7 @@ void qAsConst(const T &&) = delete;
// like std::exchange
template <typename T, typename U = T>
constexpr T qExchange(T &t, U &&newValue)
+noexcept(std::conjunction_v<std::is_nothrow_move_constructible<T>, std::is_nothrow_assignable<T &, U>>)
{
T old = std::move(t);
t = std::forward<U>(newValue);
@@ -1280,10 +1290,15 @@ QForeachContainer<typename std::decay<T>::type> qMakeForeachContainer(T &&t)
// Use C++17 if statement with initializer. User's code ends up in a else so
// scoping of different ifs is not broken
-#define Q_FOREACH(variable, container) \
-for (auto _container_ = QtPrivate::qMakeForeachContainer(container); \
- _container_.i != _container_.e; ++_container_.i) \
- if (variable = *_container_.i; false) {} else
+#define Q_FOREACH_IMPL(variable, name, container) \
+ for (auto name = QtPrivate::qMakeForeachContainer(container); name.i != name.e; ++name.i) \
+ if (variable = *name.i; false) {} else
+
+#define Q_FOREACH_JOIN(A, B) Q_FOREACH_JOIN_IMPL(A, B)
+#define Q_FOREACH_JOIN_IMPL(A, B) A ## B
+
+#define Q_FOREACH(variable, container) \
+ Q_FOREACH_IMPL(variable, Q_FOREACH_JOIN(_container_, __LINE__), container)
#endif // QT_NO_FOREACH
#define Q_FOREVER for(;;)
diff --git a/src/corelib/global/qglobal_p.h b/src/corelib/global/qglobal_p.h
index 5ab84fa8be..49927ef30f 100644
--- a/src/corelib/global/qglobal_p.h
+++ b/src/corelib/global/qglobal_p.h
@@ -72,6 +72,11 @@ QT_BEGIN_NAMESPACE
Q_CORE_EXPORT void qTzSet();
Q_CORE_EXPORT time_t qMkTime(struct tm *when);
+#if !defined(Q_CC_MSVC)
+Q_NORETURN
+#endif
+Q_CORE_EXPORT void qAbort();
+
QT_END_NAMESPACE
#if !__has_builtin(__builtin_available)
diff --git a/src/corelib/global/qglobalstatic.h b/src/corelib/global/qglobalstatic.h
index 4aa496e7f6..49cebe1e61 100644
--- a/src/corelib/global/qglobalstatic.h
+++ b/src/corelib/global/qglobalstatic.h
@@ -122,6 +122,8 @@ struct QGlobalStatic
};
#define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS) \
+ QT_WARNING_PUSH \
+ QT_WARNING_DISABLE_CLANG("-Wunevaluated-expression") \
namespace { namespace Q_QGS_ ## NAME { \
typedef TYPE Type; \
QBasicAtomicInt guard = Q_BASIC_ATOMIC_INITIALIZER(QtGlobalStatic::Uninitialized); \
@@ -129,7 +131,8 @@ struct QGlobalStatic
} } \
static QGlobalStatic<TYPE, \
Q_QGS_ ## NAME::innerFunction, \
- Q_QGS_ ## NAME::guard> NAME;
+ Q_QGS_ ## NAME::guard> NAME; \
+ QT_WARNING_POP
#define Q_GLOBAL_STATIC(TYPE, NAME) \
Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ())
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index 625fab75f7..18a429fb6d 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -244,8 +244,10 @@ QLibraryInfo::QLibraryInfo()
# define COMPILER_STRING "MSVC 2015"
# elif _MSC_VER < 1917
# define COMPILER_STRING "MSVC 2017"
-# elif _MSC_VER < 2000
+# elif _MSC_VER < 1930
# define COMPILER_STRING "MSVC 2019"
+# elif _MSC_VER < 2000
+# define COMPILER_STRING "MSVC 2022"
# else
# define COMPILER_STRING "MSVC _MSC_VER " QT_STRINGIFY(_MSC_VER)
# endif
@@ -683,6 +685,7 @@ QStringList QLibraryInfo::platformPluginArguments(const QString &platformName)
QT_END_NAMESPACE
#if defined(Q_CC_GNU) && defined(ELF_INTERPRETER)
+# include <elf.h>
# include <stdio.h>
# include <stdlib.h>
@@ -692,6 +695,35 @@ QT_WARNING_DISABLE_GCC("-Wattributes")
QT_WARNING_DISABLE_CLANG("-Wattributes")
QT_WARNING_DISABLE_INTEL(2621)
+# if defined(Q_OS_LINUX)
+# include "minimum-linux_p.h"
+# endif
+# ifdef QT_ELF_NOTE_OS_TYPE
+struct ElfNoteAbiTag
+{
+ static_assert(sizeof(Elf32_Nhdr) == sizeof(Elf64_Nhdr),
+ "The size of an ELF note is wrong (should be 12 bytes)");
+ struct Payload {
+ Elf32_Word ostype = QT_ELF_NOTE_OS_TYPE;
+ Elf32_Word major = QT_ELF_NOTE_OS_MAJOR;
+ Elf32_Word minor = QT_ELF_NOTE_OS_MINOR;
+# ifdef QT_ELF_NOTE_OS_PATCH
+ Elf32_Word patch = QT_ELF_NOTE_OS_PATCH;
+# endif
+ };
+
+ Elf32_Nhdr header = {
+ .n_namesz = sizeof(name),
+ .n_descsz = sizeof(Payload),
+ .n_type = NT_GNU_ABI_TAG
+ };
+ char name[sizeof ELF_NOTE_GNU] = ELF_NOTE_GNU; // yes, include the null terminator
+ Payload payload = {};
+};
+__attribute__((section(".note.ABI-tag"), aligned(4), used))
+extern constexpr ElfNoteAbiTag QT_MANGLE_NAMESPACE(qt_abi_tag) = {};
+# endif
+
extern const char qt_core_interpreter[] __attribute__((section(".interp")))
= ELF_INTERPRETER;
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index 9bb15d21be..e562fed336 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Copyright (C) 2016 Olivier Goffart <ogoffart@woboq.com>
** Copyright (C) 2018 Intel Corporation.
** Contact: https://www.qt.io/licensing/
@@ -1090,7 +1090,7 @@ struct QMessagePattern
QString backtraceSeparator;
int backtraceDepth;
};
- QList<BacktraceParams> backtraceArgs; // backtrace argumens in sequence of %{backtrace
+ QList<BacktraceParams> backtraceArgs; // backtrace arguments in sequence of %{backtrace
#endif
bool fromEnvironment;
@@ -1497,7 +1497,7 @@ static QBasicAtomicPointer<void (QtMsgType, const QMessageLogContext &, const QS
// ------------------------ Alternate logging sinks -------------------------
#if defined(QT_BOOTSTRAPPED)
- // Boostrapped tools always print to stderr, so no need for alternate sinks
+ // Bootstrapped tools always print to stderr, so no need for alternate sinks
#else
#if QT_CONFIG(slog2)
@@ -1632,7 +1632,7 @@ static bool syslog_default_message_handler(QtMsgType type, const QMessageLogCont
}
#endif
-#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
+#ifdef Q_OS_ANDROID
static bool android_default_message_handler(QtMsgType type,
const QMessageLogContext &context,
const QString &message)
@@ -1682,7 +1682,7 @@ static void win_outputDebugString_helper(QStringView message)
} else {
wchar_t *messagePart = new wchar_t[maxOutputStringLength + 1];
for (qsizetype i = 0; i < message.length(); i += maxOutputStringLength) {
- const qsizetype length = std::min(message.length() - i, maxOutputStringLength);
+ const qsizetype length = qMin(message.length() - i, maxOutputStringLength);
const qsizetype len = message.mid(i, length).toWCharArray(messagePart);
Q_ASSERT(len == length);
messagePart[len] = 0;
@@ -1775,7 +1775,7 @@ static void qDefaultMessageHandler(QtMsgType type, const QMessageLogContext &con
handledStderr |= systemd_default_message_handler(type, context, message);
# elif QT_CONFIG(syslog)
handledStderr |= syslog_default_message_handler(type, context, message);
-# elif defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
+# elif defined(Q_OS_ANDROID)
handledStderr |= android_default_message_handler(type, context, message);
# elif defined(QT_USE_APPLE_UNIFIED_LOGGING)
handledStderr |= AppleUnifiedLogger::messageHandler(type, context, message);
@@ -1872,31 +1872,7 @@ static void qt_message_fatal(QtMsgType, const QMessageLogContext &context, const
Q_UNUSED(message);
#endif
-#ifdef Q_OS_WIN
- // std::abort() in the MSVC runtime will call _exit(3) if the abort
- // behavior is _WRITE_ABORT_MSG - see also _set_abort_behavior(). This is
- // the default for a debug-mode build of the runtime. Worse, MinGW's
- // std::abort() implementation (in msvcrt.dll) is basically a call to
- // _exit(3) too. Unfortunately, _exit() and _Exit() *do* run the static
- // destructors of objects in DLLs, a violation of the C++ standard (see
- // [support.start.term]). So we bypass std::abort() and directly
- // terminate the application.
-
-# if defined(Q_CC_MSVC) && !defined(Q_CC_INTEL)
- if (IsProcessorFeaturePresent(PF_FASTFAIL_AVAILABLE))
- __fastfail(FAST_FAIL_FATAL_APP_EXIT);
-# else
- RaiseFailFastException(nullptr, nullptr, 0);
-# endif
-
- // Fallback
- TerminateProcess(GetCurrentProcess(), STATUS_FATAL_APP_EXIT);
-
- // Tell the compiler the application has stopped.
- Q_UNREACHABLE_IMPL();
-#else // !Q_OS_WIN
- std::abort();
-#endif
+ qAbort();
}
@@ -2045,13 +2021,17 @@ void qErrnoWarning(int code, const char *msg, ...)
environment variable; if both \l qSetMessagePattern() is called and QT_MESSAGE_PATTERN is
set, the environment variable takes precedence.
+ \note The information for the placeholders \c category, \c file, \c function and \c line is
+ only recorded in debug builds. Alternatively, \c QT_MESSAGELOGCONTEXT can be defined
+ explicitly. For more information refer to the QMessageLogContext documentation.
+
\note The message pattern only applies to unstructured logging, such as the default
\c stderr output. Structured logging such as systemd will record the message as is,
along with as much structured information as can be captured.
Custom message handlers can use qFormatLogMessage() to take \a pattern into account.
- \sa qInstallMessageHandler(), {Debugging Techniques}, {QLoggingCategory}
+ \sa qInstallMessageHandler(), {Debugging Techniques}, {QLoggingCategory}, QMessageLogContext
*/
QtMessageHandler qInstallMessageHandler(QtMessageHandler h)
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 48bbba655e..6052234545 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -1460,6 +1460,7 @@ namespace Qt {
enum LayoutDirection {
LeftToRight,
RightToLeft,
+ // ### Qt 7: make auto the first one (with value 0)
LayoutDirectionAuto
};
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 0ad279f16c..59a479d3d4 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -1126,10 +1126,10 @@
e.g., when a hidden widget was resized. This flag is set or cleared by the
Qt kernel.
- \value WA_QuitOnClose Makes Qt quit the application when the last widget
- with the attribute set has accepted closeEvent(). This behavior can be
- modified with the QApplication::quitOnLastWindowClosed property. By default
- this attribute is set for all widgets of type Qt::Window.
+ \value WA_QuitOnClose Indicates that the widget should be taken into account
+ when deciding whether to quit the application when the last window is closed.
+ This behavior can be modified with the QGuiApplication::quitOnLastWindowClosed
+ property. By default this attribute is set for all widgets of type Qt::Window.
\value WA_Resized Indicates that the widget has an explicit size. This flag
is set or cleared by QWidget::resize() and QWidget::setGeometry().
@@ -2659,7 +2659,8 @@
\value ImCursorRectangle The rectangle covering the area of the input cursor in widget coordinates.
\value ImFont The currently used font for text input.
\value ImCursorPosition The logical position of the cursor within the text surrounding the input area
- (see \c ImSurroundingText).
+ (see \c ImSurroundingText). The position does not incorporate the offset of
+ the cursor within the preedit area, as controlled by QInputMethodEvent::Cursor.
\value ImSurroundingText The plain text around the input area, for example the current paragraph.
\value ImCurrentSelection The currently selected text.
\value ImMaximumTextLength The maximum number of characters that the widget can hold. If there is no limit,
@@ -2670,7 +2671,9 @@
\value ImHints The hints for input method on expected input. (See Qt::InputMethodHints)
\value ImPreferredLanguage The preferred input language.
\value ImPlatformData Platform specific data for input method.
- \value ImAbsolutePosition The logical position of the cursor within the entire document.
+ \value ImAbsolutePosition The logical position of the cursor within the entire document. The position does
+ not incorporate the offset of the cursor within the preedit area, as controlled
+ by QInputMethodEvent::Cursor.
\value ImTextBeforeCursor The plain text before the cursor. The widget can decide how much text to return,
but \b{must} not return an empty string unless the cursor is at the start of the document.
\value ImTextAfterCursor The plain text after the cursor. The widget can decide how much text to return,
diff --git a/src/corelib/global/qnativeinterface.h b/src/corelib/global/qnativeinterface.h
index 5e5c78beec..56805d5a6e 100644
--- a/src/corelib/global/qnativeinterface.h
+++ b/src/corelib/global/qnativeinterface.h
@@ -69,6 +69,8 @@ QT_BEGIN_NAMESPACE
template <typename> \
friend struct QNativeInterface::Private::TypeInfo; \
public: \
+ NativeInterface() = default; \
+ Q_DISABLE_COPY_MOVE(NativeInterface)
// Revisioned interfaces only make sense when exposed through a base
// type via QT_DECLARE_NATIVE_INTERFACE_ACCESSOR, as the revision
@@ -163,6 +165,11 @@ namespace QNativeInterface::Private {
} // QNativeInterface::Private
// Declares an accessor for the native interface
+#ifdef Q_QDOC
+#define QT_DECLARE_NATIVE_INTERFACE_ACCESSOR(T) \
+ template <typename QNativeInterface> \
+ QNativeInterface *nativeInterface() const;
+#else
#define QT_DECLARE_NATIVE_INTERFACE_ACCESSOR(T) \
template <typename NativeInterface, typename TypeInfo = QNativeInterface::Private::NativeInterface<NativeInterface>, \
typename BaseType = T, std::enable_if_t<TypeInfo::template isCompatibleWith<T>, bool> = true> \
@@ -174,6 +181,7 @@ namespace QNativeInterface::Private {
protected: \
void *resolveInterface(const char *name, int revision) const; \
public:
+#endif
// Provides a definition for the interface destructor
#define QT_DEFINE_NATIVE_INTERFACE_2(Namespace, InterfaceClass) \
diff --git a/src/corelib/global/qoperatingsystemversion.cpp b/src/corelib/global/qoperatingsystemversion.cpp
index 3603852c82..61f64306e2 100644
--- a/src/corelib/global/qoperatingsystemversion.cpp
+++ b/src/corelib/global/qoperatingsystemversion.cpp
@@ -49,7 +49,7 @@
#include <qversionnumber.h>
#include <qdebug.h>
-#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
+#ifdef Q_OS_ANDROID
#include <QJniObject>
#endif
@@ -93,7 +93,8 @@ QT_BEGIN_NAMESPACE
\row
\li Windows
\li dwMajorVersion, dwMinorVersion, and dwBuildNumber from
- \l{https://msdn.microsoft.com/en-us/library/mt723418.aspx}{RtlGetVersion} -
+ \l{https://docs.microsoft.com/en-us/windows/win32/devnotes/rtlgetversion}
+ {RtlGetVersion} -
note that this function ALWAYS return the version number of the
underlying operating system, as opposed to the shim underneath
GetVersionEx that hides the real version number if the
@@ -155,7 +156,7 @@ QOperatingSystemVersion QOperatingSystemVersion::current()
{
QOperatingSystemVersion version;
version.m_os = currentType();
-#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
+#ifdef Q_OS_ANDROID
#ifndef QT_BOOTSTRAPPED
const QVersionNumber v = QVersionNumber::fromString(QJniObject::getStaticObjectField(
"android/os/Build$VERSION", "RELEASE", "Ljava/lang/String;").toString());
diff --git a/src/corelib/global/qoperatingsystemversion_win.cpp b/src/corelib/global/qoperatingsystemversion_win.cpp
index eb58b60788..c514aaf54d 100644
--- a/src/corelib/global/qoperatingsystemversion_win.cpp
+++ b/src/corelib/global/qoperatingsystemversion_win.cpp
@@ -90,25 +90,13 @@ OSVERSIONINFOEX qWindowsVersionInfo()
result.wServicePackMinor = 0;
const QByteArray winVerOverride = qgetenv("QT_WINVER_OVERRIDE");
- if (winVerOverride == "WINDOWS7" || winVerOverride == "2008_R2") {
- result.dwMajorVersion = 6;
- result.dwMinorVersion = 1;
- } else if (winVerOverride == "WINDOWS8" || winVerOverride == "2012") {
- result.dwMajorVersion = 6;
- result.dwMinorVersion = 2;
- } else if (winVerOverride == "WINDOWS8_1" || winVerOverride == "2012_R2") {
- result.dwMajorVersion = 6;
- result.dwMinorVersion = 3;
- } else if (winVerOverride == "WINDOWS10" || winVerOverride == "2016") {
+ if (winVerOverride == "WINDOWS10" || winVerOverride == "2016") {
result.dwMajorVersion = 10;
} else {
return realResult;
}
- if (winVerOverride == "2008_R2"
- || winVerOverride == "2012"
- || winVerOverride == "2012_R2"
- || winVerOverride == "2016") {
+ if (winVerOverride == "2016") {
// If the current host OS is a domain controller and the override OS
// is also a server type OS, preserve that information
if (result.wProductType == VER_NT_WORKSTATION)
diff --git a/src/corelib/global/qprocessordetection.h b/src/corelib/global/qprocessordetection.h
index f7bca43345..72cc0b4ad4 100644
--- a/src/corelib/global/qprocessordetection.h
+++ b/src/corelib/global/qprocessordetection.h
@@ -340,6 +340,10 @@
# define Q_PROCESSOR_WASM
# define Q_BYTE_ORDER Q_LITTLE_ENDIAN
# define Q_PROCESSOR_WORDSIZE 8
+#ifdef QT_COMPILER_SUPPORTS_SSE2
+# define Q_PROCESSOR_X86 6 // enables SIMD support
+#endif
+
#endif
/*
diff --git a/src/corelib/global/qrandom.cpp b/src/corelib/global/qrandom.cpp
index b699dcbece..34df85133b 100644
--- a/src/corelib/global/qrandom.cpp
+++ b/src/corelib/global/qrandom.cpp
@@ -231,7 +231,7 @@ static void fallback_fill(quint32 *ptr, qsizetype left) noexcept
static QBasicAtomicInteger<unsigned> seed = Q_BASIC_ATOMIC_INITIALIZER(0U);
static void fallback_update_seed(unsigned value)
{
- // Update the seed to be used for the fallback mechansim, if we need to.
+ // Update the seed to be used for the fallback mechanism, if we need to.
// We can't use QtPrivate::QHashCombine here because that is not an atomic
// operation. A simple XOR will have to do then.
seed.fetchAndXorRelaxed(value);
@@ -671,7 +671,7 @@ inline QRandomGenerator::SystemGenerator &QRandomGenerator::SystemGenerator::sel
position in the deterministic sequence as the \a other object was. Both
objects will generate the same sequence from this point on.
- For that reason, it is not adviseable to create a copy of
+ For that reason, it is not advisable to create a copy of
QRandomGenerator::global(). If one needs an exclusive deterministic
generator, consider instead using securelySeeded() to obtain a new object
that shares no relationship with the QRandomGenerator::global().
diff --git a/src/corelib/global/qsimd_p.h b/src/corelib/global/qsimd_p.h
index 35979176fa..118a62e6ac 100644
--- a/src/corelib/global/qsimd_p.h
+++ b/src/corelib/global/qsimd_p.h
@@ -190,10 +190,13 @@
# define __SSE__ 1
# endif
-# if defined(Q_CC_GNU) && !defined(Q_CC_INTEL)
+# if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_OS_WASM)
// GCC 4.4 and Clang 2.8 added a few more intrinsics there
# include <x86intrin.h>
# endif
+#ifdef Q_OS_WASM
+# include <immintrin.h>
+# endif
# if defined(__SSE4_2__) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS) && (defined(Q_CC_INTEL) || defined(Q_CC_MSVC))
// POPCNT instructions:
diff --git a/src/corelib/global/qt_pch.h b/src/corelib/global/qt_pch.h
index 6108b075f0..eccb7ba169 100644
--- a/src/corelib/global/qt_pch.h
+++ b/src/corelib/global/qt_pch.h
@@ -72,7 +72,7 @@ __declspec(selectany) auto *__wmemchr_symbol_loader_value = wmemchr(L"", L'0', 0
# include <qcoreevent.h>
# include <qiodevice.h>
# include <qlist.h>
-# include <qvariant.h> /* All moc genereated code has this include */
+# include <qvariant.h> /* All moc generated code has this include */
# include <qobject.h>
# if QT_CONFIG(regularexpression)
# include <qregularexpression.h>
diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h
index 58f20b7be4..7759eff370 100644
--- a/src/corelib/global/qtypeinfo.h
+++ b/src/corelib/global/qtypeinfo.h
@@ -311,6 +311,8 @@ using expand_operator_less_than_recursive = std::conjunction<expand_operator_les
template<typename T>
struct expand_operator_less_than_tuple : has_operator_less_than<T> {};
+template<typename T>
+struct expand_operator_less_than_tuple<std::optional<T>> : has_operator_less_than<T> {};
template<typename T1, typename T2>
struct expand_operator_less_than_tuple<std::pair<T1, T2>> : expand_operator_less_than_recursive<T1, T2> {};
template<typename ...T>
@@ -335,17 +337,29 @@ struct has_operator_equal : detail::expand_operator_equal<T> {};
template<typename T>
inline constexpr bool has_operator_equal_v = has_operator_equal<T>::value;
+template <typename Container, typename T>
+using has_operator_equal_container = std::disjunction<std::is_base_of<Container, T>, QTypeTraits::has_operator_equal<T>>;
+
template<typename T>
struct has_operator_less_than : detail::expand_operator_less_than<T> {};
template<typename T>
inline constexpr bool has_operator_less_than_v = has_operator_less_than<T>::value;
+template <typename Container, typename T>
+using has_operator_less_than_container = std::disjunction<std::is_base_of<Container, T>, QTypeTraits::has_operator_less_than<T>>;
+
template <typename ...T>
using compare_eq_result = std::enable_if_t<std::conjunction_v<QTypeTraits::has_operator_equal<T>...>, bool>;
+template <typename Container, typename ...T>
+using compare_eq_result_container = std::enable_if_t<std::conjunction_v<QTypeTraits::has_operator_equal_container<Container, T>...>, bool>;
+
template <typename ...T>
using compare_lt_result = std::enable_if_t<std::conjunction_v<QTypeTraits::has_operator_less_than<T>...>, bool>;
+template <typename Container, typename ...T>
+using compare_lt_result_container = std::enable_if_t<std::conjunction_v<QTypeTraits::has_operator_less_than_container<Container, T>...>, bool>;
+
namespace detail {
template<typename T>
@@ -363,6 +377,9 @@ struct has_ostream_operator<Stream, T, std::void_t<decltype(detail::reference<St
template <typename Stream, typename T>
inline constexpr bool has_ostream_operator_v = has_ostream_operator<Stream, T>::value;
+template <typename Stream, typename Container, typename T>
+using has_ostream_operator_container = std::disjunction<std::is_base_of<Container, T>, QTypeTraits::has_ostream_operator<Stream, T>>;
+
template <typename Stream, typename, typename = void>
struct has_istream_operator : std::false_type {};
template <typename Stream, typename T>
@@ -370,6 +387,8 @@ struct has_istream_operator<Stream, T, std::void_t<decltype(detail::reference<St
: std::true_type {};
template <typename Stream, typename T>
inline constexpr bool has_istream_operator_v = has_istream_operator<Stream, T>::value;
+template <typename Stream, typename Container, typename T>
+using has_istream_operator_container = std::disjunction<std::is_base_of<Container, T>, QTypeTraits::has_istream_operator<Stream, T>>;
template <typename Stream, typename T>
inline constexpr bool has_stream_operator_v = has_ostream_operator_v<Stream, T> && has_istream_operator_v<Stream, T>;
diff --git a/src/corelib/global/qversiontagging.cpp b/src/corelib/global/qversiontagging.cpp
index b5e524bf4c..a0d15ae871 100644
--- a/src/corelib/global/qversiontagging.cpp
+++ b/src/corelib/global/qversiontagging.cpp
@@ -102,7 +102,6 @@ make_versioned_symbol(SYM, QT_VERSION_MAJOR, 14, "@");
make_versioned_symbol(SYM, QT_VERSION_MAJOR, 15, "@");
#endif
#if QT_VERSION_MINOR > 16
-// We don't expect there will be a Qt 5.17
# error "Please update this file with more Qt versions."
#endif
diff --git a/src/corelib/io/qabstractfileengine.cpp b/src/corelib/io/qabstractfileengine.cpp
index 44d5d1b76f..0e2bd57cb6 100644
--- a/src/corelib/io/qabstractfileengine.cpp
+++ b/src/corelib/io/qabstractfileengine.cpp
@@ -1201,7 +1201,7 @@ qint64 QAbstractFileEngine::readLine(char *data, qint64 maxlen)
QIODevice can provide a faster implementation by making use of its
internal buffer. For engines that already provide a fast readLine()
implementation, returning false for this extension can avoid
- unnnecessary double-buffering in QIODevice.
+ unnecessary double-buffering in QIODevice.
\value MapExtension Whether the file engine provides the ability to map
a file to memory.
diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp
index 1889a4c3a2..a7ce66ad14 100644
--- a/src/corelib/io/qdebug.cpp
+++ b/src/corelib/io/qdebug.cpp
@@ -856,6 +856,14 @@ QDebug &QDebug::resetFormat()
*/
/*!
+ \fn template <class Key, class T> QDebug operator<<(QDebug debug, const QMultiMap<Key, T> &map)
+ \relates QDebug
+
+ Writes the contents of \a map to \a debug. Both \c Key and
+ \c T need to support streaming into QDebug.
+*/
+
+/*!
\fn template <typename Key, typename T, typename Compare, typename Alloc> QDebug operator<<(QDebug debug, const std::map<Key, T, Compare, Alloc> &map)
\relates QDebug
\since 5.7
@@ -882,6 +890,14 @@ QDebug &QDebug::resetFormat()
*/
/*!
+ \fn template <class Key, class T> QDebug operator<<(QDebug debug, const QMultiHash<Key, T> &hash)
+ \relates QDebug
+
+ Writes the contents of \a hash to \a debug. Both \c Key and
+ \c T need to support streaming into QDebug.
+*/
+
+/*!
\fn template <class T1, class T2> QDebug operator<<(QDebug debug, const QPair<T1, T2> &pair)
\relates QDebug
@@ -890,6 +906,22 @@ QDebug &QDebug::resetFormat()
*/
/*!
+ \fn template <class T1, class T2> QDebug operator<<(QDebug debug, const std::pair<T1, T2> &pair)
+ \relates QDebug
+
+ Writes the contents of \a pair to \a debug. Both \c T1 and
+ \c T2 need to support streaming into QDebug.
+*/
+
+/*!
+ \fn template <typename T> QDebug operator<<(QDebug debug, const QContiguousCache<T> &cache)
+ \relates QDebug
+
+ Writes the contents of \a cache to \a debug. \c T needs to
+ support streaming into QDebug.
+*/
+
+/*!
\fn template<typename T> QDebug operator<<(QDebug debug, const QFlags<T> &flags)
\relates QDebug
\since 4.7
diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h
index 71ad610e19..bfcdf42f0d 100644
--- a/src/corelib/io/qdebug.h
+++ b/src/corelib/io/qdebug.h
@@ -244,8 +244,14 @@ template<typename ...T>
using QDebugIfHasDebugStream =
std::enable_if_t<std::conjunction_v<QTypeTraits::has_ostream_operator<QDebug, T>...>, QDebug>;
+template<typename Container, typename ...T>
+using QDebugIfHasDebugStreamContainer =
+ std::enable_if_t<std::conjunction_v<QTypeTraits::has_ostream_operator_container<QDebug, Container, T>...>, QDebug>;
+
+#ifndef Q_CLANG_QDOC
+
template<typename T>
-inline QDebugIfHasDebugStream<T> operator<<(QDebug debug, const QList<T> &vec)
+inline QDebugIfHasDebugStreamContainer<QList<T>, T> operator<<(QDebug debug, const QList<T> &vec)
{
return QtPrivate::printSequentialContainer(debug, "QList", vec);
}
@@ -281,25 +287,25 @@ inline QDebugIfHasDebugStream<Key, T> operator<<(QDebug debug, const std::multim
}
template <class Key, class T>
-inline QDebugIfHasDebugStream<Key, T> operator<<(QDebug debug, const QMap<Key, T> &map)
+inline QDebugIfHasDebugStreamContainer<QMap<Key, T>, Key, T> operator<<(QDebug debug, const QMap<Key, T> &map)
{
return QtPrivate::printAssociativeContainer(debug, "QMap", map);
}
template <class Key, class T>
-inline QDebugIfHasDebugStream<Key, T> operator<<(QDebug debug, const QMultiMap<Key, T> &map)
+inline QDebugIfHasDebugStreamContainer<QMultiMap<Key, T>, Key, T> operator<<(QDebug debug, const QMultiMap<Key, T> &map)
{
return QtPrivate::printAssociativeContainer(debug, "QMultiMap", map);
}
template <class Key, class T>
-inline QDebugIfHasDebugStream<Key, T> operator<<(QDebug debug, const QHash<Key, T> &hash)
+inline QDebugIfHasDebugStreamContainer<QHash<Key, T>, Key, T> operator<<(QDebug debug, const QHash<Key, T> &hash)
{
return QtPrivate::printAssociativeContainer(debug, "QHash", hash);
}
template <class Key, class T>
-inline QDebugIfHasDebugStream<Key, T> operator<<(QDebug debug, const QMultiHash<Key, T> &hash)
+inline QDebugIfHasDebugStreamContainer<QMultiHash<Key, T>, Key, T> operator<<(QDebug debug, const QMultiHash<Key, T> &hash)
{
return QtPrivate::printAssociativeContainer(debug, "QMultiHash", hash);
}
@@ -313,7 +319,7 @@ inline QDebugIfHasDebugStream<T1, T2> operator<<(QDebug debug, const std::pair<T
}
template <typename T>
-inline QDebugIfHasDebugStream<T> operator<<(QDebug debug, const QSet<T> &set)
+inline QDebugIfHasDebugStreamContainer<QSet<T>, T> operator<<(QDebug debug, const QSet<T> &set)
{
return QtPrivate::printSequentialContainer(debug, "QSet", set);
}
@@ -332,6 +338,51 @@ inline QDebugIfHasDebugStream<T> operator<<(QDebug debug, const QContiguousCache
return debug;
}
+#else
+template <class T>
+QDebug operator<<(QDebug debug, const QList<T> &list);
+
+template <class T, qsizetype P>
+QDebug operator<<(QDebug debug, const QVarLengthArray<T, P> &array);
+
+template <typename T, typename Alloc>
+QDebug operator<<(QDebug debug, const std::vector<T, Alloc> &vec);
+
+template <typename T, typename Alloc>
+QDebug operator<<(QDebug debug, const std::list<T, Alloc> &vec);
+
+template <typename Key, typename T, typename Compare, typename Alloc>
+QDebug operator<<(QDebug debug, const std::map<Key, T, Compare, Alloc> &map);
+
+template <typename Key, typename T, typename Compare, typename Alloc>
+QDebug operator<<(QDebug debug, const std::multimap<Key, T, Compare, Alloc> &map);
+
+template <class Key, class T>
+QDebug operator<<(QDebug debug, const QMap<Key, T> &map);
+
+template <class Key, class T>
+QDebug operator<<(QDebug debug, const QMultiMap<Key, T> &map);
+
+template <class Key, class T>
+QDebug operator<<(QDebug debug, const QHash<Key, T> &hash);
+
+template <class Key, class T>
+QDebug operator<<(QDebug debug, const QMultiHash<Key, T> &hash);
+
+template <typename T>
+QDebug operator<<(QDebug debug, const QSet<T> &set);
+
+template <class T1, class T2>
+QDebug operator<<(QDebug debug, const QPair<T1, T2> &pair);
+
+template <class T1, class T2>
+QDebug operator<<(QDebug debug, const std::pair<T1, T2> &pair);
+
+template <typename T>
+QDebug operator<<(QDebug debug, const QContiguousCache<T> &cache);
+
+#endif // Q_CLANG_QDOC
+
template <class T>
inline QDebug operator<<(QDebug debug, const QSharedPointer<T> &ptr)
{
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index 76336ef384..fb34aa7382 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -177,10 +177,8 @@ inline QStringList QDirPrivate::splitFilters(const QString &nameFilter, QChar se
{
if (sep.isNull())
sep = getFilterSepChar(nameFilter);
- const auto split = QStringView{nameFilter}.split(sep);
QStringList ret;
- ret.reserve(split.size());
- for (const auto &e : split)
+ for (auto e : qTokenize(nameFilter, sep))
ret.append(e.trimmed().toString());
return ret;
}
@@ -1099,7 +1097,7 @@ void QDir::setSearchPaths(const QString &prefix, const QStringList &searchPaths)
}
QWriteLocker lock(&QCoreGlobalData::instance()->dirSearchPathsLock);
- QMap<QString, QStringList> &paths = QCoreGlobalData::instance()->dirSearchPaths;
+ QHash<QString, QStringList> &paths = QCoreGlobalData::instance()->dirSearchPaths;
if (searchPaths.isEmpty()) {
paths.remove(prefix);
} else {
@@ -1206,9 +1204,9 @@ QDir::Filters QDir::filter() const
files that the application can read, write, or execute, and symlinks
to such files/directories can be listed.
- To retrieve the permissons for a directory, use the
+ To retrieve the permissions for a directory, use the
entryInfoList() function to get the associated QFileInfo objects
- and then use the QFileInfo::permissons() to obtain the permissions
+ and then use the QFileInfo::permissions() to obtain the permissions
and ownership for each file.
*/
@@ -1944,6 +1942,8 @@ QFileInfoList QDir::drives()
Returns \c true if the directory was successfully changed; otherwise
returns \c false.
+ \snippet code/src_corelib_io_qdir.cpp 16
+
\sa current(), currentPath(), home(), root(), temp()
*/
bool QDir::setCurrent(const QString &path)
@@ -2256,7 +2256,7 @@ QString qt_normalizePathSegments(const QString &name, QDirPrivate::PathNormaliza
if (prefixLength) {
if (!isEmpty && out[used] == '/') {
- // Eventhough there is a prefix the out string is a slash. This happens, if the input
+ // Even though there is a prefix the out string is a slash. This happens, if the input
// string only consists of a prefix followed by one or more slashes. Just skip the slash.
++used;
}
@@ -2283,8 +2283,10 @@ QString qt_normalizePathSegments(const QString &name, QDirPrivate::PathNormaliza
static QString qt_cleanPath(const QString &path, bool *ok)
{
- if (path.isEmpty())
+ if (path.isEmpty()) {
+ Q_ASSERT(!ok); // The only caller passing ok knows its path is non-empty
return path;
+ }
QString name = QDir::fromNativeSeparators(path);
QString ret = qt_normalizePathSegments(name, OSSupportsUncPaths ? QDirPrivate::AllowUncPaths : QDirPrivate::DefaultNormalization, ok);
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp
index e031e9c091..471d73fcb6 100644
--- a/src/corelib/io/qfile.cpp
+++ b/src/corelib/io/qfile.cpp
@@ -1173,6 +1173,46 @@ qint64 QFile::size() const
\since 6.0
\overload
*/
+/*!
+ \fn bool exists(const std::filesystem::path &fileName)
+ \since 6.3
+ \overload
+*/
+/*!
+ \fn std::filesystem::path QFile::filesystemSymLinkTarget() const
+ \since 6.3
+ Returns symLinkTarget() as \c{std::filesystem::path}.
+*/
+/*!
+ \fn std::filesystem::path QFile::filesystemSymLinkTarget(const std::filesystem::path &fileName)
+ \since 6.3
+ Returns symLinkTarget() as \c{std::filesystem::path} of \a fileName.
+*/
+/*!
+ \fn bool remove(const std::filesystem::path &fileName)
+ \since 6.3
+ \overload
+*/
+/*!
+ \fn bool moveToTrash(const std::filesystem::path &fileName, QString *pathInTrash)
+ \since 6.3
+ \overload
+*/
+/*!
+ \fn bool rename(const std::filesystem::path &oldName, const std::filesystem::path &newName)
+ \since 6.3
+ \overload
+*/
+/*!
+ \fn bool link(const std::filesystem::path &fileName, const std::filesystem::path &newName);
+ \since 6.3
+ \overload
+*/
+/*!
+ \fn bool copy(const std::filesystem::path &fileName, const std::filesystem::path &newName);
+ \since 6.3
+ \overload
+*/
QT_END_NAMESPACE
diff --git a/src/corelib/io/qfile.h b/src/corelib/io/qfile.h
index 2074bd1cc4..70b094d3a9 100644
--- a/src/corelib/io/qfile.h
+++ b/src/corelib/io/qfile.h
@@ -172,51 +172,116 @@ public:
bool exists() const;
static bool exists(const QString &fileName);
+#ifdef Q_CLANG_QDOC
+ static bool exists(const std::filesystem::path &fileName);
+#elif QT_CONFIG(cxx17_filesystem)
+ template<typename T, QtPrivate::ForceFilesystemPath<T> = 0>
+ static bool exists(const T &fileName)
+ {
+ return exists(QtPrivate::fromFilesystemPath(fileName));
+ }
+#endif // QT_CONFIG(cxx17_filesystem)
QString symLinkTarget() const;
static QString symLinkTarget(const QString &fileName);
+#ifdef Q_CLANG_QDOC
+ std::filesystem::path filesystemSymLinkTarget() const;
+ static std::filesystem::path filesystemSymLinkTarget(const std::filesystem::path &fileName);
+#elif QT_CONFIG(cxx17_filesystem)
+ std::filesystem::path filesystemSymLinkTarget() const
+ {
+ return QtPrivate::toFilesystemPath(symLinkTarget());
+ }
+ template<typename T, QtPrivate::ForceFilesystemPath<T> = 0>
+ static std::filesystem::path filesystemSymLinkTarget(const T &fileName)
+ {
+ return QtPrivate::toFilesystemPath(symLinkTarget(QtPrivate::fromFilesystemPath(fileName)));
+ }
+#endif // QT_CONFIG(cxx17_filesystem)
bool remove();
static bool remove(const QString &fileName);
+#ifdef Q_CLANG_QDOC
+ static bool remove(const std::filesystem::path &fileName);
+#elif QT_CONFIG(cxx17_filesystem)
+ template<typename T, QtPrivate::ForceFilesystemPath<T> = 0>
+ static bool remove(const T &fileName)
+ {
+ return remove(QtPrivate::fromFilesystemPath(fileName));
+ }
+#endif // QT_CONFIG(cxx17_filesystem)
bool moveToTrash();
static bool moveToTrash(const QString &fileName, QString *pathInTrash = nullptr);
+#ifdef Q_CLANG_QDOC
+ static bool moveToTrash(const std::filesystem::path &fileName, QString *pathInTrash = nullptr);
+#elif QT_CONFIG(cxx17_filesystem)
+ template<typename T, QtPrivate::ForceFilesystemPath<T> = 0>
+ static bool moveToTrash(const T &fileName, QString *pathInTrash = nullptr)
+ {
+ return moveToTrash(QtPrivate::fromFilesystemPath(fileName), pathInTrash);
+ }
+#endif // QT_CONFIG(cxx17_filesystem)
bool rename(const QString &newName);
+ static bool rename(const QString &oldName, const QString &newName);
#ifdef Q_CLANG_QDOC
bool rename(const std::filesystem::path &newName);
+ static bool rename(const std::filesystem::path &oldName,
+ const std::filesystem::path &newName);
#elif QT_CONFIG(cxx17_filesystem)
template<typename T, QtPrivate::ForceFilesystemPath<T> = 0>
bool rename(const T &newName)
{
return rename(QtPrivate::fromFilesystemPath(newName));
}
+ template<typename T, QtPrivate::ForceFilesystemPath<T> = 0>
+ static bool rename(const T &oldName, const T &newName)
+ {
+ return rename(QtPrivate::fromFilesystemPath(oldName),
+ QtPrivate::fromFilesystemPath(newName));
+ }
#endif // QT_CONFIG(cxx17_filesystem)
- static bool rename(const QString &oldName, const QString &newName);
bool link(const QString &newName);
+ static bool link(const QString &fileName, const QString &newName);
#ifdef Q_CLANG_QDOC
bool link(const std::filesystem::path &newName);
+ static bool link(const std::filesystem::path &fileName,
+ const std::filesystem::path &newName);
#elif QT_CONFIG(cxx17_filesystem)
template<typename T, QtPrivate::ForceFilesystemPath<T> = 0>
bool link(const T &newName)
{
return link(QtPrivate::fromFilesystemPath(newName));
}
+ template<typename T, QtPrivate::ForceFilesystemPath<T> = 0>
+ static bool link(const T &fileName, const T &newName)
+ {
+ return link(QtPrivate::fromFilesystemPath(fileName),
+ QtPrivate::fromFilesystemPath(newName));
+ }
#endif // QT_CONFIG(cxx17_filesystem)
- static bool link(const QString &oldname, const QString &newName);
bool copy(const QString &newName);
+ static bool copy(const QString &fileName, const QString &newName);
#ifdef Q_CLANG_QDOC
bool copy(const std::filesystem::path &newName);
+ static bool copy(const std::filesystem::path &fileName,
+ const std::filesystem::path &newName);
#elif QT_CONFIG(cxx17_filesystem)
template<typename T, QtPrivate::ForceFilesystemPath<T> = 0>
bool copy(const T &newName)
{
return copy(QtPrivate::fromFilesystemPath(newName));
}
+ template<typename T, QtPrivate::ForceFilesystemPath<T> = 0>
+ static bool copy(const T &fileName, const T &newName)
+ {
+ return copy(QtPrivate::fromFilesystemPath(fileName),
+ QtPrivate::fromFilesystemPath(newName));
+ }
#endif // QT_CONFIG(cxx17_filesystem)
- static bool copy(const QString &fileName, const QString &newName);
bool open(OpenMode flags) override;
bool open(FILE *f, OpenMode ioFlags, FileHandleFlags handleFlags=DontCloseHandle);
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp
index 8f2eecc22a..8ff8896aab 100644
--- a/src/corelib/io/qfileinfo.cpp
+++ b/src/corelib/io/qfileinfo.cpp
@@ -130,11 +130,11 @@ uint QFileInfoPrivate::getFileFlags(QAbstractFileEngine::FileFlags request) cons
Q_ASSERT(fileEngine); // should never be called when using the native FS
// We split the testing into tests for for LinkType, BundleType, PermsMask
// and the rest.
- // Tests for file permissions on Windows can be slow, expecially on network
+ // Tests for file permissions on Windows can be slow, especially on network
// paths and NTFS drives.
// In order to determine if a file is a symlink or not, we have to lstat().
// If we're not interested in that information, we might as well avoid one
- // extra syscall. Bundle detecton on Mac can be slow, expecially on network
+ // extra syscall. Bundle detecton on Mac can be slow, especially on network
// paths, so we separate out that as well.
QAbstractFileEngine::FileFlags req;
@@ -1677,7 +1677,7 @@ QDebug operator<<(QDebug dbg, const QFileInfo &fi)
QDirIterator it(dir);
while (it.hasNext()) {
// Implicit conversion from QString (returned by it.next()):
- // may create unnecessary data strucutres and cause additional
+ // may create unnecessary data structures and cause additional
// accesses to the file system. Unless this macro is defined,
// this line does not compile.
diff --git a/src/corelib/io/qfilesystemengine_p.h b/src/corelib/io/qfilesystemengine_p.h
index b5daa3b88e..0b6f0fbd84 100644
--- a/src/corelib/io/qfilesystemengine_p.h
+++ b/src/corelib/io/qfilesystemengine_p.h
@@ -144,6 +144,7 @@ public:
QAbstractFileEngine::FileTime whatTime, QSystemError &error);
static QString owner(const QFileSystemEntry &entry, QAbstractFileEngine::FileOwner own);
static QString nativeAbsoluteFilePath(const QString &path);
+ static bool isDirPath(const QString &path, bool *existed);
#endif
//homePath, rootPath and tempPath shall return clean paths
static QString homePath();
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp
index c8d7170b64..054e9ed2fe 100644
--- a/src/corelib/io/qfilesystemengine_unix.cpp
+++ b/src/corelib/io/qfilesystemengine_unix.cpp
@@ -406,10 +406,7 @@ bool QFileSystemEngine::fillMetaData(int fd, QFileSystemMetaData &data)
data.entryFlags &= ~QFileSystemMetaData::PosixStatFlags;
data.knownFlagsMask |= QFileSystemMetaData::PosixStatFlags;
- union {
- struct statx statxBuffer;
- QT_STATBUF statBuffer;
- };
+ struct statx statxBuffer;
int ret = qt_fstatx(fd, &statxBuffer);
if (ret != -ENOSYS) {
@@ -420,6 +417,8 @@ bool QFileSystemEngine::fillMetaData(int fd, QFileSystemMetaData &data)
return false;
}
+ QT_STATBUF statBuffer;
+
if (QT_FSTAT(fd, &statBuffer) == 0) {
data.fillFromStatBuf(statBuffer);
return true;
@@ -1124,6 +1123,8 @@ static bool createDirectoryWithParents(const QByteArray &nativeName, bool should
if (shouldMkdirFirst && QT_MKDIR(nativeName, 0777) == 0)
return true;
+ if (errno == EISDIR)
+ return true;
if (errno == EEXIST)
return isDir(nativeName);
if (errno != ENOENT)
diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp
index 075ce0ffac..9e009a05e7 100644
--- a/src/corelib/io/qfilesystemengine_win.cpp
+++ b/src/corelib/io/qfilesystemengine_win.cpp
@@ -627,14 +627,14 @@ QFileSystemEntry QFileSystemEngine::absoluteName(const QFileSystemEntry &entry)
return QFileSystemEntry(ret, QFileSystemEntry::FromInternalPath());
}
-#if defined(Q_CC_MINGW) && WINVER < 0x0602 // Windows 8 onwards
+#if defined(Q_CC_MINGW) && WINVER < 0x0602 && _WIN32_WINNT < _WIN32_WINNT_WIN8 // Windows 8 onwards
typedef struct _FILE_ID_INFO {
ULONGLONG VolumeSerialNumber;
FILE_ID_128 FileId;
} FILE_ID_INFO, *PFILE_ID_INFO;
-#endif // if defined (Q_CC_MINGW) && WINVER < 0x0602
+#endif // if defined(Q_CC_MINGW) && WINVER < 0x0602 && _WIN32_WINNT < _WIN32_WINNT_WIN8
// File ID for Windows up to version 7 and FAT32 drives
static inline QByteArray fileId(HANDLE handle)
@@ -1022,8 +1022,6 @@ bool QFileSystemEngine::fillMetaData(HANDLE fHandle, QFileSystemMetaData &data,
return data.hasFlags(what);
}
-static bool isDirPath(const QString &dirPath, bool *existed);
-
//static
bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemMetaData &data,
QFileSystemMetaData::MetaDataFlags what)
@@ -1037,7 +1035,7 @@ bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemM
// Check for ".lnk": Directories named ".lnk" should be skipped, corrupted
// link files should still be detected as links.
const QString origFilePath = entry.filePath();
- if (origFilePath.endsWith(QLatin1String(".lnk")) && !isDirPath(origFilePath, 0)) {
+ if (origFilePath.endsWith(QLatin1String(".lnk")) && !isDirPath(origFilePath, nullptr)) {
data.entryFlags |= QFileSystemMetaData::WinLnkType;
fname = QFileSystemEntry(readLink(entry));
} else {
@@ -1103,7 +1101,8 @@ static inline bool rmDir(const QString &path)
return ::RemoveDirectory((wchar_t*)QFSFileEnginePrivate::longFileName(path).utf16());
}
-static bool isDirPath(const QString &dirPath, bool *existed)
+//static
+bool QFileSystemEngine::isDirPath(const QString &dirPath, bool *existed)
{
QString path = dirPath;
if (path.length() == 2 && path.at(1) == QLatin1Char(':'))
@@ -1141,7 +1140,7 @@ static bool createDirectoryWithParents(const QString &nativeName, bool shouldMkd
};
const auto isDir = [](const QString &nativeName) {
bool exists = false;
- return isDirPath(nativeName, &exists) && exists;
+ return QFileSystemEngine::isDirPath(nativeName, &exists) && exists;
};
// Do not try to mkdir a UNC root path or a drive letter.
if (isUNCRoot(nativeName) || isDriveName(nativeName))
@@ -1181,7 +1180,7 @@ bool QFileSystemEngine::createDirectory(const QFileSystemEntry &entry, bool crea
// mkpath should return true, if the directory already exists, mkdir false.
if (!createParents)
return false;
- if (lastError == ERROR_ALREADY_EXISTS)
+ if (lastError == ERROR_ALREADY_EXISTS || lastError == ERROR_ACCESS_DENIED)
return isDirPath(dirName, nullptr);
return createDirectoryWithParents(dirName, false);
@@ -1200,7 +1199,7 @@ bool QFileSystemEngine::removeDirectory(const QFileSystemEntry &entry, bool remo
if (chunkRef.length() == 2 && chunkRef.at(0).isLetter() && chunkRef.at(1) == QLatin1Char(':'))
break;
const QString chunk = chunkRef.toString();
- if (!isDirPath(chunk, 0))
+ if (!isDirPath(chunk, nullptr))
return false;
if (!rmDir(chunk))
return oldslash != 0;
diff --git a/src/corelib/io/qfilesystemiterator_win.cpp b/src/corelib/io/qfilesystemiterator_win.cpp
index 1b65ae3c09..ac52dacdce 100644
--- a/src/corelib/io/qfilesystemiterator_win.cpp
+++ b/src/corelib/io/qfilesystemiterator_win.cpp
@@ -59,7 +59,7 @@ QFileSystemIterator::QFileSystemIterator(const QFileSystemEntry &entry, QDir::Fi
{
Q_UNUSED(nameFilters);
Q_UNUSED(flags);
- if (nativePath.endsWith(QLatin1String(".lnk"))) {
+ if (nativePath.endsWith(u".lnk"_qs) && !QFileSystemEngine::isDirPath(dirPath, nullptr)) {
QFileSystemMetaData metaData;
QFileSystemEntry link = QFileSystemEngine::getLinkTarget(entry, metaData);
nativePath = link.nativeFilePath();
diff --git a/src/corelib/io/qfilesystemwatcher_win.cpp b/src/corelib/io/qfilesystemwatcher_win.cpp
index 31c6b747a7..5d8a5b3682 100644
--- a/src/corelib/io/qfilesystemwatcher_win.cpp
+++ b/src/corelib/io/qfilesystemwatcher_win.cpp
@@ -430,8 +430,9 @@ QStringList QWindowsFileSystemWatcherEngine::addPaths(const QStringList &paths,
FindCloseChangeNotification(hit.value().handle);
thread->handles[index] = hit.value().handle = fileHandle;
hit.value().flags = flags;
- thread->pathInfoForHandle.insert(fileHandle, pit.value());
+ auto value = std::move(*pit);
thread->pathInfoForHandle.erase(pit);
+ thread->pathInfoForHandle.insert(fileHandle, std::move(value));
}
}
// In addition, check on flags for sufficient notification attributes
diff --git a/src/corelib/io/qfsfileengine_p.h b/src/corelib/io/qfsfileengine_p.h
index d6e7ecb592..f5236a0156 100644
--- a/src/corelib/io/qfsfileengine_p.h
+++ b/src/corelib/io/qfsfileengine_p.h
@@ -197,7 +197,11 @@ public:
mutable int cachedFd;
mutable DWORD fileAttrib;
#else
- QHash<uchar *, QPair<int /*offset % PageSize*/, size_t /*length + offset % PageSize*/> > maps;
+ struct StartAndLength {
+ int start; // offset % PageSize
+ size_t length; // length + offset % PageSize
+ };
+ QHash<uchar *, StartAndLength> maps;
#endif
int fd;
diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp
index a57d924c12..484a60fb74 100644
--- a/src/corelib/io/qfsfileengine_unix.cpp
+++ b/src/corelib/io/qfsfileengine_unix.cpp
@@ -621,7 +621,7 @@ uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size, QFile::MemoryMapFla
access, sharemode, nativeHandle(), realOffset);
if (MAP_FAILED != mapAddress) {
uchar *address = extra + static_cast<uchar*>(mapAddress);
- maps[address] = QPair<int,size_t>(extra, realSize);
+ maps[address] = {extra, realSize};
return address;
}
@@ -646,18 +646,19 @@ bool QFSFileEnginePrivate::unmap(uchar *ptr)
{
#if !defined(Q_OS_INTEGRITY)
Q_Q(QFSFileEngine);
- if (!maps.contains(ptr)) {
+ const auto it = std::as_const(maps).find(ptr);
+ if (it == maps.cend()) {
q->setError(QFile::PermissionsError, qt_error_string(EACCES));
return false;
}
- uchar *start = ptr - maps[ptr].first;
- size_t len = maps[ptr].second;
+ uchar *start = ptr - it->start;
+ size_t len = it->length;
if (-1 == munmap(start, len)) {
q->setError(QFile::UnspecifiedError, qt_error_string(errno));
return false;
}
- maps.remove(ptr);
+ maps.erase(it);
return true;
#else
return false;
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp
index e95eef225b..e4c3520c44 100644
--- a/src/corelib/io/qfsfileengine_win.cpp
+++ b/src/corelib/io/qfsfileengine_win.cpp
@@ -214,7 +214,7 @@ qint64 QFSFileEnginePrivate::nativeSize() const
// ### Don't flush; for buffered files, we should get away with ftell.
thatQ->flush();
- // Always retrive the current information
+ // Always retrieve the current information
metaData.clearFlags(QFileSystemMetaData::SizeAttribute);
bool filled = false;
if (fileHandle != INVALID_HANDLE_VALUE && openMode != QIODevice::NotOpen )
@@ -871,17 +871,18 @@ uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size,
bool QFSFileEnginePrivate::unmap(uchar *ptr)
{
Q_Q(QFSFileEngine);
- if (!maps.contains(ptr)) {
+ const auto it = std::as_const(maps).find(ptr);
+ if (it == maps.cend()) {
q->setError(QFile::PermissionsError, qt_error_string(ERROR_ACCESS_DENIED));
return false;
}
- uchar *start = ptr - maps[ptr];
+ uchar *start = ptr - *it;
if (!UnmapViewOfFile(start)) {
q->setError(QFile::PermissionsError, qt_error_string());
return false;
}
- maps.remove(ptr);
+ maps.erase(it);
if (maps.isEmpty()) {
::CloseHandle(mapHandle);
mapHandle = NULL;
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index 66274e8115..e362535852 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -120,6 +120,14 @@ static void checkWarnMessage(const QIODevice *device, const char *function, cons
} \
} while (0)
+#define CHECK_LINEMAXLEN(function, returnType) \
+ do { \
+ if (maxSize < 2) { \
+ checkWarnMessage(this, #function, "Called with maxSize < 2"); \
+ return returnType; \
+ } \
+ } while (0)
+
#define CHECK_MAXBYTEARRAYSIZE(function) \
do { \
if (maxSize >= MaxByteArraySize) { \
@@ -543,7 +551,7 @@ void QIODevice::setOpenMode(QIODeviceBase::OpenMode openMode)
{
Q_D(QIODevice);
#if defined QIODEVICE_DEBUG
- printf("%p QIODevice::setOpenMode(0x%x)\n", this, int(openMode));
+ printf("%p QIODevice::setOpenMode(0x%x)\n", this, openMode.toInt());
#endif
d->openMode = openMode;
d->accessMode = QIODevicePrivate::Unset;
@@ -695,8 +703,15 @@ void QIODevice::setCurrentReadChannel(int channel)
void QIODevicePrivate::setReadChannelCount(int count)
{
if (count > readBuffers.size()) {
+ // If readBufferChunkSize is zero, we should bypass QIODevice's
+ // read buffers, even if the QIODeviceBase::Unbuffered flag is not
+ // set when opened. However, if a read transaction is started or
+ // ungetChar() is called, we still have to use the internal buffer.
+ // To support these cases, pass a default value to the QRingBuffer
+ // constructor.
readBuffers.insert(readBuffers.end(), count - readBuffers.size(),
- QRingBuffer(readBufferChunkSize));
+ QRingBuffer(readBufferChunkSize != 0 ? readBufferChunkSize
+ : QIODEVICE_BUFFERSIZE));
} else {
readBuffers.resize(count);
}
@@ -788,7 +803,7 @@ bool QIODevice::open(QIODeviceBase::OpenMode mode)
d->setWriteChannelCount(isWritable() ? 1 : 0);
d->errorString.clear();
#if defined QIODEVICE_DEBUG
- printf("%p QIODevice::open(0x%x)\n", this, quint32(mode));
+ printf("%p QIODevice::open(0x%x)\n", this, mode.toInt());
#endif
return true;
}
@@ -937,7 +952,7 @@ bool QIODevice::atEnd() const
&& bytesAvailable() == 0));
#if defined QIODEVICE_DEBUG
printf("%p QIODevice::atEnd() returns %s, d->openMode == %d, d->pos == %lld\n", this,
- result ? "true" : "false", int(d->openMode), d->pos);
+ result ? "true" : "false", d->openMode.toInt(), d->pos);
#endif
return result;
}
@@ -1011,12 +1026,12 @@ qint64 QIODevice::bytesToWrite() const
qint64 QIODevice::read(char *data, qint64 maxSize)
{
Q_D(QIODevice);
-
#if defined QIODEVICE_DEBUG
printf("%p QIODevice::read(%p, %lld), d->pos = %lld, d->buffer.size() = %lld\n",
this, data, maxSize, d->pos, d->buffer.size());
#endif
+ CHECK_READABLE(read, qint64(-1));
const bool sequential = d->isSequential();
// Short-cut for getChar(), unless we need to keep the data in the buffer.
@@ -1041,8 +1056,6 @@ qint64 QIODevice::read(char *data, qint64 maxSize)
}
CHECK_MAXLEN(read, qint64(-1));
- CHECK_READABLE(read, qint64(-1));
-
const qint64 readBytes = d->read(data, maxSize);
#if defined QIODEVICE_DEBUG
@@ -1062,7 +1075,7 @@ qint64 QIODevicePrivate::read(char *data, qint64 maxSize, bool peeking)
{
Q_Q(QIODevice);
- const bool buffered = (openMode & QIODevice::Unbuffered) == 0;
+ const bool buffered = (readBufferChunkSize != 0 && (openMode & QIODevice::Unbuffered) == 0);
const bool sequential = isSequential();
const bool keepDataInBuffer = sequential
? peeking || transactionStarted
@@ -1115,9 +1128,9 @@ qint64 QIODevicePrivate::read(char *data, qint64 maxSize, bool peeking)
}
} else {
// Do not read more than maxSize on unbuffered devices
- const qint64 bytesToBuffer = (buffered || readBufferChunkSize < maxSize)
- ? qint64(readBufferChunkSize)
- : maxSize;
+ const qint64 bytesToBuffer = (!buffered && maxSize < buffer.chunkSize())
+ ? maxSize
+ : qint64(buffer.chunkSize());
// Try to fill QIODevice buffer by single read
readFromDevice = q->readData(buffer.reserve(bytesToBuffer), bytesToBuffer);
deviceAtEof = (readFromDevice != bytesToBuffer);
@@ -1204,17 +1217,18 @@ qint64 QIODevicePrivate::read(char *data, qint64 maxSize, bool peeking)
QByteArray QIODevice::read(qint64 maxSize)
{
Q_D(QIODevice);
- QByteArray result;
-
#if defined QIODEVICE_DEBUG
printf("%p QIODevice::read(%lld), d->pos = %lld, d->buffer.size() = %lld\n",
this, maxSize, d->pos, d->buffer.size());
#endif
+ QByteArray result;
+ CHECK_READABLE(read, result);
+
// Try to prevent the data from being copied, if we have a chunk
// with the same size in the read buffer.
if (maxSize == d->buffer.nextDataBlockSize() && !d->transactionStarted
- && (d->openMode & (QIODevice::ReadOnly | QIODevice::Text)) == QIODevice::ReadOnly) {
+ && (d->openMode & QIODevice::Text) == 0) {
result = d->buffer.read();
if (!d->isSequential())
d->pos += maxSize;
@@ -1227,7 +1241,7 @@ QByteArray QIODevice::read(qint64 maxSize)
CHECK_MAXBYTEARRAYSIZE(read);
result.resize(int(maxSize));
- qint64 readBytes = read(result.data(), result.size());
+ qint64 readBytes = d->read(result.data(), result.size());
if (readBytes <= 0)
result.clear();
@@ -1254,10 +1268,12 @@ QByteArray QIODevice::readAll()
#endif
QByteArray result;
+ CHECK_READABLE(read, result);
+
qint64 readBytes = (d->isSequential() ? Q_INT64_C(0) : size());
if (readBytes == 0) {
// Size is unknown, read incrementally.
- qint64 readChunkSize = qMax(qint64(d->readBufferChunkSize),
+ qint64 readChunkSize = qMax(qint64(d->buffer.chunkSize()),
d->isSequential() ? (d->buffer.size() - d->transactionPos)
: d->buffer.size());
qint64 readResult;
@@ -1267,10 +1283,10 @@ QByteArray QIODevice::readAll()
break;
}
result.resize(readBytes + readChunkSize);
- readResult = read(result.data() + readBytes, readChunkSize);
+ readResult = d->read(result.data() + readBytes, readChunkSize);
if (readResult > 0 || readBytes == 0) {
readBytes += readResult;
- readChunkSize = d->readBufferChunkSize;
+ readChunkSize = d->buffer.chunkSize();
}
} while (readResult > 0);
} else {
@@ -1280,7 +1296,7 @@ QByteArray QIODevice::readAll()
if (readBytes >= MaxByteArraySize)
return QByteArray();
result.resize(readBytes);
- readBytes = read(result.data(), readBytes);
+ readBytes = d->read(result.data(), readBytes);
}
if (readBytes <= 0)
@@ -1295,7 +1311,7 @@ QByteArray QIODevice::readAll()
This function reads a line of ASCII characters from the device, up
to a maximum of \a maxSize - 1 bytes, stores the characters in \a
data, and returns the number of bytes read. If a line could not be
- read but no error ocurred, this function returns 0. If an error
+ read but no error occurred, this function returns 0. If an error
occurs, this function returns the length of what could be read, or
-1 if nothing was read.
@@ -1335,50 +1351,66 @@ QByteArray QIODevice::readAll()
qint64 QIODevice::readLine(char *data, qint64 maxSize)
{
Q_D(QIODevice);
- if (maxSize < 2) {
- checkWarnMessage(this, "readLine", "Called with maxSize < 2");
- return qint64(-1);
- }
-
#if defined QIODEVICE_DEBUG
printf("%p QIODevice::readLine(%p, %lld), d->pos = %lld, d->buffer.size() = %lld\n",
this, data, maxSize, d->pos, d->buffer.size());
#endif
+ CHECK_READABLE(readLine, qint64(-1));
+ CHECK_LINEMAXLEN(readLine, qint64(-1));
+ const qint64 readBytes = d->readLine(data, maxSize);
+
+#if defined QIODEVICE_DEBUG
+ printf("%p \treturning %lld, d->pos = %lld, d->buffer.size() = %lld, size() = %lld\n",
+ this, readBytes, d->pos, d->buffer.size(), size());
+ debugBinaryString(data, int(readBytes));
+#endif
+
+ return readBytes;
+}
+
+/*!
+ \internal
+*/
+qint64 QIODevicePrivate::readLine(char *data, qint64 maxSize)
+{
+ Q_Q(QIODevice);
+ Q_ASSERT(maxSize >= 2);
+
// Leave room for a '\0'
--maxSize;
- const bool sequential = d->isSequential();
- const bool keepDataInBuffer = sequential && d->transactionStarted;
+ const bool sequential = isSequential();
+ const bool keepDataInBuffer = sequential && transactionStarted;
qint64 readSoFar = 0;
if (keepDataInBuffer) {
- if (d->transactionPos < d->buffer.size()) {
+ if (transactionPos < buffer.size()) {
// Peek line from the specified position
- const qint64 i = d->buffer.indexOf('\n', maxSize, d->transactionPos);
- readSoFar = d->buffer.peek(data, i >= 0 ? (i - d->transactionPos + 1) : maxSize,
- d->transactionPos);
- d->transactionPos += readSoFar;
- if (d->transactionPos == d->buffer.size())
- readData(data, 0);
+ const qint64 i = buffer.indexOf('\n', maxSize, transactionPos);
+ readSoFar = buffer.peek(data, i >= 0 ? (i - transactionPos + 1) : maxSize,
+ transactionPos);
+ transactionPos += readSoFar;
+ if (transactionPos == buffer.size())
+ q->readData(data, 0);
}
- } else if (!d->buffer.isEmpty()) {
+ } else if (!buffer.isEmpty()) {
// QRingBuffer::readLine() terminates the line with '\0'
- readSoFar = d->buffer.readLine(data, maxSize + 1);
- if (d->buffer.isEmpty())
- readData(data, 0);
+ readSoFar = buffer.readLine(data, maxSize + 1);
+ if (buffer.isEmpty())
+ q->readData(data, 0);
if (!sequential)
- d->pos += readSoFar;
+ pos += readSoFar;
}
if (readSoFar) {
#if defined QIODEVICE_DEBUG
- printf("%p \tread from buffer: %lld bytes, last character read: %hhx\n", this,
+ printf("%p \tread from buffer: %lld bytes, last character read: %hhx\n", q,
readSoFar, data[readSoFar - 1]);
debugBinaryString(data, int(readSoFar));
#endif
if (data[readSoFar - 1] == '\n') {
- if (d->openMode & Text) {
+ if (openMode & QIODevice::Text) {
// QRingBuffer::readLine() isn't Text aware.
if (readSoFar > 1 && data[readSoFar - 2] == '\r') {
--readSoFar;
@@ -1390,16 +1422,16 @@ qint64 QIODevice::readLine(char *data, qint64 maxSize)
}
}
- if (d->pos != d->devicePos && !sequential && !seek(d->pos))
+ if (pos != devicePos && !sequential && !q->seek(pos))
return qint64(-1);
- d->baseReadLineDataCalled = false;
+ baseReadLineDataCalled = false;
// Force base implementation for transaction on sequential device
// as it stores the data in internal buffer automatically.
qint64 readBytes = keepDataInBuffer
- ? QIODevice::readLineData(data + readSoFar, maxSize - readSoFar)
- : readLineData(data + readSoFar, maxSize - readSoFar);
+ ? q->QIODevice::readLineData(data + readSoFar, maxSize - readSoFar)
+ : q->readLineData(data + readSoFar, maxSize - readSoFar);
#if defined QIODEVICE_DEBUG
- printf("%p \tread from readLineData: %lld bytes, readSoFar = %lld bytes\n", this,
+ printf("%p \tread from readLineData: %lld bytes, readSoFar = %lld bytes\n", q,
readBytes, readSoFar);
if (readBytes > 0) {
debugBinaryString(data, int(readSoFar + readBytes));
@@ -1410,15 +1442,15 @@ qint64 QIODevice::readLine(char *data, qint64 maxSize)
return readSoFar ? readSoFar : -1;
}
readSoFar += readBytes;
- if (!d->baseReadLineDataCalled && !sequential) {
- d->pos += readBytes;
+ if (!baseReadLineDataCalled && !sequential) {
+ pos += readBytes;
// If the base implementation was not called, then we must
// assume the device position is invalid and force a seek.
- d->devicePos = qint64(-1);
+ devicePos = qint64(-1);
}
data[readSoFar] = '\0';
- if (d->openMode & Text) {
+ if (openMode & QIODevice::Text) {
if (readSoFar > 1 && data[readSoFar - 1] == '\n' && data[readSoFar - 2] == '\r') {
data[readSoFar - 2] = '\n';
data[readSoFar - 1] = '\0';
@@ -1426,11 +1458,6 @@ qint64 QIODevice::readLine(char *data, qint64 maxSize)
}
}
-#if defined QIODEVICE_DEBUG
- printf("%p \treturning %lld, d->pos = %lld, d->buffer.size() = %lld, size() = %lld\n",
- this, readSoFar, d->pos, d->buffer.size(), size());
- debugBinaryString(data, int(readSoFar));
-#endif
return readSoFar;
}
@@ -1447,36 +1474,37 @@ qint64 QIODevice::readLine(char *data, qint64 maxSize)
QByteArray QIODevice::readLine(qint64 maxSize)
{
Q_D(QIODevice);
- QByteArray result;
-
- CHECK_MAXLEN(readLine, result);
- CHECK_MAXBYTEARRAYSIZE(readLine);
-
#if defined QIODEVICE_DEBUG
printf("%p QIODevice::readLine(%lld), d->pos = %lld, d->buffer.size() = %lld\n",
this, maxSize, d->pos, d->buffer.size());
#endif
- result.resize(int(maxSize));
+ QByteArray result;
+ CHECK_READABLE(readLine, result);
+
qint64 readBytes = 0;
- if (!result.size()) {
- // If resize fails or maxSize == 0, read incrementally
- if (maxSize == 0)
- maxSize = MaxByteArraySize - 1;
+ if (maxSize == 0) {
+ // Size is unknown, read incrementally.
+ maxSize = MaxByteArraySize - 1;
// The first iteration needs to leave an extra byte for the terminating null
result.resize(1);
qint64 readResult;
do {
- result.resize(int(qMin(maxSize, qint64(result.size() + d->readBufferChunkSize))));
- readResult = readLine(result.data() + readBytes, result.size() - readBytes);
+ result.resize(int(qMin(maxSize, qint64(result.size() + d->buffer.chunkSize()))));
+ readResult = d->readLine(result.data() + readBytes, result.size() - readBytes);
if (readResult > 0 || readBytes == 0)
readBytes += readResult;
- } while (readResult == d->readBufferChunkSize
+ } while (readResult == d->buffer.chunkSize()
&& result[int(readBytes - 1)] != '\n');
- } else
- readBytes = readLine(result.data(), result.size());
+ } else {
+ CHECK_LINEMAXLEN(readLine, result);
+ CHECK_MAXBYTEARRAYSIZE(readLine);
+
+ result.resize(maxSize);
+ readBytes = d->readLine(result.data(), result.size());
+ }
if (readBytes <= 0)
result.clear();
diff --git a/src/corelib/io/qiodevice_p.h b/src/corelib/io/qiodevice_p.h
index 3639418bbc..83c16eeddc 100644
--- a/src/corelib/io/qiodevice_p.h
+++ b/src/corelib/io/qiodevice_p.h
@@ -180,6 +180,7 @@ public:
void setWriteChannelCount(int count);
qint64 read(char *data, qint64 maxSize, bool peeking = false);
+ qint64 readLine(char *data, qint64 maxSize);
virtual qint64 peek(char *data, qint64 maxSize);
virtual QByteArray peek(qint64 maxSize);
qint64 skipByReading(qint64 maxSize);
diff --git a/src/corelib/io/qipaddress.cpp b/src/corelib/io/qipaddress.cpp
index 15f759156d..93a74ccd09 100644
--- a/src/corelib/io/qipaddress.cpp
+++ b/src/corelib/io/qipaddress.cpp
@@ -1,5 +1,6 @@
/****************************************************************************
**
+** Copyright (C) 2021 The Qt Company Ltd.
** Copyright (C) 2016 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
@@ -86,6 +87,7 @@ static bool parseIp4Internal(IPv4Address &address, const char *ptr, bool acceptL
{
address = 0;
int dotCount = 0;
+ const char *const stop = ptr + qstrlen(ptr);
while (dotCount < 4) {
if (!acceptLeadingZero && *ptr == '0' &&
ptr[1] != '.' && ptr[1] != '\0')
@@ -93,7 +95,7 @@ static bool parseIp4Internal(IPv4Address &address, const char *ptr, bool acceptL
const char *endptr;
bool ok;
- quint64 ll = qstrtoull(ptr, &endptr, 0, &ok);
+ quint64 ll = qstrntoull(ptr, stop - ptr, &endptr, 0, &ok);
quint32 x = ll;
if (!ok || endptr == ptr || ll != x)
return false;
@@ -158,6 +160,7 @@ const QChar *parseIp6(IPv6Address &address, const QChar *begin, const QChar *end
return ret;
const char *ptr = buffer.data();
+ const char *const stop = ptr + buffer.size();
// count the colons
int colonCount = 0;
@@ -213,7 +216,7 @@ const QChar *parseIp6(IPv6Address &address, const QChar *begin, const QChar *end
const char *endptr;
bool ok;
- quint64 ll = qstrtoull(ptr, &endptr, 16, &ok);
+ quint64 ll = qstrntoull(ptr, stop - ptr, &endptr, 16, &ok);
quint16 x = ll;
// Reject malformed fields:
diff --git a/src/corelib/io/qloggingregistry.cpp b/src/corelib/io/qloggingregistry.cpp
index c41e131f79..03c0a538a6 100644
--- a/src/corelib/io/qloggingregistry.cpp
+++ b/src/corelib/io/qloggingregistry.cpp
@@ -55,9 +55,8 @@
// We can't use the default macros because this would lead to recursion.
// Instead let's define our own one that unconditionally logs...
-#define debugMsg QMessageLogger(__FILE__, __LINE__, __FUNCTION__, "qt.core.logging").debug
-#define warnMsg QMessageLogger(__FILE__, __LINE__, __FUNCTION__, "qt.core.logging").warning
-
+#define debugMsg QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC, "qt.core.logging").debug
+#define warnMsg QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC, "qt.core.logging").warning
QT_BEGIN_NAMESPACE
@@ -208,7 +207,7 @@ void QLoggingSettingsParser::setContent(QTextStream &stream)
/*!
\internal
- Parses one line of the configuation file
+ Parses one line of the configuration file
*/
void QLoggingSettingsParser::parseNextLine(QStringView line)
@@ -371,6 +370,20 @@ void QLoggingRegistry::unregisterCategory(QLoggingCategory *cat)
}
/*!
+ \since 6.3
+ \internal
+
+ Registers the environment variable \a environment as the control variable
+ for enabling debugging by default for category \a categoryName. The
+ category name must start with "qt."
+*/
+void QLoggingRegistry::registerEnvironmentOverrideForCategory(QByteArrayView categoryName,
+ QByteArrayView environment)
+{
+ qtCategoryEnvironmentOverrides.insert(categoryName, environment);
+}
+
+/*!
\internal
Installs logging rules as specified in \a content.
*/
@@ -451,8 +464,16 @@ void QLoggingRegistry::defaultCategoryFilter(QLoggingCategory *cat)
// qt.debug=false
if (const char *categoryName = cat->categoryName()) {
// == "qt" or startsWith("qt.")
- if (strcmp(categoryName, "qt") == 0 || strncmp(categoryName, "qt.", 3) == 0)
+ if (strcmp(categoryName, "qt") == 0) {
debug = false;
+ } else if (strncmp(categoryName, "qt.", 3) == 0) {
+ // may be overridden
+ auto it = reg->qtCategoryEnvironmentOverrides.find(categoryName);
+ if (it == reg->qtCategoryEnvironmentOverrides.end())
+ debug = false;
+ else
+ debug = qEnvironmentVariableIntValue(it.value().data());
+ }
}
const auto categoryName = QLatin1String(cat->categoryName());
diff --git a/src/corelib/io/qloggingregistry_p.h b/src/corelib/io/qloggingregistry_p.h
index e8a94a030a..0009d8d2ea 100644
--- a/src/corelib/io/qloggingregistry_p.h
+++ b/src/corelib/io/qloggingregistry_p.h
@@ -63,6 +63,16 @@ class tst_QLoggingRegistry;
QT_BEGIN_NAMESPACE
+#define Q_LOGGING_CATEGORY_WITH_ENV_OVERRIDE(name, env, categoryName) \
+ const QLoggingCategory &name() \
+ { \
+ static constexpr char cname[] = categoryName; \
+ static_assert(cname[0] == 'q' && cname[1] == 't' && cname[2] == '.' \
+ && cname[4] != '\0', "Category name must start with 'qt.'"); \
+ static const QLoggingCategoryWithEnvironmentOverride category(cname, env); \
+ return category; \
+ }
+
class Q_AUTOTEST_EXPORT QLoggingRule
{
public:
@@ -118,6 +128,11 @@ public:
void registerCategory(QLoggingCategory *category, QtMsgType enableForLevel);
void unregisterCategory(QLoggingCategory *category);
+#ifndef QT_BUILD_INTERNAL
+ Q_CORE_EXPORT // always export from QtCore
+#endif
+ void registerEnvironmentOverrideForCategory(QByteArrayView categoryName, QByteArrayView environment);
+
void setApiRules(const QString &content);
QLoggingCategory::CategoryFilter
@@ -146,10 +161,28 @@ private:
QList<QLoggingRule> ruleSets[NumRuleSets];
QHash<QLoggingCategory *, QtMsgType> categories;
QLoggingCategory::CategoryFilter categoryFilter;
+ QMap<QByteArrayView, QByteArrayView> qtCategoryEnvironmentOverrides;
friend class ::tst_QLoggingRegistry;
};
+class QLoggingCategoryWithEnvironmentOverride : public QLoggingCategory
+{
+public:
+ QLoggingCategoryWithEnvironmentOverride(const char *category, const char *env)
+ : QLoggingCategory(registerOverride(category, env), QtInfoMsg)
+ {}
+
+private:
+ static const char *registerOverride(QByteArrayView categoryName, QByteArrayView environment)
+ {
+ QLoggingRegistry *c = QLoggingRegistry::instance();
+ if (c)
+ c->registerEnvironmentOverrideForCategory(categoryName, environment);
+ return categoryName.data();
+ }
+};
+
QT_END_NAMESPACE
#endif // QLOGGINGREGISTRY_P_H
diff --git a/src/corelib/io/qprocess_p.h b/src/corelib/io/qprocess_p.h
index 74ab6ab409..4b38f191d5 100644
--- a/src/corelib/io/qprocess_p.h
+++ b/src/corelib/io/qprocess_p.h
@@ -287,6 +287,7 @@ public:
#ifdef Q_OS_WIN
qint64 pipeWriterBytesToWrite() const;
void _q_bytesWritten(qint64 bytes);
+ void _q_writeFailed();
#else
bool _q_canWrite();
bool writeToStdin();
diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp
index 2daf8b50d7..c5dce4d438 100644
--- a/src/corelib/io/qprocess_win.cpp
+++ b/src/corelib/io/qprocess_win.cpp
@@ -395,7 +395,7 @@ static QString qt_create_commandline(const QString &program, const QStringList &
programName = QLatin1Char('\"') + programName + QLatin1Char('\"');
programName.replace(QLatin1Char('/'), QLatin1Char('\\'));
- // add the prgram as the first arg ... it works better
+ // add the program as the first arg ... it works better
args = programName + QLatin1Char(' ');
}
@@ -737,7 +737,7 @@ bool QProcessPrivate::waitForBytesWritten(const QDeadlineTimer &deadline)
// start with, in which case we fail immediately. Also, if the input
// pipe goes down somewhere in the code below, we avoid waiting for
// a full timeout.
- if (pipeWriterBytesToWrite() == 0)
+ if (!stdinChannel.writer || !stdinChannel.writer->isWriteOperationActive())
return false;
QProcessPoller poller(*this);
@@ -747,7 +747,6 @@ bool QProcessPrivate::waitForBytesWritten(const QDeadlineTimer &deadline)
if (ret == 0)
break;
- Q_ASSERT(stdinChannel.writer);
if (stdinChannel.writer->checkForWrite())
return true;
@@ -824,6 +823,7 @@ void QProcessPrivate::findExitCode()
}
/*! \reimp
+ \internal
*/
qint64 QProcess::writeData(const char *data, qint64 len)
{
@@ -841,6 +841,8 @@ qint64 QProcess::writeData(const char *data, qint64 len)
d->stdinChannel.writer = new QWindowsPipeWriter(d->stdinChannel.pipe[1], this);
QObjectPrivate::connect(d->stdinChannel.writer, &QWindowsPipeWriter::bytesWritten,
d, &QProcessPrivate::_q_bytesWritten);
+ QObjectPrivate::connect(d->stdinChannel.writer, &QWindowsPipeWriter::writeFailed,
+ d, &QProcessPrivate::_q_writeFailed);
}
if (d->isWriteChunkCached(data, len))
@@ -872,6 +874,12 @@ void QProcessPrivate::_q_bytesWritten(qint64 bytes)
closeWriteChannel();
}
+void QProcessPrivate::_q_writeFailed()
+{
+ closeWriteChannel();
+ setErrorAndEmit(QProcess::WriteError);
+}
+
// Use ShellExecuteEx() to trigger an UAC prompt when CreateProcess()fails
// with ERROR_ELEVATION_REQUIRED.
static bool startDetachedUacPrompt(const QString &programIn, const QStringList &arguments,
diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp
index 864fb7a5d9..54fe21c43c 100644
--- a/src/corelib/io/qresource.cpp
+++ b/src/corelib/io/qresource.cpp
@@ -470,6 +470,10 @@ qint64 QResourcePrivate::uncompressedSize() const
qsizetype QResourcePrivate::decompress(char *buffer, qsizetype bufferSize) const
{
Q_ASSERT(data);
+#if defined(QT_NO_COMPRESS) && !QT_CONFIG(zstd)
+ Q_UNUSED(buffer);
+ Q_UNUSED(bufferSize);
+#endif
switch (compressionAlgo) {
case QResource::NoCompression:
@@ -630,7 +634,7 @@ bool QResource::isValid() const
possible compression algorithm.
If this function returns QResource::ZstdCompression, you need to use the
- Zstandard library functios (\c{<zstd.h> header). Qt does not provide a
+ Zstandard library functions (\c{<zstd.h> header). Qt does not provide a
wrapper.
See \l{http://facebook.github.io/zstd/zstd_manual.html}{Zstandard manual}.
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index 8f4bf42422..e72b4349c8 100644
--- a/src/corelib/io/qsettings.cpp
+++ b/src/corelib/io/qsettings.cpp
@@ -1100,7 +1100,7 @@ QConfFileSettingsPrivate::QConfFileSettingsPrivate(QSettings::Format format,
for (const auto &dir : qAsConst(dirs))
paths.append(dir + QLatin1Char('/') + orgFile);
- // Note: No check for existence of files is done intentionaly.
+ // Note: No check for existence of files is done intentionally.
for (const auto &path : qAsConst(paths))
confFiles.append(QConfFile::fromName(path, false));
} else
diff --git a/src/corelib/io/qstandardpaths_unix.cpp b/src/corelib/io/qstandardpaths_unix.cpp
index 09f6c9d639..fa35265257 100644
--- a/src/corelib/io/qstandardpaths_unix.cpp
+++ b/src/corelib/io/qstandardpaths_unix.cpp
@@ -354,10 +354,8 @@ static QStringList xdgDataDirs()
dirs.append(QString::fromLatin1("/usr/local/share"));
dirs.append(QString::fromLatin1("/usr/share"));
} else {
- const auto parts = QStringView{xdgDataDirsEnv}.split(QLatin1Char(':'), Qt::SkipEmptyParts);
-
// Normalize paths, skip relative paths
- for (const auto &dir : parts) {
+ for (const auto dir : qTokenize(xdgDataDirsEnv, u':')) {
if (dir.startsWith(QLatin1Char('/')))
dirs.push_back(QDir::cleanPath(dir.toString()));
}
diff --git a/src/corelib/io/qstandardpaths_win.cpp b/src/corelib/io/qstandardpaths_win.cpp
index e619687a8b..60d65f4216 100644
--- a/src/corelib/io/qstandardpaths_win.cpp
+++ b/src/corelib/io/qstandardpaths_win.cpp
@@ -108,7 +108,7 @@ static bool isProcessLowIntegrity() {
auto* token_info = reinterpret_cast<TOKEN_MANDATORY_LABEL*>(token_info_buf.data());
DWORD token_info_length = token_info_buf.size();
if (!GetTokenInformation(process_token, TokenIntegrityLevel, token_info, token_info_length, &token_info_length)) {
- // grow bufer and retry GetTokenInformation
+ // grow buffer and retry GetTokenInformation
token_info_buf.resize(token_info_length);
token_info = reinterpret_cast<TOKEN_MANDATORY_LABEL*>(token_info_buf.data());
if (!GetTokenInformation(process_token, TokenIntegrityLevel, token_info, token_info_length, &token_info_length))
diff --git a/src/corelib/io/qstorageinfo_unix.cpp b/src/corelib/io/qstorageinfo_unix.cpp
index 6845a24838..566ffe46bc 100644
--- a/src/corelib/io/qstorageinfo_unix.cpp
+++ b/src/corelib/io/qstorageinfo_unix.cpp
@@ -1,5 +1,6 @@
/****************************************************************************
**
+** Copyright (C) 2021 The Qt Company Ltd.
** Copyright (C) 2014 Ivan Komissarov <ABBAPOH@gmail.com>
** Copyright (C) 2016 Intel Corporation.
** Contact: https://www.qt.io/licensing/
@@ -466,7 +467,7 @@ inline bool QStorageIterator::next()
if (fgets(ptr, buffer.size(), fp) == nullptr)
return false;
- size_t len = strlen(buffer.data());
+ size_t len = strlen(ptr);
if (len == 0)
return false;
while (Q_UNLIKELY(ptr[len - 1] != '\n' && !feof(fp))) {
@@ -481,28 +482,29 @@ inline bool QStorageIterator::next()
Q_ASSERT(len < size_t(buffer.size()));
}
ptr[len - 1] = '\0';
+ const char *const stop = ptr + len - 1;
// parse the line
bool ok;
mnt.mnt_freq = 0;
mnt.mnt_passno = 0;
- mnt.mount_id = qstrtoll(ptr, const_cast<const char **>(&ptr), 10, &ok);
- if (!ptr || !ok)
+ mnt.mount_id = qstrntoll(ptr, stop - ptr, const_cast<const char **>(&ptr), 10, &ok);
+ if (!ok)
return false;
- int parent_id = qstrtoll(ptr, const_cast<const char **>(&ptr), 10, &ok);
+ int parent_id = qstrntoll(ptr, stop - ptr, const_cast<const char **>(&ptr), 10, &ok);
Q_UNUSED(parent_id);
- if (!ptr || !ok)
+ if (!ok)
return false;
- int rdevmajor = qstrtoll(ptr, const_cast<const char **>(&ptr), 10, &ok);
- if (!ptr || !ok)
+ int rdevmajor = qstrntoll(ptr, stop - ptr, const_cast<const char **>(&ptr), 10, &ok);
+ if (!ok)
return false;
if (*ptr != ':')
return false;
- int rdevminor = qstrtoll(ptr + 1, const_cast<const char **>(&ptr), 10, &ok);
- if (!ptr || !ok)
+ int rdevminor = qstrntoll(ptr + 1, stop - ptr - 1, const_cast<const char **>(&ptr), 10, &ok);
+ if (!ok)
return false;
mnt.rdev = makedev(rdevmajor, rdevminor);
diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp
index 1e7e67b625..54d7462883 100644
--- a/src/corelib/io/qtemporaryfile.cpp
+++ b/src/corelib/io/qtemporaryfile.cpp
@@ -198,7 +198,7 @@ QFileSystemEntry::NativePath QTemporaryFileName::generateNext()
Generates a unique file path from the template \a templ and creates a new
file based based on those parameters: the \c templ.length characters in \c
- templ.path starting at \c templ.pos will be replacd by a random sequence of
+ templ.path starting at \c templ.pos will be replaced by a random sequence of
characters. \a mode specifies the file mode bits (not used on Windows).
Returns true on success and sets the file handle on \a file. On error,
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 1e198ebdd3..0e7ef68ecb 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -390,6 +390,25 @@
*/
/*!
+ \enum QUrl::AceProcessingOption
+ \since 6.3
+
+ The ACE processing options control the way URLs are transformed to and from
+ ASCII-Compatible Encoding.
+
+ \value IgnoreIDNWhitelist Ignore the IDN whitelist when converting URLs
+ to Unicode.
+ \value AceTransitionalProcessing Use transitional processing described in UTS #46.
+ This allows better compatibility with IDNA 2003
+ specification.
+
+ The default is to use nontransitional processing and to allow non-ASCII
+ characters only inside URLs whose top-level domains are listed in the IDN whitelist.
+
+ \sa toAce(), fromAce(), idnWhitelist()
+*/
+
+/*!
\fn QUrl::QUrl(QUrl &&other)
Move-constructs a QUrl instance, making it point at the same
@@ -1177,7 +1196,7 @@ inline void QUrlPrivate::appendHost(QString &appendTo, QUrl::FormattingOptions o
// this is either an IPv4Address or a reg-name
// if it is a reg-name, it is already stored in Unicode form
if (options & QUrl::EncodeUnicode && !(options & 0x4000000))
- appendTo += qt_ACE_do(host, ToAceOnly, AllowLeadingDot);
+ appendTo += qt_ACE_do(host, ToAceOnly, AllowLeadingDot, {});
else
appendTo += host;
}
@@ -1339,7 +1358,7 @@ inline bool QUrlPrivate::setHost(const QString &value, int from, int iend, QUrl:
// Unicode encoding (some non-ASCII characters case-fold to digits
// when nameprepping is done)
//
- // The qt_ACE_do function below applies nameprepping and the STD3 check.
+ // The qt_ACE_do function below does IDNA normalization and the STD3 check.
// That means a Unicode string may become an IPv4 address, but it cannot
// produce a '[' or a '%'.
@@ -1358,7 +1377,7 @@ inline bool QUrlPrivate::setHost(const QString &value, int from, int iend, QUrl:
return setHost(s, 0, s.length(), QUrl::StrictMode);
}
- s = qt_ACE_do(QStringView(begin, len), NormalizeAce, ForbidLeadingDot);
+ s = qt_ACE_do(value.mid(from, iend - from), NormalizeAce, ForbidLeadingDot, {});
if (s.isEmpty()) {
setError(InvalidRegNameError, value);
return false;
@@ -1803,7 +1822,7 @@ inline void QUrlPrivate::validate() const
Constructs a URL by parsing \a url. QUrl will automatically percent encode
all characters that are not allowed in a URL and decode the percent-encoded
sequences that represent an unreserved character (letters, digits, hyphens,
- undercores, dots and tildes). All other characters are left in their
+ underscores, dots and tildes). All other characters are left in their
original forms.
Parses the \a url using the parser mode \a parsingMode. In TolerantMode
@@ -1907,7 +1926,7 @@ void QUrl::clear()
Parses \a url and sets this object to that value. QUrl will automatically
percent encode all characters that are not allowed in a URL and decode the
percent-encoded sequences that represent an unreserved character (letters,
- digits, hyphens, undercores, dots and tildes). All other characters are
+ digits, hyphens, underscores, dots and tildes). All other characters are
left in their original forms.
Parses the \a url using the parser mode \a parsingMode. In TolerantMode
@@ -1939,7 +1958,7 @@ void QUrl::setUrl(const QString &url, ParsingMode parsingMode)
The scheme describes the type (or protocol) of the URL. It's
represented by one or more ASCII characters at the start the URL.
- A scheme is strictly \l {http://www.ietf.org/rfc/rfc3986.txt} {RFC 3986}-compliant:
+ A scheme is strictly \l {RFC 3986}-compliant:
\tt {scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )}
The following example shows a URL where the scheme is "ftp":
@@ -3013,50 +3032,72 @@ QByteArray QUrl::toPercentEncoding(const QString &input, const QByteArray &exclu
}
/*!
- \since 4.2
+ \since 6.3
Returns the Unicode form of the given domain name
\a domain, which is encoded in the ASCII Compatible Encoding (ACE).
+ The output can be customized by passing flags with \a options.
The result of this function is considered equivalent to \a domain.
If the value in \a domain cannot be encoded, it will be converted
to QString and returned.
- The ASCII Compatible Encoding (ACE) is defined by RFC 3490, RFC 3491
- and RFC 3492. It is part of the Internationalizing Domain Names in
- Applications (IDNA) specification, which allows for domain names
- (like \c "example.com") to be written using international
- characters.
+ The ASCII-Compatible Encoding (ACE) is defined by RFC 3490, RFC 3491
+ and RFC 3492 and updated by the Unicode Technical Standard #46. It is part
+ of the Internationalizing Domain Names in Applications (IDNA) specification,
+ which allows for domain names (like \c "example.com") to be written using
+ non-US-ASCII characters.
*/
-QString QUrl::fromAce(const QByteArray &domain)
+QString QUrl::fromAce(const QByteArray &domain, QUrl::AceProcessingOptions options)
{
- QVarLengthArray<char16_t> buffer;
- buffer.resize(domain.size());
- qt_from_latin1(buffer.data(), domain.data(), domain.size());
- return qt_ACE_do(QStringView{buffer.data(), buffer.size()},
- NormalizeAce, ForbidLeadingDot /*FIXME: make configurable*/);
+ return qt_ACE_do(QString::fromLatin1(domain), NormalizeAce,
+ ForbidLeadingDot /*FIXME: make configurable*/, options);
}
+#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
/*!
\since 4.2
+ \overload
+*/
+QString QUrl::fromAce(const QByteArray &domain)
+{
+ return fromAce(domain, {});
+}
+#endif
+
+/*!
+ \since 6.3
Returns the ASCII Compatible Encoding of the given domain name \a domain.
+ The output can be customized by passing flags with \a options.
The result of this function is considered equivalent to \a domain.
The ASCII-Compatible Encoding (ACE) is defined by RFC 3490, RFC 3491
- and RFC 3492. It is part of the Internationalizing Domain Names in
- Applications (IDNA) specification, which allows for domain names
- (like \c "example.com") to be written using international
- characters.
+ and RFC 3492 and updated by the Unicode Technical Standard #46. It is part
+ of the Internationalizing Domain Names in Applications (IDNA) specification,
+ which allows for domain names (like \c "example.com") to be written using
+ non-US-ASCII characters.
This function returns an empty QByteArray if \a domain is not a valid
hostname. Note, in particular, that IPv6 literals are not valid domain
names.
*/
+QByteArray QUrl::toAce(const QString &domain, AceProcessingOptions options)
+{
+ return qt_ACE_do(domain, ToAceOnly, ForbidLeadingDot /*FIXME: make configurable*/, options)
+ .toLatin1();
+}
+
+#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
+/*!
+ \since 4.2
+ \overload
+*/
QByteArray QUrl::toAce(const QString &domain)
{
- return qt_ACE_do(domain, ToAceOnly, ForbidLeadingDot /*FIXME: make configurable*/).toLatin1();
+ return toAce(domain, {});
}
+#endif
/*!
\internal
@@ -3115,6 +3156,8 @@ bool QUrl::operator <(const QUrl &url) const
/*!
Returns \c true if this URL and the given \a url are equal;
otherwise returns \c false.
+
+ \sa matches()
*/
bool QUrl::operator ==(const QUrl &url) const
{
@@ -3222,6 +3265,8 @@ bool QUrl::matches(const QUrl &url, FormattingOptions options) const
/*!
Returns \c true if this URL and the given \a url are not equal;
otherwise returns \c false.
+
+ \sa matches()
*/
bool QUrl::operator !=(const QUrl &url) const
{
@@ -3769,7 +3814,7 @@ QUrl QUrl::fromUserInput(const QString &userInput, const QString &workingDirecto
return QUrl::fromLocalFile(fileInfo.absoluteFilePath());
}
- // Check first for files, since on Windows drive letters can be interpretted as schemes
+ // Check first for files, since on Windows drive letters can be interpreted as schemes
if (QDir::isAbsolutePath(trimmedString))
return QUrl::fromLocalFile(trimmedString);
@@ -3777,7 +3822,7 @@ QUrl QUrl::fromUserInput(const QString &userInput, const QString &workingDirecto
// Check the most common case of a valid url with a scheme
// We check if the port would be valid by adding the scheme to handle the case host:port
- // where the host would be interpretted as the scheme
+ // where the host would be interpreted as the scheme
if (url.isValid()
&& !url.scheme().isEmpty()
&& urlPrepended.port() == -1)
diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h
index dffe81e885..62b8e8cd93 100644
--- a/src/corelib/io/qurl.h
+++ b/src/corelib/io/qurl.h
@@ -169,7 +169,7 @@ public:
#ifdef Q_QDOC
private:
// We need to let qdoc think that FormattingOptions is a normal QFlags, but
- // it needs to be a QUrlTwoFlags for compiling default arguments of somme functions.
+ // it needs to be a QUrlTwoFlags for compiling default arguments of some functions.
template<typename T> struct QFlags : QUrlTwoFlags<T, ComponentFormattingOption>
{ using QUrlTwoFlags<T, ComponentFormattingOption>::QUrlTwoFlags; };
public:
@@ -281,8 +281,22 @@ public:
NSURL *toNSURL() const Q_DECL_NS_RETURNS_AUTORELEASED;
#endif
+ enum AceProcessingOption : unsigned int {
+ IgnoreIDNWhitelist = 0x1,
+ AceTransitionalProcessing = 0x2,
+ };
+ Q_DECLARE_FLAGS(AceProcessingOptions, AceProcessingOption)
+
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+ static QString fromAce(const QByteArray &, AceProcessingOptions options = {});
+ static QByteArray toAce(const QString &, AceProcessingOptions options = {});
+#else
static QString fromAce(const QByteArray &);
static QByteArray toAce(const QString &);
+ static QString fromAce(const QByteArray &, AceProcessingOptions options);
+ static QByteArray toAce(const QString &, AceProcessingOptions options);
+#endif
+
static QStringList idnWhitelist();
static QStringList toStringList(const QList<QUrl> &uris, FormattingOptions options = FormattingOptions(PrettyDecoded));
static QList<QUrl> fromStringList(const QStringList &uris, ParsingMode mode = TolerantMode);
@@ -302,6 +316,7 @@ public:
Q_DECLARE_SHARED(QUrl)
Q_DECLARE_OPERATORS_FOR_FLAGS(QUrl::ComponentFormattingOptions)
//Q_DECLARE_OPERATORS_FOR_FLAGS(QUrl::FormattingOptions)
+Q_DECLARE_OPERATORS_FOR_FLAGS(QUrl::AceProcessingOptions)
#ifndef Q_QDOC
constexpr inline QUrl::FormattingOptions operator|(QUrl::UrlFormattingOption f1, QUrl::UrlFormattingOption f2)
diff --git a/src/corelib/io/qurl_p.h b/src/corelib/io/qurl_p.h
index 3d4a04928d..9b755cf5df 100644
--- a/src/corelib/io/qurl_p.h
+++ b/src/corelib/io/qurl_p.h
@@ -65,9 +65,8 @@ extern Q_AUTOTEST_EXPORT qsizetype qt_urlRecode(QString &appendTo, QStringView u
// in qurlidna.cpp
enum AceLeadingDot { AllowLeadingDot, ForbidLeadingDot };
enum AceOperation { ToAceOnly, NormalizeAce };
-extern QString qt_ACE_do(QStringView domain, AceOperation op, AceLeadingDot dot);
-extern Q_AUTOTEST_EXPORT bool qt_nameprep(QString *source, int from);
-extern Q_AUTOTEST_EXPORT bool qt_check_std3rules(QStringView in);
+extern QString qt_ACE_do(const QString &domain, AceOperation op, AceLeadingDot dot,
+ QUrl::AceProcessingOptions options);
extern Q_AUTOTEST_EXPORT void qt_punycodeEncoder(QStringView in, QString *output);
extern Q_AUTOTEST_EXPORT QString qt_punycodeDecoder(const QString &pc);
diff --git a/src/corelib/io/qurlidna.cpp b/src/corelib/io/qurlidna.cpp
index 774903c35b..b3e67fecf7 100644
--- a/src/corelib/io/qurlidna.cpp
+++ b/src/corelib/io/qurlidna.cpp
@@ -41,23 +41,15 @@
#include "qurl_p.h"
#include <QtCore/qstringlist.h>
+#include <QtCore/private/qnumeric_p.h>
#include <QtCore/private/qstringiterator_p.h>
+#include <QtCore/private/qunicodetables_p.h>
#include <algorithm>
-/* NOTE: IDNA 2003 is based on Unicode 3.2
-
- As a result, the assorted Unicode data below snould *not* be updated as part
- of our routine updates to UCS (see ../text/qt_attributions.json and
- util/unicode/). See QTBUG-85323 and RFCs 3491, 3454.
-
- TODO (QTBUG-85371): Update to IDNA 2008.
-*/
-
QT_BEGIN_NAMESPACE
// needed by the punycode encoder/decoder
-#define Q_MAXINT ((uint)((uint)(-1)>>1))
static const uint base = 36;
static const uint tmin = 1;
static const uint tmax = 26;
@@ -66,2115 +58,7 @@ static const uint damp = 700;
static const uint initial_bias = 72;
static const uint initial_n = 128;
-struct NameprepCaseFoldingEntry {
- char32_t uc;
- char16_t mapping[4];
-};
-
-inline bool operator<(char32_t one, const NameprepCaseFoldingEntry &other)
-{ return one < other.uc; }
-
-inline bool operator<(const NameprepCaseFoldingEntry &one, char32_t other)
-{ return one.uc < other; }
-
-static const NameprepCaseFoldingEntry NameprepCaseFolding[] = {
-/* { 0x0041, { 0x0061, 0x0000, 0x0000, 0x0000 } },
- { 0x0042, { 0x0062, 0x0000, 0x0000, 0x0000 } },
- { 0x0043, { 0x0063, 0x0000, 0x0000, 0x0000 } },
- { 0x0044, { 0x0064, 0x0000, 0x0000, 0x0000 } },
- { 0x0045, { 0x0065, 0x0000, 0x0000, 0x0000 } },
- { 0x0046, { 0x0066, 0x0000, 0x0000, 0x0000 } },
- { 0x0047, { 0x0067, 0x0000, 0x0000, 0x0000 } },
- { 0x0048, { 0x0068, 0x0000, 0x0000, 0x0000 } },
- { 0x0049, { 0x0069, 0x0000, 0x0000, 0x0000 } },
- { 0x004A, { 0x006A, 0x0000, 0x0000, 0x0000 } },
- { 0x004B, { 0x006B, 0x0000, 0x0000, 0x0000 } },
- { 0x004C, { 0x006C, 0x0000, 0x0000, 0x0000 } },
- { 0x004D, { 0x006D, 0x0000, 0x0000, 0x0000 } },
- { 0x004E, { 0x006E, 0x0000, 0x0000, 0x0000 } },
- { 0x004F, { 0x006F, 0x0000, 0x0000, 0x0000 } },
- { 0x0050, { 0x0070, 0x0000, 0x0000, 0x0000 } },
- { 0x0051, { 0x0071, 0x0000, 0x0000, 0x0000 } },
- { 0x0052, { 0x0072, 0x0000, 0x0000, 0x0000 } },
- { 0x0053, { 0x0073, 0x0000, 0x0000, 0x0000 } },
- { 0x0054, { 0x0074, 0x0000, 0x0000, 0x0000 } },
- { 0x0055, { 0x0075, 0x0000, 0x0000, 0x0000 } },
- { 0x0056, { 0x0076, 0x0000, 0x0000, 0x0000 } },
- { 0x0057, { 0x0077, 0x0000, 0x0000, 0x0000 } },
- { 0x0058, { 0x0078, 0x0000, 0x0000, 0x0000 } },
- { 0x0059, { 0x0079, 0x0000, 0x0000, 0x0000 } },
- { 0x005A, { 0x007A, 0x0000, 0x0000, 0x0000 } },*/
- { 0x00B5, { 0x03BC, 0x0000, 0x0000, 0x0000 } },
- { 0x00C0, { 0x00E0, 0x0000, 0x0000, 0x0000 } },
- { 0x00C1, { 0x00E1, 0x0000, 0x0000, 0x0000 } },
- { 0x00C2, { 0x00E2, 0x0000, 0x0000, 0x0000 } },
- { 0x00C3, { 0x00E3, 0x0000, 0x0000, 0x0000 } },
- { 0x00C4, { 0x00E4, 0x0000, 0x0000, 0x0000 } },
- { 0x00C5, { 0x00E5, 0x0000, 0x0000, 0x0000 } },
- { 0x00C6, { 0x00E6, 0x0000, 0x0000, 0x0000 } },
- { 0x00C7, { 0x00E7, 0x0000, 0x0000, 0x0000 } },
- { 0x00C8, { 0x00E8, 0x0000, 0x0000, 0x0000 } },
- { 0x00C9, { 0x00E9, 0x0000, 0x0000, 0x0000 } },
- { 0x00CA, { 0x00EA, 0x0000, 0x0000, 0x0000 } },
- { 0x00CB, { 0x00EB, 0x0000, 0x0000, 0x0000 } },
- { 0x00CC, { 0x00EC, 0x0000, 0x0000, 0x0000 } },
- { 0x00CD, { 0x00ED, 0x0000, 0x0000, 0x0000 } },
- { 0x00CE, { 0x00EE, 0x0000, 0x0000, 0x0000 } },
- { 0x00CF, { 0x00EF, 0x0000, 0x0000, 0x0000 } },
- { 0x00D0, { 0x00F0, 0x0000, 0x0000, 0x0000 } },
- { 0x00D1, { 0x00F1, 0x0000, 0x0000, 0x0000 } },
- { 0x00D2, { 0x00F2, 0x0000, 0x0000, 0x0000 } },
- { 0x00D3, { 0x00F3, 0x0000, 0x0000, 0x0000 } },
- { 0x00D4, { 0x00F4, 0x0000, 0x0000, 0x0000 } },
- { 0x00D5, { 0x00F5, 0x0000, 0x0000, 0x0000 } },
- { 0x00D6, { 0x00F6, 0x0000, 0x0000, 0x0000 } },
- { 0x00D8, { 0x00F8, 0x0000, 0x0000, 0x0000 } },
- { 0x00D9, { 0x00F9, 0x0000, 0x0000, 0x0000 } },
- { 0x00DA, { 0x00FA, 0x0000, 0x0000, 0x0000 } },
- { 0x00DB, { 0x00FB, 0x0000, 0x0000, 0x0000 } },
- { 0x00DC, { 0x00FC, 0x0000, 0x0000, 0x0000 } },
- { 0x00DD, { 0x00FD, 0x0000, 0x0000, 0x0000 } },
- { 0x00DE, { 0x00FE, 0x0000, 0x0000, 0x0000 } },
- { 0x00DF, { 0x0073, 0x0073, 0x0000, 0x0000 } },
- { 0x0100, { 0x0101, 0x0000, 0x0000, 0x0000 } },
- { 0x0102, { 0x0103, 0x0000, 0x0000, 0x0000 } },
- { 0x0104, { 0x0105, 0x0000, 0x0000, 0x0000 } },
- { 0x0106, { 0x0107, 0x0000, 0x0000, 0x0000 } },
- { 0x0108, { 0x0109, 0x0000, 0x0000, 0x0000 } },
- { 0x010A, { 0x010B, 0x0000, 0x0000, 0x0000 } },
- { 0x010C, { 0x010D, 0x0000, 0x0000, 0x0000 } },
- { 0x010E, { 0x010F, 0x0000, 0x0000, 0x0000 } },
- { 0x0110, { 0x0111, 0x0000, 0x0000, 0x0000 } },
- { 0x0112, { 0x0113, 0x0000, 0x0000, 0x0000 } },
- { 0x0114, { 0x0115, 0x0000, 0x0000, 0x0000 } },
- { 0x0116, { 0x0117, 0x0000, 0x0000, 0x0000 } },
- { 0x0118, { 0x0119, 0x0000, 0x0000, 0x0000 } },
- { 0x011A, { 0x011B, 0x0000, 0x0000, 0x0000 } },
- { 0x011C, { 0x011D, 0x0000, 0x0000, 0x0000 } },
- { 0x011E, { 0x011F, 0x0000, 0x0000, 0x0000 } },
- { 0x0120, { 0x0121, 0x0000, 0x0000, 0x0000 } },
- { 0x0122, { 0x0123, 0x0000, 0x0000, 0x0000 } },
- { 0x0124, { 0x0125, 0x0000, 0x0000, 0x0000 } },
- { 0x0126, { 0x0127, 0x0000, 0x0000, 0x0000 } },
- { 0x0128, { 0x0129, 0x0000, 0x0000, 0x0000 } },
- { 0x012A, { 0x012B, 0x0000, 0x0000, 0x0000 } },
- { 0x012C, { 0x012D, 0x0000, 0x0000, 0x0000 } },
- { 0x012E, { 0x012F, 0x0000, 0x0000, 0x0000 } },
- { 0x0130, { 0x0069, 0x0307, 0x0000, 0x0000 } },
- { 0x0132, { 0x0133, 0x0000, 0x0000, 0x0000 } },
- { 0x0134, { 0x0135, 0x0000, 0x0000, 0x0000 } },
- { 0x0136, { 0x0137, 0x0000, 0x0000, 0x0000 } },
- { 0x0139, { 0x013A, 0x0000, 0x0000, 0x0000 } },
- { 0x013B, { 0x013C, 0x0000, 0x0000, 0x0000 } },
- { 0x013D, { 0x013E, 0x0000, 0x0000, 0x0000 } },
- { 0x013F, { 0x0140, 0x0000, 0x0000, 0x0000 } },
- { 0x0141, { 0x0142, 0x0000, 0x0000, 0x0000 } },
- { 0x0143, { 0x0144, 0x0000, 0x0000, 0x0000 } },
- { 0x0145, { 0x0146, 0x0000, 0x0000, 0x0000 } },
- { 0x0147, { 0x0148, 0x0000, 0x0000, 0x0000 } },
- { 0x0149, { 0x02BC, 0x006E, 0x0000, 0x0000 } },
- { 0x014A, { 0x014B, 0x0000, 0x0000, 0x0000 } },
- { 0x014C, { 0x014D, 0x0000, 0x0000, 0x0000 } },
- { 0x014E, { 0x014F, 0x0000, 0x0000, 0x0000 } },
- { 0x0150, { 0x0151, 0x0000, 0x0000, 0x0000 } },
- { 0x0152, { 0x0153, 0x0000, 0x0000, 0x0000 } },
- { 0x0154, { 0x0155, 0x0000, 0x0000, 0x0000 } },
- { 0x0156, { 0x0157, 0x0000, 0x0000, 0x0000 } },
- { 0x0158, { 0x0159, 0x0000, 0x0000, 0x0000 } },
- { 0x015A, { 0x015B, 0x0000, 0x0000, 0x0000 } },
- { 0x015C, { 0x015D, 0x0000, 0x0000, 0x0000 } },
- { 0x015E, { 0x015F, 0x0000, 0x0000, 0x0000 } },
- { 0x0160, { 0x0161, 0x0000, 0x0000, 0x0000 } },
- { 0x0162, { 0x0163, 0x0000, 0x0000, 0x0000 } },
- { 0x0164, { 0x0165, 0x0000, 0x0000, 0x0000 } },
- { 0x0166, { 0x0167, 0x0000, 0x0000, 0x0000 } },
- { 0x0168, { 0x0169, 0x0000, 0x0000, 0x0000 } },
- { 0x016A, { 0x016B, 0x0000, 0x0000, 0x0000 } },
- { 0x016C, { 0x016D, 0x0000, 0x0000, 0x0000 } },
- { 0x016E, { 0x016F, 0x0000, 0x0000, 0x0000 } },
- { 0x0170, { 0x0171, 0x0000, 0x0000, 0x0000 } },
- { 0x0172, { 0x0173, 0x0000, 0x0000, 0x0000 } },
- { 0x0174, { 0x0175, 0x0000, 0x0000, 0x0000 } },
- { 0x0176, { 0x0177, 0x0000, 0x0000, 0x0000 } },
- { 0x0178, { 0x00FF, 0x0000, 0x0000, 0x0000 } },
- { 0x0179, { 0x017A, 0x0000, 0x0000, 0x0000 } },
- { 0x017B, { 0x017C, 0x0000, 0x0000, 0x0000 } },
- { 0x017D, { 0x017E, 0x0000, 0x0000, 0x0000 } },
- { 0x017F, { 0x0073, 0x0000, 0x0000, 0x0000 } },
- { 0x0181, { 0x0253, 0x0000, 0x0000, 0x0000 } },
- { 0x0182, { 0x0183, 0x0000, 0x0000, 0x0000 } },
- { 0x0184, { 0x0185, 0x0000, 0x0000, 0x0000 } },
- { 0x0186, { 0x0254, 0x0000, 0x0000, 0x0000 } },
- { 0x0187, { 0x0188, 0x0000, 0x0000, 0x0000 } },
- { 0x0189, { 0x0256, 0x0000, 0x0000, 0x0000 } },
- { 0x018A, { 0x0257, 0x0000, 0x0000, 0x0000 } },
- { 0x018B, { 0x018C, 0x0000, 0x0000, 0x0000 } },
- { 0x018E, { 0x01DD, 0x0000, 0x0000, 0x0000 } },
- { 0x018F, { 0x0259, 0x0000, 0x0000, 0x0000 } },
- { 0x0190, { 0x025B, 0x0000, 0x0000, 0x0000 } },
- { 0x0191, { 0x0192, 0x0000, 0x0000, 0x0000 } },
- { 0x0193, { 0x0260, 0x0000, 0x0000, 0x0000 } },
- { 0x0194, { 0x0263, 0x0000, 0x0000, 0x0000 } },
- { 0x0196, { 0x0269, 0x0000, 0x0000, 0x0000 } },
- { 0x0197, { 0x0268, 0x0000, 0x0000, 0x0000 } },
- { 0x0198, { 0x0199, 0x0000, 0x0000, 0x0000 } },
- { 0x019C, { 0x026F, 0x0000, 0x0000, 0x0000 } },
- { 0x019D, { 0x0272, 0x0000, 0x0000, 0x0000 } },
- { 0x019F, { 0x0275, 0x0000, 0x0000, 0x0000 } },
- { 0x01A0, { 0x01A1, 0x0000, 0x0000, 0x0000 } },
- { 0x01A2, { 0x01A3, 0x0000, 0x0000, 0x0000 } },
- { 0x01A4, { 0x01A5, 0x0000, 0x0000, 0x0000 } },
- { 0x01A6, { 0x0280, 0x0000, 0x0000, 0x0000 } },
- { 0x01A7, { 0x01A8, 0x0000, 0x0000, 0x0000 } },
- { 0x01A9, { 0x0283, 0x0000, 0x0000, 0x0000 } },
- { 0x01AC, { 0x01AD, 0x0000, 0x0000, 0x0000 } },
- { 0x01AE, { 0x0288, 0x0000, 0x0000, 0x0000 } },
- { 0x01AF, { 0x01B0, 0x0000, 0x0000, 0x0000 } },
- { 0x01B1, { 0x028A, 0x0000, 0x0000, 0x0000 } },
- { 0x01B2, { 0x028B, 0x0000, 0x0000, 0x0000 } },
- { 0x01B3, { 0x01B4, 0x0000, 0x0000, 0x0000 } },
- { 0x01B5, { 0x01B6, 0x0000, 0x0000, 0x0000 } },
- { 0x01B7, { 0x0292, 0x0000, 0x0000, 0x0000 } },
- { 0x01B8, { 0x01B9, 0x0000, 0x0000, 0x0000 } },
- { 0x01BC, { 0x01BD, 0x0000, 0x0000, 0x0000 } },
- { 0x01C4, { 0x01C6, 0x0000, 0x0000, 0x0000 } },
- { 0x01C5, { 0x01C6, 0x0000, 0x0000, 0x0000 } },
- { 0x01C7, { 0x01C9, 0x0000, 0x0000, 0x0000 } },
- { 0x01C8, { 0x01C9, 0x0000, 0x0000, 0x0000 } },
- { 0x01CA, { 0x01CC, 0x0000, 0x0000, 0x0000 } },
- { 0x01CB, { 0x01CC, 0x0000, 0x0000, 0x0000 } },
- { 0x01CD, { 0x01CE, 0x0000, 0x0000, 0x0000 } },
- { 0x01CF, { 0x01D0, 0x0000, 0x0000, 0x0000 } },
- { 0x01D1, { 0x01D2, 0x0000, 0x0000, 0x0000 } },
- { 0x01D3, { 0x01D4, 0x0000, 0x0000, 0x0000 } },
- { 0x01D5, { 0x01D6, 0x0000, 0x0000, 0x0000 } },
- { 0x01D7, { 0x01D8, 0x0000, 0x0000, 0x0000 } },
- { 0x01D9, { 0x01DA, 0x0000, 0x0000, 0x0000 } },
- { 0x01DB, { 0x01DC, 0x0000, 0x0000, 0x0000 } },
- { 0x01DE, { 0x01DF, 0x0000, 0x0000, 0x0000 } },
- { 0x01E0, { 0x01E1, 0x0000, 0x0000, 0x0000 } },
- { 0x01E2, { 0x01E3, 0x0000, 0x0000, 0x0000 } },
- { 0x01E4, { 0x01E5, 0x0000, 0x0000, 0x0000 } },
- { 0x01E6, { 0x01E7, 0x0000, 0x0000, 0x0000 } },
- { 0x01E8, { 0x01E9, 0x0000, 0x0000, 0x0000 } },
- { 0x01EA, { 0x01EB, 0x0000, 0x0000, 0x0000 } },
- { 0x01EC, { 0x01ED, 0x0000, 0x0000, 0x0000 } },
- { 0x01EE, { 0x01EF, 0x0000, 0x0000, 0x0000 } },
- { 0x01F0, { 0x006A, 0x030C, 0x0000, 0x0000 } },
- { 0x01F1, { 0x01F3, 0x0000, 0x0000, 0x0000 } },
- { 0x01F2, { 0x01F3, 0x0000, 0x0000, 0x0000 } },
- { 0x01F4, { 0x01F5, 0x0000, 0x0000, 0x0000 } },
- { 0x01F6, { 0x0195, 0x0000, 0x0000, 0x0000 } },
- { 0x01F7, { 0x01BF, 0x0000, 0x0000, 0x0000 } },
- { 0x01F8, { 0x01F9, 0x0000, 0x0000, 0x0000 } },
- { 0x01FA, { 0x01FB, 0x0000, 0x0000, 0x0000 } },
- { 0x01FC, { 0x01FD, 0x0000, 0x0000, 0x0000 } },
- { 0x01FE, { 0x01FF, 0x0000, 0x0000, 0x0000 } },
- { 0x0200, { 0x0201, 0x0000, 0x0000, 0x0000 } },
- { 0x0202, { 0x0203, 0x0000, 0x0000, 0x0000 } },
- { 0x0204, { 0x0205, 0x0000, 0x0000, 0x0000 } },
- { 0x0206, { 0x0207, 0x0000, 0x0000, 0x0000 } },
- { 0x0208, { 0x0209, 0x0000, 0x0000, 0x0000 } },
- { 0x020A, { 0x020B, 0x0000, 0x0000, 0x0000 } },
- { 0x020C, { 0x020D, 0x0000, 0x0000, 0x0000 } },
- { 0x020E, { 0x020F, 0x0000, 0x0000, 0x0000 } },
- { 0x0210, { 0x0211, 0x0000, 0x0000, 0x0000 } },
- { 0x0212, { 0x0213, 0x0000, 0x0000, 0x0000 } },
- { 0x0214, { 0x0215, 0x0000, 0x0000, 0x0000 } },
- { 0x0216, { 0x0217, 0x0000, 0x0000, 0x0000 } },
- { 0x0218, { 0x0219, 0x0000, 0x0000, 0x0000 } },
- { 0x021A, { 0x021B, 0x0000, 0x0000, 0x0000 } },
- { 0x021C, { 0x021D, 0x0000, 0x0000, 0x0000 } },
- { 0x021E, { 0x021F, 0x0000, 0x0000, 0x0000 } },
- { 0x0220, { 0x019E, 0x0000, 0x0000, 0x0000 } },
- { 0x0222, { 0x0223, 0x0000, 0x0000, 0x0000 } },
- { 0x0224, { 0x0225, 0x0000, 0x0000, 0x0000 } },
- { 0x0226, { 0x0227, 0x0000, 0x0000, 0x0000 } },
- { 0x0228, { 0x0229, 0x0000, 0x0000, 0x0000 } },
- { 0x022A, { 0x022B, 0x0000, 0x0000, 0x0000 } },
- { 0x022C, { 0x022D, 0x0000, 0x0000, 0x0000 } },
- { 0x022E, { 0x022F, 0x0000, 0x0000, 0x0000 } },
- { 0x0230, { 0x0231, 0x0000, 0x0000, 0x0000 } },
- { 0x0232, { 0x0233, 0x0000, 0x0000, 0x0000 } },
- { 0x0345, { 0x03B9, 0x0000, 0x0000, 0x0000 } },
- { 0x037A, { 0x0020, 0x03B9, 0x0000, 0x0000 } },
- { 0x0386, { 0x03AC, 0x0000, 0x0000, 0x0000 } },
- { 0x0388, { 0x03AD, 0x0000, 0x0000, 0x0000 } },
- { 0x0389, { 0x03AE, 0x0000, 0x0000, 0x0000 } },
- { 0x038A, { 0x03AF, 0x0000, 0x0000, 0x0000 } },
- { 0x038C, { 0x03CC, 0x0000, 0x0000, 0x0000 } },
- { 0x038E, { 0x03CD, 0x0000, 0x0000, 0x0000 } },
- { 0x038F, { 0x03CE, 0x0000, 0x0000, 0x0000 } },
- { 0x0390, { 0x03B9, 0x0308, 0x0301, 0x0000 } },
- { 0x0391, { 0x03B1, 0x0000, 0x0000, 0x0000 } },
- { 0x0392, { 0x03B2, 0x0000, 0x0000, 0x0000 } },
- { 0x0393, { 0x03B3, 0x0000, 0x0000, 0x0000 } },
- { 0x0394, { 0x03B4, 0x0000, 0x0000, 0x0000 } },
- { 0x0395, { 0x03B5, 0x0000, 0x0000, 0x0000 } },
- { 0x0396, { 0x03B6, 0x0000, 0x0000, 0x0000 } },
- { 0x0397, { 0x03B7, 0x0000, 0x0000, 0x0000 } },
- { 0x0398, { 0x03B8, 0x0000, 0x0000, 0x0000 } },
- { 0x0399, { 0x03B9, 0x0000, 0x0000, 0x0000 } },
- { 0x039A, { 0x03BA, 0x0000, 0x0000, 0x0000 } },
- { 0x039B, { 0x03BB, 0x0000, 0x0000, 0x0000 } },
- { 0x039C, { 0x03BC, 0x0000, 0x0000, 0x0000 } },
- { 0x039D, { 0x03BD, 0x0000, 0x0000, 0x0000 } },
- { 0x039E, { 0x03BE, 0x0000, 0x0000, 0x0000 } },
- { 0x039F, { 0x03BF, 0x0000, 0x0000, 0x0000 } },
- { 0x03A0, { 0x03C0, 0x0000, 0x0000, 0x0000 } },
- { 0x03A1, { 0x03C1, 0x0000, 0x0000, 0x0000 } },
- { 0x03A3, { 0x03C3, 0x0000, 0x0000, 0x0000 } },
- { 0x03A4, { 0x03C4, 0x0000, 0x0000, 0x0000 } },
- { 0x03A5, { 0x03C5, 0x0000, 0x0000, 0x0000 } },
- { 0x03A6, { 0x03C6, 0x0000, 0x0000, 0x0000 } },
- { 0x03A7, { 0x03C7, 0x0000, 0x0000, 0x0000 } },
- { 0x03A8, { 0x03C8, 0x0000, 0x0000, 0x0000 } },
- { 0x03A9, { 0x03C9, 0x0000, 0x0000, 0x0000 } },
- { 0x03AA, { 0x03CA, 0x0000, 0x0000, 0x0000 } },
- { 0x03AB, { 0x03CB, 0x0000, 0x0000, 0x0000 } },
- { 0x03B0, { 0x03C5, 0x0308, 0x0301, 0x0000 } },
- { 0x03C2, { 0x03C3, 0x0000, 0x0000, 0x0000 } },
- { 0x03D0, { 0x03B2, 0x0000, 0x0000, 0x0000 } },
- { 0x03D1, { 0x03B8, 0x0000, 0x0000, 0x0000 } },
- { 0x03D2, { 0x03C5, 0x0000, 0x0000, 0x0000 } },
- { 0x03D3, { 0x03CD, 0x0000, 0x0000, 0x0000 } },
- { 0x03D4, { 0x03CB, 0x0000, 0x0000, 0x0000 } },
- { 0x03D5, { 0x03C6, 0x0000, 0x0000, 0x0000 } },
- { 0x03D6, { 0x03C0, 0x0000, 0x0000, 0x0000 } },
- { 0x03D8, { 0x03D9, 0x0000, 0x0000, 0x0000 } },
- { 0x03DA, { 0x03DB, 0x0000, 0x0000, 0x0000 } },
- { 0x03DC, { 0x03DD, 0x0000, 0x0000, 0x0000 } },
- { 0x03DE, { 0x03DF, 0x0000, 0x0000, 0x0000 } },
- { 0x03E0, { 0x03E1, 0x0000, 0x0000, 0x0000 } },
- { 0x03E2, { 0x03E3, 0x0000, 0x0000, 0x0000 } },
- { 0x03E4, { 0x03E5, 0x0000, 0x0000, 0x0000 } },
- { 0x03E6, { 0x03E7, 0x0000, 0x0000, 0x0000 } },
- { 0x03E8, { 0x03E9, 0x0000, 0x0000, 0x0000 } },
- { 0x03EA, { 0x03EB, 0x0000, 0x0000, 0x0000 } },
- { 0x03EC, { 0x03ED, 0x0000, 0x0000, 0x0000 } },
- { 0x03EE, { 0x03EF, 0x0000, 0x0000, 0x0000 } },
- { 0x03F0, { 0x03BA, 0x0000, 0x0000, 0x0000 } },
- { 0x03F1, { 0x03C1, 0x0000, 0x0000, 0x0000 } },
- { 0x03F2, { 0x03C3, 0x0000, 0x0000, 0x0000 } },
- { 0x03F4, { 0x03B8, 0x0000, 0x0000, 0x0000 } },
- { 0x03F5, { 0x03B5, 0x0000, 0x0000, 0x0000 } },
- { 0x0400, { 0x0450, 0x0000, 0x0000, 0x0000 } },
- { 0x0401, { 0x0451, 0x0000, 0x0000, 0x0000 } },
- { 0x0402, { 0x0452, 0x0000, 0x0000, 0x0000 } },
- { 0x0403, { 0x0453, 0x0000, 0x0000, 0x0000 } },
- { 0x0404, { 0x0454, 0x0000, 0x0000, 0x0000 } },
- { 0x0405, { 0x0455, 0x0000, 0x0000, 0x0000 } },
- { 0x0406, { 0x0456, 0x0000, 0x0000, 0x0000 } },
- { 0x0407, { 0x0457, 0x0000, 0x0000, 0x0000 } },
- { 0x0408, { 0x0458, 0x0000, 0x0000, 0x0000 } },
- { 0x0409, { 0x0459, 0x0000, 0x0000, 0x0000 } },
- { 0x040A, { 0x045A, 0x0000, 0x0000, 0x0000 } },
- { 0x040B, { 0x045B, 0x0000, 0x0000, 0x0000 } },
- { 0x040C, { 0x045C, 0x0000, 0x0000, 0x0000 } },
- { 0x040D, { 0x045D, 0x0000, 0x0000, 0x0000 } },
- { 0x040E, { 0x045E, 0x0000, 0x0000, 0x0000 } },
- { 0x040F, { 0x045F, 0x0000, 0x0000, 0x0000 } },
- { 0x0410, { 0x0430, 0x0000, 0x0000, 0x0000 } },
- { 0x0411, { 0x0431, 0x0000, 0x0000, 0x0000 } },
- { 0x0412, { 0x0432, 0x0000, 0x0000, 0x0000 } },
- { 0x0413, { 0x0433, 0x0000, 0x0000, 0x0000 } },
- { 0x0414, { 0x0434, 0x0000, 0x0000, 0x0000 } },
- { 0x0415, { 0x0435, 0x0000, 0x0000, 0x0000 } },
- { 0x0416, { 0x0436, 0x0000, 0x0000, 0x0000 } },
- { 0x0417, { 0x0437, 0x0000, 0x0000, 0x0000 } },
- { 0x0418, { 0x0438, 0x0000, 0x0000, 0x0000 } },
- { 0x0419, { 0x0439, 0x0000, 0x0000, 0x0000 } },
- { 0x041A, { 0x043A, 0x0000, 0x0000, 0x0000 } },
- { 0x041B, { 0x043B, 0x0000, 0x0000, 0x0000 } },
- { 0x041C, { 0x043C, 0x0000, 0x0000, 0x0000 } },
- { 0x041D, { 0x043D, 0x0000, 0x0000, 0x0000 } },
- { 0x041E, { 0x043E, 0x0000, 0x0000, 0x0000 } },
- { 0x041F, { 0x043F, 0x0000, 0x0000, 0x0000 } },
- { 0x0420, { 0x0440, 0x0000, 0x0000, 0x0000 } },
- { 0x0421, { 0x0441, 0x0000, 0x0000, 0x0000 } },
- { 0x0422, { 0x0442, 0x0000, 0x0000, 0x0000 } },
- { 0x0423, { 0x0443, 0x0000, 0x0000, 0x0000 } },
- { 0x0424, { 0x0444, 0x0000, 0x0000, 0x0000 } },
- { 0x0425, { 0x0445, 0x0000, 0x0000, 0x0000 } },
- { 0x0426, { 0x0446, 0x0000, 0x0000, 0x0000 } },
- { 0x0427, { 0x0447, 0x0000, 0x0000, 0x0000 } },
- { 0x0428, { 0x0448, 0x0000, 0x0000, 0x0000 } },
- { 0x0429, { 0x0449, 0x0000, 0x0000, 0x0000 } },
- { 0x042A, { 0x044A, 0x0000, 0x0000, 0x0000 } },
- { 0x042B, { 0x044B, 0x0000, 0x0000, 0x0000 } },
- { 0x042C, { 0x044C, 0x0000, 0x0000, 0x0000 } },
- { 0x042D, { 0x044D, 0x0000, 0x0000, 0x0000 } },
- { 0x042E, { 0x044E, 0x0000, 0x0000, 0x0000 } },
- { 0x042F, { 0x044F, 0x0000, 0x0000, 0x0000 } },
- { 0x0460, { 0x0461, 0x0000, 0x0000, 0x0000 } },
- { 0x0462, { 0x0463, 0x0000, 0x0000, 0x0000 } },
- { 0x0464, { 0x0465, 0x0000, 0x0000, 0x0000 } },
- { 0x0466, { 0x0467, 0x0000, 0x0000, 0x0000 } },
- { 0x0468, { 0x0469, 0x0000, 0x0000, 0x0000 } },
- { 0x046A, { 0x046B, 0x0000, 0x0000, 0x0000 } },
- { 0x046C, { 0x046D, 0x0000, 0x0000, 0x0000 } },
- { 0x046E, { 0x046F, 0x0000, 0x0000, 0x0000 } },
- { 0x0470, { 0x0471, 0x0000, 0x0000, 0x0000 } },
- { 0x0472, { 0x0473, 0x0000, 0x0000, 0x0000 } },
- { 0x0474, { 0x0475, 0x0000, 0x0000, 0x0000 } },
- { 0x0476, { 0x0477, 0x0000, 0x0000, 0x0000 } },
- { 0x0478, { 0x0479, 0x0000, 0x0000, 0x0000 } },
- { 0x047A, { 0x047B, 0x0000, 0x0000, 0x0000 } },
- { 0x047C, { 0x047D, 0x0000, 0x0000, 0x0000 } },
- { 0x047E, { 0x047F, 0x0000, 0x0000, 0x0000 } },
- { 0x0480, { 0x0481, 0x0000, 0x0000, 0x0000 } },
- { 0x048A, { 0x048B, 0x0000, 0x0000, 0x0000 } },
- { 0x048C, { 0x048D, 0x0000, 0x0000, 0x0000 } },
- { 0x048E, { 0x048F, 0x0000, 0x0000, 0x0000 } },
- { 0x0490, { 0x0491, 0x0000, 0x0000, 0x0000 } },
- { 0x0492, { 0x0493, 0x0000, 0x0000, 0x0000 } },
- { 0x0494, { 0x0495, 0x0000, 0x0000, 0x0000 } },
- { 0x0496, { 0x0497, 0x0000, 0x0000, 0x0000 } },
- { 0x0498, { 0x0499, 0x0000, 0x0000, 0x0000 } },
- { 0x049A, { 0x049B, 0x0000, 0x0000, 0x0000 } },
- { 0x049C, { 0x049D, 0x0000, 0x0000, 0x0000 } },
- { 0x049E, { 0x049F, 0x0000, 0x0000, 0x0000 } },
- { 0x04A0, { 0x04A1, 0x0000, 0x0000, 0x0000 } },
- { 0x04A2, { 0x04A3, 0x0000, 0x0000, 0x0000 } },
- { 0x04A4, { 0x04A5, 0x0000, 0x0000, 0x0000 } },
- { 0x04A6, { 0x04A7, 0x0000, 0x0000, 0x0000 } },
- { 0x04A8, { 0x04A9, 0x0000, 0x0000, 0x0000 } },
- { 0x04AA, { 0x04AB, 0x0000, 0x0000, 0x0000 } },
- { 0x04AC, { 0x04AD, 0x0000, 0x0000, 0x0000 } },
- { 0x04AE, { 0x04AF, 0x0000, 0x0000, 0x0000 } },
- { 0x04B0, { 0x04B1, 0x0000, 0x0000, 0x0000 } },
- { 0x04B2, { 0x04B3, 0x0000, 0x0000, 0x0000 } },
- { 0x04B4, { 0x04B5, 0x0000, 0x0000, 0x0000 } },
- { 0x04B6, { 0x04B7, 0x0000, 0x0000, 0x0000 } },
- { 0x04B8, { 0x04B9, 0x0000, 0x0000, 0x0000 } },
- { 0x04BA, { 0x04BB, 0x0000, 0x0000, 0x0000 } },
- { 0x04BC, { 0x04BD, 0x0000, 0x0000, 0x0000 } },
- { 0x04BE, { 0x04BF, 0x0000, 0x0000, 0x0000 } },
- { 0x04C1, { 0x04C2, 0x0000, 0x0000, 0x0000 } },
- { 0x04C3, { 0x04C4, 0x0000, 0x0000, 0x0000 } },
- { 0x04C5, { 0x04C6, 0x0000, 0x0000, 0x0000 } },
- { 0x04C7, { 0x04C8, 0x0000, 0x0000, 0x0000 } },
- { 0x04C9, { 0x04CA, 0x0000, 0x0000, 0x0000 } },
- { 0x04CB, { 0x04CC, 0x0000, 0x0000, 0x0000 } },
- { 0x04CD, { 0x04CE, 0x0000, 0x0000, 0x0000 } },
- { 0x04D0, { 0x04D1, 0x0000, 0x0000, 0x0000 } },
- { 0x04D2, { 0x04D3, 0x0000, 0x0000, 0x0000 } },
- { 0x04D4, { 0x04D5, 0x0000, 0x0000, 0x0000 } },
- { 0x04D6, { 0x04D7, 0x0000, 0x0000, 0x0000 } },
- { 0x04D8, { 0x04D9, 0x0000, 0x0000, 0x0000 } },
- { 0x04DA, { 0x04DB, 0x0000, 0x0000, 0x0000 } },
- { 0x04DC, { 0x04DD, 0x0000, 0x0000, 0x0000 } },
- { 0x04DE, { 0x04DF, 0x0000, 0x0000, 0x0000 } },
- { 0x04E0, { 0x04E1, 0x0000, 0x0000, 0x0000 } },
- { 0x04E2, { 0x04E3, 0x0000, 0x0000, 0x0000 } },
- { 0x04E4, { 0x04E5, 0x0000, 0x0000, 0x0000 } },
- { 0x04E6, { 0x04E7, 0x0000, 0x0000, 0x0000 } },
- { 0x04E8, { 0x04E9, 0x0000, 0x0000, 0x0000 } },
- { 0x04EA, { 0x04EB, 0x0000, 0x0000, 0x0000 } },
- { 0x04EC, { 0x04ED, 0x0000, 0x0000, 0x0000 } },
- { 0x04EE, { 0x04EF, 0x0000, 0x0000, 0x0000 } },
- { 0x04F0, { 0x04F1, 0x0000, 0x0000, 0x0000 } },
- { 0x04F2, { 0x04F3, 0x0000, 0x0000, 0x0000 } },
- { 0x04F4, { 0x04F5, 0x0000, 0x0000, 0x0000 } },
- { 0x04F8, { 0x04F9, 0x0000, 0x0000, 0x0000 } },
- { 0x0500, { 0x0501, 0x0000, 0x0000, 0x0000 } },
- { 0x0502, { 0x0503, 0x0000, 0x0000, 0x0000 } },
- { 0x0504, { 0x0505, 0x0000, 0x0000, 0x0000 } },
- { 0x0506, { 0x0507, 0x0000, 0x0000, 0x0000 } },
- { 0x0508, { 0x0509, 0x0000, 0x0000, 0x0000 } },
- { 0x050A, { 0x050B, 0x0000, 0x0000, 0x0000 } },
- { 0x050C, { 0x050D, 0x0000, 0x0000, 0x0000 } },
- { 0x050E, { 0x050F, 0x0000, 0x0000, 0x0000 } },
- { 0x0531, { 0x0561, 0x0000, 0x0000, 0x0000 } },
- { 0x0532, { 0x0562, 0x0000, 0x0000, 0x0000 } },
- { 0x0533, { 0x0563, 0x0000, 0x0000, 0x0000 } },
- { 0x0534, { 0x0564, 0x0000, 0x0000, 0x0000 } },
- { 0x0535, { 0x0565, 0x0000, 0x0000, 0x0000 } },
- { 0x0536, { 0x0566, 0x0000, 0x0000, 0x0000 } },
- { 0x0537, { 0x0567, 0x0000, 0x0000, 0x0000 } },
- { 0x0538, { 0x0568, 0x0000, 0x0000, 0x0000 } },
- { 0x0539, { 0x0569, 0x0000, 0x0000, 0x0000 } },
- { 0x053A, { 0x056A, 0x0000, 0x0000, 0x0000 } },
- { 0x053B, { 0x056B, 0x0000, 0x0000, 0x0000 } },
- { 0x053C, { 0x056C, 0x0000, 0x0000, 0x0000 } },
- { 0x053D, { 0x056D, 0x0000, 0x0000, 0x0000 } },
- { 0x053E, { 0x056E, 0x0000, 0x0000, 0x0000 } },
- { 0x053F, { 0x056F, 0x0000, 0x0000, 0x0000 } },
- { 0x0540, { 0x0570, 0x0000, 0x0000, 0x0000 } },
- { 0x0541, { 0x0571, 0x0000, 0x0000, 0x0000 } },
- { 0x0542, { 0x0572, 0x0000, 0x0000, 0x0000 } },
- { 0x0543, { 0x0573, 0x0000, 0x0000, 0x0000 } },
- { 0x0544, { 0x0574, 0x0000, 0x0000, 0x0000 } },
- { 0x0545, { 0x0575, 0x0000, 0x0000, 0x0000 } },
- { 0x0546, { 0x0576, 0x0000, 0x0000, 0x0000 } },
- { 0x0547, { 0x0577, 0x0000, 0x0000, 0x0000 } },
- { 0x0548, { 0x0578, 0x0000, 0x0000, 0x0000 } },
- { 0x0549, { 0x0579, 0x0000, 0x0000, 0x0000 } },
- { 0x054A, { 0x057A, 0x0000, 0x0000, 0x0000 } },
- { 0x054B, { 0x057B, 0x0000, 0x0000, 0x0000 } },
- { 0x054C, { 0x057C, 0x0000, 0x0000, 0x0000 } },
- { 0x054D, { 0x057D, 0x0000, 0x0000, 0x0000 } },
- { 0x054E, { 0x057E, 0x0000, 0x0000, 0x0000 } },
- { 0x054F, { 0x057F, 0x0000, 0x0000, 0x0000 } },
- { 0x0550, { 0x0580, 0x0000, 0x0000, 0x0000 } },
- { 0x0551, { 0x0581, 0x0000, 0x0000, 0x0000 } },
- { 0x0552, { 0x0582, 0x0000, 0x0000, 0x0000 } },
- { 0x0553, { 0x0583, 0x0000, 0x0000, 0x0000 } },
- { 0x0554, { 0x0584, 0x0000, 0x0000, 0x0000 } },
- { 0x0555, { 0x0585, 0x0000, 0x0000, 0x0000 } },
- { 0x0556, { 0x0586, 0x0000, 0x0000, 0x0000 } },
- { 0x0587, { 0x0565, 0x0582, 0x0000, 0x0000 } },
- { 0x1E00, { 0x1E01, 0x0000, 0x0000, 0x0000 } },
- { 0x1E02, { 0x1E03, 0x0000, 0x0000, 0x0000 } },
- { 0x1E04, { 0x1E05, 0x0000, 0x0000, 0x0000 } },
- { 0x1E06, { 0x1E07, 0x0000, 0x0000, 0x0000 } },
- { 0x1E08, { 0x1E09, 0x0000, 0x0000, 0x0000 } },
- { 0x1E0A, { 0x1E0B, 0x0000, 0x0000, 0x0000 } },
- { 0x1E0C, { 0x1E0D, 0x0000, 0x0000, 0x0000 } },
- { 0x1E0E, { 0x1E0F, 0x0000, 0x0000, 0x0000 } },
- { 0x1E10, { 0x1E11, 0x0000, 0x0000, 0x0000 } },
- { 0x1E12, { 0x1E13, 0x0000, 0x0000, 0x0000 } },
- { 0x1E14, { 0x1E15, 0x0000, 0x0000, 0x0000 } },
- { 0x1E16, { 0x1E17, 0x0000, 0x0000, 0x0000 } },
- { 0x1E18, { 0x1E19, 0x0000, 0x0000, 0x0000 } },
- { 0x1E1A, { 0x1E1B, 0x0000, 0x0000, 0x0000 } },
- { 0x1E1C, { 0x1E1D, 0x0000, 0x0000, 0x0000 } },
- { 0x1E1E, { 0x1E1F, 0x0000, 0x0000, 0x0000 } },
- { 0x1E20, { 0x1E21, 0x0000, 0x0000, 0x0000 } },
- { 0x1E22, { 0x1E23, 0x0000, 0x0000, 0x0000 } },
- { 0x1E24, { 0x1E25, 0x0000, 0x0000, 0x0000 } },
- { 0x1E26, { 0x1E27, 0x0000, 0x0000, 0x0000 } },
- { 0x1E28, { 0x1E29, 0x0000, 0x0000, 0x0000 } },
- { 0x1E2A, { 0x1E2B, 0x0000, 0x0000, 0x0000 } },
- { 0x1E2C, { 0x1E2D, 0x0000, 0x0000, 0x0000 } },
- { 0x1E2E, { 0x1E2F, 0x0000, 0x0000, 0x0000 } },
- { 0x1E30, { 0x1E31, 0x0000, 0x0000, 0x0000 } },
- { 0x1E32, { 0x1E33, 0x0000, 0x0000, 0x0000 } },
- { 0x1E34, { 0x1E35, 0x0000, 0x0000, 0x0000 } },
- { 0x1E36, { 0x1E37, 0x0000, 0x0000, 0x0000 } },
- { 0x1E38, { 0x1E39, 0x0000, 0x0000, 0x0000 } },
- { 0x1E3A, { 0x1E3B, 0x0000, 0x0000, 0x0000 } },
- { 0x1E3C, { 0x1E3D, 0x0000, 0x0000, 0x0000 } },
- { 0x1E3E, { 0x1E3F, 0x0000, 0x0000, 0x0000 } },
- { 0x1E40, { 0x1E41, 0x0000, 0x0000, 0x0000 } },
- { 0x1E42, { 0x1E43, 0x0000, 0x0000, 0x0000 } },
- { 0x1E44, { 0x1E45, 0x0000, 0x0000, 0x0000 } },
- { 0x1E46, { 0x1E47, 0x0000, 0x0000, 0x0000 } },
- { 0x1E48, { 0x1E49, 0x0000, 0x0000, 0x0000 } },
- { 0x1E4A, { 0x1E4B, 0x0000, 0x0000, 0x0000 } },
- { 0x1E4C, { 0x1E4D, 0x0000, 0x0000, 0x0000 } },
- { 0x1E4E, { 0x1E4F, 0x0000, 0x0000, 0x0000 } },
- { 0x1E50, { 0x1E51, 0x0000, 0x0000, 0x0000 } },
- { 0x1E52, { 0x1E53, 0x0000, 0x0000, 0x0000 } },
- { 0x1E54, { 0x1E55, 0x0000, 0x0000, 0x0000 } },
- { 0x1E56, { 0x1E57, 0x0000, 0x0000, 0x0000 } },
- { 0x1E58, { 0x1E59, 0x0000, 0x0000, 0x0000 } },
- { 0x1E5A, { 0x1E5B, 0x0000, 0x0000, 0x0000 } },
- { 0x1E5C, { 0x1E5D, 0x0000, 0x0000, 0x0000 } },
- { 0x1E5E, { 0x1E5F, 0x0000, 0x0000, 0x0000 } },
- { 0x1E60, { 0x1E61, 0x0000, 0x0000, 0x0000 } },
- { 0x1E62, { 0x1E63, 0x0000, 0x0000, 0x0000 } },
- { 0x1E64, { 0x1E65, 0x0000, 0x0000, 0x0000 } },
- { 0x1E66, { 0x1E67, 0x0000, 0x0000, 0x0000 } },
- { 0x1E68, { 0x1E69, 0x0000, 0x0000, 0x0000 } },
- { 0x1E6A, { 0x1E6B, 0x0000, 0x0000, 0x0000 } },
- { 0x1E6C, { 0x1E6D, 0x0000, 0x0000, 0x0000 } },
- { 0x1E6E, { 0x1E6F, 0x0000, 0x0000, 0x0000 } },
- { 0x1E70, { 0x1E71, 0x0000, 0x0000, 0x0000 } },
- { 0x1E72, { 0x1E73, 0x0000, 0x0000, 0x0000 } },
- { 0x1E74, { 0x1E75, 0x0000, 0x0000, 0x0000 } },
- { 0x1E76, { 0x1E77, 0x0000, 0x0000, 0x0000 } },
- { 0x1E78, { 0x1E79, 0x0000, 0x0000, 0x0000 } },
- { 0x1E7A, { 0x1E7B, 0x0000, 0x0000, 0x0000 } },
- { 0x1E7C, { 0x1E7D, 0x0000, 0x0000, 0x0000 } },
- { 0x1E7E, { 0x1E7F, 0x0000, 0x0000, 0x0000 } },
- { 0x1E80, { 0x1E81, 0x0000, 0x0000, 0x0000 } },
- { 0x1E82, { 0x1E83, 0x0000, 0x0000, 0x0000 } },
- { 0x1E84, { 0x1E85, 0x0000, 0x0000, 0x0000 } },
- { 0x1E86, { 0x1E87, 0x0000, 0x0000, 0x0000 } },
- { 0x1E88, { 0x1E89, 0x0000, 0x0000, 0x0000 } },
- { 0x1E8A, { 0x1E8B, 0x0000, 0x0000, 0x0000 } },
- { 0x1E8C, { 0x1E8D, 0x0000, 0x0000, 0x0000 } },
- { 0x1E8E, { 0x1E8F, 0x0000, 0x0000, 0x0000 } },
- { 0x1E90, { 0x1E91, 0x0000, 0x0000, 0x0000 } },
- { 0x1E92, { 0x1E93, 0x0000, 0x0000, 0x0000 } },
- { 0x1E94, { 0x1E95, 0x0000, 0x0000, 0x0000 } },
- { 0x1E96, { 0x0068, 0x0331, 0x0000, 0x0000 } },
- { 0x1E97, { 0x0074, 0x0308, 0x0000, 0x0000 } },
- { 0x1E98, { 0x0077, 0x030A, 0x0000, 0x0000 } },
- { 0x1E99, { 0x0079, 0x030A, 0x0000, 0x0000 } },
- { 0x1E9A, { 0x0061, 0x02BE, 0x0000, 0x0000 } },
- { 0x1E9B, { 0x1E61, 0x0000, 0x0000, 0x0000 } },
- { 0x1EA0, { 0x1EA1, 0x0000, 0x0000, 0x0000 } },
- { 0x1EA2, { 0x1EA3, 0x0000, 0x0000, 0x0000 } },
- { 0x1EA4, { 0x1EA5, 0x0000, 0x0000, 0x0000 } },
- { 0x1EA6, { 0x1EA7, 0x0000, 0x0000, 0x0000 } },
- { 0x1EA8, { 0x1EA9, 0x0000, 0x0000, 0x0000 } },
- { 0x1EAA, { 0x1EAB, 0x0000, 0x0000, 0x0000 } },
- { 0x1EAC, { 0x1EAD, 0x0000, 0x0000, 0x0000 } },
- { 0x1EAE, { 0x1EAF, 0x0000, 0x0000, 0x0000 } },
- { 0x1EB0, { 0x1EB1, 0x0000, 0x0000, 0x0000 } },
- { 0x1EB2, { 0x1EB3, 0x0000, 0x0000, 0x0000 } },
- { 0x1EB4, { 0x1EB5, 0x0000, 0x0000, 0x0000 } },
- { 0x1EB6, { 0x1EB7, 0x0000, 0x0000, 0x0000 } },
- { 0x1EB8, { 0x1EB9, 0x0000, 0x0000, 0x0000 } },
- { 0x1EBA, { 0x1EBB, 0x0000, 0x0000, 0x0000 } },
- { 0x1EBC, { 0x1EBD, 0x0000, 0x0000, 0x0000 } },
- { 0x1EBE, { 0x1EBF, 0x0000, 0x0000, 0x0000 } },
- { 0x1EC0, { 0x1EC1, 0x0000, 0x0000, 0x0000 } },
- { 0x1EC2, { 0x1EC3, 0x0000, 0x0000, 0x0000 } },
- { 0x1EC4, { 0x1EC5, 0x0000, 0x0000, 0x0000 } },
- { 0x1EC6, { 0x1EC7, 0x0000, 0x0000, 0x0000 } },
- { 0x1EC8, { 0x1EC9, 0x0000, 0x0000, 0x0000 } },
- { 0x1ECA, { 0x1ECB, 0x0000, 0x0000, 0x0000 } },
- { 0x1ECC, { 0x1ECD, 0x0000, 0x0000, 0x0000 } },
- { 0x1ECE, { 0x1ECF, 0x0000, 0x0000, 0x0000 } },
- { 0x1ED0, { 0x1ED1, 0x0000, 0x0000, 0x0000 } },
- { 0x1ED2, { 0x1ED3, 0x0000, 0x0000, 0x0000 } },
- { 0x1ED4, { 0x1ED5, 0x0000, 0x0000, 0x0000 } },
- { 0x1ED6, { 0x1ED7, 0x0000, 0x0000, 0x0000 } },
- { 0x1ED8, { 0x1ED9, 0x0000, 0x0000, 0x0000 } },
- { 0x1EDA, { 0x1EDB, 0x0000, 0x0000, 0x0000 } },
- { 0x1EDC, { 0x1EDD, 0x0000, 0x0000, 0x0000 } },
- { 0x1EDE, { 0x1EDF, 0x0000, 0x0000, 0x0000 } },
- { 0x1EE0, { 0x1EE1, 0x0000, 0x0000, 0x0000 } },
- { 0x1EE2, { 0x1EE3, 0x0000, 0x0000, 0x0000 } },
- { 0x1EE4, { 0x1EE5, 0x0000, 0x0000, 0x0000 } },
- { 0x1EE6, { 0x1EE7, 0x0000, 0x0000, 0x0000 } },
- { 0x1EE8, { 0x1EE9, 0x0000, 0x0000, 0x0000 } },
- { 0x1EEA, { 0x1EEB, 0x0000, 0x0000, 0x0000 } },
- { 0x1EEC, { 0x1EED, 0x0000, 0x0000, 0x0000 } },
- { 0x1EEE, { 0x1EEF, 0x0000, 0x0000, 0x0000 } },
- { 0x1EF0, { 0x1EF1, 0x0000, 0x0000, 0x0000 } },
- { 0x1EF2, { 0x1EF3, 0x0000, 0x0000, 0x0000 } },
- { 0x1EF4, { 0x1EF5, 0x0000, 0x0000, 0x0000 } },
- { 0x1EF6, { 0x1EF7, 0x0000, 0x0000, 0x0000 } },
- { 0x1EF8, { 0x1EF9, 0x0000, 0x0000, 0x0000 } },
- { 0x1F08, { 0x1F00, 0x0000, 0x0000, 0x0000 } },
- { 0x1F09, { 0x1F01, 0x0000, 0x0000, 0x0000 } },
- { 0x1F0A, { 0x1F02, 0x0000, 0x0000, 0x0000 } },
- { 0x1F0B, { 0x1F03, 0x0000, 0x0000, 0x0000 } },
- { 0x1F0C, { 0x1F04, 0x0000, 0x0000, 0x0000 } },
- { 0x1F0D, { 0x1F05, 0x0000, 0x0000, 0x0000 } },
- { 0x1F0E, { 0x1F06, 0x0000, 0x0000, 0x0000 } },
- { 0x1F0F, { 0x1F07, 0x0000, 0x0000, 0x0000 } },
- { 0x1F18, { 0x1F10, 0x0000, 0x0000, 0x0000 } },
- { 0x1F19, { 0x1F11, 0x0000, 0x0000, 0x0000 } },
- { 0x1F1A, { 0x1F12, 0x0000, 0x0000, 0x0000 } },
- { 0x1F1B, { 0x1F13, 0x0000, 0x0000, 0x0000 } },
- { 0x1F1C, { 0x1F14, 0x0000, 0x0000, 0x0000 } },
- { 0x1F1D, { 0x1F15, 0x0000, 0x0000, 0x0000 } },
- { 0x1F28, { 0x1F20, 0x0000, 0x0000, 0x0000 } },
- { 0x1F29, { 0x1F21, 0x0000, 0x0000, 0x0000 } },
- { 0x1F2A, { 0x1F22, 0x0000, 0x0000, 0x0000 } },
- { 0x1F2B, { 0x1F23, 0x0000, 0x0000, 0x0000 } },
- { 0x1F2C, { 0x1F24, 0x0000, 0x0000, 0x0000 } },
- { 0x1F2D, { 0x1F25, 0x0000, 0x0000, 0x0000 } },
- { 0x1F2E, { 0x1F26, 0x0000, 0x0000, 0x0000 } },
- { 0x1F2F, { 0x1F27, 0x0000, 0x0000, 0x0000 } },
- { 0x1F38, { 0x1F30, 0x0000, 0x0000, 0x0000 } },
- { 0x1F39, { 0x1F31, 0x0000, 0x0000, 0x0000 } },
- { 0x1F3A, { 0x1F32, 0x0000, 0x0000, 0x0000 } },
- { 0x1F3B, { 0x1F33, 0x0000, 0x0000, 0x0000 } },
- { 0x1F3C, { 0x1F34, 0x0000, 0x0000, 0x0000 } },
- { 0x1F3D, { 0x1F35, 0x0000, 0x0000, 0x0000 } },
- { 0x1F3E, { 0x1F36, 0x0000, 0x0000, 0x0000 } },
- { 0x1F3F, { 0x1F37, 0x0000, 0x0000, 0x0000 } },
- { 0x1F48, { 0x1F40, 0x0000, 0x0000, 0x0000 } },
- { 0x1F49, { 0x1F41, 0x0000, 0x0000, 0x0000 } },
- { 0x1F4A, { 0x1F42, 0x0000, 0x0000, 0x0000 } },
- { 0x1F4B, { 0x1F43, 0x0000, 0x0000, 0x0000 } },
- { 0x1F4C, { 0x1F44, 0x0000, 0x0000, 0x0000 } },
- { 0x1F4D, { 0x1F45, 0x0000, 0x0000, 0x0000 } },
- { 0x1F50, { 0x03C5, 0x0313, 0x0000, 0x0000 } },
- { 0x1F52, { 0x03C5, 0x0313, 0x0300, 0x0000 } },
- { 0x1F54, { 0x03C5, 0x0313, 0x0301, 0x0000 } },
- { 0x1F56, { 0x03C5, 0x0313, 0x0342, 0x0000 } },
- { 0x1F59, { 0x1F51, 0x0000, 0x0000, 0x0000 } },
- { 0x1F5B, { 0x1F53, 0x0000, 0x0000, 0x0000 } },
- { 0x1F5D, { 0x1F55, 0x0000, 0x0000, 0x0000 } },
- { 0x1F5F, { 0x1F57, 0x0000, 0x0000, 0x0000 } },
- { 0x1F68, { 0x1F60, 0x0000, 0x0000, 0x0000 } },
- { 0x1F69, { 0x1F61, 0x0000, 0x0000, 0x0000 } },
- { 0x1F6A, { 0x1F62, 0x0000, 0x0000, 0x0000 } },
- { 0x1F6B, { 0x1F63, 0x0000, 0x0000, 0x0000 } },
- { 0x1F6C, { 0x1F64, 0x0000, 0x0000, 0x0000 } },
- { 0x1F6D, { 0x1F65, 0x0000, 0x0000, 0x0000 } },
- { 0x1F6E, { 0x1F66, 0x0000, 0x0000, 0x0000 } },
- { 0x1F6F, { 0x1F67, 0x0000, 0x0000, 0x0000 } },
- { 0x1F80, { 0x1F00, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F81, { 0x1F01, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F82, { 0x1F02, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F83, { 0x1F03, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F84, { 0x1F04, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F85, { 0x1F05, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F86, { 0x1F06, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F87, { 0x1F07, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F88, { 0x1F00, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F89, { 0x1F01, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F8A, { 0x1F02, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F8B, { 0x1F03, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F8C, { 0x1F04, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F8D, { 0x1F05, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F8E, { 0x1F06, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F8F, { 0x1F07, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F90, { 0x1F20, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F91, { 0x1F21, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F92, { 0x1F22, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F93, { 0x1F23, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F94, { 0x1F24, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F95, { 0x1F25, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F96, { 0x1F26, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F97, { 0x1F27, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F98, { 0x1F20, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F99, { 0x1F21, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F9A, { 0x1F22, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F9B, { 0x1F23, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F9C, { 0x1F24, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F9D, { 0x1F25, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F9E, { 0x1F26, 0x03B9, 0x0000, 0x0000 } },
- { 0x1F9F, { 0x1F27, 0x03B9, 0x0000, 0x0000 } },
- { 0x1FA0, { 0x1F60, 0x03B9, 0x0000, 0x0000 } },
- { 0x1FA1, { 0x1F61, 0x03B9, 0x0000, 0x0000 } },
- { 0x1FA2, { 0x1F62, 0x03B9, 0x0000, 0x0000 } },
- { 0x1FA3, { 0x1F63, 0x03B9, 0x0000, 0x0000 } },
- { 0x1FA4, { 0x1F64, 0x03B9, 0x0000, 0x0000 } },
- { 0x1FA5, { 0x1F65, 0x03B9, 0x0000, 0x0000 } },
- { 0x1FA6, { 0x1F66, 0x03B9, 0x0000, 0x0000 } },
- { 0x1FA7, { 0x1F67, 0x03B9, 0x0000, 0x0000 } },
- { 0x1FA8, { 0x1F60, 0x03B9, 0x0000, 0x0000 } },
- { 0x1FA9, { 0x1F61, 0x03B9, 0x0000, 0x0000 } },
- { 0x1FAA, { 0x1F62, 0x03B9, 0x0000, 0x0000 } },
- { 0x1FAB, { 0x1F63, 0x03B9, 0x0000, 0x0000 } },
- { 0x1FAC, { 0x1F64, 0x03B9, 0x0000, 0x0000 } },
- { 0x1FAD, { 0x1F65, 0x03B9, 0x0000, 0x0000 } },
- { 0x1FAE, { 0x1F66, 0x03B9, 0x0000, 0x0000 } },
- { 0x1FAF, { 0x1F67, 0x03B9, 0x0000, 0x0000 } },
- { 0x1FB2, { 0x1F70, 0x03B9, 0x0000, 0x0000 } },
- { 0x1FB3, { 0x03B1, 0x03B9, 0x0000, 0x0000 } },
- { 0x1FB4, { 0x03AC, 0x03B9, 0x0000, 0x0000 } },
- { 0x1FB6, { 0x03B1, 0x0342, 0x0000, 0x0000 } },
- { 0x1FB7, { 0x03B1, 0x0342, 0x03B9, 0x0000 } },
- { 0x1FB8, { 0x1FB0, 0x0000, 0x0000, 0x0000 } },
- { 0x1FB9, { 0x1FB1, 0x0000, 0x0000, 0x0000 } },
- { 0x1FBA, { 0x1F70, 0x0000, 0x0000, 0x0000 } },
- { 0x1FBB, { 0x1F71, 0x0000, 0x0000, 0x0000 } },
- { 0x1FBC, { 0x03B1, 0x03B9, 0x0000, 0x0000 } },
- { 0x1FBE, { 0x03B9, 0x0000, 0x0000, 0x0000 } },
- { 0x1FC2, { 0x1F74, 0x03B9, 0x0000, 0x0000 } },
- { 0x1FC3, { 0x03B7, 0x03B9, 0x0000, 0x0000 } },
- { 0x1FC4, { 0x03AE, 0x03B9, 0x0000, 0x0000 } },
- { 0x1FC6, { 0x03B7, 0x0342, 0x0000, 0x0000 } },
- { 0x1FC7, { 0x03B7, 0x0342, 0x03B9, 0x0000 } },
- { 0x1FC8, { 0x1F72, 0x0000, 0x0000, 0x0000 } },
- { 0x1FC9, { 0x1F73, 0x0000, 0x0000, 0x0000 } },
- { 0x1FCA, { 0x1F74, 0x0000, 0x0000, 0x0000 } },
- { 0x1FCB, { 0x1F75, 0x0000, 0x0000, 0x0000 } },
- { 0x1FCC, { 0x03B7, 0x03B9, 0x0000, 0x0000 } },
- { 0x1FD2, { 0x03B9, 0x0308, 0x0300, 0x0000 } },
- { 0x1FD3, { 0x03B9, 0x0308, 0x0301, 0x0000 } },
- { 0x1FD6, { 0x03B9, 0x0342, 0x0000, 0x0000 } },
- { 0x1FD7, { 0x03B9, 0x0308, 0x0342, 0x0000 } },
- { 0x1FD8, { 0x1FD0, 0x0000, 0x0000, 0x0000 } },
- { 0x1FD9, { 0x1FD1, 0x0000, 0x0000, 0x0000 } },
- { 0x1FDA, { 0x1F76, 0x0000, 0x0000, 0x0000 } },
- { 0x1FDB, { 0x1F77, 0x0000, 0x0000, 0x0000 } },
- { 0x1FE2, { 0x03C5, 0x0308, 0x0300, 0x0000 } },
- { 0x1FE3, { 0x03C5, 0x0308, 0x0301, 0x0000 } },
- { 0x1FE4, { 0x03C1, 0x0313, 0x0000, 0x0000 } },
- { 0x1FE6, { 0x03C5, 0x0342, 0x0000, 0x0000 } },
- { 0x1FE7, { 0x03C5, 0x0308, 0x0342, 0x0000 } },
- { 0x1FE8, { 0x1FE0, 0x0000, 0x0000, 0x0000 } },
- { 0x1FE9, { 0x1FE1, 0x0000, 0x0000, 0x0000 } },
- { 0x1FEA, { 0x1F7A, 0x0000, 0x0000, 0x0000 } },
- { 0x1FEB, { 0x1F7B, 0x0000, 0x0000, 0x0000 } },
- { 0x1FEC, { 0x1FE5, 0x0000, 0x0000, 0x0000 } },
- { 0x1FF2, { 0x1F7C, 0x03B9, 0x0000, 0x0000 } },
- { 0x1FF3, { 0x03C9, 0x03B9, 0x0000, 0x0000 } },
- { 0x1FF4, { 0x03CE, 0x03B9, 0x0000, 0x0000 } },
- { 0x1FF6, { 0x03C9, 0x0342, 0x0000, 0x0000 } },
- { 0x1FF7, { 0x03C9, 0x0342, 0x03B9, 0x0000 } },
- { 0x1FF8, { 0x1F78, 0x0000, 0x0000, 0x0000 } },
- { 0x1FF9, { 0x1F79, 0x0000, 0x0000, 0x0000 } },
- { 0x1FFA, { 0x1F7C, 0x0000, 0x0000, 0x0000 } },
- { 0x1FFB, { 0x1F7D, 0x0000, 0x0000, 0x0000 } },
- { 0x1FFC, { 0x03C9, 0x03B9, 0x0000, 0x0000 } },
- { 0x20A8, { 0x0072, 0x0073, 0x0000, 0x0000 } },
- { 0x2102, { 0x0063, 0x0000, 0x0000, 0x0000 } },
- { 0x2103, { 0x00B0, 0x0063, 0x0000, 0x0000 } },
- { 0x2107, { 0x025B, 0x0000, 0x0000, 0x0000 } },
- { 0x2109, { 0x00B0, 0x0066, 0x0000, 0x0000 } },
- { 0x210B, { 0x0068, 0x0000, 0x0000, 0x0000 } },
- { 0x210C, { 0x0068, 0x0000, 0x0000, 0x0000 } },
- { 0x210D, { 0x0068, 0x0000, 0x0000, 0x0000 } },
- { 0x2110, { 0x0069, 0x0000, 0x0000, 0x0000 } },
- { 0x2111, { 0x0069, 0x0000, 0x0000, 0x0000 } },
- { 0x2112, { 0x006C, 0x0000, 0x0000, 0x0000 } },
- { 0x2115, { 0x006E, 0x0000, 0x0000, 0x0000 } },
- { 0x2116, { 0x006E, 0x006F, 0x0000, 0x0000 } },
- { 0x2119, { 0x0070, 0x0000, 0x0000, 0x0000 } },
- { 0x211A, { 0x0071, 0x0000, 0x0000, 0x0000 } },
- { 0x211B, { 0x0072, 0x0000, 0x0000, 0x0000 } },
- { 0x211C, { 0x0072, 0x0000, 0x0000, 0x0000 } },
- { 0x211D, { 0x0072, 0x0000, 0x0000, 0x0000 } },
- { 0x2120, { 0x0073, 0x006D, 0x0000, 0x0000 } },
- { 0x2121, { 0x0074, 0x0065, 0x006C, 0x0000 } },
- { 0x2122, { 0x0074, 0x006D, 0x0000, 0x0000 } },
- { 0x2124, { 0x007A, 0x0000, 0x0000, 0x0000 } },
- { 0x2126, { 0x03C9, 0x0000, 0x0000, 0x0000 } },
- { 0x2128, { 0x007A, 0x0000, 0x0000, 0x0000 } },
- { 0x212A, { 0x006B, 0x0000, 0x0000, 0x0000 } },
- { 0x212B, { 0x00E5, 0x0000, 0x0000, 0x0000 } },
- { 0x212C, { 0x0062, 0x0000, 0x0000, 0x0000 } },
- { 0x212D, { 0x0063, 0x0000, 0x0000, 0x0000 } },
- { 0x2130, { 0x0065, 0x0000, 0x0000, 0x0000 } },
- { 0x2131, { 0x0066, 0x0000, 0x0000, 0x0000 } },
- { 0x2133, { 0x006D, 0x0000, 0x0000, 0x0000 } },
- { 0x213E, { 0x03B3, 0x0000, 0x0000, 0x0000 } },
- { 0x213F, { 0x03C0, 0x0000, 0x0000, 0x0000 } },
- { 0x2145, { 0x0064, 0x0000, 0x0000, 0x0000 } },
- { 0x2160, { 0x2170, 0x0000, 0x0000, 0x0000 } },
- { 0x2161, { 0x2171, 0x0000, 0x0000, 0x0000 } },
- { 0x2162, { 0x2172, 0x0000, 0x0000, 0x0000 } },
- { 0x2163, { 0x2173, 0x0000, 0x0000, 0x0000 } },
- { 0x2164, { 0x2174, 0x0000, 0x0000, 0x0000 } },
- { 0x2165, { 0x2175, 0x0000, 0x0000, 0x0000 } },
- { 0x2166, { 0x2176, 0x0000, 0x0000, 0x0000 } },
- { 0x2167, { 0x2177, 0x0000, 0x0000, 0x0000 } },
- { 0x2168, { 0x2178, 0x0000, 0x0000, 0x0000 } },
- { 0x2169, { 0x2179, 0x0000, 0x0000, 0x0000 } },
- { 0x216A, { 0x217A, 0x0000, 0x0000, 0x0000 } },
- { 0x216B, { 0x217B, 0x0000, 0x0000, 0x0000 } },
- { 0x216C, { 0x217C, 0x0000, 0x0000, 0x0000 } },
- { 0x216D, { 0x217D, 0x0000, 0x0000, 0x0000 } },
- { 0x216E, { 0x217E, 0x0000, 0x0000, 0x0000 } },
- { 0x216F, { 0x217F, 0x0000, 0x0000, 0x0000 } },
- { 0x24B6, { 0x24D0, 0x0000, 0x0000, 0x0000 } },
- { 0x24B7, { 0x24D1, 0x0000, 0x0000, 0x0000 } },
- { 0x24B8, { 0x24D2, 0x0000, 0x0000, 0x0000 } },
- { 0x24B9, { 0x24D3, 0x0000, 0x0000, 0x0000 } },
- { 0x24BA, { 0x24D4, 0x0000, 0x0000, 0x0000 } },
- { 0x24BB, { 0x24D5, 0x0000, 0x0000, 0x0000 } },
- { 0x24BC, { 0x24D6, 0x0000, 0x0000, 0x0000 } },
- { 0x24BD, { 0x24D7, 0x0000, 0x0000, 0x0000 } },
- { 0x24BE, { 0x24D8, 0x0000, 0x0000, 0x0000 } },
- { 0x24BF, { 0x24D9, 0x0000, 0x0000, 0x0000 } },
- { 0x24C0, { 0x24DA, 0x0000, 0x0000, 0x0000 } },
- { 0x24C1, { 0x24DB, 0x0000, 0x0000, 0x0000 } },
- { 0x24C2, { 0x24DC, 0x0000, 0x0000, 0x0000 } },
- { 0x24C3, { 0x24DD, 0x0000, 0x0000, 0x0000 } },
- { 0x24C4, { 0x24DE, 0x0000, 0x0000, 0x0000 } },
- { 0x24C5, { 0x24DF, 0x0000, 0x0000, 0x0000 } },
- { 0x24C6, { 0x24E0, 0x0000, 0x0000, 0x0000 } },
- { 0x24C7, { 0x24E1, 0x0000, 0x0000, 0x0000 } },
- { 0x24C8, { 0x24E2, 0x0000, 0x0000, 0x0000 } },
- { 0x24C9, { 0x24E3, 0x0000, 0x0000, 0x0000 } },
- { 0x24CA, { 0x24E4, 0x0000, 0x0000, 0x0000 } },
- { 0x24CB, { 0x24E5, 0x0000, 0x0000, 0x0000 } },
- { 0x24CC, { 0x24E6, 0x0000, 0x0000, 0x0000 } },
- { 0x24CD, { 0x24E7, 0x0000, 0x0000, 0x0000 } },
- { 0x24CE, { 0x24E8, 0x0000, 0x0000, 0x0000 } },
- { 0x24CF, { 0x24E9, 0x0000, 0x0000, 0x0000 } },
- { 0x3371, { 0x0068, 0x0070, 0x0061, 0x0000 } },
- { 0x3373, { 0x0061, 0x0075, 0x0000, 0x0000 } },
- { 0x3375, { 0x006F, 0x0076, 0x0000, 0x0000 } },
- { 0x3380, { 0x0070, 0x0061, 0x0000, 0x0000 } },
- { 0x3381, { 0x006E, 0x0061, 0x0000, 0x0000 } },
- { 0x3382, { 0x03BC, 0x0061, 0x0000, 0x0000 } },
- { 0x3383, { 0x006D, 0x0061, 0x0000, 0x0000 } },
- { 0x3384, { 0x006B, 0x0061, 0x0000, 0x0000 } },
- { 0x3385, { 0x006B, 0x0062, 0x0000, 0x0000 } },
- { 0x3386, { 0x006D, 0x0062, 0x0000, 0x0000 } },
- { 0x3387, { 0x0067, 0x0062, 0x0000, 0x0000 } },
- { 0x338A, { 0x0070, 0x0066, 0x0000, 0x0000 } },
- { 0x338B, { 0x006E, 0x0066, 0x0000, 0x0000 } },
- { 0x338C, { 0x03BC, 0x0066, 0x0000, 0x0000 } },
- { 0x3390, { 0x0068, 0x007A, 0x0000, 0x0000 } },
- { 0x3391, { 0x006B, 0x0068, 0x007A, 0x0000 } },
- { 0x3392, { 0x006D, 0x0068, 0x007A, 0x0000 } },
- { 0x3393, { 0x0067, 0x0068, 0x007A, 0x0000 } },
- { 0x3394, { 0x0074, 0x0068, 0x007A, 0x0000 } },
- { 0x33A9, { 0x0070, 0x0061, 0x0000, 0x0000 } },
- { 0x33AA, { 0x006B, 0x0070, 0x0061, 0x0000 } },
- { 0x33AB, { 0x006D, 0x0070, 0x0061, 0x0000 } },
- { 0x33AC, { 0x0067, 0x0070, 0x0061, 0x0000 } },
- { 0x33B4, { 0x0070, 0x0076, 0x0000, 0x0000 } },
- { 0x33B5, { 0x006E, 0x0076, 0x0000, 0x0000 } },
- { 0x33B6, { 0x03BC, 0x0076, 0x0000, 0x0000 } },
- { 0x33B7, { 0x006D, 0x0076, 0x0000, 0x0000 } },
- { 0x33B8, { 0x006B, 0x0076, 0x0000, 0x0000 } },
- { 0x33B9, { 0x006D, 0x0076, 0x0000, 0x0000 } },
- { 0x33BA, { 0x0070, 0x0077, 0x0000, 0x0000 } },
- { 0x33BB, { 0x006E, 0x0077, 0x0000, 0x0000 } },
- { 0x33BC, { 0x03BC, 0x0077, 0x0000, 0x0000 } },
- { 0x33BD, { 0x006D, 0x0077, 0x0000, 0x0000 } },
- { 0x33BE, { 0x006B, 0x0077, 0x0000, 0x0000 } },
- { 0x33BF, { 0x006D, 0x0077, 0x0000, 0x0000 } },
- { 0x33C0, { 0x006B, 0x03C9, 0x0000, 0x0000 } },
- { 0x33C1, { 0x006D, 0x03C9, 0x0000, 0x0000 } },
- { 0x33C3, { 0x0062, 0x0071, 0x0000, 0x0000 } },
- { 0x33C6, { 0x0063, 0x2215, 0x006B, 0x0067 } },
- { 0x33C7, { 0x0063, 0x006F, 0x002E, 0x0000 } },
- { 0x33C8, { 0x0064, 0x0062, 0x0000, 0x0000 } },
- { 0x33C9, { 0x0067, 0x0079, 0x0000, 0x0000 } },
- { 0x33CB, { 0x0068, 0x0070, 0x0000, 0x0000 } },
- { 0x33CD, { 0x006B, 0x006B, 0x0000, 0x0000 } },
- { 0x33CE, { 0x006B, 0x006D, 0x0000, 0x0000 } },
- { 0x33D7, { 0x0070, 0x0068, 0x0000, 0x0000 } },
- { 0x33D9, { 0x0070, 0x0070, 0x006D, 0x0000 } },
- { 0x33DA, { 0x0070, 0x0072, 0x0000, 0x0000 } },
- { 0x33DC, { 0x0073, 0x0076, 0x0000, 0x0000 } },
- { 0x33DD, { 0x0077, 0x0062, 0x0000, 0x0000 } },
- { 0xFB00, { 0x0066, 0x0066, 0x0000, 0x0000 } },
- { 0xFB01, { 0x0066, 0x0069, 0x0000, 0x0000 } },
- { 0xFB02, { 0x0066, 0x006C, 0x0000, 0x0000 } },
- { 0xFB03, { 0x0066, 0x0066, 0x0069, 0x0000 } },
- { 0xFB04, { 0x0066, 0x0066, 0x006C, 0x0000 } },
- { 0xFB05, { 0x0073, 0x0074, 0x0000, 0x0000 } },
- { 0xFB06, { 0x0073, 0x0074, 0x0000, 0x0000 } },
- { 0xFB13, { 0x0574, 0x0576, 0x0000, 0x0000 } },
- { 0xFB14, { 0x0574, 0x0565, 0x0000, 0x0000 } },
- { 0xFB15, { 0x0574, 0x056B, 0x0000, 0x0000 } },
- { 0xFB16, { 0x057E, 0x0576, 0x0000, 0x0000 } },
- { 0xFB17, { 0x0574, 0x056D, 0x0000, 0x0000 } },
- { 0xFF21, { 0xFF41, 0x0000, 0x0000, 0x0000 } },
- { 0xFF22, { 0xFF42, 0x0000, 0x0000, 0x0000 } },
- { 0xFF23, { 0xFF43, 0x0000, 0x0000, 0x0000 } },
- { 0xFF24, { 0xFF44, 0x0000, 0x0000, 0x0000 } },
- { 0xFF25, { 0xFF45, 0x0000, 0x0000, 0x0000 } },
- { 0xFF26, { 0xFF46, 0x0000, 0x0000, 0x0000 } },
- { 0xFF27, { 0xFF47, 0x0000, 0x0000, 0x0000 } },
- { 0xFF28, { 0xFF48, 0x0000, 0x0000, 0x0000 } },
- { 0xFF29, { 0xFF49, 0x0000, 0x0000, 0x0000 } },
- { 0xFF2A, { 0xFF4A, 0x0000, 0x0000, 0x0000 } },
- { 0xFF2B, { 0xFF4B, 0x0000, 0x0000, 0x0000 } },
- { 0xFF2C, { 0xFF4C, 0x0000, 0x0000, 0x0000 } },
- { 0xFF2D, { 0xFF4D, 0x0000, 0x0000, 0x0000 } },
- { 0xFF2E, { 0xFF4E, 0x0000, 0x0000, 0x0000 } },
- { 0xFF2F, { 0xFF4F, 0x0000, 0x0000, 0x0000 } },
- { 0xFF30, { 0xFF50, 0x0000, 0x0000, 0x0000 } },
- { 0xFF31, { 0xFF51, 0x0000, 0x0000, 0x0000 } },
- { 0xFF32, { 0xFF52, 0x0000, 0x0000, 0x0000 } },
- { 0xFF33, { 0xFF53, 0x0000, 0x0000, 0x0000 } },
- { 0xFF34, { 0xFF54, 0x0000, 0x0000, 0x0000 } },
- { 0xFF35, { 0xFF55, 0x0000, 0x0000, 0x0000 } },
- { 0xFF36, { 0xFF56, 0x0000, 0x0000, 0x0000 } },
- { 0xFF37, { 0xFF57, 0x0000, 0x0000, 0x0000 } },
- { 0xFF38, { 0xFF58, 0x0000, 0x0000, 0x0000 } },
- { 0xFF39, { 0xFF59, 0x0000, 0x0000, 0x0000 } },
- { 0xFF3A, { 0xFF5A, 0x0000, 0x0000, 0x0000 } },
- { 0x10400, { 0xd801, 0xdc28, 0x0000, 0x0000 } },
- { 0x10401, { 0xd801, 0xdc29, 0x0000, 0x0000 } },
- { 0x10402, { 0xd801, 0xdc2A, 0x0000, 0x0000 } },
- { 0x10403, { 0xd801, 0xdc2B, 0x0000, 0x0000 } },
- { 0x10404, { 0xd801, 0xdc2C, 0x0000, 0x0000 } },
- { 0x10405, { 0xd801, 0xdc2D, 0x0000, 0x0000 } },
- { 0x10406, { 0xd801, 0xdc2E, 0x0000, 0x0000 } },
- { 0x10407, { 0xd801, 0xdc2F, 0x0000, 0x0000 } },
- { 0x10408, { 0xd801, 0xdc30, 0x0000, 0x0000 } },
- { 0x10409, { 0xd801, 0xdc31, 0x0000, 0x0000 } },
- { 0x1040A, { 0xd801, 0xdc32, 0x0000, 0x0000 } },
- { 0x1040B, { 0xd801, 0xdc33, 0x0000, 0x0000 } },
- { 0x1040C, { 0xd801, 0xdc34, 0x0000, 0x0000 } },
- { 0x1040D, { 0xd801, 0xdc35, 0x0000, 0x0000 } },
- { 0x1040E, { 0xd801, 0xdc36, 0x0000, 0x0000 } },
- { 0x1040F, { 0xd801, 0xdc37, 0x0000, 0x0000 } },
- { 0x10410, { 0xd801, 0xdc38, 0x0000, 0x0000 } },
- { 0x10411, { 0xd801, 0xdc39, 0x0000, 0x0000 } },
- { 0x10412, { 0xd801, 0xdc3A, 0x0000, 0x0000 } },
- { 0x10413, { 0xd801, 0xdc3B, 0x0000, 0x0000 } },
- { 0x10414, { 0xd801, 0xdc3C, 0x0000, 0x0000 } },
- { 0x10415, { 0xd801, 0xdc3D, 0x0000, 0x0000 } },
- { 0x10416, { 0xd801, 0xdc3E, 0x0000, 0x0000 } },
- { 0x10417, { 0xd801, 0xdc3F, 0x0000, 0x0000 } },
- { 0x10418, { 0xd801, 0xdc40, 0x0000, 0x0000 } },
- { 0x10419, { 0xd801, 0xdc41, 0x0000, 0x0000 } },
- { 0x1041A, { 0xd801, 0xdc42, 0x0000, 0x0000 } },
- { 0x1041B, { 0xd801, 0xdc43, 0x0000, 0x0000 } },
- { 0x1041C, { 0xd801, 0xdc44, 0x0000, 0x0000 } },
- { 0x1041D, { 0xd801, 0xdc45, 0x0000, 0x0000 } },
- { 0x1041E, { 0xd801, 0xdc46, 0x0000, 0x0000 } },
- { 0x1041F, { 0xd801, 0xdc47, 0x0000, 0x0000 } },
- { 0x10420, { 0xd801, 0xdc48, 0x0000, 0x0000 } },
- { 0x10421, { 0xd801, 0xdc49, 0x0000, 0x0000 } },
- { 0x10422, { 0xd801, 0xdc4A, 0x0000, 0x0000 } },
- { 0x10423, { 0xd801, 0xdc4B, 0x0000, 0x0000 } },
- { 0x10424, { 0xd801, 0xdc4C, 0x0000, 0x0000 } },
- { 0x10425, { 0xd801, 0xdc4D, 0x0000, 0x0000 } },
- { 0x1D400, { 0x0061, 0x0000, 0x0000, 0x0000 } },
- { 0x1D401, { 0x0062, 0x0000, 0x0000, 0x0000 } },
- { 0x1D402, { 0x0063, 0x0000, 0x0000, 0x0000 } },
- { 0x1D403, { 0x0064, 0x0000, 0x0000, 0x0000 } },
- { 0x1D404, { 0x0065, 0x0000, 0x0000, 0x0000 } },
- { 0x1D405, { 0x0066, 0x0000, 0x0000, 0x0000 } },
- { 0x1D406, { 0x0067, 0x0000, 0x0000, 0x0000 } },
- { 0x1D407, { 0x0068, 0x0000, 0x0000, 0x0000 } },
- { 0x1D408, { 0x0069, 0x0000, 0x0000, 0x0000 } },
- { 0x1D409, { 0x006A, 0x0000, 0x0000, 0x0000 } },
- { 0x1D40A, { 0x006B, 0x0000, 0x0000, 0x0000 } },
- { 0x1D40B, { 0x006C, 0x0000, 0x0000, 0x0000 } },
- { 0x1D40C, { 0x006D, 0x0000, 0x0000, 0x0000 } },
- { 0x1D40D, { 0x006E, 0x0000, 0x0000, 0x0000 } },
- { 0x1D40E, { 0x006F, 0x0000, 0x0000, 0x0000 } },
- { 0x1D40F, { 0x0070, 0x0000, 0x0000, 0x0000 } },
- { 0x1D410, { 0x0071, 0x0000, 0x0000, 0x0000 } },
- { 0x1D411, { 0x0072, 0x0000, 0x0000, 0x0000 } },
- { 0x1D412, { 0x0073, 0x0000, 0x0000, 0x0000 } },
- { 0x1D413, { 0x0074, 0x0000, 0x0000, 0x0000 } },
- { 0x1D414, { 0x0075, 0x0000, 0x0000, 0x0000 } },
- { 0x1D415, { 0x0076, 0x0000, 0x0000, 0x0000 } },
- { 0x1D416, { 0x0077, 0x0000, 0x0000, 0x0000 } },
- { 0x1D417, { 0x0078, 0x0000, 0x0000, 0x0000 } },
- { 0x1D418, { 0x0079, 0x0000, 0x0000, 0x0000 } },
- { 0x1D419, { 0x007A, 0x0000, 0x0000, 0x0000 } },
- { 0x1D434, { 0x0061, 0x0000, 0x0000, 0x0000 } },
- { 0x1D435, { 0x0062, 0x0000, 0x0000, 0x0000 } },
- { 0x1D436, { 0x0063, 0x0000, 0x0000, 0x0000 } },
- { 0x1D437, { 0x0064, 0x0000, 0x0000, 0x0000 } },
- { 0x1D438, { 0x0065, 0x0000, 0x0000, 0x0000 } },
- { 0x1D439, { 0x0066, 0x0000, 0x0000, 0x0000 } },
- { 0x1D43A, { 0x0067, 0x0000, 0x0000, 0x0000 } },
- { 0x1D43B, { 0x0068, 0x0000, 0x0000, 0x0000 } },
- { 0x1D43C, { 0x0069, 0x0000, 0x0000, 0x0000 } },
- { 0x1D43D, { 0x006A, 0x0000, 0x0000, 0x0000 } },
- { 0x1D43E, { 0x006B, 0x0000, 0x0000, 0x0000 } },
- { 0x1D43F, { 0x006C, 0x0000, 0x0000, 0x0000 } },
- { 0x1D440, { 0x006D, 0x0000, 0x0000, 0x0000 } },
- { 0x1D441, { 0x006E, 0x0000, 0x0000, 0x0000 } },
- { 0x1D442, { 0x006F, 0x0000, 0x0000, 0x0000 } },
- { 0x1D443, { 0x0070, 0x0000, 0x0000, 0x0000 } },
- { 0x1D444, { 0x0071, 0x0000, 0x0000, 0x0000 } },
- { 0x1D445, { 0x0072, 0x0000, 0x0000, 0x0000 } },
- { 0x1D446, { 0x0073, 0x0000, 0x0000, 0x0000 } },
- { 0x1D447, { 0x0074, 0x0000, 0x0000, 0x0000 } },
- { 0x1D448, { 0x0075, 0x0000, 0x0000, 0x0000 } },
- { 0x1D449, { 0x0076, 0x0000, 0x0000, 0x0000 } },
- { 0x1D44A, { 0x0077, 0x0000, 0x0000, 0x0000 } },
- { 0x1D44B, { 0x0078, 0x0000, 0x0000, 0x0000 } },
- { 0x1D44C, { 0x0079, 0x0000, 0x0000, 0x0000 } },
- { 0x1D44D, { 0x007A, 0x0000, 0x0000, 0x0000 } },
- { 0x1D468, { 0x0061, 0x0000, 0x0000, 0x0000 } },
- { 0x1D469, { 0x0062, 0x0000, 0x0000, 0x0000 } },
- { 0x1D46A, { 0x0063, 0x0000, 0x0000, 0x0000 } },
- { 0x1D46B, { 0x0064, 0x0000, 0x0000, 0x0000 } },
- { 0x1D46C, { 0x0065, 0x0000, 0x0000, 0x0000 } },
- { 0x1D46D, { 0x0066, 0x0000, 0x0000, 0x0000 } },
- { 0x1D46E, { 0x0067, 0x0000, 0x0000, 0x0000 } },
- { 0x1D46F, { 0x0068, 0x0000, 0x0000, 0x0000 } },
- { 0x1D470, { 0x0069, 0x0000, 0x0000, 0x0000 } },
- { 0x1D471, { 0x006A, 0x0000, 0x0000, 0x0000 } },
- { 0x1D472, { 0x006B, 0x0000, 0x0000, 0x0000 } },
- { 0x1D473, { 0x006C, 0x0000, 0x0000, 0x0000 } },
- { 0x1D474, { 0x006D, 0x0000, 0x0000, 0x0000 } },
- { 0x1D475, { 0x006E, 0x0000, 0x0000, 0x0000 } },
- { 0x1D476, { 0x006F, 0x0000, 0x0000, 0x0000 } },
- { 0x1D477, { 0x0070, 0x0000, 0x0000, 0x0000 } },
- { 0x1D478, { 0x0071, 0x0000, 0x0000, 0x0000 } },
- { 0x1D479, { 0x0072, 0x0000, 0x0000, 0x0000 } },
- { 0x1D47A, { 0x0073, 0x0000, 0x0000, 0x0000 } },
- { 0x1D47B, { 0x0074, 0x0000, 0x0000, 0x0000 } },
- { 0x1D47C, { 0x0075, 0x0000, 0x0000, 0x0000 } },
- { 0x1D47D, { 0x0076, 0x0000, 0x0000, 0x0000 } },
- { 0x1D47E, { 0x0077, 0x0000, 0x0000, 0x0000 } },
- { 0x1D47F, { 0x0078, 0x0000, 0x0000, 0x0000 } },
- { 0x1D480, { 0x0079, 0x0000, 0x0000, 0x0000 } },
- { 0x1D481, { 0x007A, 0x0000, 0x0000, 0x0000 } },
- { 0x1D49C, { 0x0061, 0x0000, 0x0000, 0x0000 } },
- { 0x1D49E, { 0x0063, 0x0000, 0x0000, 0x0000 } },
- { 0x1D49F, { 0x0064, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4A2, { 0x0067, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4A5, { 0x006A, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4A6, { 0x006B, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4A9, { 0x006E, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4AA, { 0x006F, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4AB, { 0x0070, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4AC, { 0x0071, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4AE, { 0x0073, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4AF, { 0x0074, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4B0, { 0x0075, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4B1, { 0x0076, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4B2, { 0x0077, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4B3, { 0x0078, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4B4, { 0x0079, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4B5, { 0x007A, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4D0, { 0x0061, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4D1, { 0x0062, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4D2, { 0x0063, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4D3, { 0x0064, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4D4, { 0x0065, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4D5, { 0x0066, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4D6, { 0x0067, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4D7, { 0x0068, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4D8, { 0x0069, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4D9, { 0x006A, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4DA, { 0x006B, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4DB, { 0x006C, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4DC, { 0x006D, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4DD, { 0x006E, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4DE, { 0x006F, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4DF, { 0x0070, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4E0, { 0x0071, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4E1, { 0x0072, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4E2, { 0x0073, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4E3, { 0x0074, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4E4, { 0x0075, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4E5, { 0x0076, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4E6, { 0x0077, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4E7, { 0x0078, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4E8, { 0x0079, 0x0000, 0x0000, 0x0000 } },
- { 0x1D4E9, { 0x007A, 0x0000, 0x0000, 0x0000 } },
- { 0x1D504, { 0x0061, 0x0000, 0x0000, 0x0000 } },
- { 0x1D505, { 0x0062, 0x0000, 0x0000, 0x0000 } },
- { 0x1D507, { 0x0064, 0x0000, 0x0000, 0x0000 } },
- { 0x1D508, { 0x0065, 0x0000, 0x0000, 0x0000 } },
- { 0x1D509, { 0x0066, 0x0000, 0x0000, 0x0000 } },
- { 0x1D50A, { 0x0067, 0x0000, 0x0000, 0x0000 } },
- { 0x1D50D, { 0x006A, 0x0000, 0x0000, 0x0000 } },
- { 0x1D50E, { 0x006B, 0x0000, 0x0000, 0x0000 } },
- { 0x1D50F, { 0x006C, 0x0000, 0x0000, 0x0000 } },
- { 0x1D510, { 0x006D, 0x0000, 0x0000, 0x0000 } },
- { 0x1D511, { 0x006E, 0x0000, 0x0000, 0x0000 } },
- { 0x1D512, { 0x006F, 0x0000, 0x0000, 0x0000 } },
- { 0x1D513, { 0x0070, 0x0000, 0x0000, 0x0000 } },
- { 0x1D514, { 0x0071, 0x0000, 0x0000, 0x0000 } },
- { 0x1D516, { 0x0073, 0x0000, 0x0000, 0x0000 } },
- { 0x1D517, { 0x0074, 0x0000, 0x0000, 0x0000 } },
- { 0x1D518, { 0x0075, 0x0000, 0x0000, 0x0000 } },
- { 0x1D519, { 0x0076, 0x0000, 0x0000, 0x0000 } },
- { 0x1D51A, { 0x0077, 0x0000, 0x0000, 0x0000 } },
- { 0x1D51B, { 0x0078, 0x0000, 0x0000, 0x0000 } },
- { 0x1D51C, { 0x0079, 0x0000, 0x0000, 0x0000 } },
- { 0x1D538, { 0x0061, 0x0000, 0x0000, 0x0000 } },
- { 0x1D539, { 0x0062, 0x0000, 0x0000, 0x0000 } },
- { 0x1D53B, { 0x0064, 0x0000, 0x0000, 0x0000 } },
- { 0x1D53C, { 0x0065, 0x0000, 0x0000, 0x0000 } },
- { 0x1D53D, { 0x0066, 0x0000, 0x0000, 0x0000 } },
- { 0x1D53E, { 0x0067, 0x0000, 0x0000, 0x0000 } },
- { 0x1D540, { 0x0069, 0x0000, 0x0000, 0x0000 } },
- { 0x1D541, { 0x006A, 0x0000, 0x0000, 0x0000 } },
- { 0x1D542, { 0x006B, 0x0000, 0x0000, 0x0000 } },
- { 0x1D543, { 0x006C, 0x0000, 0x0000, 0x0000 } },
- { 0x1D544, { 0x006D, 0x0000, 0x0000, 0x0000 } },
- { 0x1D546, { 0x006F, 0x0000, 0x0000, 0x0000 } },
- { 0x1D54A, { 0x0073, 0x0000, 0x0000, 0x0000 } },
- { 0x1D54B, { 0x0074, 0x0000, 0x0000, 0x0000 } },
- { 0x1D54C, { 0x0075, 0x0000, 0x0000, 0x0000 } },
- { 0x1D54D, { 0x0076, 0x0000, 0x0000, 0x0000 } },
- { 0x1D54E, { 0x0077, 0x0000, 0x0000, 0x0000 } },
- { 0x1D54F, { 0x0078, 0x0000, 0x0000, 0x0000 } },
- { 0x1D550, { 0x0079, 0x0000, 0x0000, 0x0000 } },
- { 0x1D56C, { 0x0061, 0x0000, 0x0000, 0x0000 } },
- { 0x1D56D, { 0x0062, 0x0000, 0x0000, 0x0000 } },
- { 0x1D56E, { 0x0063, 0x0000, 0x0000, 0x0000 } },
- { 0x1D56F, { 0x0064, 0x0000, 0x0000, 0x0000 } },
- { 0x1D570, { 0x0065, 0x0000, 0x0000, 0x0000 } },
- { 0x1D571, { 0x0066, 0x0000, 0x0000, 0x0000 } },
- { 0x1D572, { 0x0067, 0x0000, 0x0000, 0x0000 } },
- { 0x1D573, { 0x0068, 0x0000, 0x0000, 0x0000 } },
- { 0x1D574, { 0x0069, 0x0000, 0x0000, 0x0000 } },
- { 0x1D575, { 0x006A, 0x0000, 0x0000, 0x0000 } },
- { 0x1D576, { 0x006B, 0x0000, 0x0000, 0x0000 } },
- { 0x1D577, { 0x006C, 0x0000, 0x0000, 0x0000 } },
- { 0x1D578, { 0x006D, 0x0000, 0x0000, 0x0000 } },
- { 0x1D579, { 0x006E, 0x0000, 0x0000, 0x0000 } },
- { 0x1D57A, { 0x006F, 0x0000, 0x0000, 0x0000 } },
- { 0x1D57B, { 0x0070, 0x0000, 0x0000, 0x0000 } },
- { 0x1D57C, { 0x0071, 0x0000, 0x0000, 0x0000 } },
- { 0x1D57D, { 0x0072, 0x0000, 0x0000, 0x0000 } },
- { 0x1D57E, { 0x0073, 0x0000, 0x0000, 0x0000 } },
- { 0x1D57F, { 0x0074, 0x0000, 0x0000, 0x0000 } },
- { 0x1D580, { 0x0075, 0x0000, 0x0000, 0x0000 } },
- { 0x1D581, { 0x0076, 0x0000, 0x0000, 0x0000 } },
- { 0x1D582, { 0x0077, 0x0000, 0x0000, 0x0000 } },
- { 0x1D583, { 0x0078, 0x0000, 0x0000, 0x0000 } },
- { 0x1D584, { 0x0079, 0x0000, 0x0000, 0x0000 } },
- { 0x1D585, { 0x007A, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5A0, { 0x0061, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5A1, { 0x0062, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5A2, { 0x0063, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5A3, { 0x0064, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5A4, { 0x0065, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5A5, { 0x0066, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5A6, { 0x0067, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5A7, { 0x0068, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5A8, { 0x0069, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5A9, { 0x006A, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5AA, { 0x006B, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5AB, { 0x006C, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5AC, { 0x006D, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5AD, { 0x006E, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5AE, { 0x006F, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5AF, { 0x0070, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5B0, { 0x0071, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5B1, { 0x0072, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5B2, { 0x0073, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5B3, { 0x0074, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5B4, { 0x0075, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5B5, { 0x0076, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5B6, { 0x0077, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5B7, { 0x0078, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5B8, { 0x0079, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5B9, { 0x007A, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5D4, { 0x0061, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5D5, { 0x0062, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5D6, { 0x0063, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5D7, { 0x0064, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5D8, { 0x0065, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5D9, { 0x0066, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5DA, { 0x0067, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5DB, { 0x0068, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5DC, { 0x0069, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5DD, { 0x006A, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5DE, { 0x006B, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5DF, { 0x006C, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5E0, { 0x006D, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5E1, { 0x006E, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5E2, { 0x006F, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5E3, { 0x0070, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5E4, { 0x0071, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5E5, { 0x0072, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5E6, { 0x0073, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5E7, { 0x0074, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5E8, { 0x0075, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5E9, { 0x0076, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5EA, { 0x0077, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5EB, { 0x0078, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5EC, { 0x0079, 0x0000, 0x0000, 0x0000 } },
- { 0x1D5ED, { 0x007A, 0x0000, 0x0000, 0x0000 } },
- { 0x1D608, { 0x0061, 0x0000, 0x0000, 0x0000 } },
- { 0x1D609, { 0x0062, 0x0000, 0x0000, 0x0000 } },
- { 0x1D60A, { 0x0063, 0x0000, 0x0000, 0x0000 } },
- { 0x1D60B, { 0x0064, 0x0000, 0x0000, 0x0000 } },
- { 0x1D60C, { 0x0065, 0x0000, 0x0000, 0x0000 } },
- { 0x1D60D, { 0x0066, 0x0000, 0x0000, 0x0000 } },
- { 0x1D60E, { 0x0067, 0x0000, 0x0000, 0x0000 } },
- { 0x1D60F, { 0x0068, 0x0000, 0x0000, 0x0000 } },
- { 0x1D610, { 0x0069, 0x0000, 0x0000, 0x0000 } },
- { 0x1D611, { 0x006A, 0x0000, 0x0000, 0x0000 } },
- { 0x1D612, { 0x006B, 0x0000, 0x0000, 0x0000 } },
- { 0x1D613, { 0x006C, 0x0000, 0x0000, 0x0000 } },
- { 0x1D614, { 0x006D, 0x0000, 0x0000, 0x0000 } },
- { 0x1D615, { 0x006E, 0x0000, 0x0000, 0x0000 } },
- { 0x1D616, { 0x006F, 0x0000, 0x0000, 0x0000 } },
- { 0x1D617, { 0x0070, 0x0000, 0x0000, 0x0000 } },
- { 0x1D618, { 0x0071, 0x0000, 0x0000, 0x0000 } },
- { 0x1D619, { 0x0072, 0x0000, 0x0000, 0x0000 } },
- { 0x1D61A, { 0x0073, 0x0000, 0x0000, 0x0000 } },
- { 0x1D61B, { 0x0074, 0x0000, 0x0000, 0x0000 } },
- { 0x1D61C, { 0x0075, 0x0000, 0x0000, 0x0000 } },
- { 0x1D61D, { 0x0076, 0x0000, 0x0000, 0x0000 } },
- { 0x1D61E, { 0x0077, 0x0000, 0x0000, 0x0000 } },
- { 0x1D61F, { 0x0078, 0x0000, 0x0000, 0x0000 } },
- { 0x1D620, { 0x0079, 0x0000, 0x0000, 0x0000 } },
- { 0x1D621, { 0x007A, 0x0000, 0x0000, 0x0000 } },
- { 0x1D63C, { 0x0061, 0x0000, 0x0000, 0x0000 } },
- { 0x1D63D, { 0x0062, 0x0000, 0x0000, 0x0000 } },
- { 0x1D63E, { 0x0063, 0x0000, 0x0000, 0x0000 } },
- { 0x1D63F, { 0x0064, 0x0000, 0x0000, 0x0000 } },
- { 0x1D640, { 0x0065, 0x0000, 0x0000, 0x0000 } },
- { 0x1D641, { 0x0066, 0x0000, 0x0000, 0x0000 } },
- { 0x1D642, { 0x0067, 0x0000, 0x0000, 0x0000 } },
- { 0x1D643, { 0x0068, 0x0000, 0x0000, 0x0000 } },
- { 0x1D644, { 0x0069, 0x0000, 0x0000, 0x0000 } },
- { 0x1D645, { 0x006A, 0x0000, 0x0000, 0x0000 } },
- { 0x1D646, { 0x006B, 0x0000, 0x0000, 0x0000 } },
- { 0x1D647, { 0x006C, 0x0000, 0x0000, 0x0000 } },
- { 0x1D648, { 0x006D, 0x0000, 0x0000, 0x0000 } },
- { 0x1D649, { 0x006E, 0x0000, 0x0000, 0x0000 } },
- { 0x1D64A, { 0x006F, 0x0000, 0x0000, 0x0000 } },
- { 0x1D64B, { 0x0070, 0x0000, 0x0000, 0x0000 } },
- { 0x1D64C, { 0x0071, 0x0000, 0x0000, 0x0000 } },
- { 0x1D64D, { 0x0072, 0x0000, 0x0000, 0x0000 } },
- { 0x1D64E, { 0x0073, 0x0000, 0x0000, 0x0000 } },
- { 0x1D64F, { 0x0074, 0x0000, 0x0000, 0x0000 } },
- { 0x1D650, { 0x0075, 0x0000, 0x0000, 0x0000 } },
- { 0x1D651, { 0x0076, 0x0000, 0x0000, 0x0000 } },
- { 0x1D652, { 0x0077, 0x0000, 0x0000, 0x0000 } },
- { 0x1D653, { 0x0078, 0x0000, 0x0000, 0x0000 } },
- { 0x1D654, { 0x0079, 0x0000, 0x0000, 0x0000 } },
- { 0x1D655, { 0x007A, 0x0000, 0x0000, 0x0000 } },
- { 0x1D670, { 0x0061, 0x0000, 0x0000, 0x0000 } },
- { 0x1D671, { 0x0062, 0x0000, 0x0000, 0x0000 } },
- { 0x1D672, { 0x0063, 0x0000, 0x0000, 0x0000 } },
- { 0x1D673, { 0x0064, 0x0000, 0x0000, 0x0000 } },
- { 0x1D674, { 0x0065, 0x0000, 0x0000, 0x0000 } },
- { 0x1D675, { 0x0066, 0x0000, 0x0000, 0x0000 } },
- { 0x1D676, { 0x0067, 0x0000, 0x0000, 0x0000 } },
- { 0x1D677, { 0x0068, 0x0000, 0x0000, 0x0000 } },
- { 0x1D678, { 0x0069, 0x0000, 0x0000, 0x0000 } },
- { 0x1D679, { 0x006A, 0x0000, 0x0000, 0x0000 } },
- { 0x1D67A, { 0x006B, 0x0000, 0x0000, 0x0000 } },
- { 0x1D67B, { 0x006C, 0x0000, 0x0000, 0x0000 } },
- { 0x1D67C, { 0x006D, 0x0000, 0x0000, 0x0000 } },
- { 0x1D67D, { 0x006E, 0x0000, 0x0000, 0x0000 } },
- { 0x1D67E, { 0x006F, 0x0000, 0x0000, 0x0000 } },
- { 0x1D67F, { 0x0070, 0x0000, 0x0000, 0x0000 } },
- { 0x1D680, { 0x0071, 0x0000, 0x0000, 0x0000 } },
- { 0x1D681, { 0x0072, 0x0000, 0x0000, 0x0000 } },
- { 0x1D682, { 0x0073, 0x0000, 0x0000, 0x0000 } },
- { 0x1D683, { 0x0074, 0x0000, 0x0000, 0x0000 } },
- { 0x1D684, { 0x0075, 0x0000, 0x0000, 0x0000 } },
- { 0x1D685, { 0x0076, 0x0000, 0x0000, 0x0000 } },
- { 0x1D686, { 0x0077, 0x0000, 0x0000, 0x0000 } },
- { 0x1D687, { 0x0078, 0x0000, 0x0000, 0x0000 } },
- { 0x1D688, { 0x0079, 0x0000, 0x0000, 0x0000 } },
- { 0x1D689, { 0x007A, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6A8, { 0x03B1, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6A9, { 0x03B2, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6AA, { 0x03B3, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6AB, { 0x03B4, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6AC, { 0x03B5, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6AD, { 0x03B6, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6AE, { 0x03B7, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6AF, { 0x03B8, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6B0, { 0x03B9, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6B1, { 0x03BA, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6B2, { 0x03BB, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6B3, { 0x03BC, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6B4, { 0x03BD, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6B5, { 0x03BE, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6B6, { 0x03BF, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6B7, { 0x03C0, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6B8, { 0x03C1, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6B9, { 0x03B8, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6BA, { 0x03C3, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6BB, { 0x03C4, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6BC, { 0x03C5, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6BD, { 0x03C6, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6BE, { 0x03C7, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6BF, { 0x03C8, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6C0, { 0x03C9, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6D3, { 0x03C3, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6E2, { 0x03B1, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6E3, { 0x03B2, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6E4, { 0x03B3, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6E5, { 0x03B4, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6E6, { 0x03B5, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6E7, { 0x03B6, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6E8, { 0x03B7, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6E9, { 0x03B8, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6EA, { 0x03B9, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6EB, { 0x03BA, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6EC, { 0x03BB, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6ED, { 0x03BC, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6EE, { 0x03BD, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6EF, { 0x03BE, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6F0, { 0x03BF, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6F1, { 0x03C0, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6F2, { 0x03C1, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6F3, { 0x03B8, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6F4, { 0x03C3, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6F5, { 0x03C4, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6F6, { 0x03C5, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6F7, { 0x03C6, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6F8, { 0x03C7, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6F9, { 0x03C8, 0x0000, 0x0000, 0x0000 } },
- { 0x1D6FA, { 0x03C9, 0x0000, 0x0000, 0x0000 } },
- { 0x1D70D, { 0x03C3, 0x0000, 0x0000, 0x0000 } },
- { 0x1D71C, { 0x03B1, 0x0000, 0x0000, 0x0000 } },
- { 0x1D71D, { 0x03B2, 0x0000, 0x0000, 0x0000 } },
- { 0x1D71E, { 0x03B3, 0x0000, 0x0000, 0x0000 } },
- { 0x1D71F, { 0x03B4, 0x0000, 0x0000, 0x0000 } },
- { 0x1D720, { 0x03B5, 0x0000, 0x0000, 0x0000 } },
- { 0x1D721, { 0x03B6, 0x0000, 0x0000, 0x0000 } },
- { 0x1D722, { 0x03B7, 0x0000, 0x0000, 0x0000 } },
- { 0x1D723, { 0x03B8, 0x0000, 0x0000, 0x0000 } },
- { 0x1D724, { 0x03B9, 0x0000, 0x0000, 0x0000 } },
- { 0x1D725, { 0x03BA, 0x0000, 0x0000, 0x0000 } },
- { 0x1D726, { 0x03BB, 0x0000, 0x0000, 0x0000 } },
- { 0x1D727, { 0x03BC, 0x0000, 0x0000, 0x0000 } },
- { 0x1D728, { 0x03BD, 0x0000, 0x0000, 0x0000 } },
- { 0x1D729, { 0x03BE, 0x0000, 0x0000, 0x0000 } },
- { 0x1D72A, { 0x03BF, 0x0000, 0x0000, 0x0000 } },
- { 0x1D72B, { 0x03C0, 0x0000, 0x0000, 0x0000 } },
- { 0x1D72C, { 0x03C1, 0x0000, 0x0000, 0x0000 } },
- { 0x1D72D, { 0x03B8, 0x0000, 0x0000, 0x0000 } },
- { 0x1D72E, { 0x03C3, 0x0000, 0x0000, 0x0000 } },
- { 0x1D72F, { 0x03C4, 0x0000, 0x0000, 0x0000 } },
- { 0x1D730, { 0x03C5, 0x0000, 0x0000, 0x0000 } },
- { 0x1D731, { 0x03C6, 0x0000, 0x0000, 0x0000 } },
- { 0x1D732, { 0x03C7, 0x0000, 0x0000, 0x0000 } },
- { 0x1D733, { 0x03C8, 0x0000, 0x0000, 0x0000 } },
- { 0x1D734, { 0x03C9, 0x0000, 0x0000, 0x0000 } },
- { 0x1D747, { 0x03C3, 0x0000, 0x0000, 0x0000 } },
- { 0x1D756, { 0x03B1, 0x0000, 0x0000, 0x0000 } },
- { 0x1D757, { 0x03B2, 0x0000, 0x0000, 0x0000 } },
- { 0x1D758, { 0x03B3, 0x0000, 0x0000, 0x0000 } },
- { 0x1D759, { 0x03B4, 0x0000, 0x0000, 0x0000 } },
- { 0x1D75A, { 0x03B5, 0x0000, 0x0000, 0x0000 } },
- { 0x1D75B, { 0x03B6, 0x0000, 0x0000, 0x0000 } },
- { 0x1D75C, { 0x03B7, 0x0000, 0x0000, 0x0000 } },
- { 0x1D75D, { 0x03B8, 0x0000, 0x0000, 0x0000 } },
- { 0x1D75E, { 0x03B9, 0x0000, 0x0000, 0x0000 } },
- { 0x1D75F, { 0x03BA, 0x0000, 0x0000, 0x0000 } },
- { 0x1D760, { 0x03BB, 0x0000, 0x0000, 0x0000 } },
- { 0x1D761, { 0x03BC, 0x0000, 0x0000, 0x0000 } },
- { 0x1D762, { 0x03BD, 0x0000, 0x0000, 0x0000 } },
- { 0x1D763, { 0x03BE, 0x0000, 0x0000, 0x0000 } },
- { 0x1D764, { 0x03BF, 0x0000, 0x0000, 0x0000 } },
- { 0x1D765, { 0x03C0, 0x0000, 0x0000, 0x0000 } },
- { 0x1D766, { 0x03C1, 0x0000, 0x0000, 0x0000 } },
- { 0x1D767, { 0x03B8, 0x0000, 0x0000, 0x0000 } },
- { 0x1D768, { 0x03C3, 0x0000, 0x0000, 0x0000 } },
- { 0x1D769, { 0x03C4, 0x0000, 0x0000, 0x0000 } },
- { 0x1D76A, { 0x03C5, 0x0000, 0x0000, 0x0000 } },
- { 0x1D76B, { 0x03C6, 0x0000, 0x0000, 0x0000 } },
- { 0x1D76C, { 0x03C7, 0x0000, 0x0000, 0x0000 } },
- { 0x1D76D, { 0x03C8, 0x0000, 0x0000, 0x0000 } },
- { 0x1D76E, { 0x03C9, 0x0000, 0x0000, 0x0000 } },
- { 0x1D781, { 0x03C3, 0x0000, 0x0000, 0x0000 } },
- { 0x1D790, { 0x03B1, 0x0000, 0x0000, 0x0000 } },
- { 0x1D791, { 0x03B2, 0x0000, 0x0000, 0x0000 } },
- { 0x1D792, { 0x03B3, 0x0000, 0x0000, 0x0000 } },
- { 0x1D793, { 0x03B4, 0x0000, 0x0000, 0x0000 } },
- { 0x1D794, { 0x03B5, 0x0000, 0x0000, 0x0000 } },
- { 0x1D795, { 0x03B6, 0x0000, 0x0000, 0x0000 } },
- { 0x1D796, { 0x03B7, 0x0000, 0x0000, 0x0000 } },
- { 0x1D797, { 0x03B8, 0x0000, 0x0000, 0x0000 } },
- { 0x1D798, { 0x03B9, 0x0000, 0x0000, 0x0000 } },
- { 0x1D799, { 0x03BA, 0x0000, 0x0000, 0x0000 } },
- { 0x1D79A, { 0x03BB, 0x0000, 0x0000, 0x0000 } },
- { 0x1D79B, { 0x03BC, 0x0000, 0x0000, 0x0000 } },
- { 0x1D79C, { 0x03BD, 0x0000, 0x0000, 0x0000 } },
- { 0x1D79D, { 0x03BE, 0x0000, 0x0000, 0x0000 } },
- { 0x1D79E, { 0x03BF, 0x0000, 0x0000, 0x0000 } },
- { 0x1D79F, { 0x03C0, 0x0000, 0x0000, 0x0000 } },
- { 0x1D7A0, { 0x03C1, 0x0000, 0x0000, 0x0000 } },
- { 0x1D7A1, { 0x03B8, 0x0000, 0x0000, 0x0000 } },
- { 0x1D7A2, { 0x03C3, 0x0000, 0x0000, 0x0000 } },
- { 0x1D7A3, { 0x03C4, 0x0000, 0x0000, 0x0000 } },
- { 0x1D7A4, { 0x03C5, 0x0000, 0x0000, 0x0000 } },
- { 0x1D7A5, { 0x03C6, 0x0000, 0x0000, 0x0000 } },
- { 0x1D7A6, { 0x03C7, 0x0000, 0x0000, 0x0000 } },
- { 0x1D7A7, { 0x03C8, 0x0000, 0x0000, 0x0000 } },
- { 0x1D7A8, { 0x03C9, 0x0000, 0x0000, 0x0000 } },
- { 0x1D7BB, { 0x03C3, 0x0000, 0x0000, 0x0000 } }
-};
-
-static void mapToLowerCase(QString *str, int from)
-{
- ushort *d = nullptr;
- for (int i = from; i < str->size(); ++i) {
- uint uc = str->at(i).unicode();
- if (uc < 0x80) {
- if (uc <= 'Z' && uc >= 'A') {
- if (!d)
- d = reinterpret_cast<ushort *>(str->data());
- d[i] = (uc | 0x20);
- }
- } else {
- if (QChar(uc).isHighSurrogate() && i < str->size() - 1) {
- ushort low = str->at(i + 1).unicode();
- if (QChar(low).isLowSurrogate()) {
- uc = QChar::surrogateToUcs4(uc, low);
- ++i;
- }
- }
- const auto entry = std::lower_bound(std::begin(NameprepCaseFolding),
- std::end(NameprepCaseFolding),
- uc);
- if ((entry != std::end(NameprepCaseFolding)) && !(uc < *entry)) {
- int l = 1;
- while (l < 4 && entry->mapping[l])
- ++l;
- if (l > 1 || uc > 0xffff) {
- if (uc <= 0xffff)
- str->replace(i, 1, reinterpret_cast<const QChar *>(&entry->mapping[0]), l);
- else
- str->replace(--i, 2, reinterpret_cast<const QChar *>(&entry->mapping[0]), l);
- i += l - 1;
- d = nullptr;
- } else {
- if (!d)
- d = reinterpret_cast<ushort *>(str->data());
- d[i] = entry->mapping[0];
- }
- }
- }
- }
-}
-
-static bool isMappedToNothing(uint uc)
-{
- if (uc < 0xad)
- return false;
- switch (uc) {
- case 0x00AD: case 0x034F: case 0x1806: case 0x180B: case 0x180C: case 0x180D:
- case 0x200B: case 0x200C: case 0x200D: case 0x2060: case 0xFE00: case 0xFE01:
- case 0xFE02: case 0xFE03: case 0xFE04: case 0xFE05: case 0xFE06: case 0xFE07:
- case 0xFE08: case 0xFE09: case 0xFE0A: case 0xFE0B: case 0xFE0C: case 0xFE0D:
- case 0xFE0E: case 0xFE0F: case 0xFEFF:
- return true;
- default:
- return false;
- }
-}
-
-namespace {
- static constexpr bool isProhibitedOutputChar(char32_t uc)
- {
- if (uc <= 0xFFFF) {
- if (uc < 0x80 ||
- !(uc <= 0x009F
- || uc == 0x00A0
- || uc == 0x0340
- || uc == 0x0341
- || uc == 0x06DD
- || uc == 0x070F
- || uc == 0x1680
- || uc == 0x180E
- || (uc >= 0x2000 && uc <= 0x200F)
- || (uc >= 0x2028 && uc <= 0x202F)
- || uc == 0x205F
- || (uc >= 0x2060 && uc <= 0x2063)
- || (uc >= 0x206A && uc <= 0x206F)
- || (uc >= 0x2FF0 && uc <= 0x2FFB)
- || uc == 0x3000
- || (uc >= 0xD800 && uc <= 0xDFFF)
- || (uc >= 0xE000 && uc <= 0xF8FF)
- || (uc >= 0xFDD0 && uc <= 0xFDEF)
- || uc == 0xFEFF
- || uc >= 0xFFF9)) {
- return false;
- }
- } else {
- if (!((uc >= 0x1D173 && uc <= 0x1D17A)
- || (uc >= 0x1FFFE && uc <= 0x1FFFF)
- || (uc >= 0x2FFFE && uc <= 0x2FFFF)
- || (uc >= 0x3FFFE && uc <= 0x3FFFF)
- || (uc >= 0x4FFFE && uc <= 0x4FFFF)
- || (uc >= 0x5FFFE && uc <= 0x5FFFF)
- || (uc >= 0x6FFFE && uc <= 0x6FFFF)
- || (uc >= 0x7FFFE && uc <= 0x7FFFF)
- || (uc >= 0x8FFFE && uc <= 0x8FFFF)
- || (uc >= 0x9FFFE && uc <= 0x9FFFF)
- || (uc >= 0xAFFFE && uc <= 0xAFFFF)
- || (uc >= 0xBFFFE && uc <= 0xBFFFF)
- || (uc >= 0xCFFFE && uc <= 0xCFFFF)
- || (uc >= 0xDFFFE && uc <= 0xDFFFF)
- || uc == 0xE0001
- || (uc >= 0xE0020 && uc <= 0xE007F)
- || (uc >= 0xEFFFE && uc <= 0xEFFFF)
- || (uc >= 0xF0000 && uc <= 0xFFFFD)
- || (uc >= 0xFFFFE && uc <= 0xFFFFF)
- || (uc >= 0x100000 && uc <= 0x10FFFD)
- || (uc >= 0x10FFFE && uc <= 0x10FFFF))) {
- return false;
- }
- }
- return true;
- }
-} // unnamed namespace
-
-static bool containsProhibitedOutput(QStringView str, qsizetype from)
-{
- constexpr char32_t invalid = 0xDEAD;
- static_assert(isProhibitedOutputChar(invalid));
-
- QStringIterator it{str, from};
- while (it.hasNext()) {
- if (isProhibitedOutputChar(it.next(invalid)))
- return true;
- }
-
- return false;
-}
-
-static bool isBidirectionalRorAL(uint uc)
-{
- if (uc < 0x5b0)
- return false;
- return uc == 0x05BE
- || uc == 0x05C0
- || uc == 0x05C3
- || (uc >= 0x05D0 && uc <= 0x05EA)
- || (uc >= 0x05F0 && uc <= 0x05F4)
- || uc == 0x061B
- || uc == 0x061F
- || (uc >= 0x0621 && uc <= 0x063A)
- || (uc >= 0x0640 && uc <= 0x064A)
- || (uc >= 0x066D && uc <= 0x066F)
- || (uc >= 0x0671 && uc <= 0x06D5)
- || uc == 0x06DD
- || (uc >= 0x06E5 && uc <= 0x06E6)
- || (uc >= 0x06FA && uc <= 0x06FE)
- || (uc >= 0x0700 && uc <= 0x070D)
- || uc == 0x0710
- || (uc >= 0x0712 && uc <= 0x072C)
- || (uc >= 0x0780 && uc <= 0x07A5)
- || uc == 0x07B1
- || uc == 0x200F
- || uc == 0xFB1D
- || (uc >= 0xFB1F && uc <= 0xFB28)
- || (uc >= 0xFB2A && uc <= 0xFB36)
- || (uc >= 0xFB38 && uc <= 0xFB3C)
- || uc == 0xFB3E
- || (uc >= 0xFB40 && uc <= 0xFB41)
- || (uc >= 0xFB43 && uc <= 0xFB44)
- || (uc >= 0xFB46 && uc <= 0xFBB1)
- || (uc >= 0xFBD3 && uc <= 0xFD3D)
- || (uc >= 0xFD50 && uc <= 0xFD8F)
- || (uc >= 0xFD92 && uc <= 0xFDC7)
- || (uc >= 0xFDF0 && uc <= 0xFDFC)
- || (uc >= 0xFE70 && uc <= 0xFE74)
- || (uc >= 0xFE76 && uc <= 0xFEFC);
-}
-
-static bool isBidirectionalL(uint uc)
-{
- if (uc < 0xaa)
- return (uc >= 0x0041 && uc <= 0x005A)
- || (uc >= 0x0061 && uc <= 0x007A);
-
- if (uc == 0x00AA
- || uc == 0x00B5
- || uc == 0x00BA
- || (uc >= 0x00C0 && uc <= 0x00D6)
- || (uc >= 0x00D8 && uc <= 0x00F6)
- || (uc >= 0x00F8 && uc <= 0x0220)
- || (uc >= 0x0222 && uc <= 0x0233)
- || (uc >= 0x0250 && uc <= 0x02AD)
- || (uc >= 0x02B0 && uc <= 0x02B8)
- || (uc >= 0x02BB && uc <= 0x02C1)
- || (uc >= 0x02D0 && uc <= 0x02D1)
- || (uc >= 0x02E0 && uc <= 0x02E4)
- || uc == 0x02EE
- || uc == 0x037A
- || uc == 0x0386
- || (uc >= 0x0388 && uc <= 0x038A)) {
- return true;
- }
-
- if (uc == 0x038C
- || (uc >= 0x038E && uc <= 0x03A1)
- || (uc >= 0x03A3 && uc <= 0x03CE)
- || (uc >= 0x03D0 && uc <= 0x03F5)
- || (uc >= 0x0400 && uc <= 0x0482)
- || (uc >= 0x048A && uc <= 0x04CE)
- || (uc >= 0x04D0 && uc <= 0x04F5)
- || (uc >= 0x04F8 && uc <= 0x04F9)
- || (uc >= 0x0500 && uc <= 0x050F)
- || (uc >= 0x0531 && uc <= 0x0556)
- || (uc >= 0x0559 && uc <= 0x055F)
- || (uc >= 0x0561 && uc <= 0x0587)
- || uc == 0x0589
- || uc == 0x0903
- || (uc >= 0x0905 && uc <= 0x0939)
- || (uc >= 0x093D && uc <= 0x0940)
- || (uc >= 0x0949 && uc <= 0x094C)
- || uc == 0x0950) {
- return true;
- }
-
- if ((uc >= 0x0958 && uc <= 0x0961)
- || (uc >= 0x0964 && uc <= 0x0970)
- || (uc >= 0x0982 && uc <= 0x0983)
- || (uc >= 0x0985 && uc <= 0x098C)
- || (uc >= 0x098F && uc <= 0x0990)
- || (uc >= 0x0993 && uc <= 0x09A8)
- || (uc >= 0x09AA && uc <= 0x09B0)
- || uc == 0x09B2
- || (uc >= 0x09B6 && uc <= 0x09B9)
- || (uc >= 0x09BE && uc <= 0x09C0)
- || (uc >= 0x09C7 && uc <= 0x09C8)
- || (uc >= 0x09CB && uc <= 0x09CC)
- || uc == 0x09D7
- || (uc >= 0x09DC && uc <= 0x09DD)
- || (uc >= 0x09DF && uc <= 0x09E1)
- || (uc >= 0x09E6 && uc <= 0x09F1)
- || (uc >= 0x09F4 && uc <= 0x09FA)
- || (uc >= 0x0A05 && uc <= 0x0A0A)
- || (uc >= 0x0A0F && uc <= 0x0A10)
- || (uc >= 0x0A13 && uc <= 0x0A28)
- || (uc >= 0x0A2A && uc <= 0x0A30)
- || (uc >= 0x0A32 && uc <= 0x0A33)) {
- return true;
- }
-
- if ((uc >= 0x0A35 && uc <= 0x0A36)
- || (uc >= 0x0A38 && uc <= 0x0A39)
- || (uc >= 0x0A3E && uc <= 0x0A40)
- || (uc >= 0x0A59 && uc <= 0x0A5C)
- || uc == 0x0A5E
- || (uc >= 0x0A66 && uc <= 0x0A6F)
- || (uc >= 0x0A72 && uc <= 0x0A74)
- || uc == 0x0A83
- || (uc >= 0x0A85 && uc <= 0x0A8B)
- || uc == 0x0A8D
- || (uc >= 0x0A8F && uc <= 0x0A91)
- || (uc >= 0x0A93 && uc <= 0x0AA8)
- || (uc >= 0x0AAA && uc <= 0x0AB0)
- || (uc >= 0x0AB2 && uc <= 0x0AB3)
- || (uc >= 0x0AB5 && uc <= 0x0AB9)
- || (uc >= 0x0ABD && uc <= 0x0AC0)
- || uc == 0x0AC9
- || (uc >= 0x0ACB && uc <= 0x0ACC)
- || uc == 0x0AD0
- || uc == 0x0AE0
- || (uc >= 0x0AE6 && uc <= 0x0AEF)
- || (uc >= 0x0B02 && uc <= 0x0B03)
- || (uc >= 0x0B05 && uc <= 0x0B0C)
- || (uc >= 0x0B0F && uc <= 0x0B10)
- || (uc >= 0x0B13 && uc <= 0x0B28)
- || (uc >= 0x0B2A && uc <= 0x0B30)) {
- return true;
- }
-
- if ((uc >= 0x0B32 && uc <= 0x0B33)
- || (uc >= 0x0B36 && uc <= 0x0B39)
- || (uc >= 0x0B3D && uc <= 0x0B3E)
- || uc == 0x0B40
- || (uc >= 0x0B47 && uc <= 0x0B48)
- || (uc >= 0x0B4B && uc <= 0x0B4C)
- || uc == 0x0B57
- || (uc >= 0x0B5C && uc <= 0x0B5D)
- || (uc >= 0x0B5F && uc <= 0x0B61)
- || (uc >= 0x0B66 && uc <= 0x0B70)
- || uc == 0x0B83
- || (uc >= 0x0B85 && uc <= 0x0B8A)
- || (uc >= 0x0B8E && uc <= 0x0B90)
- || (uc >= 0x0B92 && uc <= 0x0B95)
- || (uc >= 0x0B99 && uc <= 0x0B9A)
- || uc == 0x0B9C
- || (uc >= 0x0B9E && uc <= 0x0B9F)
- || (uc >= 0x0BA3 && uc <= 0x0BA4)
- || (uc >= 0x0BA8 && uc <= 0x0BAA)
- || (uc >= 0x0BAE && uc <= 0x0BB5)
- || (uc >= 0x0BB7 && uc <= 0x0BB9)
- || (uc >= 0x0BBE && uc <= 0x0BBF)
- || (uc >= 0x0BC1 && uc <= 0x0BC2)
- || (uc >= 0x0BC6 && uc <= 0x0BC8)
- || (uc >= 0x0BCA && uc <= 0x0BCC)
- || uc == 0x0BD7
- || (uc >= 0x0BE7 && uc <= 0x0BF2)
- || (uc >= 0x0C01 && uc <= 0x0C03)
- || (uc >= 0x0C05 && uc <= 0x0C0C)
- || (uc >= 0x0C0E && uc <= 0x0C10)
- || (uc >= 0x0C12 && uc <= 0x0C28)
- || (uc >= 0x0C2A && uc <= 0x0C33)
- || (uc >= 0x0C35 && uc <= 0x0C39)) {
- return true;
- }
- if ((uc >= 0x0C41 && uc <= 0x0C44)
- || (uc >= 0x0C60 && uc <= 0x0C61)
- || (uc >= 0x0C66 && uc <= 0x0C6F)
- || (uc >= 0x0C82 && uc <= 0x0C83)
- || (uc >= 0x0C85 && uc <= 0x0C8C)
- || (uc >= 0x0C8E && uc <= 0x0C90)
- || (uc >= 0x0C92 && uc <= 0x0CA8)
- || (uc >= 0x0CAA && uc <= 0x0CB3)
- || (uc >= 0x0CB5 && uc <= 0x0CB9)
- || uc == 0x0CBE
- || (uc >= 0x0CC0 && uc <= 0x0CC4)
- || (uc >= 0x0CC7 && uc <= 0x0CC8)
- || (uc >= 0x0CCA && uc <= 0x0CCB)
- || (uc >= 0x0CD5 && uc <= 0x0CD6)
- || uc == 0x0CDE
- || (uc >= 0x0CE0 && uc <= 0x0CE1)
- || (uc >= 0x0CE6 && uc <= 0x0CEF)
- || (uc >= 0x0D02 && uc <= 0x0D03)
- || (uc >= 0x0D05 && uc <= 0x0D0C)
- || (uc >= 0x0D0E && uc <= 0x0D10)
- || (uc >= 0x0D12 && uc <= 0x0D28)
- || (uc >= 0x0D2A && uc <= 0x0D39)
- || (uc >= 0x0D3E && uc <= 0x0D40)
- || (uc >= 0x0D46 && uc <= 0x0D48)
- || (uc >= 0x0D4A && uc <= 0x0D4C)
- || uc == 0x0D57
- || (uc >= 0x0D60 && uc <= 0x0D61)
- || (uc >= 0x0D66 && uc <= 0x0D6F)
- || (uc >= 0x0D82 && uc <= 0x0D83)
- || (uc >= 0x0D85 && uc <= 0x0D96)
- || (uc >= 0x0D9A && uc <= 0x0DB1)
- || (uc >= 0x0DB3 && uc <= 0x0DBB)
- || uc == 0x0DBD) {
- return true;
- }
- if ((uc >= 0x0DC0 && uc <= 0x0DC6)
- || (uc >= 0x0DCF && uc <= 0x0DD1)
- || (uc >= 0x0DD8 && uc <= 0x0DDF)
- || (uc >= 0x0DF2 && uc <= 0x0DF4)
- || (uc >= 0x0E01 && uc <= 0x0E30)
- || (uc >= 0x0E32 && uc <= 0x0E33)
- || (uc >= 0x0E40 && uc <= 0x0E46)
- || (uc >= 0x0E4F && uc <= 0x0E5B)
- || (uc >= 0x0E81 && uc <= 0x0E82)
- || uc == 0x0E84
- || (uc >= 0x0E87 && uc <= 0x0E88)
- || uc == 0x0E8A
- || uc == 0x0E8D
- || (uc >= 0x0E94 && uc <= 0x0E97)
- || (uc >= 0x0E99 && uc <= 0x0E9F)
- || (uc >= 0x0EA1 && uc <= 0x0EA3)
- || uc == 0x0EA5
- || uc == 0x0EA7
- || (uc >= 0x0EAA && uc <= 0x0EAB)
- || (uc >= 0x0EAD && uc <= 0x0EB0)
- || (uc >= 0x0EB2 && uc <= 0x0EB3)
- || uc == 0x0EBD
- || (uc >= 0x0EC0 && uc <= 0x0EC4)
- || uc == 0x0EC6
- || (uc >= 0x0ED0 && uc <= 0x0ED9)
- || (uc >= 0x0EDC && uc <= 0x0EDD)
- || (uc >= 0x0F00 && uc <= 0x0F17)
- || (uc >= 0x0F1A && uc <= 0x0F34)
- || uc == 0x0F36
- || uc == 0x0F38
- || (uc >= 0x0F3E && uc <= 0x0F47)
- || (uc >= 0x0F49 && uc <= 0x0F6A)
- || uc == 0x0F7F
- || uc == 0x0F85
- || (uc >= 0x0F88 && uc <= 0x0F8B)
- || (uc >= 0x0FBE && uc <= 0x0FC5)
- || (uc >= 0x0FC7 && uc <= 0x0FCC)
- || uc == 0x0FCF) {
- return true;
- }
-
- if ((uc >= 0x1000 && uc <= 0x1021)
- || (uc >= 0x1023 && uc <= 0x1027)
- || (uc >= 0x1029 && uc <= 0x102A)
- || uc == 0x102C
- || uc == 0x1031
- || uc == 0x1038
- || (uc >= 0x1040 && uc <= 0x1057)
- || (uc >= 0x10A0 && uc <= 0x10C5)
- || (uc >= 0x10D0 && uc <= 0x10F8)
- || uc == 0x10FB
- || (uc >= 0x1100 && uc <= 0x1159)
- || (uc >= 0x115F && uc <= 0x11A2)
- || (uc >= 0x11A8 && uc <= 0x11F9)
- || (uc >= 0x1200 && uc <= 0x1206)
- || (uc >= 0x1208 && uc <= 0x1246)
- || uc == 0x1248
- || (uc >= 0x124A && uc <= 0x124D)
- || (uc >= 0x1250 && uc <= 0x1256)
- || uc == 0x1258
- || (uc >= 0x125A && uc <= 0x125D)
- || (uc >= 0x1260 && uc <= 0x1286)
- || uc == 0x1288
- || (uc >= 0x128A && uc <= 0x128D)
- || (uc >= 0x1290 && uc <= 0x12AE)
- || uc == 0x12B0
- || (uc >= 0x12B2 && uc <= 0x12B5)
- || (uc >= 0x12B8 && uc <= 0x12BE)
- || uc == 0x12C0
- || (uc >= 0x12C2 && uc <= 0x12C5)
- || (uc >= 0x12C8 && uc <= 0x12CE)
- || (uc >= 0x12D0 && uc <= 0x12D6)
- || (uc >= 0x12D8 && uc <= 0x12EE)
- || (uc >= 0x12F0 && uc <= 0x130E)
- || uc == 0x1310) {
- return true;
- }
-
- if ((uc >= 0x1312 && uc <= 0x1315)
- || (uc >= 0x1318 && uc <= 0x131E)
- || (uc >= 0x1320 && uc <= 0x1346)
- || (uc >= 0x1348 && uc <= 0x135A)
- || (uc >= 0x1361 && uc <= 0x137C)
- || (uc >= 0x13A0 && uc <= 0x13F4)
- || (uc >= 0x1401 && uc <= 0x1676)
- || (uc >= 0x1681 && uc <= 0x169A)
- || (uc >= 0x16A0 && uc <= 0x16F0)
- || (uc >= 0x1700 && uc <= 0x170C)
- || (uc >= 0x170E && uc <= 0x1711)
- || (uc >= 0x1720 && uc <= 0x1731)
- || (uc >= 0x1735 && uc <= 0x1736)
- || (uc >= 0x1740 && uc <= 0x1751)
- || (uc >= 0x1760 && uc <= 0x176C)
- || (uc >= 0x176E && uc <= 0x1770)
- || (uc >= 0x1780 && uc <= 0x17B6)
- || (uc >= 0x17BE && uc <= 0x17C5)
- || (uc >= 0x17C7 && uc <= 0x17C8)
- || (uc >= 0x17D4 && uc <= 0x17DA)
- || uc == 0x17DC
- || (uc >= 0x17E0 && uc <= 0x17E9)
- || (uc >= 0x1810 && uc <= 0x1819)
- || (uc >= 0x1820 && uc <= 0x1877)
- || (uc >= 0x1880 && uc <= 0x18A8)
- || (uc >= 0x1E00 && uc <= 0x1E9B)
- || (uc >= 0x1EA0 && uc <= 0x1EF9)
- || (uc >= 0x1F00 && uc <= 0x1F15)
- || (uc >= 0x1F18 && uc <= 0x1F1D)
- || (uc >= 0x1F20 && uc <= 0x1F45)
- || (uc >= 0x1F48 && uc <= 0x1F4D)
- || (uc >= 0x1F50 && uc <= 0x1F57)
- || uc == 0x1F59
- || uc == 0x1F5B
- || uc == 0x1F5D) {
- return true;
- }
-
- if ((uc >= 0x1F5F && uc <= 0x1F7D)
- || (uc >= 0x1F80 && uc <= 0x1FB4)
- || (uc >= 0x1FB6 && uc <= 0x1FBC)
- || uc == 0x1FBE
- || (uc >= 0x1FC2 && uc <= 0x1FC4)
- || (uc >= 0x1FC6 && uc <= 0x1FCC)
- || (uc >= 0x1FD0 && uc <= 0x1FD3)
- || (uc >= 0x1FD6 && uc <= 0x1FDB)
- || (uc >= 0x1FE0 && uc <= 0x1FEC)
- || (uc >= 0x1FF2 && uc <= 0x1FF4)
- || (uc >= 0x1FF6 && uc <= 0x1FFC)
- || uc == 0x200E
- || uc == 0x2071
- || uc == 0x207F
- || uc == 0x2102
- || uc == 0x2107
- || (uc >= 0x210A && uc <= 0x2113)
- || uc == 0x2115
- || (uc >= 0x2119 && uc <= 0x211D)) {
- return true;
- }
-
- if (uc == 0x2124
- || uc == 0x2126
- || uc == 0x2128
- || (uc >= 0x212A && uc <= 0x212D)
- || (uc >= 0x212F && uc <= 0x2131)
- || (uc >= 0x2133 && uc <= 0x2139)
- || (uc >= 0x213D && uc <= 0x213F)
- || (uc >= 0x2145 && uc <= 0x2149)
- || (uc >= 0x2160 && uc <= 0x2183)
- || (uc >= 0x2336 && uc <= 0x237A)
- || uc == 0x2395
- || (uc >= 0x249C && uc <= 0x24E9)
- || (uc >= 0x3005 && uc <= 0x3007)
- || (uc >= 0x3021 && uc <= 0x3029)
- || (uc >= 0x3031 && uc <= 0x3035)
- || (uc >= 0x3038 && uc <= 0x303C)
- || (uc >= 0x3041 && uc <= 0x3096)
- || (uc >= 0x309D && uc <= 0x309F)
- || (uc >= 0x30A1 && uc <= 0x30FA)) {
- return true;
- }
-
- if ((uc >= 0x30FC && uc <= 0x30FF)
- || (uc >= 0x3105 && uc <= 0x312C)
- || (uc >= 0x3131 && uc <= 0x318E)
- || (uc >= 0x3190 && uc <= 0x31B7)
- || (uc >= 0x31F0 && uc <= 0x321C)
- || (uc >= 0x3220 && uc <= 0x3243)) {
- return true;
- }
-
- if ((uc >= 0x3260 && uc <= 0x327B)
- || (uc >= 0x327F && uc <= 0x32B0)
- || (uc >= 0x32C0 && uc <= 0x32CB)
- || (uc >= 0x32D0 && uc <= 0x32FE)
- || (uc >= 0x3300 && uc <= 0x3376)
- || (uc >= 0x337B && uc <= 0x33DD)) {
- return true;
- }
- if ((uc >= 0x33E0 && uc <= 0x33FE)
- || (uc >= 0x3400 && uc <= 0x4DB5)
- || (uc >= 0x4E00 && uc <= 0x9FA5)
- || (uc >= 0xA000 && uc <= 0xA48C)
- || (uc >= 0xAC00 && uc <= 0xD7A3)
- || (uc >= 0xD800 && uc <= 0xFA2D)
- || (uc >= 0xFA30 && uc <= 0xFA6A)
- || (uc >= 0xFB00 && uc <= 0xFB06)
- || (uc >= 0xFB13 && uc <= 0xFB17)
- || (uc >= 0xFF21 && uc <= 0xFF3A)
- || (uc >= 0xFF41 && uc <= 0xFF5A)
- || (uc >= 0xFF66 && uc <= 0xFFBE)
- || (uc >= 0xFFC2 && uc <= 0xFFC7)
- || (uc >= 0xFFCA && uc <= 0xFFCF)
- || (uc >= 0xFFD2 && uc <= 0xFFD7)
- || (uc >= 0xFFDA && uc <= 0xFFDC)) {
- return true;
- }
-
- if ((uc >= 0x10300 && uc <= 0x1031E)
- || (uc >= 0x10320 && uc <= 0x10323)
- || (uc >= 0x10330 && uc <= 0x1034A)
- || (uc >= 0x10400 && uc <= 0x10425)
- || (uc >= 0x10428 && uc <= 0x1044D)
- || (uc >= 0x1D000 && uc <= 0x1D0F5)
- || (uc >= 0x1D100 && uc <= 0x1D126)
- || (uc >= 0x1D12A && uc <= 0x1D166)
- || (uc >= 0x1D16A && uc <= 0x1D172)
- || (uc >= 0x1D183 && uc <= 0x1D184)
- || (uc >= 0x1D18C && uc <= 0x1D1A9)
- || (uc >= 0x1D1AE && uc <= 0x1D1DD)
- || (uc >= 0x1D400 && uc <= 0x1D454)
- || (uc >= 0x1D456 && uc <= 0x1D49C)
- || (uc >= 0x1D49E && uc <= 0x1D49F)
- || uc == 0x1D4A2
- || (uc >= 0x1D4A5 && uc <= 0x1D4A6)
- || (uc >= 0x1D4A9 && uc <= 0x1D4AC)
- || (uc >= 0x1D4AE && uc <= 0x1D4B9)
- || uc == 0x1D4BB
- || (uc >= 0x1D4BD && uc <= 0x1D4C0)
- || (uc >= 0x1D4C2 && uc <= 0x1D4C3)
- || (uc >= 0x1D4C5 && uc <= 0x1D505)
- || (uc >= 0x1D507 && uc <= 0x1D50A)
- || (uc >= 0x1D50D && uc <= 0x1D514)
- || (uc >= 0x1D516 && uc <= 0x1D51C)
- || (uc >= 0x1D51E && uc <= 0x1D539)
- || (uc >= 0x1D53B && uc <= 0x1D53E)
- || (uc >= 0x1D540 && uc <= 0x1D544)
- || uc == 0x1D546
- || (uc >= 0x1D54A && uc <= 0x1D550)
- || (uc >= 0x1D552 && uc <= 0x1D6A3)
- || (uc >= 0x1D6A8 && uc <= 0x1D7C9)
- || (uc >= 0x20000 && uc <= 0x2A6D6)
- || (uc >= 0x2F800 && uc <= 0x2FA1D)
- || (uc >= 0xF0000 && uc <= 0xFFFFD)
- || (uc >= 0x100000 && uc <= 0x10FFFD)) {
- return true;
- }
-
- return false;
-}
-
-Q_AUTOTEST_EXPORT bool qt_nameprep(QString *source, int from)
-{
- QChar *src = source->data(); // causes a detach, so we're sure the only one using it
- QChar *out = src + from;
- const QChar *e = src + source->size();
-
- for ( ; out < e; ++out) {
- ushort uc = out->unicode();
- if (uc >= 0x80) {
- break;
- } else if (uc >= 'A' && uc <= 'Z') {
- *out = QChar(uc | 0x20);
- }
- }
- if (out == e)
- return true; // everything was mapped easily (lowercased, actually)
- int firstNonAscii = out - src;
-
- // Characters unassigned in Unicode 3.2 are not allowed in "stored string" scheme
- // but allowed in "query" scheme
- // (Table A.1)
- const bool isUnassignedAllowed = false; // ###
- // Characters commonly mapped to nothing are simply removed
- // (Table B.1)
- const QChar *in = out;
- for ( ; in < e; ++in) {
- uint uc = in->unicode();
- if (QChar(uc).isHighSurrogate() && in < e - 1) {
- ushort low = in[1].unicode();
- if (QChar(low).isLowSurrogate()) {
- ++in;
- uc = QChar::surrogateToUcs4(uc, low);
- }
- }
- if (!isUnassignedAllowed) {
- QChar::UnicodeVersion version = QChar::unicodeVersion(uc);
- if (version == QChar::Unicode_Unassigned || version > QChar::Unicode_3_2) {
- source->resize(from); // not allowed, clear the label
- return false;
- }
- }
- if (!isMappedToNothing(uc)) {
- if (uc <= 0xFFFF) {
- *out++ = *in;
- } else {
- *out++ = in[-1];
- *out++ = in[0];
- }
- }
- }
- if (out != in)
- source->truncate(out - src);
-
- // Map to lowercase (Table B.2)
- mapToLowerCase(source, firstNonAscii);
-
- // Normalize to Unicode 3.2 form KC
- extern void qt_string_normalize(QString *data, QString::NormalizationForm mode,
- QChar::UnicodeVersion version, qsizetype from);
- qt_string_normalize(source, QString::NormalizationForm_KC, QChar::Unicode_3_2,
- firstNonAscii > from ? firstNonAscii - 1 : from);
-
- // Check for prohibited output
- if (containsProhibitedOutput(*source, firstNonAscii)) {
- source->resize(from);
- return false;
- }
-
- // Check for valid bidirectional characters
- bool containsLCat = false;
- bool containsRandALCat = false;
- src = source->data();
- e = src + source->size();
- for (in = src + from; in < e && (!containsLCat || !containsRandALCat); ++in) {
- uint uc = in->unicode();
- if (QChar(uc).isHighSurrogate() && in < e - 1) {
- ushort low = in[1].unicode();
- if (QChar(low).isLowSurrogate()) {
- ++in;
- uc = QChar::surrogateToUcs4(uc, low);
- }
- }
- if (isBidirectionalL(uc))
- containsLCat = true;
- else if (isBidirectionalRorAL(uc))
- containsRandALCat = true;
- }
- if (containsRandALCat) {
- if (containsLCat || (!isBidirectionalRorAL(src[from].unicode())
- || !isBidirectionalRorAL(e[-1].unicode()))) {
- source->resize(from); // not allowed, clear the label
- return false;
- }
- }
-
- return true;
-}
-
-static const QChar *qt_find_nonstd3(QStringView in, Qt::CaseSensitivity cs)
-{
- const QChar * const uc = in.data();
- const qsizetype len = in.size();
-
- if (len > 63)
- return uc;
-
- for (qsizetype i = 0; i < len; ++i) {
- const char16_t c = uc[i].unicode();
- if (c == '-' && (i == 0 || i == len - 1))
- return uc + i;
-
- // verifying the absence of non-LDH is the same as verifying that
- // only LDH is present
- if (cs == Qt::CaseInsensitive && (c >= 'A' && c <= 'Z'))
- continue;
- if (c == '-' || (c >= '0' && c <= '9')
- || (c >= 'a' && c <= 'z')
- //underscore is not supposed to be allowed, but other browser accept it (QTBUG-7434)
- || c == '_')
- continue;
-
- return uc + i;
- }
-
- return nullptr;
-}
-
-Q_AUTOTEST_EXPORT bool qt_check_std3rules(QStringView in)
-{
- return qt_find_nonstd3(in, Qt::CaseInsensitive) == nullptr;
-}
-
-static bool qt_check_nameprepped_std3(QStringView in)
-{
- // fast path: check for lowercase ASCII
- const QChar *firstNonAscii = qt_find_nonstd3(in, Qt::CaseSensitive);
- if (firstNonAscii == nullptr) {
- // everything was lowercase ASCII, digits or hyphen
- return true;
- }
-
- QString origin = QString::fromRawData(firstNonAscii, in.end() - firstNonAscii);
- QString copy = origin;
- qt_nameprep(&copy, 0);
- return origin == copy;
-}
+static constexpr qsizetype MaxDomainLabelLength = 63;
static inline uint encodeDigit(uint digit)
{
@@ -2193,14 +77,13 @@ static inline uint adapt(uint delta, uint numpoints, bool firsttime)
return k + (((base - tmin + 1) * delta) / (delta + skew));
}
-static inline void appendEncode(QString* output, uint& delta, uint& bias, uint& b, uint& h)
+static inline void appendEncode(QString *output, uint delta, uint bias)
{
uint qq;
uint k;
uint t;
- // insert the variable length delta integer; fail on
- // overflow.
+ // insert the variable length delta integer.
for (qq = delta, k = base;; k += base) {
// stop generating digits when the threshold is
// detected.
@@ -2212,9 +95,6 @@ static inline void appendEncode(QString* output, uint& delta, uint& bias, uint&
}
*output += QChar(encodeDigit(qq));
- bias = adapt(delta, h + 1, h == b);
- delta = 0;
- ++h;
}
Q_AUTOTEST_EXPORT void qt_punycodeEncoder(QStringView in, QString *output)
@@ -2223,6 +103,12 @@ Q_AUTOTEST_EXPORT void qt_punycodeEncoder(QStringView in, QString *output)
uint delta = 0;
uint bias = initial_bias;
+ // Do not try to encode strings that certainly will result in output
+ // that is longer than allowable domain name label length. Note that
+ // non-BMP codepoints are encoded as two QChars.
+ if (in.length() > MaxDomainLabelLength * 2)
+ return;
+
int outLen = output->length();
output->resize(outLen + in.length());
@@ -2252,42 +138,57 @@ Q_AUTOTEST_EXPORT void qt_punycodeEncoder(QStringView in, QString *output)
if (h > 0)
*output += QLatin1Char{'-'};
+ // compute the input length in Unicode code points.
+ uint inputLength = 0;
+ for (QStringIterator iter(in); iter.hasNext();) {
+ inputLength++;
+
+ if (iter.next(char32_t(-1)) == char32_t(-1)) {
+ output->truncate(outLen);
+ return; // invalid surrogate pair
+ }
+ }
+
// while there are still unprocessed non-basic code points left in
// the input string...
- while (h < (uint) in.length()) {
- // find the character in the input string with the lowest
- // unicode value.
- uint m = Q_MAXINT;
- for (QChar c : in) {
- if (c.unicode() >= n && c.unicode() < m)
- m = (uint) c.unicode();
+ while (h < inputLength) {
+ // find the character in the input string with the lowest unprocessed value.
+ uint m = std::numeric_limits<uint>::max();
+ for (QStringIterator iter(in); iter.hasNext();) {
+ auto c = iter.nextUnchecked();
+ static_assert(std::numeric_limits<decltype(m)>::max()
+ >= std::numeric_limits<decltype(c)>::max(),
+ "Punycode uint should be able to cover all codepoints");
+ if (c >= n && c < m)
+ m = c;
}
- // reject out-of-bounds unicode characters
- if (m - n > (Q_MAXINT - delta) / (h + 1)) {
+ // delta = delta + (m - n) * (h + 1), fail on overflow
+ uint tmp;
+ if (mul_overflow<uint>(m - n, h + 1, &tmp) || add_overflow<uint>(delta, tmp, &delta)) {
output->truncate(outLen);
return; // punycode_overflow
}
-
- delta += (m - n) * (h + 1);
n = m;
- for (QChar c : in) {
+ for (QStringIterator iter(in); iter.hasNext();) {
+ auto c = iter.nextUnchecked();
- // increase delta until we reach the character with the
- // lowest unicode code. fail if delta overflows.
- if (c.unicode() < n) {
- ++delta;
- if (!delta) {
+ // increase delta until we reach the character processed in this iteration;
+ // fail if delta overflows.
+ if (c < n) {
+ if (add_overflow<uint>(delta, 1, &delta)) {
output->truncate(outLen);
return; // punycode_overflow
}
}
- // if j is the index of the character with the lowest
- // unicode code...
- if (c.unicode() == n) {
- appendEncode(output, delta, bias, b, h);
+ if (c == n) {
+ appendEncode(output, delta, bias);
+
+ bias = adapt(delta, h + 1, h == b);
+ delta = 0;
+ ++h;
}
}
@@ -2306,6 +207,12 @@ Q_AUTOTEST_EXPORT QString qt_punycodeDecoder(const QString &pc)
uint i = 0;
uint bias = initial_bias;
+ // Do not try to decode strings longer than allowable for a domain label.
+ // Non-ASCII strings are not allowed here anyway, so there is no need
+ // to account for surrogates.
+ if (pc.length() > MaxDomainLabelLength)
+ return QString();
+
// strip any ACE prefix
int start = pc.startsWith(QLatin1String("xn--")) ? 4 : 0;
if (!start)
@@ -2314,8 +221,8 @@ Q_AUTOTEST_EXPORT QString qt_punycodeDecoder(const QString &pc)
// find the last delimiter character '-' in the input array. copy
// all data before this delimiter directly to the output array.
int delimiterPos = pc.lastIndexOf(QLatin1Char{'-'});
- QString output = delimiterPos < 4 ?
- QString() : pc.mid(start, delimiterPos - start);
+ auto output = delimiterPos < 4 ? std::u32string()
+ : pc.mid(start, delimiterPos - start).toStdU32String();
// if a delimiter was found, skip to the position after it;
// otherwise start at the front of the input string. everything
@@ -2339,36 +246,68 @@ Q_AUTOTEST_EXPORT QString qt_punycodeDecoder(const QString &pc)
else if (digit - 97 < 26) digit -= 97;
else digit = base;
- // reject out of range digits
- if (digit >= base || digit > (Q_MAXINT - i) / w)
- return QStringLiteral("");
+ // Fail if the code point has no digit value
+ if (digit >= base)
+ return QString();
- i += (digit * w);
+ // i = i + digit * w, fail on overflow
+ uint tmp;
+ if (mul_overflow<uint>(digit, w, &tmp) || add_overflow<uint>(i, tmp, &i))
+ return QString();
// detect threshold to stop reading delta digits
uint t;
if (k <= bias) t = tmin;
else if (k >= bias + tmax) t = tmax;
else t = k - bias;
+
if (digit < t) break;
- w *= (base - t);
+ // w = w * (base - t), fail on overflow
+ if (mul_overflow<uint>(w, base - t, &w))
+ return QString();
}
// find new bias and calculate the next non-basic code
// character.
- bias = adapt(i - oldi, output.length() + 1, oldi == 0);
- n += i / (output.length() + 1);
+ uint outputLength = static_cast<uint>(output.length());
+ bias = adapt(i - oldi, outputLength + 1, oldi == 0);
+
+ // n = n + i div (length(output) + 1), fail on overflow
+ if (add_overflow<uint>(n, i / (outputLength + 1), &n))
+ return QString();
// allow the deltas to wrap around
- i %= (output.length() + 1);
+ i %= (outputLength + 1);
+
+ // if n is a basic code point then fail; this should not happen with
+ // correct implementation of Punycode, but check just n case.
+ if (n < initial_n) {
+ // Don't use Q_ASSERT() to avoid possibility of DoS
+ qWarning("Attempt to insert a basic codepoint. Unhandled overflow?");
+ return QString();
+ }
+
+ // Surrogates should normally be rejected later by other IDNA code.
+ // But because of Qt's use of UTF-16 to represent strings the
+ // IDNA code is not able to distinguish characters represented as pairs
+ // of surrogates from normal code points. This is why surrogates are
+ // not allowed here.
+ //
+ // Allowing surrogates would lead to non-unique (after normalization)
+ // encoding of strings with non-BMP characters.
+ //
+ // Punycode that encodes characters outside the Unicode range is also
+ // invalid and is rejected here.
+ if (QChar::isSurrogate(n) || n > QChar::LastValidCodePoint)
+ return QString();
// insert the character n at position i
- output.insert((uint) i, QChar((ushort) n));
+ output.insert(i, 1, static_cast<char32_t>(n));
++i;
}
- return output;
+ return QString::fromStdU32String(output);
}
static const char * const idn_whitelist[] = {
@@ -2442,13 +381,13 @@ static bool equal(const QChar *a, int l, const char *b)
return l == 0;
}
-static bool qt_is_idn_enabled(QStringView domain)
+static bool qt_is_idn_enabled(QStringView aceDomain)
{
- const auto idx = domain.lastIndexOf(QLatin1Char('.'));
+ auto idx = aceDomain.lastIndexOf(QLatin1Char('.'));
if (idx == -1)
return false;
- QString tldString = qt_ACE_do(domain.mid(idx + 1), ToAceOnly, ForbidLeadingDot);
+ auto tldString = aceDomain.mid(idx + 1);
const auto len = tldString.size();
const QChar *tld = tldString.constData();
@@ -2470,136 +409,544 @@ static bool qt_is_idn_enabled(QStringView domain)
return equal(tld, len, idn_whitelist[i]);
}
-static inline bool isDotDelimiter(ushort uc)
+template<typename C>
+static inline bool isValidInNormalizedAsciiLabel(C c)
{
- // IDNA / rfc3490 describes these four delimiters used for
- // separating labels in unicode international domain
- // names.
- return uc == 0x2e || uc == 0x3002 || uc == 0xff0e || uc == 0xff61;
+ return c == u'-' || c == u'_' || (c >= u'0' && c <= u'9') || (c >= u'a' && c <= u'z');
}
-static qsizetype nextDotDelimiter(QStringView domain, qsizetype from = 0)
+template<typename C>
+static inline bool isValidInNormalizedAsciiName(C c)
+{
+ return isValidInNormalizedAsciiLabel(c) || c == u'.';
+}
+
+/*
+ Map domain name according to algorithm in UTS #46, 4.1
+
+ Returns empty string if there are disallowed characters in the input.
+
+ Sets resultIsAscii if the result is known for sure to be all ASCII.
+*/
+static QString mapDomainName(const QString &in, QUrl::AceProcessingOptions options,
+ bool *resultIsAscii)
{
- const QChar *b = domain.data();
- const QChar *ch = b + from;
- const QChar *e = b + domain.length();
- while (ch < e) {
- if (isDotDelimiter(ch->unicode()))
+ *resultIsAscii = true;
+
+ // Check if the input is already normalized ASCII first and can be returned as is.
+ int i = 0;
+ for (auto c : in) {
+ if (c.unicode() >= 0x80 || !isValidInNormalizedAsciiName(c))
break;
- else
- ++ch;
+ i++;
+ }
+
+ if (i == in.size())
+ return in;
+
+ QString result;
+ result.reserve(in.size());
+ result.append(in.constData(), i);
+ bool allAscii = true;
+
+ for (QStringIterator iter(QStringView(in).sliced(i)); iter.hasNext();) {
+ char32_t uc = iter.next();
+
+ // Fast path for ASCII-only inputs
+ if (Q_LIKELY(uc < 0x80)) {
+ if (uc >= U'A' && uc <= U'Z')
+ uc |= 0x20; // lower-case it
+
+ if (!isValidInNormalizedAsciiName(uc))
+ return {};
+
+ result.append(static_cast<char16_t>(uc));
+ continue;
+ }
+ allAscii = false;
+
+ QUnicodeTables::IdnaStatus status = QUnicodeTables::idnaStatus(uc);
+
+ if (status == QUnicodeTables::IdnaStatus::Deviation)
+ status = options.testFlag(QUrl::AceTransitionalProcessing)
+ ? QUnicodeTables::IdnaStatus::Mapped
+ : QUnicodeTables::IdnaStatus::Valid;
+
+ switch (status) {
+ case QUnicodeTables::IdnaStatus::Ignored:
+ continue;
+ case QUnicodeTables::IdnaStatus::Valid:
+ for (auto c : QChar::fromUcs4(uc))
+ result.append(c);
+ break;
+ case QUnicodeTables::IdnaStatus::Mapped:
+ result.append(QUnicodeTables::idnaMapping(uc));
+ break;
+ case QUnicodeTables::IdnaStatus::Disallowed:
+ return {};
+ default:
+ Q_UNREACHABLE();
+ }
+ }
+
+ *resultIsAscii = allAscii;
+ return result;
+}
+
+/*
+ Check the rules for an ASCII label.
+
+ Check the size restriction and that the label does not start or end with dashes.
+
+ The label should be nonempty.
+*/
+static bool validateAsciiLabel(QStringView label)
+{
+ if (label.length() > MaxDomainLabelLength)
+ return false;
+
+ if (label.first() == u'-' || label.last() == u'-')
+ return false;
+
+ return std::all_of(label.begin(), label.end(), isValidInNormalizedAsciiLabel<QChar>);
+}
+
+namespace {
+
+class DomainValidityChecker
+{
+ bool domainNameIsBidi = false;
+ bool hadBidiErrors = false;
+
+ static constexpr char32_t ZWNJ = U'\u200C';
+ static constexpr char32_t ZWJ = U'\u200D';
+
+public:
+ DomainValidityChecker() { }
+ bool checkLabel(const QString &label, QUrl::AceProcessingOptions options);
+
+private:
+ static bool checkContextJRules(QStringView label);
+ static bool checkBidiRules(QStringView label);
+};
+
+} // anonymous namespace
+
+/*
+ Check CONTEXTJ rules according to RFC 5892, appendix A.1 & A.2.
+
+ Rule Set for U+200C (ZWNJ):
+
+ False;
+
+ If Canonical_Combining_Class(Before(cp)) .eq. Virama Then True;
+
+ If RegExpMatch((Joining_Type:{L,D})(Joining_Type:T)*\u200C
+
+ (Joining_Type:T)*(Joining_Type:{R,D})) Then True;
+
+ Rule Set for U+200D (ZWJ):
+
+ False;
+
+ If Canonical_Combining_Class(Before(cp)) .eq. Virama Then True;
+
+*/
+bool DomainValidityChecker::checkContextJRules(QStringView label)
+{
+ constexpr unsigned char CombiningClassVirama = 9;
+
+ enum class State {
+ Initial,
+ LD_T, // L,D with possible following T*
+ ZWNJ_T, // ZWNJ with possible following T*
+ };
+ State regexpState = State::Initial;
+ bool previousIsVirama = false;
+
+ for (QStringIterator iter(label); iter.hasNext();) {
+ auto ch = iter.next();
+
+ if (ch == ZWJ) {
+ if (!previousIsVirama)
+ return false;
+ regexpState = State::Initial;
+ } else if (ch == ZWNJ) {
+ if (!previousIsVirama && regexpState != State::LD_T)
+ return false;
+ regexpState = previousIsVirama ? State::Initial : State::ZWNJ_T;
+ } else {
+ switch (QChar::joiningType(ch)) {
+ case QChar::Joining_Left:
+ if (regexpState == State::ZWNJ_T)
+ return false;
+ regexpState = State::LD_T;
+ break;
+ case QChar::Joining_Right:
+ regexpState = State::Initial;
+ break;
+ case QChar::Joining_Dual:
+ regexpState = State::LD_T;
+ break;
+ case QChar::Joining_Transparent:
+ break;
+ default:
+ regexpState = State::Initial;
+ break;
+ }
+ }
+
+ previousIsVirama = QChar::combiningClass(ch) == CombiningClassVirama;
}
- return ch - b;
+
+ return regexpState != State::ZWNJ_T;
}
-QString qt_ACE_do(QStringView domain, AceOperation op, AceLeadingDot dot)
+/*
+ Check if the label conforms to BiDi rule of RFC 5893.
+
+ 1. The first character must be a character with Bidi property L, R,
+ or AL. If it has the R or AL property, it is an RTL label; if it
+ has the L property, it is an LTR label.
+
+ 2. In an RTL label, only characters with the Bidi properties R, AL,
+ AN, EN, ES, CS, ET, ON, BN, or NSM are allowed.
+
+ 3. In an RTL label, the end of the label must be a character with
+ Bidi property R, AL, EN, or AN, followed by zero or more
+ characters with Bidi property NSM.
+
+ 4. In an RTL label, if an EN is present, no AN may be present, and
+ vice versa.
+
+ 5. In an LTR label, only characters with the Bidi properties L, EN,
+ ES, CS, ET, ON, BN, or NSM are allowed.
+
+ 6. In an LTR label, the end of the label must be a character with
+ Bidi property L or EN, followed by zero or more characters with
+ Bidi property NSM.
+*/
+bool DomainValidityChecker::checkBidiRules(QStringView label)
{
- QString result;
- if (domain.isEmpty())
- return result;
+ if (label.isEmpty())
+ return true;
+
+ QStringIterator iter(label);
+ Q_ASSERT(iter.hasNext());
- result.reserve(domain.length());
+ char32_t ch = iter.next();
+ bool labelIsRTL = false;
+
+ switch (QChar::direction(ch)) {
+ case QChar::DirL:
+ break;
+ case QChar::DirR:
+ case QChar::DirAL:
+ labelIsRTL = true;
+ break;
+ default:
+ return false;
+ }
+
+ bool tailOk = true;
+ bool labelHasEN = false;
+ bool labelHasAN = false;
+
+ while (iter.hasNext()) {
+ ch = iter.next();
+
+ switch (QChar::direction(ch)) {
+ case QChar::DirR:
+ case QChar::DirAL:
+ if (!labelIsRTL)
+ return false;
+ tailOk = true;
+ break;
+
+ case QChar::DirL:
+ if (labelIsRTL)
+ return false;
+ tailOk = true;
+ break;
- const bool isIdnEnabled = op == NormalizeAce ? qt_is_idn_enabled(domain) : false;
+ case QChar::DirES:
+ case QChar::DirCS:
+ case QChar::DirET:
+ case QChar::DirON:
+ case QChar::DirBN:
+ tailOk = false;
+ break;
+
+ case QChar::DirNSM:
+ break;
+
+ case QChar::DirAN:
+ if (labelIsRTL) {
+ if (labelHasEN)
+ return false;
+ labelHasAN = true;
+ tailOk = true;
+ } else {
+ return false;
+ }
+ break;
+
+ case QChar::DirEN:
+ if (labelIsRTL) {
+ if (labelHasAN)
+ return false;
+ labelHasEN = true;
+ }
+ tailOk = true;
+ break;
+
+ default:
+ return false;
+ }
+ }
+
+ return tailOk;
+}
+
+/*
+ Check if the given label is valid according to UTS #46 validity criteria.
+
+ NFC check can be skipped if the label was transformed to NFC before calling
+ this function (as optimization).
+
+ The domain name is considered invalid if this function returns false at least
+ once.
+
+ 1. The label must be in Unicode Normalization Form NFC.
+ 2. If CheckHyphens, the label must not contain a U+002D HYPHEN-MINUS character
+ in both the third and fourth positions.
+ 3. If CheckHyphens, the label must neither begin nor end with a U+002D HYPHEN-MINUS character.
+ 4. The label must not contain a U+002E ( . ) FULL STOP.
+ 5. The label must not begin with a combining mark, that is: General_Category=Mark.
+ 6. Each code point in the label must only have certain status values according to Section 5,
+ IDNA Mapping Table:
+ 1. For Transitional Processing, each value must be valid.
+ 2. For Nontransitional Processing, each value must be either valid or deviation.
+ 7. If CheckJoiners, the label must satisfy the ContextJ rules from Appendix A, in The Unicode
+ Code Points and Internationalized Domain Names for Applications (IDNA).
+ 8. If CheckBidi, and if the domain name is a Bidi domain name, then the label must satisfy
+ all six of the numbered conditions in RFC 5893, Section 2.
+
+ NOTE: Don't use QStringView for label, so that call to QString::normalized() can avoid
+ memory allocation when there is nothing to normalize.
+*/
+bool DomainValidityChecker::checkLabel(const QString &label, QUrl::AceProcessingOptions options)
+{
+ if (label.isEmpty())
+ return true;
+
+ if (label != label.normalized(QString::NormalizationForm_C))
+ return false;
+
+ if (label.length() >= 4) {
+ // This assumes that the first two characters are in BMP, but that's ok
+ // because non-BMP characters are unlikely to be used for specifying
+ // future extensions.
+ if (label[2] == QLatin1Char('-') && label[3] == QLatin1Char('-'))
+ return false;
+ }
+
+ if (label.startsWith(QLatin1Char('-')) || label.endsWith(QLatin1Char('-')))
+ return false;
+
+ if (label.contains(QLatin1Char('.')))
+ return false;
+
+ QStringIterator iter(label);
+ auto c = iter.next();
+
+ if (QChar::isMark(c))
+ return false;
+
+ // As optimization, CONTEXTJ rules check can be skipped if no
+ // ZWJ/ZWNJ characters were found during the first pass.
+ bool hasJoiners = false;
+
+ for (;;) {
+ hasJoiners = hasJoiners || c == ZWNJ || c == ZWJ;
+
+ if (!domainNameIsBidi) {
+ switch (QChar::direction(c)) {
+ case QChar::DirR:
+ case QChar::DirAL:
+ case QChar::DirAN:
+ domainNameIsBidi = true;
+ if (hadBidiErrors)
+ return false;
+ break;
+ default:
+ break;
+ }
+ }
+
+ switch (QUnicodeTables::idnaStatus(c)) {
+ case QUnicodeTables::IdnaStatus::Valid:
+ break;
+ case QUnicodeTables::IdnaStatus::Deviation:
+ if (options.testFlag(QUrl::AceTransitionalProcessing))
+ return false;
+ break;
+ default:
+ return false;
+ }
+
+ if (!iter.hasNext())
+ break;
+ c = iter.next();
+ }
+
+ if (hasJoiners && !checkContextJRules(label))
+ return false;
+
+ hadBidiErrors = hadBidiErrors || !checkBidiRules(label);
+
+ if (domainNameIsBidi && hadBidiErrors)
+ return false;
+
+ return true;
+}
+
+static QString convertToAscii(const QString &normalizedDomain, AceLeadingDot dot)
+{
qsizetype lastIdx = 0;
QString aceForm; // this variable is here for caching
+ QString aceResult;
+
+ while (true) {
+ auto idx = normalizedDomain.indexOf(u'.', lastIdx);
+ if (idx == -1)
+ idx = normalizedDomain.size();
- while (1) {
- const auto idx = nextDotDelimiter(domain, lastIdx);
const auto labelLength = idx - lastIdx;
if (labelLength == 0) {
- if (idx == domain.size())
+ if (idx == normalizedDomain.size())
break;
if (dot == ForbidLeadingDot || idx > 0)
- return QString(); // two delimiters in a row -- empty label not allowed
- }
+ return {}; // two delimiters in a row -- empty label not allowed
+ } else {
+ const auto label = QStringView(normalizedDomain).sliced(lastIdx, labelLength);
+ aceForm.clear();
+ qt_punycodeEncoder(label, &aceForm);
+ if (aceForm.isEmpty())
+ return {};
- // RFC 3490 says, about the ToASCII operation:
- // 3. If the UseSTD3ASCIIRules flag is set, then perform these checks:
- //
- // (a) Verify the absence of non-LDH ASCII code points; that is, the
- // absence of 0..2C, 2E..2F, 3A..40, 5B..60, and 7B..7F.
- //
- // (b) Verify the absence of leading and trailing hyphen-minus; that
- // is, the absence of U+002D at the beginning and end of the
- // sequence.
- // and:
- // 8. Verify that the number of code points is in the range 1 to 63
- // inclusive.
-
- // copy the label to the destination, which also serves as our scratch area, lowercasing it
- int prevLen = result.size();
- bool simple = true;
- result.resize(prevLen + labelLength);
- {
- QChar *out = result.data() + prevLen;
- for (QChar c : domain.mid(lastIdx, labelLength)) {
- const auto uc = c.unicode();
- if (uc > 0x7f)
- simple = false;
- if (uc >= 'A' && uc <= 'Z')
- *out++ = QChar(uc | 0x20);
- else
- *out++ = c;
- }
+ aceResult.append(aceForm);
}
- if (simple && labelLength > 6) {
- // ACE form domains contain only ASCII characters, but we can't consider them simple
- // is this an ACE form?
- // the shortest valid ACE domain is 6 characters long (U+0080 would be 1, but it's not allowed)
- if (QStringView{result}.sliced(prevLen).startsWith(u"xn--"))
- simple = false;
+ if (idx == normalizedDomain.size())
+ break;
+
+ lastIdx = idx + 1;
+ aceResult += u'.';
+ }
+
+ return aceResult;
+}
+
+static bool checkAsciiDomainName(const QString &normalizedDomain, AceLeadingDot dot,
+ bool *usesPunycode)
+{
+ qsizetype lastIdx = 0;
+ bool hasPunycode = false;
+ *usesPunycode = false;
+
+ while (lastIdx < normalizedDomain.size()) {
+ auto idx = normalizedDomain.indexOf(u'.', lastIdx);
+ if (idx == -1)
+ idx = normalizedDomain.size();
+
+ const auto labelLength = idx - lastIdx;
+ if (labelLength == 0) {
+ if (idx == normalizedDomain.size())
+ break;
+ if (dot == ForbidLeadingDot || idx > 0)
+ return false; // two delimiters in a row -- empty label not allowed
+ } else {
+ const auto label = QStringView(normalizedDomain).sliced(lastIdx, labelLength);
+ if (!validateAsciiLabel(label))
+ return false;
+
+ hasPunycode = hasPunycode || label.startsWith(QLatin1String("xn--"));
}
- if (simple) {
- // fastest case: this is the common case (non IDN-domains)
- // so we're done
- if (!qt_check_std3rules(QStringView{result.constData() + prevLen, labelLength}))
- return QString();
+ lastIdx = idx + 1;
+ }
+
+ *usesPunycode = hasPunycode;
+ return true;
+}
+
+static QString convertToUnicode(const QString &asciiDomain, QUrl::AceProcessingOptions options)
+{
+ QString result;
+ result.reserve(asciiDomain.size());
+ qsizetype lastIdx = 0;
+
+ DomainValidityChecker checker;
+
+ while (true) {
+ auto idx = asciiDomain.indexOf(u'.', lastIdx);
+ if (idx == -1)
+ idx = asciiDomain.size();
+
+ const auto labelLength = idx - lastIdx;
+ if (labelLength == 0) {
+ if (idx == asciiDomain.size())
+ break;
} else {
- // Punycode encoding and decoding cannot be done in-place
- // That means we need one or two temporaries
- if (!qt_nameprep(&result, prevLen))
- return QString(); // failed
- const auto toReserve = result.length() - prevLen + 4 + 6; // "xn--" plus some extra bytes
- aceForm.resize(0);
- if (toReserve > aceForm.capacity())
- aceForm.reserve(toReserve);
- qt_punycodeEncoder(QStringView{result}.mid(prevLen), &aceForm);
-
- // We use resize()+memcpy() here because we're overwriting the data we've copied
- bool appended = false;
- if (isIdnEnabled) {
- QString tmp = qt_punycodeDecoder(aceForm);
- if (tmp.isEmpty())
- return QString(); // shouldn't happen, since we've just punycode-encoded it
- if (qt_check_nameprepped_std3(tmp)) {
- result.resize(prevLen + tmp.size());
- memcpy(result.data() + prevLen, tmp.constData(), tmp.size() * sizeof(QChar));
- appended = true;
- }
- }
+ const auto label = asciiDomain.sliced(lastIdx, labelLength);
+ const auto unicodeLabel = qt_punycodeDecoder(label);
- if (!appended) {
- result.resize(prevLen + aceForm.size());
- memcpy(result.data() + prevLen, aceForm.constData(), aceForm.size() * sizeof(QChar));
- }
+ if (unicodeLabel.isEmpty())
+ return asciiDomain;
- if (!qt_check_std3rules(aceForm))
- return QString();
+ if (!checker.checkLabel(unicodeLabel, options))
+ return asciiDomain;
+
+ result.append(unicodeLabel);
}
+ if (idx == asciiDomain.size())
+ break;
lastIdx = idx + 1;
- if (lastIdx < domain.size() + 1)
- result += QLatin1Char('.');
- else
- break;
+ result += u'.';
}
return result;
}
+QString qt_ACE_do(const QString &domain, AceOperation op, AceLeadingDot dot,
+ QUrl::AceProcessingOptions options)
+{
+ if (domain.isEmpty())
+ return {};
+
+ bool mappedToAscii;
+ const QString mapped = mapDomainName(domain, options, &mappedToAscii);
+ const QString normalized =
+ mappedToAscii ? mapped : mapped.normalized(QString::NormalizationForm_C);
+
+ if (normalized.isEmpty())
+ return {};
+
+ bool needsCoversionToUnicode;
+ const QString aceResult = mappedToAscii ? normalized : convertToAscii(normalized, dot);
+ if (aceResult.isEmpty() || !checkAsciiDomainName(aceResult, dot, &needsCoversionToUnicode))
+ return {};
+
+ if (op == ToAceOnly || !needsCoversionToUnicode
+ || (!options.testFlag(QUrl::IgnoreIDNWhitelist) && !qt_is_idn_enabled(aceResult))) {
+ return aceResult;
+ }
+
+ return convertToUnicode(aceResult, options);
+}
+
/*!
\since 4.2
@@ -2607,6 +954,8 @@ QString qt_ACE_do(QStringView domain, AceOperation op, AceLeadingDot dot)
to have non-ASCII characters in their compositions.
See setIdnWhitelist() for the rationale of this list.
+
+ \sa AceProcessingOption
*/
QStringList QUrl::idnWhitelist()
{
diff --git a/src/corelib/io/qurlrecode.cpp b/src/corelib/io/qurlrecode.cpp
index 44e0a8239d..fd5accb108 100644
--- a/src/corelib/io/qurlrecode.cpp
+++ b/src/corelib/io/qurlrecode.cpp
@@ -167,48 +167,45 @@ static const uchar reservedMask[96] = {
0xff // BSKP
};
-static inline bool isHex(ushort c)
+static inline bool isHex(char16_t c)
{
- return (c >= 'a' && c <= 'f') ||
- (c >= 'A' && c <= 'F') ||
- (c >= '0' && c <= '9');
+ return (c >= u'a' && c <= u'f') || (c >= u'A' && c <= u'F') || (c >= u'0' && c <= u'9');
}
-static inline bool isUpperHex(ushort c)
+static inline bool isUpperHex(char16_t c)
{
// undefined behaviour if c isn't an hex char!
return c < 0x60;
}
-static inline ushort toUpperHex(ushort c)
+static inline char16_t toUpperHex(char16_t c)
{
return isUpperHex(c) ? c : c - 0x20;
}
-static inline ushort decodeNibble(ushort c)
+static inline ushort decodeNibble(char16_t c)
{
- return c >= 'a' ? c - 'a' + 0xA :
- c >= 'A' ? c - 'A' + 0xA : c - '0';
+ return c >= u'a' ? c - u'a' + 0xA : c >= u'A' ? c - u'A' + 0xA : c - u'0';
}
// if the sequence at input is 2*HEXDIG, returns its decoding
// returns -1 if it isn't.
// assumes that the range has been checked already
-static inline ushort decodePercentEncoding(const ushort *input)
+static inline char16_t decodePercentEncoding(const char16_t *input)
{
- ushort c1 = input[1];
- ushort c2 = input[2];
+ char16_t c1 = input[1];
+ char16_t c2 = input[2];
if (!isHex(c1) || !isHex(c2))
- return ushort(-1);
+ return char16_t(-1);
return decodeNibble(c1) << 4 | decodeNibble(c2);
}
-static inline ushort encodeNibble(ushort c)
+static inline char16_t encodeNibble(ushort c)
{
- return ushort(QtMiscUtils::toHexUpper(c));
+ return QtMiscUtils::toHexUpper(c);
}
-static void ensureDetached(QString &result, ushort *&output, const ushort *begin, const ushort *input, const ushort *end,
+static void ensureDetached(QString &result, char16_t *&output, const char16_t *begin, const char16_t *input, const char16_t *end,
int add = 0)
{
if (!output) {
@@ -221,7 +218,7 @@ static void ensureDetached(QString &result, ushort *&output, const ushort *begin
result.resize(origSize + spaceNeeded);
// we know that resize() above detached, so we bypass the reference count check
- output = const_cast<ushort *>(reinterpret_cast<const ushort *>(result.constData()))
+ output = const_cast<char16_t *>(reinterpret_cast<const char16_t *>(result.constData()))
+ origSize;
// copy the chars we've already processed
@@ -260,7 +257,7 @@ struct QUrlUtf8Traits : public QUtf8BaseTraitsNoAscii
static const bool allowNonCharacters = false;
// override: our "bytes" are three percent-encoded UTF-16 characters
- static void appendByte(ushort *&ptr, uchar b)
+ static void appendByte(char16_t *&ptr, uchar b)
{
// b >= 0x80, by construction, so percent-encode
*ptr++ = '%';
@@ -268,9 +265,9 @@ struct QUrlUtf8Traits : public QUtf8BaseTraitsNoAscii
*ptr++ = encodeNibble(b & 0xf);
}
- static uchar peekByte(const ushort *ptr, qsizetype n = 0)
+ static uchar peekByte(const char16_t *ptr, qsizetype n = 0)
{
- // decodePercentEncoding returns ushort(-1) if it can't decode,
+ // decodePercentEncoding returns char16_t(-1) if it can't decode,
// which means we return 0xff, which is not a valid continuation byte.
// If ptr[i * 3] is not '%', we'll multiply by zero and return 0,
// also not a valid continuation byte (if it's '%', we multiply by 1).
@@ -278,12 +275,12 @@ struct QUrlUtf8Traits : public QUtf8BaseTraitsNoAscii
* uchar(ptr[n * 3] == '%');
}
- static qptrdiff availableBytes(const ushort *ptr, const ushort *end)
+ static qptrdiff availableBytes(const char16_t *ptr, const char16_t *end)
{
return (end - ptr) / 3;
}
- static void advanceByte(const ushort *&ptr, int n = 1)
+ static void advanceByte(const char16_t *&ptr, int n = 1)
{
ptr += n * 3;
}
@@ -291,11 +288,11 @@ struct QUrlUtf8Traits : public QUtf8BaseTraitsNoAscii
}
// returns true if we performed an UTF-8 decoding
-static bool encodedUtf8ToUtf16(QString &result, ushort *&output, const ushort *begin, const ushort *&input,
- const ushort *end, ushort decoded)
+static bool encodedUtf8ToUtf16(QString &result, char16_t *&output, const char16_t *begin,
+ const char16_t *&input, const char16_t *end, char16_t decoded)
{
- uint ucs4 = 0, *dst = &ucs4;
- const ushort *src = input + 3;// skip the %XX that yielded \a decoded
+ char32_t ucs4 = 0, *dst = &ucs4;
+ const char16_t *src = input + 3;// skip the %XX that yielded \a decoded
int charsNeeded = QUtf8Functions::fromUtf8<QUrlUtf8Traits>(decoded, dst, src, end);
if (charsNeeded < 0)
return false;
@@ -318,8 +315,8 @@ static bool encodedUtf8ToUtf16(QString &result, ushort *&output, const ushort *b
return true;
}
-static void unicodeToEncodedUtf8(QString &result, ushort *&output, const ushort *begin,
- const ushort *&input, const ushort *end, ushort decoded)
+static void unicodeToEncodedUtf8(QString &result, char16_t *&output, const char16_t *begin,
+ const char16_t *&input, const char16_t *end, char16_t decoded)
{
// calculate the utf8 length and ensure enough space is available
int utf8len = QChar::isHighSurrogate(decoded) ? 4 : decoded >= 0x800 ? 3 : 2;
@@ -332,14 +329,14 @@ static void unicodeToEncodedUtf8(QString &result, ushort *&output, const ushort
} else {
// verify that there's enough space or expand
int charsRemaining = end - input - 1; // not including this one
- int pos = output - reinterpret_cast<const ushort *>(result.constData());
+ int pos = output - reinterpret_cast<const char16_t *>(result.constData());
int spaceRemaining = result.size() - pos;
if (spaceRemaining < 3*charsRemaining + 3*utf8len) {
// must resize
result.resize(result.size() + 3*utf8len);
// we know that resize() above detached, so we bypass the reference count check
- output = const_cast<ushort *>(reinterpret_cast<const ushort *>(result.constData()));
+ output = const_cast<char16_t *>(reinterpret_cast<const char16_t *>(result.constData()));
output += pos;
}
}
@@ -372,16 +369,17 @@ static void unicodeToEncodedUtf8(QString &result, ushort *&output, const ushort
}
}
-static int recode(QString &result, const ushort *begin, const ushort *end, QUrl::ComponentFormattingOptions encoding,
- const uchar *actionTable, bool retryBadEncoding)
+static int recode(QString &result, const char16_t *begin, const char16_t *end,
+ QUrl::ComponentFormattingOptions encoding, const uchar *actionTable,
+ bool retryBadEncoding)
{
const int origSize = result.size();
- const ushort *input = begin;
- ushort *output = nullptr;
+ const char16_t *input = begin;
+ char16_t *output = nullptr;
EncodingAction action = EncodeCharacter;
for ( ; input != end; ++input) {
- ushort c;
+ char16_t c;
// try a run where no change is necessary
for ( ; input != end; ++input) {
c = *input;
@@ -398,7 +396,7 @@ static int recode(QString &result, const ushort *begin, const ushort *end, QUrl:
break;
non_trivial:
- uint decoded;
+ char16_t decoded;
if (c == '%' && retryBadEncoding) {
// always write "%25"
ensureDetached(result, output, begin, input, end);
@@ -408,7 +406,7 @@ non_trivial:
continue;
} else if (c == '%') {
// check if the input is valid
- if (input + 2 >= end || (decoded = decodePercentEncoding(input)) == ushort(-1)) {
+ if (input + 2 >= end || (decoded = decodePercentEncoding(input)) == char16_t(-1)) {
// not valid, retry
result.resize(origSize);
return recode(result, begin, end, encoding, actionTable, true);
@@ -468,7 +466,7 @@ non_trivial:
}
if (output) {
- int len = output - reinterpret_cast<const ushort *>(result.constData());
+ int len = output - reinterpret_cast<const char16_t *>(result.constData());
result.truncate(len);
return len - origSize;
}
@@ -603,7 +601,8 @@ static qsizetype decode(QString &appendTo, QStringView in)
if (Q_UNLIKELY(end - input < 3 || !isHex(input[1]) || !isHex(input[2]))) {
// badly-encoded data
appendTo.resize(origSize + (end - begin));
- memcpy(static_cast<void *>(appendTo.begin() + origSize), static_cast<const void *>(begin), (end - begin) * sizeof(ushort));
+ memcpy(static_cast<void *>(appendTo.begin() + origSize),
+ static_cast<const void *>(begin), (end - begin) * sizeof(*end));
return end - begin;
}
@@ -691,8 +690,8 @@ qt_urlRecode(QString &appendTo, QStringView in,
actionTable[uchar(*p) - ' '] = *p >> 8;
}
- return recode(appendTo, reinterpret_cast<const ushort *>(in.begin()), reinterpret_cast<const ushort *>(in.end()),
- encoding, actionTable, false);
+ return recode(appendTo, reinterpret_cast<const char16_t *>(in.begin()),
+ reinterpret_cast<const char16_t *>(in.end()), encoding, actionTable, false);
}
QT_END_NAMESPACE
diff --git a/src/corelib/io/qwindowspipereader.cpp b/src/corelib/io/qwindowspipereader.cpp
index 5415ad7830..4435a47cab 100644
--- a/src/corelib/io/qwindowspipereader.cpp
+++ b/src/corelib/io/qwindowspipereader.cpp
@@ -104,6 +104,7 @@ void QWindowsPipeReader::setHandle(HANDLE hPipeReadEnd)
void QWindowsPipeReader::stop()
{
cancelAsyncRead(Stopped);
+ pipeBroken = true;
}
/*!
@@ -113,6 +114,22 @@ void QWindowsPipeReader::stop()
void QWindowsPipeReader::drainAndStop()
{
cancelAsyncRead(Draining);
+ pipeBroken = true;
+}
+
+/*!
+ Stops the asynchronous read sequence.
+ Clears the internal buffer and discards any pending data.
+ */
+void QWindowsPipeReader::stopAndClear()
+{
+ cancelAsyncRead(Stopped);
+ readBuffer.clear();
+ actualReadBufferSize = 0;
+ // QLocalSocket is supposed to write data in the 'Closing'
+ // state, so we don't set 'pipeBroken' flag here. Also, avoid
+ // setting this flag in checkForReadyRead().
+ lastError = ERROR_SUCCESS;
}
/*!
@@ -120,7 +137,6 @@ void QWindowsPipeReader::drainAndStop()
*/
void QWindowsPipeReader::cancelAsyncRead(State newState)
{
- pipeBroken = true;
if (state != Running)
return;
@@ -147,9 +163,9 @@ void QWindowsPipeReader::cancelAsyncRead(State newState)
}
mutex.unlock();
- // Because pipeBroken was set earlier, finish reading to keep the class
- // state consistent. Note that signals are not emitted in the call
- // below, as the caller is expected to do that synchronously.
+ // Finish reading to keep the class state consistent. Note that
+ // signals are not emitted in the call below, as the caller is
+ // expected to do that synchronously.
consumePending();
}
diff --git a/src/corelib/io/qwindowspipereader_p.h b/src/corelib/io/qwindowspipereader_p.h
index 5eb62cb393..22a4365f02 100644
--- a/src/corelib/io/qwindowspipereader_p.h
+++ b/src/corelib/io/qwindowspipereader_p.h
@@ -71,6 +71,7 @@ public:
void startAsyncRead();
void stop();
void drainAndStop();
+ void stopAndClear();
void setMaxReadBufferSize(qint64 size);
qint64 maxReadBufferSize() const { return readBufferMaxSize; }
diff --git a/src/corelib/io/qwindowspipewriter.cpp b/src/corelib/io/qwindowspipewriter.cpp
index 2db3cb4060..2d96a3d87d 100644
--- a/src/corelib/io/qwindowspipewriter.cpp
+++ b/src/corelib/io/qwindowspipewriter.cpp
@@ -41,6 +41,7 @@
#include "qwindowspipewriter_p.h"
#include <qcoreapplication.h>
#include <QMutexLocker>
+#include <QPointer>
QT_BEGIN_NAMESPACE
@@ -52,6 +53,7 @@ QWindowsPipeWriter::QWindowsPipeWriter(HANDLE pipeWriteEnd, QObject *parent)
waitObject(NULL),
pendingBytesWrittenValue(0),
lastError(ERROR_SUCCESS),
+ completionState(NoError),
stopped(true),
writeSequenceStarted(false),
bytesWrittenPending(false),
@@ -82,7 +84,7 @@ void QWindowsPipeWriter::setHandle(HANDLE hPipeWriteEnd)
handle = hPipeWriteEnd;
QMutexLocker locker(&mutex);
- startAsyncWriteLocked(&locker);
+ startAsyncWriteHelper(&locker);
}
/*!
@@ -124,49 +126,64 @@ qint64 QWindowsPipeWriter::bytesToWrite() const
}
/*!
+ Returns \c true if async operation is in progress.
+*/
+bool QWindowsPipeWriter::isWriteOperationActive() const
+{
+ return completionState == NoError && bytesToWrite() != 0;
+}
+
+/*!
Writes a shallow copy of \a ba to the internal buffer.
*/
-bool QWindowsPipeWriter::write(const QByteArray &ba)
+void QWindowsPipeWriter::write(const QByteArray &ba)
{
- return writeImpl(ba);
+ if (completionState != WriteDisabled)
+ writeImpl(ba);
}
/*!
Writes data to the internal buffer.
*/
-bool QWindowsPipeWriter::write(const char *data, qint64 size)
+void QWindowsPipeWriter::write(const char *data, qint64 size)
{
- return writeImpl(data, size);
+ if (completionState != WriteDisabled)
+ writeImpl(data, size);
}
template <typename... Args>
-inline bool QWindowsPipeWriter::writeImpl(Args... args)
+inline void QWindowsPipeWriter::writeImpl(Args... args)
{
QMutexLocker locker(&mutex);
- if (lastError != ERROR_SUCCESS)
- return false;
-
writeBuffer.append(args...);
- if (writeSequenceStarted)
- return true;
+ if (writeSequenceStarted || (lastError != ERROR_SUCCESS))
+ return;
stopped = false;
// If we don't have an assigned handle yet, defer writing until
// setHandle() is called.
- if (handle == INVALID_HANDLE_VALUE)
- return true;
+ if (handle != INVALID_HANDLE_VALUE)
+ startAsyncWriteHelper(&locker);
+}
+
+void QWindowsPipeWriter::startAsyncWriteHelper(QMutexLocker<QMutex> *locker)
+{
+ startAsyncWriteLocked();
+
+ // Do not post the event, if the write operation will be completed asynchronously.
+ if (!bytesWrittenPending && lastError == ERROR_SUCCESS)
+ return;
- startAsyncWriteLocked(&locker);
- return true;
+ notifyCompleted(locker);
}
/*!
Starts a new write sequence.
*/
-void QWindowsPipeWriter::startAsyncWriteLocked(QMutexLocker<QMutex> *locker)
+void QWindowsPipeWriter::startAsyncWriteLocked()
{
while (!writeBuffer.isEmpty()) {
// WriteFile() returns true, if the write operation completes synchronously.
@@ -188,22 +205,6 @@ void QWindowsPipeWriter::startAsyncWriteLocked(QMutexLocker<QMutex> *locker)
if (!writeCompleted(errorCode, numberOfBytesWritten))
break;
}
-
- // Do not post the event, if the write operation will be completed asynchronously.
- if (!bytesWrittenPending)
- return;
-
- if (!winEventActPosted) {
- winEventActPosted = true;
- locker->unlock();
- QCoreApplication::postEvent(this, new QEvent(QEvent::WinEventAct));
- } else {
- locker->unlock();
- }
-
- // We set the event only after unlocking to avoid additional context
- // switches due to the released thread immediately running into the lock.
- SetEvent(syncHandle);
}
/*!
@@ -235,16 +236,12 @@ void QWindowsPipeWriter::waitCallback(PTP_CALLBACK_INSTANCE instance, PVOID cont
pipeWriter->writeSequenceStarted = false;
- if (pipeWriter->writeCompleted(errorCode, numberOfBytesTransfered)) {
- pipeWriter->startAsyncWriteLocked(&locker);
- } else {
- // The write operation failed, so we must unblock the main thread,
- // which can wait for the event. We set the event only after unlocking
- // to avoid additional context switches due to the released thread
- // immediately running into the lock.
- locker.unlock();
- SetEvent(pipeWriter->syncHandle);
- }
+ if (pipeWriter->writeCompleted(errorCode, numberOfBytesTransfered))
+ pipeWriter->startAsyncWriteLocked();
+
+ // We post the notification even if the write operation failed,
+ // to unblock the main thread, in case it is waiting for the event.
+ pipeWriter->notifyCompleted(&locker);
}
/*!
@@ -253,22 +250,46 @@ void QWindowsPipeWriter::waitCallback(PTP_CALLBACK_INSTANCE instance, PVOID cont
*/
bool QWindowsPipeWriter::writeCompleted(DWORD errorCode, DWORD numberOfBytesWritten)
{
- if (errorCode == ERROR_SUCCESS) {
+ switch (errorCode) {
+ case ERROR_SUCCESS:
bytesWrittenPending = true;
pendingBytesWrittenValue += numberOfBytesWritten;
writeBuffer.free(numberOfBytesWritten);
return true;
+ case ERROR_PIPE_NOT_CONNECTED: // the other end has closed the pipe
+ case ERROR_OPERATION_ABORTED: // the operation was canceled
+ case ERROR_NO_DATA: // the pipe is being closed
+ break;
+ default:
+ qErrnoWarning(errorCode, "QWindowsPipeWriter: write failed.");
+ break;
}
+ // The buffer is not cleared here, because the write progress
+ // should appear on the main thread synchronously.
lastError = errorCode;
- writeBuffer.clear();
- // The other end has closed the pipe. This can happen in QLocalSocket. Do not warn.
- if (errorCode != ERROR_OPERATION_ABORTED && errorCode != ERROR_NO_DATA)
- qErrnoWarning(errorCode, "QWindowsPipeWriter: write failed.");
return false;
}
/*!
+ Posts a notification event to the main thread.
+ */
+void QWindowsPipeWriter::notifyCompleted(QMutexLocker<QMutex> *locker)
+{
+ if (!winEventActPosted) {
+ winEventActPosted = true;
+ locker->unlock();
+ QCoreApplication::postEvent(this, new QEvent(QEvent::WinEventAct));
+ } else {
+ locker->unlock();
+ }
+
+ // We set the event only after unlocking to avoid additional context
+ // switches due to the released thread immediately running into the lock.
+ SetEvent(syncHandle);
+}
+
+/*!
Receives notification that the write operation has completed.
*/
bool QWindowsPipeWriter::event(QEvent *e)
@@ -293,14 +314,13 @@ bool QWindowsPipeWriter::consumePendingAndEmit(bool allowWinActPosting)
if (allowWinActPosting)
winEventActPosted = false;
- if (!bytesWrittenPending)
- return false;
-
- // Reset the state even if we don't emit bytesWritten().
- // It's a defined behavior to not re-emit this signal recursively.
- bytesWrittenPending = false;
- qint64 numberOfBytesWritten = pendingBytesWrittenValue;
- pendingBytesWrittenValue = 0;
+ const qint64 numberOfBytesWritten = pendingBytesWrittenValue;
+ const bool emitBytesWritten = bytesWrittenPending;
+ if (emitBytesWritten) {
+ bytesWrittenPending = false;
+ pendingBytesWrittenValue = 0;
+ }
+ const DWORD dwError = lastError;
locker.unlock();
@@ -308,8 +328,25 @@ bool QWindowsPipeWriter::consumePendingAndEmit(bool allowWinActPosting)
if (stopped)
return false;
- emit bytesWritten(numberOfBytesWritten);
- return true;
+ // Trigger 'ErrorDetected' state only once. This state must be set before
+ // emitting the bytesWritten() signal. Otherwise, the write sequence will
+ // be considered not finished, and we may hang if a slot connected
+ // to bytesWritten() calls waitForBytesWritten().
+ if (dwError != ERROR_SUCCESS && completionState == NoError) {
+ QPointer<QWindowsPipeWriter> alive(this);
+ completionState = ErrorDetected;
+ if (emitBytesWritten)
+ emit bytesWritten(numberOfBytesWritten);
+ if (alive) {
+ writeBuffer.clear();
+ completionState = WriteDisabled;
+ emit writeFailed();
+ }
+ } else if (emitBytesWritten) {
+ emit bytesWritten(numberOfBytesWritten);
+ }
+
+ return emitBytesWritten;
}
QT_END_NAMESPACE
diff --git a/src/corelib/io/qwindowspipewriter_p.h b/src/corelib/io/qwindowspipewriter_p.h
index 8a3b3068e5..71e47c9787 100644
--- a/src/corelib/io/qwindowspipewriter_p.h
+++ b/src/corelib/io/qwindowspipewriter_p.h
@@ -68,27 +68,33 @@ public:
~QWindowsPipeWriter();
void setHandle(HANDLE hPipeWriteEnd);
- bool write(const QByteArray &ba);
- bool write(const char *data, qint64 size);
+ void write(const QByteArray &ba);
+ void write(const char *data, qint64 size);
void stop();
bool checkForWrite() { return consumePendingAndEmit(false); }
qint64 bytesToWrite() const;
+ bool isWriteOperationActive() const;
HANDLE syncEvent() const { return syncHandle; }
Q_SIGNALS:
void bytesWritten(qint64 bytes);
+ void writeFailed();
protected:
bool event(QEvent *e) override;
private:
+ enum CompletionState { NoError, ErrorDetected, WriteDisabled };
+
template <typename... Args>
- inline bool writeImpl(Args... args);
+ inline void writeImpl(Args... args);
- void startAsyncWriteLocked(QMutexLocker<QMutex> *locker);
+ void startAsyncWriteHelper(QMutexLocker<QMutex> *locker);
+ void startAsyncWriteLocked();
static void CALLBACK waitCallback(PTP_CALLBACK_INSTANCE instance, PVOID context,
PTP_WAIT wait, TP_WAIT_RESULT waitResult);
bool writeCompleted(DWORD errorCode, DWORD numberOfBytesWritten);
+ void notifyCompleted(QMutexLocker<QMutex> *locker);
bool consumePendingAndEmit(bool allowWinActPosting);
HANDLE handle;
@@ -100,6 +106,8 @@ private:
qint64 pendingBytesWrittenValue;
mutable QMutex mutex;
DWORD lastError;
+
+ CompletionState completionState;
bool stopped;
bool writeSequenceStarted;
bool bytesWrittenPending;
diff --git a/src/corelib/itemmodels/qitemselectionmodel.cpp b/src/corelib/itemmodels/qitemselectionmodel.cpp
index ad24b5c9d8..6e1fbabd9d 100644
--- a/src/corelib/itemmodels/qitemselectionmodel.cpp
+++ b/src/corelib/itemmodels/qitemselectionmodel.cpp
@@ -1738,8 +1738,11 @@ bool QItemSelectionModel::hasSelection() const
// d->ranges here. It sorts itself in executePendingOperations,
// thus preventing the sort to happen inside of selectionIsEmpty below.
// Sad story, read more in QTBUG-94546
- auto model_p = static_cast<const QAbstractItemModelPrivate *>(QObjectPrivate::get(model()));
- model_p->executePendingOperations();
+ const QAbstractItemModel *model = QItemSelectionModel::model();
+ if (model != nullptr) {
+ auto model_p = static_cast<const QAbstractItemModelPrivate *>(QObjectPrivate::get(model));
+ model_p->executePendingOperations();
+ }
if (d->currentCommand & (Toggle | Deselect)) {
QItemSelection sel = d->ranges;
diff --git a/src/corelib/itemmodels/qitemselectionmodel.h b/src/corelib/itemmodels/qitemselectionmodel.h
index 580b9866fc..678ba8bbad 100644
--- a/src/corelib/itemmodels/qitemselectionmodel.h
+++ b/src/corelib/itemmodels/qitemselectionmodel.h
@@ -212,7 +212,7 @@ private:
Q_DECLARE_OPERATORS_FOR_FLAGS(QItemSelectionModel::SelectionFlags)
-// We export each out-of-line method invidually to prevent MSVC from
+// We export each out-of-line method individually to prevent MSVC from
// exporting the whole QList class.
class QItemSelection : public QList<QItemSelectionRange>
{
diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
index bc2d83a6bc..9ee438d699 100644
--- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp
+++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
@@ -1623,8 +1623,7 @@ void QSortFilterProxyModelPrivate::_q_sourceReset()
_q_clearMapping();
// All internal structures are deleted in clear()
q->endResetModel();
- update_source_sort_column();
- if (dynamic_sortfilter && update_source_sort_column())
+ if (update_source_sort_column() && dynamic_sortfilter)
sort();
}
diff --git a/src/corelib/kernel/qapplicationpermission.qdoc b/src/corelib/kernel/qapplicationpermission.qdoc
deleted file mode 100644
index 7e2bcaad91..0000000000
--- a/src/corelib/kernel/qapplicationpermission.qdoc
+++ /dev/null
@@ -1,100 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2021 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \namespace QApplicationPermission
-
- \brief The QApplicationPermission namespace contains enums for app permission
- types and results.
-
- This namespace's enums are used by \l {QCoreApplication::requestPermission()} and
- \l {QCoreApplication::checkPermission()}.
-*/
-
-/*!
- \enum QApplicationPermission::PermissionType
-
- Predefined sets of permission values.
-
- \value Camera Access the camera for taking pictures or videos and configuring
- the camera settings. Maps to "android.permission.CAMERA" on Android.
- \value Microphone Access the microphone, receive the sound signal (e.g. to
- analyze or record it). Maps to \c "android.permission.RECORD_AUDIO"
- on Android.
- \value Location Access approximate location provider (wifi, cell tower).
- Maps to \c "android.permission.ACCESS_COARSE_LOCATION" on Android.
- \value PreciseLocation Location Access accurate location provider (satellite).
- Maps to \c "android.permission.ACCESS_FINE_LOCATION" on Android.
- \value PreciseBackgroundLocation Access the precise location services when
- the app is in the background. Maps to
- \c "android.permission.ACCESS_BACKGROUND_LOCATION" on Android, and
- implies \l PreciseLocation.
- \value BackgroundLocation Access the approximate location services when
- the app is in the background. Maps to
- \c "android.permission.ACCESS_BACKGROUND_LOCATION" on Android, and
- implies \l Location.
- \value BodySensors Access body sensors such as a heart rate sensor.
- Maps to \c "android.permission.BODY_SENSORS" on Android.
- \value PhysicalActivity Access to data about physical activity and body
- movements. Maps to \c "android.permission.ACTIVITY_RECOGNITION"
- on Android.
- \value Contacts Read and write user contacts. Maps to
- \c "android.permission.READ_CONTACTS" and \c "android.permission.WRITE_CONTACTS"
- on Android.
- \value Storage Access device storage with read and write permissions.
- Maps to \c "android.permission.READ_EXTERNAL_STORAGE" and
- \c "android.permission.WRITE_EXTERNAL_STORAGE"on Android.
- \value Calendar Read and write the user's calendar.
- Maps to \c "android.permission.READ_CALENDAR" and
- \c "android.permission.WRITE_CALENDAR" on Android.
-
- \omitvalue Bluetooth
-
- \note Both Android and iOS require the native permission values to be added
- to the \c AndroidManifest.xml and \c info.plist respectively. For more
- information on Android permissions, see \c {Qt Creator: Editing Manifest Files}.
- For more information on iOS \c info.plist, see
- \l {Information Property List Files}.
-
- \since 6.2
- \sa QCoreApplication::requestPermission(), QCoreApplication::checkPermission()
-*/
-
-/*!
- \enum QApplicationPermission::PermissionResult
-
- The result values for a permission check or request.
-
- \value Authorized The permission is authorized.
- \value Denied The permission is denied.
- \value Restricted The permission state is denied and cannot be changed due
- to restrictions from the system.
- \value Undetermined The permission state is not yet known.
-
- \since 6.2
- \sa QCoreApplication::requestPermission(), QCoreApplication::checkPermission()
-*/
diff --git a/src/corelib/kernel/qbasictimer.cpp b/src/corelib/kernel/qbasictimer.cpp
index 604b4edba6..60de171e14 100644
--- a/src/corelib/kernel/qbasictimer.cpp
+++ b/src/corelib/kernel/qbasictimer.cpp
@@ -79,7 +79,7 @@ QT_BEGIN_NAMESPACE
/*!
\fn QBasicTimer::QBasicTimer()
- Contructs a basic timer.
+ Constructs a basic timer.
\sa start()
*/
diff --git a/src/corelib/kernel/qcfsocketnotifier.cpp b/src/corelib/kernel/qcfsocketnotifier.cpp
index 13fe30d0cd..9b1ed8cbf9 100644
--- a/src/corelib/kernel/qcfsocketnotifier.cpp
+++ b/src/corelib/kernel/qcfsocketnotifier.cpp
@@ -171,7 +171,7 @@ void QCFSocketNotifier::registerSocketNotifier(QSocketNotifier *notifier)
CFOptionFlags flags = CFSocketGetSocketFlags(socketInfo->socket);
// QSocketNotifier doesn't close the socket upon destruction/invalidation
flags &= ~kCFSocketCloseOnInvalidate;
- // Expicitly disable automatic re-enable, as we do that manually on each runloop pass
+ // Explicitly disable automatic re-enable, as we do that manually on each runloop pass
flags &= ~(kCFSocketAutomaticallyReenableWriteCallBack | kCFSocketAutomaticallyReenableReadCallBack);
CFSocketSetSocketFlags(socketInfo->socket, flags);
diff --git a/src/corelib/kernel/qcore_mac_p.h b/src/corelib/kernel/qcore_mac_p.h
index 538ade3466..7b503d10cc 100644
--- a/src/corelib/kernel/qcore_mac_p.h
+++ b/src/corelib/kernel/qcore_mac_p.h
@@ -145,7 +145,7 @@ private:
#endif
/*
- Helper class that automates refernce counting for CFtypes.
+ Helper class that automates reference counting for CFtypes.
After constructing the QCFType object, it can be copied like a
value-based type.
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 10dbe2f684..c980e70dbf 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -47,6 +47,7 @@
#include "qeventloop.h"
#endif
#include "qmetaobject.h"
+#include <private/qproperty_p.h>
#include "qcorecmdlineargs_p.h"
#include <qdatastream.h>
#include <qdebug.h>
@@ -93,7 +94,7 @@
#endif
#endif // QT_NO_QOBJECT
-#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
+#if defined(Q_OS_ANDROID)
#include <QtCore/qjniobject.h>
#endif
@@ -140,10 +141,11 @@ QT_BEGIN_NAMESPACE
extern QString qAppFileName();
#endif
-#if QT_VERSION >= 0x070000
-# error "Bump QCoreApplicatoinPrivate::app_compile_version to 0x070000"
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+# error "Bump QCoreApplicatoinPrivate::app_compile_version to QT_VERSION_CHECK(7, 0, 0)"
#endif
-int QCoreApplicationPrivate::app_compile_version = 0x060000; //we don't know exactly, but it's at least 6.0.0
+// We don't know exactly, but it's at least 6.0.0:
+int QCoreApplicationPrivate::app_compile_version = QT_VERSION_CHECK(6, 0, 0);
bool QCoreApplicationPrivate::setuidAllowed = false;
@@ -176,10 +178,10 @@ QString QCoreApplicationPrivate::appName() const
QString QCoreApplicationPrivate::appVersion() const
{
QString applicationVersion;
-#ifndef QT_BOOTSTRAPPED
-# ifdef Q_OS_DARWIN
+#ifdef QT_BOOTSTRAPPED
+#elif defined(Q_OS_DARWIN)
applicationVersion = infoDictionaryStringProperty(QStringLiteral("CFBundleVersion"));
-# elif defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
+#elif defined(Q_OS_ANDROID)
QJniObject context(QNativeInterface::QAndroidApplication::context());
if (context.isValid()) {
QJniObject pm = context.callObjectMethod(
@@ -197,11 +199,10 @@ QString QCoreApplicationPrivate::appVersion() const
}
}
}
-# endif
#endif
return applicationVersion;
}
-#endif
+#endif // !Q_OS_WIN
QString *QCoreApplicationPrivate::cachedApplicationFilePath = nullptr;
@@ -399,7 +400,7 @@ struct QCoreApplicationData {
Q_GLOBAL_STATIC(QCoreApplicationData, coreappdata)
#ifndef QT_NO_QOBJECT
-static bool quitLockRefEnabled = true;
+static bool quitLockEnabled = true;
#endif
#if defined(Q_OS_WIN)
@@ -861,6 +862,7 @@ void QCoreApplicationPrivate::init()
qt_call_pre_routines();
qt_startup_hook();
#ifndef QT_BOOTSTRAPPED
+ QtPrivate::initBindingStatusThreadId();
if (Q_UNLIKELY(qtHookData[QHooks::Startup]))
reinterpret_cast<QHooks::StartupCallback>(qtHookData[QHooks::Startup])();
#endif
@@ -1018,14 +1020,14 @@ bool QCoreApplication::testAttribute(Qt::ApplicationAttribute attribute)
bool QCoreApplication::isQuitLockEnabled()
{
- return quitLockRefEnabled;
+ return quitLockEnabled;
}
static bool doNotify(QObject *, QEvent *);
void QCoreApplication::setQuitLockEnabled(bool enabled)
{
- quitLockRefEnabled = enabled;
+ quitLockEnabled = enabled;
}
/*!
@@ -1131,6 +1133,9 @@ bool QCoreApplication::forwardEvent(QObject *receiver, QEvent *event, QEvent *or
bool QCoreApplication::notify(QObject *receiver, QEvent *event)
{
+ Q_ASSERT(receiver);
+ Q_ASSERT(event);
+
// no events are delivered after ~QCoreApplication() has started
if (QCoreApplicationPrivate::is_app_closing)
return true;
@@ -1139,6 +1144,9 @@ bool QCoreApplication::notify(QObject *receiver, QEvent *event)
static bool doNotify(QObject *receiver, QEvent *event)
{
+ Q_ASSERT(event);
+
+ // ### Qt 7: turn into an assert
if (receiver == nullptr) { // serious error
qWarning("QCoreApplication::notify: Unexpected null receiver");
return true;
@@ -1462,10 +1470,12 @@ void QCoreApplication::exit(int returnCode)
*/
bool QCoreApplication::sendEvent(QObject *receiver, QEvent *event)
{
+ Q_ASSERT_X(receiver, "QCoreApplication::sendEvent", "Unexpected null receiver");
+ Q_ASSERT_X(event, "QCoreApplication::sendEvent", "Unexpected null event");
+
Q_TRACE(QCoreApplication_sendEvent, receiver, event, event->type());
- if (event)
- event->m_spont = false;
+ event->m_spont = false;
return notifyInternal2(receiver, event);
}
@@ -1474,10 +1484,12 @@ bool QCoreApplication::sendEvent(QObject *receiver, QEvent *event)
*/
bool QCoreApplication::sendSpontaneousEvent(QObject *receiver, QEvent *event)
{
+ Q_ASSERT_X(receiver, "QCoreApplication::sendSpontaneousEvent", "Unexpected null receiver");
+ Q_ASSERT_X(event, "QCoreApplication::sendSpontaneousEvent", "Unexpected null event");
+
Q_TRACE(QCoreApplication_sendSpontaneousEvent, receiver, event, event->type());
- if (event)
- event->m_spont = true;
+ event->m_spont = true;
return notifyInternal2(receiver, event);
}
@@ -1542,8 +1554,11 @@ QCoreApplicationPrivate::QPostEventListLocker QCoreApplicationPrivate::lockThrea
*/
void QCoreApplication::postEvent(QObject *receiver, QEvent *event, int priority)
{
+ Q_ASSERT_X(event, "QCoreApplication::postEvent", "Unexpected null event");
+
Q_TRACE_SCOPE(QCoreApplication_postEvent, receiver, event, event->type());
+ // ### Qt 7: turn into an assert
if (receiver == nullptr) {
qWarning("QCoreApplication::postEvent: Unexpected null receiver");
delete event;
@@ -1613,11 +1628,11 @@ void QCoreApplication::postEvent(QObject *receiver, QEvent *event, int priority)
*/
bool QCoreApplication::compressEvent(QEvent *event, QObject *receiver, QPostEventList *postedEvents)
{
-#ifdef Q_OS_WIN
Q_ASSERT(event);
Q_ASSERT(receiver);
Q_ASSERT(postedEvents);
+#ifdef Q_OS_WIN
// compress posted timers to this object.
if (event->type() == QEvent::Timer && receiver->d_func()->postedEvents > 0) {
int timerId = ((QTimerEvent *) event)->timerId();
@@ -1967,14 +1982,34 @@ void QCoreApplicationPrivate::ref()
void QCoreApplicationPrivate::deref()
{
- if (!quitLockRef.deref())
- maybeQuit();
+ quitLockRef.deref();
+
+ if (quitLockEnabled && canQuitAutomatically())
+ quitAutomatically();
}
-void QCoreApplicationPrivate::maybeQuit()
+bool QCoreApplicationPrivate::canQuitAutomatically()
{
- if (quitLockRef.loadRelaxed() == 0 && in_exec && quitLockRefEnabled && shouldQuit())
- QCoreApplication::postEvent(QCoreApplication::instance(), new QEvent(QEvent::Quit));
+ if (!in_exec)
+ return false;
+
+ if (quitLockEnabled && quitLockRef.loadRelaxed())
+ return false;
+
+ return true;
+}
+
+void QCoreApplicationPrivate::quitAutomatically()
+{
+ Q_Q(QCoreApplication);
+
+ // Explicit requests by the user to quit() is plumbed via the platform
+ // if possible, and delivers the quit event synchronously. For automatic
+ // quits we implicitly support cancelling the quit by showing another
+ // window, which currently relies on removing any posted quit events
+ // from the event queue. As a result, we can't use the normal quit()
+ // code path, and need to post manually.
+ QCoreApplication::postEvent(q, new QEvent(QEvent::Quit));
}
/*!
@@ -2300,7 +2335,7 @@ QString QCoreApplication::applicationDirPath()
#if !defined(Q_OS_WIN) && !defined(Q_OS_DARWIN) // qcoreapplication_win.cpp or qcoreapplication_mac.cpp
static QString qAppFileName()
{
-# if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
+# if defined(Q_OS_ANDROID)
// the actual process on Android is the Java VM, so this doesn't help us
return QString();
# elif defined(Q_OS_LINUX)
@@ -2430,7 +2465,7 @@ qint64 QCoreApplication::applicationPid()
encoding problems might occur.
Otherwise, the arguments() are constructed from the return value of
- \l{http://msdn2.microsoft.com/en-us/library/ms683156(VS.85).aspx}{GetCommandLine()}.
+ \l{https://docs.microsoft.com/en-us/windows/win32/api/processenv/nf-processenv-getcommandlinea}{GetCommandLine()}.
As a result of this, the string given by arguments().at(0) might not be
the program name on Windows, depending on how the application was started.
@@ -3083,166 +3118,6 @@ void QCoreApplication::setEventDispatcher(QAbstractEventDispatcher *eventDispatc
\sa Q_OBJECT, QObject::tr()
*/
-#if QT_CONFIG(future) && !defined(QT_NO_QOBJECT)
-
- QFuture<QApplicationPermission::PermissionResult> defaultPermissionFuture()
- {
- QPromise<QApplicationPermission::PermissionResult> promise;
- QFuture<QApplicationPermission::PermissionResult> future = promise.future();
- promise.start();
-#if defined(QT_DEBUG)
- qWarning() << "This platform doesn't have an implementation"
- << "for the application permissions API.";
-#endif
- promise.addResult(QApplicationPermission::Authorized);
- promise.finish();
- return future;
- }
-
- QFuture<QApplicationPermission::PermissionResult>
- QCoreApplicationPrivate::requestPermission(QApplicationPermission::PermissionType permission)
- {
- Q_UNUSED(permission)
- return defaultPermissionFuture();
- }
-
- QFuture<QApplicationPermission::PermissionResult>
- QCoreApplicationPrivate::requestPermission(const QString &permission)
- {
- Q_UNUSED(permission)
- return defaultPermissionFuture();
- }
-
- QFuture<QApplicationPermission::PermissionResult>
- QCoreApplicationPrivate::checkPermission(QApplicationPermission::PermissionType permission)
- {
- Q_UNUSED(permission)
- return defaultPermissionFuture();
- }
-
- QFuture<QApplicationPermission::PermissionResult>
- QCoreApplicationPrivate::checkPermission(const QString &permission)
- {
- Q_UNUSED(permission)
- return defaultPermissionFuture();
- }
-
-/*!
- Requests the \a permission and returns a QFuture representing the
- result of the request.
-
- Applications can request a permission in a cross-platform fashion. For example
- you can request permission to use the camera asynchronously as follows:
-
- \snippet permissions/permissions.cpp Request camera permission
-
- \note A function passed to \l {QFuture::then()} will be called once the request
- is processed. It can take some suitable action in response to the
- granting or refusal of the permission. It must not access objects that
- might be deleted before it is called.
-
- To do the same request synchronously:
-
- \snippet permissions/permissions.cpp Request camera permission sync
-
- \note Any platform that doesn't have an implementation for this API,
- returns QApplicationPermission::Authorized by default. Currently, only Android
- has an implemtation for this API.
-
- \since 6.2
- \sa checkPermission()
-*/
-QFuture<QApplicationPermission::PermissionResult>
-QCoreApplication::requestPermission(QApplicationPermission::PermissionType permission)
-{
- return QCoreApplicationPrivate::requestPermission(permission);
-}
-
-/*!
- Requests the \a permission and returns a QFuture representing the
- result of the request.
-
- All application permissions supported by a platform can be requested by their
- platform-specific names. For example you can request permission to use the
- camera asynchronously on Android as follows:
-
- \snippet permissions/permissions.cpp Request camera permission on Android
-
- \note A function passed to \l {QFuture::then()} will be called once the request
- is processed. It can take some suitable action in response to the
- granting or refusal of the permission. It must not access objects that
- might be deleted before it is called.
-
- To do the same request synchronously:
-
- \snippet permissions/permissions.cpp Request camera permission sync on Android
-
- \note Any platform that doesn't have an implementation for this API,
- returns QApplicationPermission::Authorized by default. Currently, only Android
- has an implemtation for this API.
-
- \since 6.2
- \sa checkPermission()
-*/
-QFuture<QApplicationPermission::PermissionResult>
-QCoreApplication::requestPermission(const QString &permission)
-{
- return QCoreApplicationPrivate::requestPermission(permission);
-}
-
-/*!
- Checks whether this process has the named \a permission and returns a QFuture
- representing the result of the check.
-
- Applications can check a permission in a cross-platform fashion. For example
- you can check the permission to use the camera asynchronously as follows:
-
- \snippet permissions/permissions.cpp Check camera permission
-
- To do the same request synchronously:
-
- \snippet permissions/permissions.cpp Check camera permission sync
-
- \note Any platform that doesn't have an implementation for this API,
- returns QApplicationPermission::Authorized by default. Currently, only Android
- has an implemtation for this API.
-
- \since 6.2
- \sa requestPermission()
-*/
-QFuture<QApplicationPermission::PermissionResult>
-QCoreApplication::checkPermission(QApplicationPermission::PermissionType permission)
-{
- return QCoreApplicationPrivate::checkPermission(permission);
-}
-
-/*!
- Checks whether this process has the named \a permission and returns a QFuture
- representing the result of the check.
-
- All applicat