summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/blake2/qt_attribution.json4
-rw-r--r--src/3rdparty/blake2/src/blake2.h4
-rw-r--r--src/3rdparty/harfbuzz-ng/CMakeLists.txt6
-rw-r--r--src/3rdparty/libjpeg/COPYRIGHT.txt12
-rw-r--r--src/3rdparty/libjpeg/ijg-license.txt34
-rw-r--r--src/3rdparty/libjpeg/qt_attribution.json19
-rw-r--r--src/3rdparty/libjpeg/src/ChangeLog.md9
-rw-r--r--src/3rdparty/libjpeg/src/jchuff.c5
-rw-r--r--src/3rdparty/libjpeg/src/jcphuff.c5
-rw-r--r--src/3rdparty/libjpeg/zlib-license.txt15
-rw-r--r--src/3rdparty/md4/qt_attribution.json2
-rw-r--r--src/3rdparty/md4c/0001-md4c-Fix-MSVC-compiler-level-3-warnings.patch40
-rw-r--r--src/3rdparty/md4c/md4c.c99
-rw-r--r--src/3rdparty/md4c/qt_attribution.json4
-rw-r--r--src/3rdparty/md5/qt_attribution.json2
-rw-r--r--src/3rdparty/pcre2/AUTHORS6
-rw-r--r--src/3rdparty/pcre2/CMakeLists.txt7
-rw-r--r--src/3rdparty/pcre2/LICENCE6
-rw-r--r--src/3rdparty/pcre2/qt_attribution.json12
-rw-r--r--src/3rdparty/pcre2/src/pcre2.h4
-rw-r--r--src/3rdparty/pcre2/src/pcre2_auto_possess.c13
-rw-r--r--src/3rdparty/pcre2/src/pcre2_compile.c52
-rw-r--r--src/3rdparty/pcre2/src/pcre2_jit_compile.c40
-rw-r--r--src/3rdparty/pcre2/src/pcre2_jit_simd_inc.h828
-rw-r--r--src/3rdparty/pcre2/src/pcre2_match.c4
-rw-r--r--src/3rdparty/pcre2/src/sljit/sljitConfigInternal.h2
-rw-r--r--src/3rdparty/pcre2/src/sljit/sljitExecAllocator.c124
-rw-r--r--src/3rdparty/pcre2/src/sljit/sljitNativeS390X.c43
-rw-r--r--src/3rdparty/pcre2/src/sljit/sljitUtils.c10
-rw-r--r--src/3rdparty/pcre2/src/sljit/sljitWXExecAllocator.c8
-rw-r--r--src/3rdparty/sqlite/qt_attribution.json4
-rw-r--r--src/3rdparty/sqlite/sqlite3.c271
-rw-r--r--src/3rdparty/sqlite/sqlite3.h6
-rw-r--r--src/android/jar/src/org/qtproject/qt/android/CursorHandle.java5
-rw-r--r--src/android/jar/src/org/qtproject/qt/android/EditPopupMenu.java7
-rw-r--r--src/android/jar/src/org/qtproject/qt/android/ExtractStyle.java4
-rw-r--r--src/android/jar/src/org/qtproject/qt/android/QtActivityDelegate.java17
-rw-r--r--src/android/jar/src/org/qtproject/qt/android/QtNative.java38
-rw-r--r--src/android/jar/src/org/qtproject/qt/android/extras/QtAndroidBinder.java69
-rw-r--r--src/android/jar/src/org/qtproject/qt/android/extras/QtAndroidServiceConnection.java78
-rw-r--r--src/android/jar/src/org/qtproject/qt/android/extras/QtNative.java55
-rw-r--r--src/android/java/res/values-de/strings.xml2
-rw-r--r--src/android/java/res/values-el/strings.xml2
-rw-r--r--src/android/java/res/values-es/strings.xml2
-rw-r--r--src/android/java/res/values-et/strings.xml2
-rw-r--r--src/android/java/res/values-fa/strings.xml2
-rw-r--r--src/android/java/res/values-fr/strings.xml2
-rw-r--r--src/android/java/res/values-in/strings.xml2
-rw-r--r--src/android/java/res/values-it/strings.xml2
-rw-r--r--src/android/java/res/values-ja/strings.xml2
-rw-r--r--src/android/java/res/values-ms/strings.xml2
-rw-r--r--src/android/java/res/values-nb/strings.xml2
-rw-r--r--src/android/java/res/values-nl/strings.xml2
-rw-r--r--src/android/java/res/values-pl/strings.xml2
-rw-r--r--src/android/java/res/values-pt-rBR/strings.xml2
-rw-r--r--src/android/java/res/values-ro/strings.xml2
-rw-r--r--src/android/java/res/values-ru/strings.xml2
-rw-r--r--src/android/java/res/values-se/strings.xml2
-rw-r--r--src/android/java/res/values-zh-rCN/strings.xml2
-rw-r--r--src/android/java/res/values-zh-rTW/strings.xml2
-rw-r--r--src/android/java/res/values/strings.xml2
-rw-r--r--src/android/java/src/org/kde/necessitas/ministro/IMinistro.aidl60
-rw-r--r--src/android/java/src/org/kde/necessitas/ministro/IMinistroCallback.aidl65
-rw-r--r--src/android/java/src/org/qtproject/qt/android/bindings/QtActivity.java7
-rw-r--r--src/android/java/src/org/qtproject/qt/android/bindings/QtActivityLoader.java26
-rw-r--r--src/android/java/src/org/qtproject/qt/android/bindings/QtApplication.java4
-rw-r--r--src/android/java/src/org/qtproject/qt/android/bindings/QtLoader.java224
-rw-r--r--src/android/templates/AndroidManifest.xml106
-rw-r--r--src/android/templates/build.gradle4
-rw-r--r--src/android/templates/res/values/libs.xml10
-rw-r--r--src/concurrent/CMakeLists.txt1
-rw-r--r--src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentfilter.cpp10
-rw-r--r--src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentmap.cpp8
-rw-r--r--src/concurrent/qtconcurrent_global.h15
-rw-r--r--src/concurrent/qtconcurrentfilter.cpp8
-rw-r--r--src/concurrent/qtconcurrentfilter.h58
-rw-r--r--src/concurrent/qtconcurrentfunctionwrappers.h52
-rw-r--r--src/concurrent/qtconcurrentmap.cpp8
-rw-r--r--src/concurrent/qtconcurrentmap.h70
-rw-r--r--src/concurrent/qtconcurrentthreadengine.cpp33
-rw-r--r--src/concurrent/qtconcurrentthreadengine.h23
-rw-r--r--src/corelib/.prev_configure.cmake965
-rw-r--r--src/corelib/CMakeLists.txt50
-rw-r--r--src/corelib/Qt6AndroidMacros.cmake123
-rw-r--r--src/corelib/Qt6CTestMacros.cmake43
-rw-r--r--src/corelib/Qt6CoreConfigExtras.cmake.in1
-rw-r--r--src/corelib/Qt6CoreMacros.cmake757
-rw-r--r--src/corelib/animation/qabstractanimation.cpp8
-rw-r--r--src/corelib/animation/qpropertyanimation.h4
-rw-r--r--src/corelib/animation/qsequentialanimationgroup.h6
-rw-r--r--src/corelib/animation/qvariantanimation.cpp4
-rw-r--r--src/corelib/compat/removed_api.cpp70
-rw-r--r--src/corelib/configure.cmake30
-rw-r--r--src/corelib/configure.json1065
-rw-r--r--src/corelib/debug_script.py10
-rw-r--r--src/corelib/doc/include/QtCoreDoc2
-rw-r--r--src/corelib/doc/include/jni.h2
-rw-r--r--src/corelib/doc/qtcore.qdocconf1
-rw-r--r--src/corelib/doc/snippets/cmake-macros/examples.cmake9
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_global_qrandom.cpp2
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp2
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_kernel_qvariant.cpp14
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_text_qstring.cpp2
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_text_qstringconverter.cpp2
-rw-r--r--src/corelib/doc/snippets/jni/src_qjniobject.cpp5
-rw-r--r--src/corelib/doc/snippets/permissions/permissions.cpp32
-rw-r--r--src/corelib/doc/snippets/resource-system/CMakeLists.txt23
-rw-r--r--src/corelib/doc/snippets/settings/settings.cpp10
-rw-r--r--src/corelib/doc/src/cmake-macros.qdoc85
-rw-r--r--src/corelib/doc/src/cmake-properties.qdoc17
-rw-r--r--src/corelib/doc/src/external-resources.qdoc5
-rw-r--r--src/corelib/doc/src/includes/qfile-copy.qdocinc11
-rw-r--r--src/corelib/doc/src/objectmodel/bindableproperties.qdoc33
-rw-r--r--src/corelib/doc/src/qt6-changes.qdoc24
-rw-r--r--src/corelib/doc/src/resource-system.qdoc24
-rw-r--r--src/corelib/global/qcompare.h11
-rw-r--r--src/corelib/global/qcompare_impl.h69
-rw-r--r--src/corelib/global/qcompilerdetection.h1
-rw-r--r--src/corelib/global/qconfig-bootstrapped.h2
-rw-r--r--src/corelib/global/qflags.h101
-rw-r--r--src/corelib/global/qglobal.cpp192
-rw-r--r--src/corelib/global/qglobal.h80
-rw-r--r--src/corelib/global/qglobalstatic.h4
-rw-r--r--src/corelib/global/qlibraryinfo.cpp5
-rw-r--r--src/corelib/global/qlogging.cpp8
-rw-r--r--src/corelib/global/qnamespace.h7
-rw-r--r--src/corelib/global/qnamespace.qdoc32
-rw-r--r--src/corelib/global/qnativeinterface.h209
-rw-r--r--src/corelib/global/qrandom.cpp65
-rw-r--r--src/corelib/global/qrandom.h6
-rw-r--r--src/corelib/global/qrandom_p.h3
-rw-r--r--src/corelib/global/qsimd.cpp41
-rw-r--r--src/corelib/global/qsimd_p.h61
-rw-r--r--src/corelib/global/qt_pch.h35
-rw-r--r--src/corelib/global/qvolatile_p.h89
-rw-r--r--src/corelib/io/qabstractfileengine.cpp2
-rw-r--r--src/corelib/io/qabstractfileengine_p.h3
-rw-r--r--src/corelib/io/qdebug.cpp57
-rw-r--r--src/corelib/io/qdebug.h9
-rw-r--r--src/corelib/io/qdebug_p.h3
-rw-r--r--src/corelib/io/qdir.cpp87
-rw-r--r--src/corelib/io/qdiriterator.cpp44
-rw-r--r--src/corelib/io/qdiriterator.h1
-rw-r--r--src/corelib/io/qfile.cpp26
-rw-r--r--src/corelib/io/qfile_p.h4
-rw-r--r--src/corelib/io/qfiledevice.cpp4
-rw-r--r--src/corelib/io/qfileinfo.cpp46
-rw-r--r--src/corelib/io/qfileinfo.h5
-rw-r--r--src/corelib/io/qfileselector.cpp5
-rw-r--r--src/corelib/io/qfilesystemengine.cpp13
-rw-r--r--src/corelib/io/qfilesystemengine_p.h3
-rw-r--r--src/corelib/io/qfilesystemengine_unix.cpp4
-rw-r--r--src/corelib/io/qfilesystemengine_win.cpp178
-rw-r--r--src/corelib/io/qfilesystementry.cpp38
-rw-r--r--src/corelib/io/qfilesystementry_p.h7
-rw-r--r--src/corelib/io/qfilesystemiterator_win.cpp6
-rw-r--r--src/corelib/io/qfilesystemmetadata_p.h28
-rw-r--r--src/corelib/io/qfsfileengine.cpp9
-rw-r--r--src/corelib/io/qfsfileengine_unix.cpp6
-rw-r--r--src/corelib/io/qfsfileengine_win.cpp114
-rw-r--r--src/corelib/io/qiodevice.cpp13
-rw-r--r--src/corelib/io/qiodevice_p.h7
-rw-r--r--src/corelib/io/qloggingcategory.cpp9
-rw-r--r--src/corelib/io/qloggingregistry.cpp6
-rw-r--r--src/corelib/io/qloggingregistry_p.h2
-rw-r--r--src/corelib/io/qnoncontiguousbytedevice.cpp27
-rw-r--r--src/corelib/io/qnoncontiguousbytedevice_p.h25
-rw-r--r--src/corelib/io/qprocess.cpp176
-rw-r--r--src/corelib/io/qprocess.h2
-rw-r--r--src/corelib/io/qprocess_p.h47
-rw-r--r--src/corelib/io/qprocess_unix.cpp121
-rw-r--r--src/corelib/io/qprocess_win.cpp139
-rw-r--r--src/corelib/io/qresource.cpp3
-rw-r--r--src/corelib/io/qsavefile.cpp2
-rw-r--r--src/corelib/io/qsettings.cpp22
-rw-r--r--src/corelib/io/qsettings_mac.cpp25
-rw-r--r--src/corelib/io/qsettings_p.h4
-rw-r--r--src/corelib/io/qsettings_wasm.cpp8
-rw-r--r--src/corelib/io/qsettings_win.cpp61
-rw-r--r--src/corelib/io/qstandardpaths_win.cpp2
-rw-r--r--src/corelib/io/qstorageinfo_unix.cpp3
-rw-r--r--src/corelib/io/qtemporaryfile.cpp2
-rw-r--r--src/corelib/io/qurl.cpp22
-rw-r--r--src/corelib/io/qurl.h22
-rw-r--r--src/corelib/io/qurlidna.cpp4
-rw-r--r--src/corelib/io/qurlquery.cpp29
-rw-r--r--src/corelib/io/qwindowspipereader.cpp96
-rw-r--r--src/corelib/io/qwindowspipereader_p.h3
-rw-r--r--src/corelib/io/qwindowspipewriter.cpp133
-rw-r--r--src/corelib/io/qwindowspipewriter_p.h11
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.cpp13
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel_p.h3
-rw-r--r--src/corelib/itemmodels/qabstractproxymodel.cpp3
-rw-r--r--src/corelib/itemmodels/qabstractproxymodel.h4
-rw-r--r--src/corelib/itemmodels/qidentityproxymodel.cpp37
-rw-r--r--src/corelib/itemmodels/qidentityproxymodel_p.h98
-rw-r--r--src/corelib/itemmodels/qitemselectionmodel.cpp108
-rw-r--r--src/corelib/itemmodels/qitemselectionmodel.h15
-rw-r--r--src/corelib/itemmodels/qsortfilterproxymodel.cpp388
-rw-r--r--src/corelib/itemmodels/qsortfilterproxymodel.h43
-rw-r--r--src/corelib/itemmodels/qtransposeproxymodel.cpp30
-rw-r--r--src/corelib/kernel/qapplicationpermission.h (renamed from src/corelib/kernel/qpermission.h)33
-rw-r--r--src/corelib/kernel/qapplicationpermission.qdoc (renamed from src/corelib/kernel/qpermission.qdoc)38
-rw-r--r--src/corelib/kernel/qassociativeiterable.h2
-rw-r--r--src/corelib/kernel/qcfsocketnotifier.cpp14
-rw-r--r--src/corelib/kernel/qcore_foundation.mm4
-rw-r--r--src/corelib/kernel/qcore_mac.mm20
-rw-r--r--src/corelib/kernel/qcore_mac_p.h7
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp83
-rw-r--r--src/corelib/kernel/qcoreapplication.h38
-rw-r--r--src/corelib/kernel/qcoreapplication_android.cpp319
-rw-r--r--src/corelib/kernel/qcoreapplication_p.h23
-rw-r--r--src/corelib/kernel/qcoreapplication_platform.h25
-rw-r--r--src/corelib/kernel/qcoreevent.cpp1
-rw-r--r--src/corelib/kernel/qdeadlinetimer.h2
-rw-r--r--src/corelib/kernel/qeventdispatcher_cf.mm2
-rw-r--r--src/corelib/kernel/qeventdispatcher_cf_p.h2
-rw-r--r--src/corelib/kernel/qeventdispatcher_glib.cpp2
-rw-r--r--src/corelib/kernel/qeventdispatcher_unix.cpp2
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp27
-rw-r--r--src/corelib/kernel/qeventloop.cpp24
-rw-r--r--src/corelib/kernel/qeventloop.h2
-rw-r--r--src/corelib/kernel/qiterable_p.h2
-rw-r--r--src/corelib/kernel/qjni.cpp2384
-rw-r--r--src/corelib/kernel/qjni_p.h292
-rw-r--r--src/corelib/kernel/qjnienvironment.cpp151
-rw-r--r--src/corelib/kernel/qjnienvironment.h11
-rw-r--r--src/corelib/kernel/qjnihelpers.cpp206
-rw-r--r--src/corelib/kernel/qjnihelpers_p.h61
-rw-r--r--src/corelib/kernel/qjniobject.cpp36
-rw-r--r--src/corelib/kernel/qjniobject.h3
-rw-r--r--src/corelib/kernel/qmath.qdoc8
-rw-r--r--src/corelib/kernel/qmetacontainer.cpp8
-rw-r--r--src/corelib/kernel/qmetaobject.cpp2
-rw-r--r--src/corelib/kernel/qmetaobjectbuilder.cpp8
-rw-r--r--src/corelib/kernel/qmetatype.cpp12
-rw-r--r--src/corelib/kernel/qmetatype.h88
-rw-r--r--src/corelib/kernel/qobject.cpp224
-rw-r--r--src/corelib/kernel/qobject.h26
-rw-r--r--src/corelib/kernel/qobject_p.h66
-rw-r--r--src/corelib/kernel/qobjectdefs_impl.h5
-rw-r--r--src/corelib/kernel/qproperty.cpp240
-rw-r--r--src/corelib/kernel/qproperty.h88
-rw-r--r--src/corelib/kernel/qproperty_p.h47
-rw-r--r--src/corelib/kernel/qsequentialiterable.h2
-rw-r--r--src/corelib/kernel/qsharedmemory.cpp63
-rw-r--r--src/corelib/kernel/qsharedmemory_posix.cpp2
-rw-r--r--src/corelib/kernel/qsocketnotifier.cpp2
-rw-r--r--src/corelib/kernel/qsystemerror.cpp9
-rw-r--r--src/corelib/kernel/qsystemsemaphore.cpp7
-rw-r--r--src/corelib/kernel/qsystemsemaphore_systemv.cpp14
-rw-r--r--src/corelib/kernel/qsystemsemaphore_unix.cpp6
-rw-r--r--src/corelib/kernel/qtranslator.cpp11
-rw-r--r--src/corelib/kernel/qvariant.cpp153
-rw-r--r--src/corelib/kernel/qvariant.h1
-rw-r--r--src/corelib/mimetypes/qmimedatabase.cpp15
-rw-r--r--src/corelib/mimetypes/qmimeprovider.cpp92
-rw-r--r--src/corelib/mimetypes/qmimeprovider_p.h9
-rw-r--r--src/corelib/platform/android/qandroidextras.cpp1286
-rw-r--r--src/corelib/platform/android/qandroidextras_p.h302
-rw-r--r--src/corelib/platform/android/qandroidnativeinterface.cpp149
-rw-r--r--src/corelib/plugin/qlibrary.cpp4
-rw-r--r--src/corelib/plugin/qlibrary_unix.cpp2
-rw-r--r--src/corelib/plugin/quuid.cpp29
-rw-r--r--src/corelib/plugin/quuid.h40
-rw-r--r--src/corelib/serialization/qcborarray.h1
-rw-r--r--src/corelib/serialization/qcbormap.h1
-rw-r--r--src/corelib/serialization/qcborstreamreader.cpp8
-rw-r--r--src/corelib/serialization/qjsoncbor.cpp23
-rw-r--r--src/corelib/serialization/qjsonvalue.cpp18
-rw-r--r--src/corelib/serialization/qjsonvalue.h2
-rw-r--r--src/corelib/serialization/qtextstream.cpp52
-rw-r--r--src/corelib/serialization/qtextstream_p.h9
-rw-r--r--src/corelib/text/qbytearray.cpp15
-rw-r--r--src/corelib/text/qbytearray.h57
-rw-r--r--src/corelib/text/qbytearrayalgorithms.h53
-rw-r--r--src/corelib/text/qbytearrayview.h15
-rw-r--r--src/corelib/text/qbytearrayview.qdoc12
-rw-r--r--src/corelib/text/qchar.cpp83
-rw-r--r--src/corelib/text/qchar.h2
-rw-r--r--src/corelib/text/qcollator.cpp12
-rw-r--r--src/corelib/text/qlocale.cpp75
-rw-r--r--src/corelib/text/qlocale.qdoc4
-rw-r--r--src/corelib/text/qlocale_data_p.h40
-rw-r--r--src/corelib/text/qlocale_p.h1
-rw-r--r--src/corelib/text/qlocale_tools.cpp92
-rw-r--r--src/corelib/text/qlocale_tools_p.h1
-rw-r--r--src/corelib/text/qlocale_unix.cpp4
-rw-r--r--src/corelib/text/qlocale_win.cpp6
-rw-r--r--src/corelib/text/qregularexpression.cpp10
-rw-r--r--src/corelib/text/qstring.cpp201
-rw-r--r--src/corelib/text/qstring.h13
-rw-r--r--src/corelib/text/qstringbuilder.h2
-rw-r--r--src/corelib/text/qstringlist.cpp5
-rw-r--r--src/corelib/text/qstringview.cpp6
-rw-r--r--src/corelib/text/qt_attribution.json2
-rw-r--r--src/corelib/text/qtextboundaryfinder.cpp12
-rw-r--r--src/corelib/text/qunicodetools.cpp4
-rw-r--r--src/corelib/text/qutf8stringview.h6
-rw-r--r--src/corelib/text/qutf8stringview.qdoc6
-rw-r--r--src/corelib/thread/qexception.cpp6
-rw-r--r--src/corelib/thread/qexception.h2
-rw-r--r--src/corelib/thread/qfuture.h33
-rw-r--r--src/corelib/thread/qfuture.qdoc21
-rw-r--r--src/corelib/thread/qfuture_impl.h12
-rw-r--r--src/corelib/thread/qfutureinterface.cpp172
-rw-r--r--src/corelib/thread/qfutureinterface.h77
-rw-r--r--src/corelib/thread/qfutureinterface_p.h38
-rw-r--r--src/corelib/thread/qfuturewatcher.cpp30
-rw-r--r--src/corelib/thread/qfuturewatcher_p.h1
-rw-r--r--src/corelib/thread/qmutex.h3
-rw-r--r--src/corelib/thread/qorderedmutexlocker_p.h37
-rw-r--r--src/corelib/thread/qpromise.h26
-rw-r--r--src/corelib/thread/qpromise.qdoc10
-rw-r--r--src/corelib/thread/qresultstore.cpp1
-rw-r--r--src/corelib/thread/qresultstore.h8
-rw-r--r--src/corelib/thread/qsemaphore.cpp86
-rw-r--r--src/corelib/thread/qsemaphore.h16
-rw-r--r--src/corelib/thread/qthread.h3
-rw-r--r--src/corelib/thread/qthread_unix.cpp6
-rw-r--r--src/corelib/time/qcalendar.cpp141
-rw-r--r--src/corelib/time/qcalendar.h19
-rw-r--r--src/corelib/time/qcalendarbackend_p.h12
-rw-r--r--src/corelib/time/qdatetime.cpp846
-rw-r--r--src/corelib/time/qdatetime.h8
-rw-r--r--src/corelib/time/qdatetime_p.h21
-rw-r--r--src/corelib/time/qdatetimeparser.cpp161
-rw-r--r--src/corelib/time/qdatetimeparser_p.h11
-rw-r--r--src/corelib/time/qgregoriancalendar.cpp11
-rw-r--r--src/corelib/time/qgregoriancalendar_p.h4
-rw-r--r--src/corelib/time/qhijricalendar_data_p.h6
-rw-r--r--src/corelib/time/qislamiccivilcalendar.cpp4
-rw-r--r--src/corelib/time/qjalalicalendar.cpp4
-rw-r--r--src/corelib/time/qjalalicalendar_data_p.h6
-rw-r--r--src/corelib/time/qjuliancalendar.cpp4
-rw-r--r--src/corelib/time/qmilankoviccalendar.cpp4
-rw-r--r--src/corelib/time/qromancalendar_data_p.h36
-rw-r--r--src/corelib/time/qtimezone.cpp2
-rw-r--r--src/corelib/time/qtimezoneprivate.cpp70
-rw-r--r--src/corelib/time/qtimezoneprivate_data_p.h66
-rw-r--r--src/corelib/time/qtimezoneprivate_tz.cpp4
-rw-r--r--src/corelib/time/qtimezoneprivate_win.cpp2
-rw-r--r--src/corelib/tools/qarraydata.cpp2
-rw-r--r--src/corelib/tools/qarraydata.h2
-rw-r--r--src/corelib/tools/qarraydataops.h8
-rw-r--r--src/corelib/tools/qarraydatapointer.h3
-rw-r--r--src/corelib/tools/qcryptographichash.cpp507
-rw-r--r--src/corelib/tools/qcryptographichash.h13
-rw-r--r--src/corelib/tools/qduplicatetracker_p.h83
-rw-r--r--src/corelib/tools/qhash.cpp195
-rw-r--r--src/corelib/tools/qhash.h19
-rw-r--r--src/corelib/tools/qhashfunctions.h38
-rw-r--r--src/corelib/tools/qline.cpp2
-rw-r--r--src/corelib/tools/qlist.qdoc11
-rw-r--r--src/corelib/tools/qmap.h108
-rw-r--r--src/corelib/tools/qmap.qdoc40
-rw-r--r--src/corelib/tools/qmessageauthenticationcode.cpp13
-rw-r--r--src/corelib/tools/qmultimap.qdoc46
-rw-r--r--src/corelib/tools/qoffsetstringarray_p.h1
-rw-r--r--src/corelib/tools/qpair.qdoc2
-rw-r--r--src/corelib/tools/qscopedpointer.cpp6
-rw-r--r--src/corelib/tools/qset.qdoc5
-rw-r--r--src/corelib/tools/qsharedpointer.cpp6
-rw-r--r--src/corelib/tools/qsharedpointer_impl.h12
-rw-r--r--src/corelib/tools/qtimeline.h4
-rw-r--r--src/corelib/tools/qvarlengtharray.h2
-rw-r--r--src/dbus/CMakeLists.txt1
-rw-r--r--src/dbus/qdbusargument_p.h1
-rw-r--r--src/dbus/qdbusmarshaller.cpp41
-rw-r--r--src/dbus/qtdbusglobal.h16
-rw-r--r--src/entrypoint/CMakeLists.txt32
-rw-r--r--src/gui/.prev_configure.cmake1225
-rw-r--r--src/gui/CMakeLists.txt23
-rw-r--r--src/gui/accessible/qaccessible.cpp39
-rw-r--r--src/gui/accessible/qaccessible.h27
-rw-r--r--src/gui/configure.cmake14
-rw-r--r--src/gui/configure.json1841
-rw-r--r--src/gui/doc/snippets/code/src_gui_kernel_qkeysequence.cpp4
-rw-r--r--src/gui/doc/snippets/code/src_gui_painting_qtransform.cpp8
-rw-r--r--src/gui/doc/snippets/code/src_gui_vulkan_qvulkaninstance.cpp6
-rw-r--r--src/gui/doc/snippets/code/src_gui_vulkan_qvulkanwindow.cpp2
-rw-r--r--src/gui/doc/snippets/textdocument-listitems/mainwindow.cpp8
-rw-r--r--src/gui/doc/snippets/textdocument-listitemstyles/mainwindow.cpp8
-rw-r--r--src/gui/doc/snippets/textdocument-printing/mainwindow.cpp8
-rw-r--r--src/gui/doc/snippets/textdocument-selections/mainwindow.cpp4
-rw-r--r--src/gui/doc/snippets/transform/main.cpp14
-rw-r--r--src/gui/image/qbitmap.cpp11
-rw-r--r--src/gui/image/qicon.cpp5
-rw-r--r--src/gui/image/qimage.cpp337
-rw-r--r--src/gui/image/qimage.h23
-rw-r--r--src/gui/image/qimage_conversions.cpp394
-rw-r--r--src/gui/image/qimage_p.h51
-rw-r--r--src/gui/image/qimagewriter.cpp10
-rw-r--r--src/gui/image/qpnghandler.cpp4
-rw-r--r--src/gui/itemmodels/qfileinfogatherer.cpp3
-rw-r--r--src/gui/itemmodels/qfilesystemmodel.cpp10
-rw-r--r--src/gui/itemmodels/qstandarditemmodel.cpp29
-rw-r--r--src/gui/kernel/qaction.cpp19
-rw-r--r--src/gui/kernel/qaction.h12
-rw-r--r--src/gui/kernel/qclipboard.cpp3
-rw-r--r--src/gui/kernel/qcursor.cpp4
-rw-r--r--src/gui/kernel/qevent.cpp174
-rw-r--r--src/gui/kernel/qevent.h19
-rw-r--r--src/gui/kernel/qeventpoint.cpp15
-rw-r--r--src/gui/kernel/qguiapplication.cpp49
-rw-r--r--src/gui/kernel/qguiapplication.h11
-rw-r--r--src/gui/kernel/qguiapplication_p.h13
-rw-r--r--src/gui/kernel/qinputdevice.h3
-rw-r--r--src/gui/kernel/qinputmethod.h3
-rw-r--r--src/gui/kernel/qkeymapper.cpp12
-rw-r--r--src/gui/kernel/qkeymapper_p.h5
-rw-r--r--src/gui/kernel/qoffscreensurface.cpp16
-rw-r--r--src/gui/kernel/qoffscreensurface.h3
-rw-r--r--src/gui/kernel/qoffscreensurface_platform.h3
-rw-r--r--src/gui/kernel/qopenglcontext.cpp28
-rw-r--r--src/gui/kernel/qopenglcontext.h3
-rw-r--r--src/gui/kernel/qopenglcontext_platform.h10
-rw-r--r--src/gui/kernel/qpalette.cpp5
-rw-r--r--src/gui/kernel/qplatformmenu_p.h2
-rw-r--r--src/gui/kernel/qplatformoffscreensurface.h8
-rw-r--r--src/gui/kernel/qplatformopenglcontext.h8
-rw-r--r--src/gui/kernel/qplatformscreen.cpp19
-rw-r--r--src/gui/kernel/qplatformscreen_p.h18
-rw-r--r--src/gui/kernel/qplatformwindow_p.h7
-rw-r--r--src/gui/kernel/qpointingdevice.cpp6
-rw-r--r--src/gui/kernel/qscreen.cpp23
-rw-r--r--src/gui/kernel/qscreen.h15
-rw-r--r--src/gui/kernel/qstylehints.h25
-rw-r--r--src/gui/kernel/qt_gui_pch.h1
-rw-r--r--src/gui/kernel/qtguiglobal.h15
-rw-r--r--src/gui/kernel/qwindow.cpp25
-rw-r--r--src/gui/kernel/qwindow.h18
-rw-r--r--src/gui/kernel/qwindowsysteminterface.cpp8
-rw-r--r--src/gui/kernel/qwindowsysteminterface.h4
-rw-r--r--src/gui/kernel/qwindowsysteminterface_p.h2
-rw-r--r--src/gui/math3d/qmatrix4x4.cpp8
-rw-r--r--src/gui/math3d/qmatrix4x4.h4
-rw-r--r--src/gui/math3d/qquaternion.cpp6
-rw-r--r--src/gui/painting/qbrush.cpp7
-rw-r--r--src/gui/painting/qcolor.cpp21
-rw-r--r--src/gui/painting/qcolor.h2
-rw-r--r--src/gui/painting/qcolorspace.cpp25
-rw-r--r--src/gui/painting/qcolorspace_p.h9
-rw-r--r--src/gui/painting/qcolortransform.cpp455
-rw-r--r--src/gui/painting/qcolortransform.h1
-rw-r--r--src/gui/painting/qcolortransform_p.h9
-rw-r--r--src/gui/painting/qcolortrclut.cpp17
-rw-r--r--src/gui/painting/qcolortrclut_p.h14
-rw-r--r--src/gui/painting/qcompositionfunctions.cpp1250
-rw-r--r--src/gui/painting/qdrawhelper.cpp1421
-rw-r--r--src/gui/painting/qdrawhelper_avx2.cpp385
-rw-r--r--src/gui/painting/qdrawhelper_p.h133
-rw-r--r--src/gui/painting/qdrawhelper_sse4.cpp75
-rw-r--r--src/gui/painting/qicc.cpp2
-rw-r--r--src/gui/painting/qimagescale.cpp223
-rw-r--r--src/gui/painting/qmemrotate.cpp66
-rw-r--r--src/gui/painting/qpagesize.h2
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp30
-rw-r--r--src/gui/painting/qpaintengine_raster_p.h1
-rw-r--r--src/gui/painting/qpaintengineex.cpp4
-rw-r--r--src/gui/painting/qpainter.cpp106
-rw-r--r--src/gui/painting/qpainter.h28
-rw-r--r--src/gui/painting/qpainter_p.h50
-rw-r--r--src/gui/painting/qpixellayout.cpp850
-rw-r--r--src/gui/painting/qpixellayout_p.h32
-rw-r--r--src/gui/painting/qrasterizer.cpp4
-rw-r--r--src/gui/painting/qregion.cpp1
-rw-r--r--src/gui/painting/qrgbafloat.h140
-rw-r--r--src/gui/painting/qrgbafloat.qdoc265
-rw-r--r--src/gui/painting/qtransform.cpp21
-rw-r--r--src/gui/platform/android/qandroidnativeinterface.cpp2
-rw-r--r--src/gui/platform/macos/qcocoanativeinterface.mm2
-rw-r--r--src/gui/platform/unix/dbusmenu/qdbusmenuconnection.cpp7
-rw-r--r--src/gui/platform/unix/dbusmenu/qdbusmenuconnection_p.h2
-rw-r--r--src/gui/platform/unix/qgenericunixservices.cpp2
-rw-r--r--src/gui/platform/unix/qtx11extras.cpp548
-rw-r--r--src/gui/platform/unix/qtx11extras_p.h110
-rw-r--r--src/gui/platform/unix/qunixnativeinterface.cpp13
-rw-r--r--src/gui/platform/unix/qxkbcommon.cpp20
-rw-r--r--src/gui/platform/windows/qwindowsnativeinterface.cpp2
-rw-r--r--src/gui/rhi/qrhi.cpp122
-rw-r--r--src/gui/rhi/qrhi_p.h27
-rw-r--r--src/gui/rhi/qrhi_p_p.h12
-rw-r--r--src/gui/rhi/qrhid3d11.cpp207
-rw-r--r--src/gui/rhi/qrhid3d11_p_p.h13
-rw-r--r--src/gui/rhi/qrhigles2.cpp259
-rw-r--r--src/gui/rhi/qrhigles2_p_p.h23
-rw-r--r--src/gui/rhi/qrhimetal.mm91
-rw-r--r--src/gui/rhi/qrhimetal_p_p.h3
-rw-r--r--src/gui/rhi/qrhinull.cpp18
-rw-r--r--src/gui/rhi/qrhinull_p_p.h5
-rw-r--r--src/gui/rhi/qrhiprofiler.cpp7
-rw-r--r--src/gui/rhi/qrhivulkan.cpp180
-rw-r--r--src/gui/rhi/qrhivulkan_p_p.h19
-rw-r--r--src/gui/rhi/qshader.cpp7
-rw-r--r--src/gui/rhi/qshader_p.h5
-rw-r--r--src/gui/text/freetype/qfontengine_ft.cpp4
-rw-r--r--src/gui/text/qcssparser.cpp24
-rw-r--r--src/gui/text/qfont.cpp25
-rw-r--r--src/gui/text/qfont.h4
-rw-r--r--src/gui/text/qfontdatabase.cpp20
-rw-r--r--src/gui/text/qtextdocumentfragment.cpp3
-rw-r--r--src/gui/text/qtextdocumentlayout.cpp12
-rw-r--r--src/gui/text/qtextengine.cpp17
-rw-r--r--src/gui/text/qtextformat.cpp36
-rw-r--r--src/gui/text/qtextformat.h10
-rw-r--r--src/gui/text/qtexthtmlparser.cpp94
-rw-r--r--src/gui/text/qtexthtmlparser_p.h3
-rw-r--r--src/gui/text/qtextlayout.cpp18
-rw-r--r--src/gui/text/qtextmarkdownimporter.cpp4
-rw-r--r--src/gui/text/unix/qfontconfigdatabase.cpp8
-rw-r--r--src/gui/text/unix/qfontconfigdatabase_p.h1
-rw-r--r--src/gui/text/windows/qwindowsfontenginedirectwrite.cpp3
-rw-r--r--src/gui/util/qvalidator.cpp4
-rw-r--r--src/gui/vulkan/qbasicvulkanplatforminstance.cpp1
-rw-r--r--src/gui/vulkan/qbasicvulkanplatforminstance_p.h2
-rw-r--r--src/gui/vulkan/qvulkanwindow.cpp3
-rw-r--r--src/network/.prev_configure.cmake433
-rw-r--r--src/network/CMakeLists.txt3
-rw-r--r--src/network/access/http2/http2protocol_p.h3
-rw-r--r--src/network/access/qdecompresshelper.cpp34
-rw-r--r--src/network/access/qdecompresshelper_p.h6
-rw-r--r--src/network/access/qhttp2protocolhandler.cpp36
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp138
-rw-r--r--src/network/access/qhttpnetworkconnection_p.h7
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp24
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel_p.h2
-rw-r--r--src/network/access/qhttpnetworkreply.cpp64
-rw-r--r--src/network/access/qhttpnetworkreply_p.h9
-rw-r--r--src/network/access/qhttpnetworkrequest.cpp14
-rw-r--r--src/network/access/qhttpnetworkrequest_p.h3
-rw-r--r--src/network/access/qhttpprotocolhandler.cpp5
-rw-r--r--src/network/access/qhttpthreaddelegate.cpp10
-rw-r--r--src/network/access/qhttpthreaddelegate_p.h13
-rw-r--r--src/network/access/qnetworkaccessbackend.cpp6
-rw-r--r--src/network/access/qnetworkaccesscache.cpp59
-rw-r--r--src/network/access/qnetworkaccesscache_p.h3
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp6
-rw-r--r--src/network/access/qnetworkaccessmanager_p.h4
-rw-r--r--src/network/access/qnetworkdiskcache.cpp13
-rw-r--r--src/network/access/qnetworkreply.cpp21
-rw-r--r--src/network/access/qnetworkreply.h2
-rw-r--r--src/network/access/qnetworkreplyhttpimpl.cpp207
-rw-r--r--src/network/access/qnetworkreplyhttpimpl_p.h19
-rw-r--r--src/network/access/qnetworkreplyimpl.cpp4
-rw-r--r--src/network/access/qnetworkreplyimpl_p.h4
-rw-r--r--src/network/access/qnetworkreplywasmimpl.cpp86
-rw-r--r--src/network/access/qnetworkreplywasmimpl_p.h10
-rw-r--r--src/network/access/qnetworkrequest.cpp52
-rw-r--r--src/network/access/qnetworkrequest.h5
-rw-r--r--src/network/configure.json484
-rw-r--r--src/network/doc/snippets/code/src_network_ssl_qsslconfiguration.cpp2
-rw-r--r--src/network/doc/src/ssl.qdoc4
-rw-r--r--src/network/kernel/qauthenticator.cpp47
-rw-r--r--src/network/kernel/qauthenticator_p.h2
-rw-r--r--src/network/kernel/qnetworkinformation.cpp21
-rw-r--r--src/network/kernel/qnetworkinformation.h6
-rw-r--r--src/network/kernel/qnetworkinformation_p.h11
-rw-r--r--src/network/kernel/qnetworkinterface.cpp21
-rw-r--r--src/network/kernel/qnetworkinterface.h1
-rw-r--r--src/network/kernel/qt_attribution.json2
-rw-r--r--src/network/kernel/qtnetworkglobal.h15
-rw-r--r--src/network/kernel/qurltlds_p.h28726
-rw-r--r--src/network/socket/qabstractsocket.cpp51
-rw-r--r--src/network/socket/qabstractsocketengine_p.h2
-rw-r--r--src/network/socket/qhttpsocketengine.cpp5
-rw-r--r--src/network/socket/qhttpsocketengine_p.h2
-rw-r--r--src/network/socket/qlocalserver.cpp30
-rw-r--r--src/network/socket/qlocalserver.h6
-rw-r--r--src/network/socket/qlocalserver_p.h1
-rw-r--r--src/network/socket/qlocalserver_tcp.cpp2
-rw-r--r--src/network/socket/qlocalserver_unix.cpp8
-rw-r--r--src/network/socket/qlocalserver_win.cpp5
-rw-r--r--src/network/socket/qlocalsocket.cpp16
-rw-r--r--src/network/socket/qlocalsocket.h5
-rw-r--r--src/network/socket/qlocalsocket_p.h2
-rw-r--r--src/network/socket/qlocalsocket_tcp.cpp11
-rw-r--r--src/network/socket/qlocalsocket_unix.cpp11
-rw-r--r--src/network/socket/qlocalsocket_win.cpp147
-rw-r--r--src/network/socket/qnativesocketengine.cpp8
-rw-r--r--src/network/socket/qnativesocketengine_p.h2
-rw-r--r--src/network/socket/qnativesocketengine_unix.cpp49
-rw-r--r--src/network/socket/qnativesocketengine_win.cpp79
-rw-r--r--src/network/socket/qsctpsocket.cpp4
-rw-r--r--src/network/socket/qsocks5socketengine.cpp3
-rw-r--r--src/network/socket/qsocks5socketengine_p.h2
-rw-r--r--src/network/socket/qtcpserver.cpp30
-rw-r--r--src/network/socket/qtcpserver.h3
-rw-r--r--src/network/socket/qtcpserver_p.h1
-rw-r--r--src/network/ssl/qssl.cpp7
-rw-r--r--src/network/ssl/qssl.h15
-rw-r--r--src/network/ssl/qsslconfiguration.cpp2
-rw-r--r--src/network/ssl/qsslsocket.cpp31
-rw-r--r--src/network/ssl/qsslsocket_p.h4
-rw-r--r--src/network/ssl/qtlsbackend.cpp1783
-rw-r--r--src/network/ssl/qtlsbackend_p.h49
-rw-r--r--src/opengl/CMakeLists.txt7
-rw-r--r--src/opengl/qopenglframebufferobject.cpp44
-rw-r--r--src/opengl/qopenglpaintdevice.cpp2
-rw-r--r--src/opengl/qopenglpaintengine.cpp2
-rw-r--r--src/opengl/qopengltextureuploader.cpp39
-rw-r--r--src/opengl/qplatformbackingstoreopenglsupport.cpp3
-rw-r--r--src/opengl/qtopenglglobal.h15
-rw-r--r--src/openglwidgets/CMakeLists.txt1
-rw-r--r--src/openglwidgets/qtopenglwidgetsglobal.h15
-rw-r--r--src/platformsupport/devicediscovery/CMakeLists.txt10
-rw-r--r--src/platformsupport/fbconvenience/CMakeLists.txt4
-rw-r--r--src/platformsupport/input/CMakeLists.txt24
-rw-r--r--src/platformsupport/kmsconvenience/CMakeLists.txt4
-rw-r--r--src/plugins/CMakeLists.txt2
-rw-r--r--src/plugins/imageformats/jpeg/CMakeLists.txt2
-rw-r--r--src/plugins/networkinformation/CMakeLists.txt (renamed from src/plugins/networkinformationbackends/CMakeLists.txt)0
-rw-r--r--src/plugins/networkinformation/android/CMakeLists.txt (renamed from src/plugins/networkinformationbackends/android/CMakeLists.txt)15
-rw-r--r--src/plugins/networkinformation/android/jar/src/org/qtproject/qt/android/networkinformation/QtAndroidNetworkInformation.java (renamed from src/plugins/networkinformationbackends/android/jar/src/org/qtproject/qt/android/networkinformation/QtAndroidNetworkInformation.java)5
-rw-r--r--src/plugins/networkinformation/android/qandroidnetworkinformationbackend.cpp (renamed from src/plugins/networkinformationbackends/android/qandroidnetworkinformationbackend.cpp)6
-rw-r--r--src/plugins/networkinformation/android/wrapper/androidconnectivitymanager.cpp (renamed from src/plugins/networkinformationbackends/android/wrapper/androidconnectivitymanager.cpp)20
-rw-r--r--src/plugins/networkinformation/android/wrapper/androidconnectivitymanager.h (renamed from src/plugins/networkinformationbackends/android/wrapper/androidconnectivitymanager.h)1
-rw-r--r--src/plugins/networkinformation/networklistmanager/CMakeLists.txt13
-rw-r--r--src/plugins/networkinformation/networklistmanager/qnetworklistmanagernetworkinformationbackend.cpp (renamed from src/plugins/networkinformationbackends/networklistmanager/qnetworklistmanagernetworkinformationbackend.cpp)53
-rw-r--r--src/plugins/networkinformation/networkmanager/CMakeLists.txt (renamed from src/plugins/networkinformationbackends/networkmanager/CMakeLists.txt)8
-rw-r--r--src/plugins/networkinformation/networkmanager/qnetworkmanagernetworkinformationbackend.cpp (renamed from src/plugins/networkinformationbackends/networkmanager/qnetworkmanagernetworkinformationbackend.cpp)31
-rw-r--r--src/plugins/networkinformation/networkmanager/qnetworkmanagerservice.cpp (renamed from src/plugins/networkinformationbackends/networkmanager/qnetworkmanagerservice.cpp)19
-rw-r--r--src/plugins/networkinformation/networkmanager/qnetworkmanagerservice.h (renamed from src/plugins/networkinformationbackends/networkmanager/qnetworkmanagerservice.h)16
-rw-r--r--src/plugins/networkinformation/scnetworkreachability/CMakeLists.txt (renamed from src/plugins/networkinformationbackends/scnetworkreachability/CMakeLists.txt)8
-rw-r--r--src/plugins/networkinformation/scnetworkreachability/qscnetworkreachabilitynetworkinformationbackend.mm (renamed from src/plugins/networkinformationbackends/scnetworkreachability/qscnetworkreachabilitynetworkinformationbackend.mm)0
-rw-r--r--src/plugins/networkinformationbackends/networklistmanager/CMakeLists.txt9
-rw-r--r--src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.cpp14
-rw-r--r--src/plugins/platforms/android/CMakeLists.txt2
-rw-r--r--src/plugins/platforms/android/androidjniinput.cpp5
-rw-r--r--src/plugins/platforms/android/androidjniinput.h1
-rw-r--r--src/plugins/platforms/android/qandroidinputcontext.cpp45
-rw-r--r--src/plugins/platforms/android/qandroidplatformfiledialoghelper.cpp17
-rw-r--r--src/plugins/platforms/android/qandroidplatformtheme.cpp10
-rw-r--r--src/plugins/platforms/android/qandroidplatformvulkanwindow.cpp2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaglcontext.mm8
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenu.mm19
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenuitem.h1
-rw-r--r--src/plugins/platforms/cocoa/qcocoanativeinterface.h5
-rw-r--r--src/plugins/platforms/cocoa/qcocoanativeinterface.mm14
-rw-r--r--src/plugins/platforms/cocoa/qcocoascreen.h4
-rw-r--r--src/plugins/platforms/cocoa/qcocoascreen.mm19
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm23
-rw-r--r--src/plugins/platforms/cocoa/qnsview_keys.mm5
-rw-r--r--src/plugins/platforms/cocoa/qnsview_mouse.mm23
-rw-r--r--src/plugins/platforms/direct2d/CMakeLists.txt111
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dbitmap.cpp3
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dpaintdevice.cpp3
-rw-r--r--src/plugins/platforms/eglfs/CMakeLists.txt16
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfscontext_p.h1
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/CMakeLists.txt2
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/CMakeLists.txt2
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/CMakeLists.txt6
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/CMakeLists.txt2
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/CMakeLists.txt6
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_mali/CMakeLists.txt2
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_openwfd/CMakeLists.txt24
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_viv/CMakeLists.txt2
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_viv_wl/CMakeLists.txt1
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/CMakeLists.txt2
-rw-r--r--src/plugins/platforms/ios/qiosviewcontroller.mm4
-rw-r--r--src/plugins/platforms/ios/quiaccessibilityelement.mm10
-rw-r--r--src/plugins/platforms/offscreen/qoffscreenintegration.cpp2
-rw-r--r--src/plugins/platforms/qnx/CMakeLists.txt8
-rw-r--r--src/plugins/platforms/vkkhrdisplay/CMakeLists.txt4
-rw-r--r--src/plugins/platforms/wasm/CMakeLists.txt16
-rw-r--r--src/plugins/platforms/wasm/qtloader.js63
-rw-r--r--src/plugins/platforms/wasm/qwasmclipboard.cpp25
-rw-r--r--src/plugins/platforms/wasm/qwasmcompositor.cpp10
-rw-r--r--src/plugins/platforms/wasm/qwasmeventtranslator.cpp177
-rw-r--r--src/plugins/platforms/wasm/qwasmeventtranslator.h2
-rw-r--r--src/plugins/platforms/wasm/qwasmintegration.cpp24
-rw-r--r--src/plugins/platforms/wasm/qwasmintegration.h1
-rw-r--r--src/plugins/platforms/wasm/qwasmscreen.cpp13
-rw-r--r--src/plugins/platforms/wasm/qwasmscreen.h4
-rw-r--r--src/plugins/platforms/wasm/qwasmstring.cpp4
-rw-r--r--src/plugins/platforms/wasm/qwasmwindow.cpp17
-rw-r--r--src/plugins/platforms/wasm/qwasmwindow.h1
-rw-r--r--src/plugins/platforms/windows/CMakeLists.txt2
-rw-r--r--src/plugins/platforms/windows/qwindowsglcontext.cpp7
-rw-r--r--src/plugins/platforms/windows/qwindowstheme.cpp11
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiautils.cpp17
-rw-r--r--src/plugins/platforms/xcb/CMakeLists.txt34
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp14
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.h14
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection_xi2.cpp62
-rw-r--r--src/plugins/platforms/xcb/qxcbcursor.cpp11
-rw-r--r--src/plugins/platforms/xcb/qxcbkeyboard.cpp6
-rw-r--r--src/plugins/platforms/xcb/qxcbsessionmanager.cpp2
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp14
-rw-r--r--src/plugins/sqldrivers/.prev_configure.cmake77
-rw-r--r--src/plugins/sqldrivers/configure.json201
-rw-r--r--src/plugins/sqldrivers/mysql/qsql_mysql.cpp2
-rw-r--r--src/plugins/sqldrivers/oci/qsql_oci.cpp126
-rw-r--r--src/plugins/sqldrivers/odbc/qsql_odbc.cpp4
-rw-r--r--src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp4
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac.mm103
-rw-r--r--src/plugins/styles/windowsvista/qwindowsxpstyle.cpp4
-rw-r--r--src/plugins/tls/certonly/CMakeLists.txt5
-rw-r--r--src/plugins/tls/certonly/qtlsbackend_cert.cpp2
-rw-r--r--src/plugins/tls/openssl/CMakeLists.txt13
-rw-r--r--src/plugins/tls/openssl/qdtls_openssl.cpp9
-rw-r--r--src/plugins/tls/openssl/qdtls_openssl_p.h2
-rw-r--r--src/plugins/tls/openssl/qsslcontext_openssl.cpp50
-rw-r--r--src/plugins/tls/openssl/qsslcontext_openssl_p.h7
-rw-r--r--src/plugins/tls/openssl/qssldiffiehellmanparameters_openssl.cpp51
-rw-r--r--src/plugins/tls/openssl/qsslsocket_openssl_symbols.cpp185
-rw-r--r--src/plugins/tls/openssl/qsslsocket_openssl_symbols_p.h120
-rw-r--r--src/plugins/tls/openssl/qtls_openssl.cpp18
-rw-r--r--src/plugins/tls/openssl/qtls_openssl_p.h6
-rw-r--r--src/plugins/tls/openssl/qtlsbackend_openssl.cpp66
-rw-r--r--src/plugins/tls/openssl/qtlsbackend_openssl_p.h2
-rw-r--r--src/plugins/tls/openssl/qtlskey_openssl.cpp144
-rw-r--r--src/plugins/tls/openssl/qtlskey_openssl_p.h9
-rw-r--r--src/plugins/tls/openssl/qx509_openssl.cpp2
-rw-r--r--src/plugins/tls/schannel/CMakeLists.txt7
-rw-r--r--src/plugins/tls/schannel/qtls_schannel.cpp128
-rw-r--r--src/plugins/tls/schannel/qtlsbackend_schannel_p.h2
-rw-r--r--src/plugins/tls/schannel/qtlskey_schannel.cpp11
-rw-r--r--src/plugins/tls/securetransport/CMakeLists.txt5
-rw-r--r--src/plugins/tls/securetransport/qtls_st.cpp97
-rw-r--r--src/plugins/tls/securetransport/qtlsbackend_st.cpp5
-rw-r--r--src/plugins/tls/securetransport/qtlsbackend_st_p.h2
-rw-r--r--src/plugins/tls/shared/qdtls_base.cpp3
-rw-r--r--src/plugins/tls/shared/qsslsocket_mac_shared.cpp10
-rw-r--r--src/plugins/tls/shared/qsslsocket_qt.cpp8
-rw-r--r--src/plugins/tls/shared/qtlskey_generic.cpp4
-rw-r--r--src/plugins/tls/shared/qx509_generic.cpp2
-rw-r--r--src/printsupport/CMakeLists.txt68
-rw-r--r--src/printsupport/configure.json102
-rw-r--r--src/printsupport/dialogs/images/printer-24.png (renamed from src/printsupport/dialogs/images/print-24.png)bin914 -> 914 bytes
-rw-r--r--src/printsupport/dialogs/images/printer-32.png (renamed from src/printsupport/dialogs/images/print-32.png)bin1202 -> 1202 bytes
-rw-r--r--src/printsupport/dialogs/images/view-pages-facing-24.png (renamed from src/printsupport/dialogs/images/view-page-sided-24.png)bin700 -> 700 bytes
-rw-r--r--src/printsupport/dialogs/images/view-pages-facing-32.png (renamed from src/printsupport/dialogs/images/view-page-sided-32.png)bin908 -> 908 bytes
-rw-r--r--src/printsupport/dialogs/images/view-pages-overview-24.png (renamed from src/printsupport/dialogs/images/view-page-multi-24.png)bin390 -> 390 bytes
-rw-r--r--src/printsupport/dialogs/images/view-pages-overview-32.png (renamed from src/printsupport/dialogs/images/view-page-multi-32.png)bin556 -> 556 bytes
-rw-r--r--src/printsupport/dialogs/images/view-pages-single-24.png (renamed from src/printsupport/dialogs/images/view-page-one-24.png)bin662 -> 662 bytes
-rw-r--r--src/printsupport/dialogs/images/view-pages-single-32.png (renamed from src/printsupport/dialogs/images/view-page-one-32.png)bin810 -> 810 bytes
-rw-r--r--src/printsupport/dialogs/images/zoom-fit-page-24.png (renamed from src/printsupport/dialogs/images/fit-page-24.png)bin985 -> 985 bytes
-rw-r--r--src/printsupport/dialogs/images/zoom-fit-page-32.png (renamed from src/printsupport/dialogs/images/fit-page-32.png)bin1330 -> 1330 bytes
-rw-r--r--src/printsupport/dialogs/images/zoom-fit-width-24.png (renamed from src/printsupport/dialogs/images/fit-width-24.png)bin706 -> 706 bytes
-rw-r--r--src/printsupport/dialogs/images/zoom-fit-width-32.png (renamed from src/printsupport/dialogs/images/fit-width-32.png)bin1004 -> 1004 bytes
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog_win.cpp31
-rw-r--r--src/printsupport/dialogs/qprintdialog.qrc24
-rw-r--r--src/printsupport/dialogs/qprintdialog_unix.cpp2
-rw-r--r--src/printsupport/dialogs/qprintpreviewdialog.cpp14
-rw-r--r--src/printsupport/doc/src/qtprintsupport-index.qdoc2
-rw-r--r--src/printsupport/doc/src/qtprintsupport-module.qdoc1
-rw-r--r--src/printsupport/kernel/qtprintsupportglobal.h15
-rw-r--r--src/sql/CMakeLists.txt1
-rw-r--r--src/sql/configure.json22
-rw-r--r--src/sql/kernel/qsqlfield.cpp36
-rw-r--r--src/sql/kernel/qsqlquery.cpp4
-rw-r--r--src/sql/kernel/qtsqlglobal.h11
-rw-r--r--src/sql/models/qsqlquerymodel.cpp3
-rw-r--r--src/testlib/CMakeLists.txt1
-rw-r--r--src/testlib/configure.json34
-rw-r--r--src/testlib/doc/snippets/code/src_qtestlib_qtestcase.cpp8
-rw-r--r--src/testlib/qabstracttestlogger_p.h2
-rw-r--r--src/testlib/qtest.h2
-rw-r--r--src/testlib/qtest_gui.h2
-rw-r--r--src/testlib/qtestaccessible.h11
-rw-r--r--src/testlib/qtestcase.cpp117
-rw-r--r--src/testlib/qtestcase.h35
-rw-r--r--src/testlib/qtestresult.cpp17
-rw-r--r--src/testlib/qtestresult_p.h3
-rw-r--r--src/testlib/qttestglobal.h11
-rw-r--r--src/tools/androiddeployqt/CMakeLists.txt2
-rw-r--r--src/tools/androiddeployqt/main.cpp275
-rw-r--r--src/tools/androidtestrunner/main.cpp85
-rw-r--r--src/tools/bootstrap/CMakeLists.txt6
-rw-r--r--src/tools/moc/CMakeLists.txt1
-rw-r--r--src/tools/moc/collectjson.cpp6
-rw-r--r--src/tools/moc/collectjson.h2
-rw-r--r--src/tools/moc/main.cpp54
-rw-r--r--src/tools/moc/moc.cpp11
-rw-r--r--src/tools/moc/moc.h3
-rw-r--r--src/tools/qtpaths/CMakeLists.txt1
-rw-r--r--src/tools/qtpaths/qtpaths.cpp59
-rw-r--r--src/tools/rcc/main.cpp6
-rw-r--r--src/tools/shared/depfile_shared.h80
-rw-r--r--src/tools/uic/CMakeLists.txt1
-rw-r--r--src/tools/uic/cpp/cppwriteincludes.cpp163
-rw-r--r--src/tools/uic/cpp/cppwriteincludes.h45
-rw-r--r--src/tools/uic/main.cpp6
-rw-r--r--src/tools/uic/option.h2
-rw-r--r--src/tools/uic/python/pythonwriteimports.cpp206
-rw-r--r--src/tools/uic/python/pythonwriteimports.h27
-rw-r--r--src/tools/uic/qclass_lib_map.h3
-rw-r--r--src/tools/uic/shared/writeincludesbase.cpp160
-rw-r--r--src/tools/uic/shared/writeincludesbase.h99
-rw-r--r--src/widgets/CMakeLists.txt401
-rw-r--r--src/widgets/compat/removed_api.cpp114
-rw-r--r--src/widgets/configure.json647
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp4
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp27
-rw-r--r--src/widgets/dialogs/qmessagebox.h3
-rw-r--r--src/widgets/doc/src/guibooks.qdoc13
-rw-r--r--src/widgets/graphicsview/qgraphicsitem.cpp10
-rw-r--r--src/widgets/graphicsview/qgraphicsitem.h12
-rw-r--r--src/widgets/graphicsview/qgraphicsscene.cpp2
-rw-r--r--src/widgets/graphicsview/qgraphicsview.cpp2
-rw-r--r--src/widgets/graphicsview/qgraphicsview.h12
-rw-r--r--src/widgets/graphicsview/qgraphicswidget.h3
-rw-r--r--src/widgets/graphicsview/qsimplex_p.cpp2
-rw-r--r--src/widgets/itemviews/qabstractitemview.cpp55
-rw-r--r--src/widgets/itemviews/qabstractitemview.h9
-rw-r--r--src/widgets/itemviews/qabstractitemview_p.h4
-rw-r--r--src/widgets/itemviews/qheaderview.h9
-rw-r--r--src/widgets/itemviews/qlistview.cpp66
-rw-r--r--src/widgets/itemviews/qlistwidget.cpp12
-rw-r--r--src/widgets/itemviews/qlistwidget.h3
-rw-r--r--src/widgets/itemviews/qtableview.cpp28
-rw-r--r--src/widgets/itemviews/qtableview_p.h3
-rw-r--r--src/widgets/itemviews/qtreeview.cpp15
-rw-r--r--src/widgets/itemviews/qtreewidget.cpp98
-rw-r--r--src/widgets/itemviews/qtreewidget.h9
-rw-r--r--src/widgets/itemviews/qtreewidget_p.h9
-rw-r--r--src/widgets/kernel/qapplication.cpp8
-rw-r--r--src/widgets/kernel/qapplication.h2
-rw-r--r--src/widgets/kernel/qboxlayout.cpp2
-rw-r--r--src/widgets/kernel/qformlayout.h12
-rw-r--r--src/widgets/kernel/qgesture.h3
-rw-r--r--src/widgets/kernel/qlayout.cpp27
-rw-r--r--src/widgets/kernel/qlayout.h4
-rw-r--r--src/widgets/kernel/qlayoutitem.cpp30
-rw-r--r--src/widgets/kernel/qlayoutitem.h1
-rw-r--r--src/widgets/kernel/qmacgesturerecognizer.cpp2
-rw-r--r--src/widgets/kernel/qt_widgets_pch.h1
-rw-r--r--src/widgets/kernel/qtwidgetsglobal.h15
-rw-r--r--src/widgets/kernel/qwidget.cpp169
-rw-r--r--src/widgets/kernel/qwidget.h85
-rw-r--r--src/widgets/styles/images/check_list_controller.svg21
-rw-r--r--src/widgets/styles/images/closedock-down-macstyle-10.pngbin0 -> 195 bytes
-rw-r--r--src/widgets/styles/images/closedock-down-macstyle-20.pngbin0 -> 344 bytes
-rw-r--r--src/widgets/styles/images/closedock-down-macstyle-32.pngbin0 -> 474 bytes
-rw-r--r--src/widgets/styles/images/closedock-down-macstyle-48.pngbin0 -> 721 bytes
-rw-r--r--src/widgets/styles/images/closedock-down-macstyle-64.pngbin0 -> 920 bytes
-rw-r--r--src/widgets/styles/images/closedock-down-macstyle.svg15
-rw-r--r--src/widgets/styles/images/closedock-macstyle-10.pngbin0 -> 309 bytes
-rw-r--r--src/widgets/styles/images/closedock-macstyle-20.pngbin0 -> 579 bytes
-rw-r--r--src/widgets/styles/images/closedock-macstyle-32.pngbin0 -> 938 bytes
-rw-r--r--src/widgets/styles/images/closedock-macstyle-48.pngbin0 -> 1236 bytes
-rw-r--r--src/widgets/styles/images/closedock-macstyle-64.pngbin0 -> 1495 bytes
-rw-r--r--src/widgets/styles/images/closedock-macstyle.svg15
-rw-r--r--src/widgets/styles/images/closedock.svg18
-rw-r--r--src/widgets/styles/images/critical.svg14
-rw-r--r--src/widgets/styles/images/dockdock-down-macstyle-10.pngbin0 -> 246 bytes
-rw-r--r--src/widgets/styles/images/dockdock-down-macstyle-20.pngbin0 -> 363 bytes
-rw-r--r--src/widgets/styles/images/dockdock-down-macstyle-32.pngbin0 -> 416 bytes
-rw-r--r--src/widgets/styles/images/dockdock-down-macstyle-48.pngbin0 -> 622 bytes
-rw-r--r--src/widgets/styles/images/dockdock-down-macstyle-64.pngbin0 -> 771 bytes
-rw-r--r--src/widgets/styles/images/dockdock-down-macstyle.svg16
-rw-r--r--src/widgets/styles/images/dockdock-macstyle-10.pngbin0 -> 339 bytes
-rw-r--r--src/widgets/styles/images/dockdock-macstyle-20.pngbin0 -> 555 bytes
-rw-r--r--src/widgets/styles/images/dockdock-macstyle-32.pngbin0 -> 654 bytes
-rw-r--r--src/widgets/styles/images/dockdock-macstyle-48.pngbin0 -> 915 bytes
-rw-r--r--src/widgets/styles/images/dockdock-macstyle-64.pngbin0 -> 1212 bytes
-rw-r--r--src/widgets/styles/images/dockdock-macstyle.svg17
-rw-r--r--src/widgets/styles/images/file_open.svg19
-rw-r--r--src/widgets/styles/images/filedialog_end.svg27
-rw-r--r--src/widgets/styles/images/filedialog_start.svg27
-rw-r--r--src/widgets/styles/images/information.svg14
-rw-r--r--src/widgets/styles/images/qt_close.svg18
-rw-r--r--src/widgets/styles/images/qt_help.svg25
-rw-r--r--src/widgets/styles/images/qt_maximize.svg12
-rw-r--r--src/widgets/styles/images/qt_menu.svg22
-rw-r--r--src/widgets/styles/images/qt_minimize.svg15
-rw-r--r--src/widgets/styles/images/qt_normalizeup.svg20
-rw-r--r--src/widgets/styles/images/qt_shade.svg15
-rw-r--r--src/widgets/styles/images/qt_unshade.svg15
-rw-r--r--src/widgets/styles/images/question.svg21
-rw-r--r--src/widgets/styles/images/toolbar-ext-h.svg16
-rw-r--r--src/widgets/styles/images/toolbar-ext-v.svg16
-rw-r--r--src/widgets/styles/images/warning.svg16
-rw-r--r--src/widgets/styles/qcommonstyle.cpp56
-rw-r--r--src/widgets/styles/qcommonstylepixmaps_p.h2
-rw-r--r--src/widgets/styles/qfusionstyle.cpp11
-rw-r--r--src/widgets/styles/qstyle.cpp9
-rw-r--r--src/widgets/styles/qstyle.h2
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp247
-rw-r--r--src/widgets/styles/qstylesheetstyle_p.h2
-rw-r--r--src/widgets/styles/qwindowsstyle.cpp2
-rw-r--r--src/widgets/util/qscroller.h3
-rw-r--r--src/widgets/widgets/qabstractscrollarea.cpp2
-rw-r--r--src/widgets/widgets/qabstractscrollarea.h6
-rw-r--r--src/widgets/widgets/qcalendarwidget.h6
-rw-r--r--src/widgets/widgets/qcombobox.cpp43
-rw-r--r--src/widgets/widgets/qcombobox.h3
-rw-r--r--src/widgets/widgets/qcombobox_p.h1
-rw-r--r--src/widgets/widgets/qdatetimeedit.cpp72
-rw-r--r--src/widgets/widgets/qdatetimeedit.h6
-rw-r--r--src/widgets/widgets/qdatetimeedit_p.h20
-rw-r--r--src/widgets/widgets/qdockarealayout.cpp4
-rw-r--r--src/widgets/widgets/qdockwidget.cpp33
-rw-r--r--src/widgets/widgets/qkeysequenceedit.h3
-rw-r--r--src/widgets/widgets/qlabel.cpp4
-rw-r--r--src/widgets/widgets/qlabel.h3
-rw-r--r--src/widgets/widgets/qlineedit.cpp14
-rw-r--r--src/widgets/widgets/qlineedit_p.cpp19
-rw-r--r--src/widgets/widgets/qlineedit_p.h7
-rw-r--r--src/widgets/widgets/qmainwindow.h3
-rw-r--r--src/widgets/widgets/qmainwindowlayout.cpp14
-rw-r--r--src/widgets/widgets/qmdisubwindow.cpp2
-rw-r--r--src/widgets/widgets/qmenu.cpp147
-rw-r--r--src/widgets/widgets/qmenu.h93
-rw-r--r--src/widgets/widgets/qmenubar.cpp68
-rw-r--r--src/widgets/widgets/qmenubar.h28
-rw-r--r--src/widgets/widgets/qplaintextedit.h3
-rw-r--r--src/widgets/widgets/qpushbutton_p.h2
-rw-r--r--src/widgets/widgets/qtabbar.cpp29
-rw-r--r--src/widgets/widgets/qtabbar.h3
-rw-r--r--src/widgets/widgets/qtextedit.h3
-rw-r--r--src/widgets/widgets/qtoolbar.cpp111
-rw-r--r--src/widgets/widgets/qtoolbar.h55
-rw-r--r--src/widgets/widgets/qtoolbutton.cpp6
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol.cpp18
-rw-r--r--src/widgets/widgets/qwidgettextcontrol.cpp5
-rw-r--r--src/widgets/widgets/qwidgettextcontrol_p.h6
-rw-r--r--src/xml/CMakeLists.txt1
-rw-r--r--src/xml/configure.json16
-rw-r--r--src/xml/dom/qdom.cpp2
-rw-r--r--src/xml/qtxmlglobal.h14
923 files changed, 40407 insertions, 33975 deletions
diff --git a/src/3rdparty/blake2/qt_attribution.json b/src/3rdparty/blake2/qt_attribution.json
index 638a6c2ed4..ad1116f53e 100644
--- a/src/3rdparty/blake2/qt_attribution.json
+++ b/src/3rdparty/blake2/qt_attribution.json
@@ -7,8 +7,8 @@
"Description": "BLAKE2 is a cryptographic hash function faster than MD5, SHA-1, SHA-2, and SHA-3, yet is at least as secure as the latest standard SHA-3.",
"Homepage": "https://blake2.net/",
- "Version": "3d6155ab1682e68c30f93064f988247508f55bbe",
- "DownloadLocation": "https://github.com/BLAKE2/BLAKE2/tree/3d6155ab1682e68c30f93064f988247508f55bbe",
+ "Version": "54f4faa4c16ea34bcd59d16e8da46a64b259fc07",
+ "DownloadLocation": "https://github.com/BLAKE2/BLAKE2/tree/54f4faa4c16ea34bcd59d16e8da46a64b259fc07",
"License": "Creative Commons Zero v1.0 Universal or Apache License 2.0",
"LicenseId": "CC0-1.0 OR Apache-2.0",
"LicenseFile": "COPYING",
diff --git a/src/3rdparty/blake2/src/blake2.h b/src/3rdparty/blake2/src/blake2.h
index ad62f260e7..ca390305e6 100644
--- a/src/3rdparty/blake2/src/blake2.h
+++ b/src/3rdparty/blake2/src/blake2.h
@@ -137,8 +137,8 @@ extern "C" {
/* Padded structs result in a compile-time error */
enum {
- BLAKE2_DUMMY_1 = 1/(sizeof(blake2s_param) == BLAKE2S_OUTBYTES),
- BLAKE2_DUMMY_2 = 1/(sizeof(blake2b_param) == BLAKE2B_OUTBYTES)
+ BLAKE2_DUMMY_1 = 1/(int)(sizeof(blake2s_param) == BLAKE2S_OUTBYTES),
+ BLAKE2_DUMMY_2 = 1/(int)(sizeof(blake2b_param) == BLAKE2B_OUTBYTES)
};
/* Streaming API */
diff --git a/src/3rdparty/harfbuzz-ng/CMakeLists.txt b/src/3rdparty/harfbuzz-ng/CMakeLists.txt
index 5ac9b33b62..966cc09d36 100644
--- a/src/3rdparty/harfbuzz-ng/CMakeLists.txt
+++ b/src/3rdparty/harfbuzz-ng/CMakeLists.txt
@@ -65,6 +65,12 @@ qt_internal_add_3rdparty_library(BundledHarfbuzz
PUBLIC_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/harfbuzz>
)
+
+# GHS compiler doesn't support the __restrict keyword
+if(INTEGRITY)
+ target_compile_definitions(BundledHarfbuzz PRIVATE __restrict=)
+endif()
+
qt_disable_warnings(BundledHarfbuzz)
qt_set_symbol_visibility_hidden(BundledHarfbuzz)
diff --git a/src/3rdparty/libjpeg/COPYRIGHT.txt b/src/3rdparty/libjpeg/COPYRIGHT.txt
new file mode 100644
index 0000000000..6d80d7dc77
--- /dev/null
+++ b/src/3rdparty/libjpeg/COPYRIGHT.txt
@@ -0,0 +1,12 @@
+Copyright (C) 2009-2021 D. R. Commander
+Copyright (C) 2015, 2020 Google, Inc.
+Copyright (C) 2019 Arm Limited
+Copyright (C) 2015-2016, 2018 Matthieu Darbois
+Copyright (C) 2011-2016 Siarhei Siamashka
+Copyright (C) 2015 Intel Corporation
+Copyright (C) 2013-2014 Linaro Limited
+Copyright (C) 2013-2014 MIPS Technologies, Inc.
+Copyright (C) 2009, 2012 Pierre Ossman for Cendio AB
+Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)
+Copyright (C) 1999-2006 MIYASAKA Masaru
+Copyright (C) 1991-2017 Thomas G. Lane, Guido Vollbeding
diff --git a/src/3rdparty/libjpeg/ijg-license.txt b/src/3rdparty/libjpeg/ijg-license.txt
new file mode 100644
index 0000000000..eec5341d1c
--- /dev/null
+++ b/src/3rdparty/libjpeg/ijg-license.txt
@@ -0,0 +1,34 @@
+The authors make NO WARRANTY or representation, either express or implied,
+with respect to this software, its quality, accuracy, merchantability, or
+fitness for a particular purpose. This software is provided "AS IS", and you,
+its user, assume the entire risk as to its quality and accuracy.
+
+This software is copyright (C) 1991-2020, Thomas G. Lane, Guido Vollbeding.
+All Rights Reserved except as specified below.
+
+Permission is hereby granted to use, copy, modify, and distribute this
+software (or portions thereof) for any purpose, without fee, subject to these
+conditions:
+(1) If any part of the source code for this software is distributed, then this
+README file must be included, with this copyright and no-warranty notice
+unaltered; and any additions, deletions, or changes to the original files
+must be clearly indicated in accompanying documentation.
+(2) If only executable code is distributed, then the accompanying
+documentation must state that "this software is based in part on the work of
+the Independent JPEG Group".
+(3) Permission for use of this software is granted only if the user accepts
+full responsibility for any undesirable consequences; the authors accept
+NO LIABILITY for damages of any kind.
+
+These conditions apply to any software derived from or based on the IJG code,
+not just to the unmodified library. If you use our work, you ought to
+acknowledge us.
+
+Permission is NOT granted for the use of any IJG author's name or company name
+in advertising or publicity relating to this software or products derived from
+it. This software may be referred to only as "the Independent JPEG Group's
+software".
+
+We specifically permit and encourage the use of this software as the basis of
+commercial products, provided that all warranty or liability claims are
+assumed by the product vendor.
diff --git a/src/3rdparty/libjpeg/qt_attribution.json b/src/3rdparty/libjpeg/qt_attribution.json
index 0940636da3..04b89a05bc 100644
--- a/src/3rdparty/libjpeg/qt_attribution.json
+++ b/src/3rdparty/libjpeg/qt_attribution.json
@@ -7,19 +7,8 @@
"Description": "The Independent JPEG Group's JPEG software",
"Homepage": "http://libjpeg-turbo.virtualgl.org/",
"Version": "2.1.0",
- "License": "Independent JPEG Group License",
- "LicenseId": "IJG",
- "LicenseFile": "LICENSE",
- "Copyright": "Copyright (C) 2009-2021 D. R. Commander
-Copyright (C) 2015, 2020 Google, Inc.
-Copyright (C) 2019 Arm Limited
-Copyright (C) 2015-2016, 2018 Matthieu Darbois
-Copyright (C) 2011-2016 Siarhei Siamashka
-Copyright (C) 2015 Intel Corporation
-Copyright (C) 2013-2014 Linaro Limited
-Copyright (C) 2013-2014 MIPS Technologies, Inc.
-Copyright (C) 2009, 2012 Pierre Ossman for Cendio AB
-Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)
-Copyright (C) 1999-2006 MIYASAKA Masaru
-Copyright (C) 1991-2017 Thomas G. Lane, Guido Vollbeding"
+ "License": "Independent JPEG Group License and BSD 3-Clause \"New\" or \"Revised\" License and zlib License",
+ "LicenseId": "IJG AND BSD-3-Clause AND Zlib",
+ "LicenseFiles": [ "LICENSE", "ijg-license.txt", "zlib-license.txt"],
+ "CopyrightFile": "COPYRIGHT.txt"
}
diff --git a/src/3rdparty/libjpeg/src/ChangeLog.md b/src/3rdparty/libjpeg/src/ChangeLog.md
index 498b8f2729..5ecbf3b510 100644
--- a/src/3rdparty/libjpeg/src/ChangeLog.md
+++ b/src/3rdparty/libjpeg/src/ChangeLog.md
@@ -1,3 +1,12 @@
+2.1.1
+=====
+
+### Significant changes relative to 2.1.0
+
+1. Fixed a regression introduced in 2.1.0 that caused build failures with
+non-GCC-compatible compilers for Un*x/Arm platforms.
+
+
2.1.0
=====
diff --git a/src/3rdparty/libjpeg/src/jchuff.c b/src/3rdparty/libjpeg/src/jchuff.c
index 2bce767ebd..8ff817b151 100644
--- a/src/3rdparty/libjpeg/src/jchuff.c
+++ b/src/3rdparty/libjpeg/src/jchuff.c
@@ -44,8 +44,9 @@
* flags (this defines __thumb__).
*/
-#if defined(__arm__) || defined(__aarch64__) || defined(_M_ARM) || \
- defined(_M_ARM64)
+/* NOTE: Both GCC and Clang define __GNUC__ */
+#if (defined(__GNUC__) && (defined(__arm__) || defined(__aarch64__))) || \
+ defined(_M_ARM) || defined(_M_ARM64)
#if !defined(__thumb__) || defined(__thumb2__)
#define USE_CLZ_INTRINSIC
#endif
diff --git a/src/3rdparty/libjpeg/src/jcphuff.c b/src/3rdparty/libjpeg/src/jcphuff.c
index bd14fc27d5..9bf96124b4 100644
--- a/src/3rdparty/libjpeg/src/jcphuff.c
+++ b/src/3rdparty/libjpeg/src/jcphuff.c
@@ -52,8 +52,9 @@
* flags (this defines __thumb__).
*/
-#if defined(__arm__) || defined(__aarch64__) || defined(_M_ARM) || \
- defined(_M_ARM64)
+/* NOTE: Both GCC and Clang define __GNUC__ */
+#if (defined(__GNUC__) && (defined(__arm__) || defined(__aarch64__))) || \
+ defined(_M_ARM) || defined(_M_ARM64)
#if !defined(__thumb__) || defined(__thumb2__)
#define USE_CLZ_INTRINSIC
#endif
diff --git a/src/3rdparty/libjpeg/zlib-license.txt b/src/3rdparty/libjpeg/zlib-license.txt
new file mode 100644
index 0000000000..480c61edca
--- /dev/null
+++ b/src/3rdparty/libjpeg/zlib-license.txt
@@ -0,0 +1,15 @@
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any damages
+arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
diff --git a/src/3rdparty/md4/qt_attribution.json b/src/3rdparty/md4/qt_attribution.json
index ea7e22705f..37dd3fab5f 100644
--- a/src/3rdparty/md4/qt_attribution.json
+++ b/src/3rdparty/md4/qt_attribution.json
@@ -2,7 +2,7 @@
"Id": "md4",
"Name": "MD4",
"QDocModule": "qtcore",
- "QtUsage": "Used in Qt Core (QCryptographicHash). Configure with -DQT_CRYPTOGRAPHICHASH_ONLY_SHA1 to avoid.",
+ "QtUsage": "Used in Qt Core (QCryptographicHash).",
"Description": "Treat as final version; no upstream known",
"Description": "An OpenSSL-compatible implementation of the RSA Data Security, Inc. MD4 Message-Digest Algorithm.",
diff --git a/src/3rdparty/md4c/0001-md4c-Fix-MSVC-compiler-level-3-warnings.patch b/src/3rdparty/md4c/0001-md4c-Fix-MSVC-compiler-level-3-warnings.patch
new file mode 100644
index 0000000000..5f2cf8401b
--- /dev/null
+++ b/src/3rdparty/md4c/0001-md4c-Fix-MSVC-compiler-level-3-warnings.patch
@@ -0,0 +1,40 @@
+diff --git a/src/3rdparty/md4c/md4c.c b/src/3rdparty/md4c/md4c.c
+index 6aeef112e5..9d0d1b7d7b 100644
+--- a/src/3rdparty/md4c/md4c.c
++++ b/src/3rdparty/md4c/md4c.c
+@@ -916,7 +916,7 @@ md_merge_lines(MD_CTX* ctx, OFF beg, OFF end, const MD_LINE* lines, int n_lines,
+ }
+
+ if(off >= end) {
+- *p_size = ptr - buffer;
++ *p_size = (MD_SIZE)(ptr - buffer);
+ return;
+ }
+
+@@ -2229,7 +2229,7 @@ md_is_link_reference(MD_CTX* ctx, const MD_LINE* lines, int n_lines,
+
+ if(beg_line != end_line) {
+ MD_CHECK(md_merge_lines_alloc(ctx, beg, end, beg_line,
+- n_lines - (beg_line - lines), _T(' '), &label, &label_size));
++ (int)(n_lines - (beg_line - lines)), _T(' '), &label, &label_size));
+ } else {
+ label = (CHAR*) STR(beg);
+ label_size = end - beg;
+@@ -4265,7 +4265,7 @@ md_process_inlines(MD_CTX* ctx, const MD_LINE* lines, int n_lines)
+ MD_CHECK(md_enter_leave_span_a(ctx, (mark->ch != ']'),
+ (opener->ch == '!' ? MD_SPAN_IMG : MD_SPAN_A),
+ STR(dest_mark->beg), dest_mark->end - dest_mark->beg, FALSE,
+- md_mark_get_ptr(ctx, title_mark - ctx->marks), title_mark->prev));
++ md_mark_get_ptr(ctx, (int)(title_mark - ctx->marks)), title_mark->prev));
+
+ /* link/image closer may span multiple lines. */
+ if(mark->ch == ']') {
+@@ -4908,7 +4908,7 @@ md_push_block_bytes(MD_CTX* ctx, int n_bytes)
+
+ /* Fix the ->current_block after the reallocation. */
+ if(ctx->current_block != NULL) {
+- OFF off_current_block = (char*) ctx->current_block - (char*) ctx->block_bytes;
++ OFF off_current_block = (OFF)((char*) ctx->current_block - (char*) ctx->block_bytes);
+ ctx->current_block = (MD_BLOCK*) ((char*) new_block_bytes + off_current_block);
+ }
+
diff --git a/src/3rdparty/md4c/md4c.c b/src/3rdparty/md4c/md4c.c
index 19ba212a09..9d0d1b7d7b 100644
--- a/src/3rdparty/md4c/md4c.c
+++ b/src/3rdparty/md4c/md4c.c
@@ -588,7 +588,7 @@ struct MD_UNICODE_FOLD_INFO_tag {
#define R(cp_min, cp_max) ((cp_min) | 0x40000000), ((cp_max) | 0x80000000)
#define S(cp) (cp)
/* Unicode "Pc", "Pd", "Pe", "Pf", "Pi", "Po", "Ps" categories.
- * (generated by scripts/build_punct_map.py) */
+ * (generated by scripts/build_folding_map.py) */
static const unsigned FOLD_MAP_1[] = {
R(0x0041,0x005a), S(0x00b5), R(0x00c0,0x00d6), R(0x00d8,0x00de), R(0x0100,0x012e), R(0x0132,0x0136),
R(0x0139,0x0147), R(0x014a,0x0176), S(0x0178), R(0x0179,0x017d), S(0x017f), S(0x0181), S(0x0182),
@@ -916,7 +916,7 @@ md_merge_lines(MD_CTX* ctx, OFF beg, OFF end, const MD_LINE* lines, int n_lines,
}
if(off >= end) {
- *p_size = ptr - buffer;
+ *p_size = (MD_SIZE)(ptr - buffer);
return;
}
@@ -2229,7 +2229,7 @@ md_is_link_reference(MD_CTX* ctx, const MD_LINE* lines, int n_lines,
if(beg_line != end_line) {
MD_CHECK(md_merge_lines_alloc(ctx, beg, end, beg_line,
- n_lines - (beg_line - lines), _T(' '), &label, &label_size));
+ (int)(n_lines - (beg_line - lines)), _T(' '), &label, &label_size));
} else {
label = (CHAR*) STR(beg);
label_size = end - beg;
@@ -3611,6 +3611,34 @@ md_resolve_links(MD_CTX* ctx, const MD_LINE* lines, int n_lines)
}
md_analyze_link_contents(ctx, lines, n_lines, opener_index+1, closer_index);
+
+ /* If the link text is formed by nothing but permissive autolink,
+ * suppress the autolink.
+ * See https://github.com/mity/md4c/issues/152 for more info. */
+ if(ctx->parser.flags & MD_FLAG_PERMISSIVEAUTOLINKS) {
+ MD_MARK* first_nested;
+ MD_MARK* last_nested;
+
+ first_nested = opener + 1;
+ while(first_nested->ch == _T('D') && first_nested < closer)
+ first_nested++;
+
+ last_nested = closer - 1;
+ while(first_nested->ch == _T('D') && last_nested > opener)
+ last_nested--;
+
+ if((first_nested->flags & MD_MARK_RESOLVED) &&
+ first_nested->beg == opener->end &&
+ ISANYOF_(first_nested->ch, _T("@:.")) &&
+ first_nested->next == (last_nested - ctx->marks) &&
+ last_nested->end == closer->beg)
+ {
+ first_nested->ch = _T('D');
+ first_nested->flags &= ~MD_MARK_RESOLVED;
+ last_nested->ch = _T('D');
+ last_nested->flags &= ~MD_MARK_RESOLVED;
+ }
+ }
}
opener_index = next_index;
@@ -4237,7 +4265,7 @@ md_process_inlines(MD_CTX* ctx, const MD_LINE* lines, int n_lines)
MD_CHECK(md_enter_leave_span_a(ctx, (mark->ch != ']'),
(opener->ch == '!' ? MD_SPAN_IMG : MD_SPAN_A),
STR(dest_mark->beg), dest_mark->end - dest_mark->beg, FALSE,
- md_mark_get_ptr(ctx, title_mark - ctx->marks), title_mark->prev));
+ md_mark_get_ptr(ctx, (int)(title_mark - ctx->marks)), title_mark->prev));
/* link/image closer may span multiple lines. */
if(mark->ch == ']') {
@@ -4880,7 +4908,7 @@ md_push_block_bytes(MD_CTX* ctx, int n_bytes)
/* Fix the ->current_block after the reallocation. */
if(ctx->current_block != NULL) {
- OFF off_current_block = (char*) ctx->current_block - (char*) ctx->block_bytes;
+ OFF off_current_block = (OFF)((char*) ctx->current_block - (char*) ctx->block_bytes);
ctx->current_block = (MD_BLOCK*) ((char*) new_block_bytes + off_current_block);
}
@@ -5525,7 +5553,7 @@ md_push_container(MD_CTX* ctx, const MD_CONTAINER* container)
}
static int
-md_enter_child_containers(MD_CTX* ctx, int n_children, unsigned data)
+md_enter_child_containers(MD_CTX* ctx, int n_children)
{
int i;
int ret = 0;
@@ -5550,7 +5578,7 @@ md_enter_child_containers(MD_CTX* ctx, int n_children, unsigned data)
MD_CHECK(md_push_container_bytes(ctx,
(is_ordered_list ? MD_BLOCK_OL : MD_BLOCK_UL),
- c->start, data, MD_BLOCK_CONTAINER_OPENER));
+ c->start, c->ch, MD_BLOCK_CONTAINER_OPENER));
MD_CHECK(md_push_container_bytes(ctx, MD_BLOCK_LI,
c->task_mark_off,
(c->is_task ? CH(c->task_mark_off) : 0),
@@ -5779,25 +5807,30 @@ md_analyze_line(MD_CTX* ctx, OFF beg, OFF* p_end,
/* Check whether we are HTML block continuation. */
if(pivot_line->type == MD_LINE_HTML && ctx->html_block_type > 0) {
- int html_block_type;
+ if(n_parents < ctx->n_containers) {
+ /* HTML block is implicitly ended if the enclosing container
+ * block ends. */
+ ctx->html_block_type = 0;
+ } else {
+ int html_block_type;
- html_block_type = md_is_html_block_end_condition(ctx, off, &off);
- if(html_block_type > 0) {
- MD_ASSERT(html_block_type == ctx->html_block_type);
+ html_block_type = md_is_html_block_end_condition(ctx, off, &off);
+ if(html_block_type > 0) {
+ MD_ASSERT(html_block_type == ctx->html_block_type);
- /* Make sure this is the last line of the block. */
- ctx->html_block_type = 0;
+ /* Make sure this is the last line of the block. */
+ ctx->html_block_type = 0;
- /* Some end conditions serve as blank lines at the same time. */
- if(html_block_type == 6 || html_block_type == 7) {
- line->type = MD_LINE_BLANK;
- line->indent = 0;
- break;
+ /* Some end conditions serve as blank lines at the same time. */
+ if(html_block_type == 6 || html_block_type == 7) {
+ line->type = MD_LINE_BLANK;
+ line->indent = 0;
+ break;
+ }
}
- }
- if(n_parents == ctx->n_containers) {
line->type = MD_LINE_HTML;
+ n_parents = ctx->n_containers;
break;
}
}
@@ -5864,7 +5897,7 @@ md_analyze_line(MD_CTX* ctx, OFF beg, OFF* p_end,
/* Check whether we are Setext underline. */
if(line->indent < ctx->code_indent_offset && pivot_line->type == MD_LINE_TEXT
- && (CH(off) == _T('=') || CH(off) == _T('-'))
+ && off < ctx->size && ISANYOF2(off, _T('='), _T('-'))
&& (n_parents == ctx->n_containers))
{
unsigned level;
@@ -5877,7 +5910,10 @@ md_analyze_line(MD_CTX* ctx, OFF beg, OFF* p_end,
}
/* Check for thematic break line. */
- if(line->indent < ctx->code_indent_offset && ISANYOF(off, _T("-_*")) && off >= hr_killer) {
+ if(line->indent < ctx->code_indent_offset
+ && off < ctx->size && off >= hr_killer
+ && ISANYOF(off, _T("-_*")))
+ {
if(md_is_hr_line(ctx, off, &off, &hr_killer)) {
line->type = MD_LINE_HR;
break;
@@ -5941,7 +5977,7 @@ md_analyze_line(MD_CTX* ctx, OFF beg, OFF* p_end,
{
/* Noop. List mark followed by a blank line cannot interrupt a paragraph. */
} else if(pivot_line->type == MD_LINE_TEXT && n_parents == ctx->n_containers &&
- (container.ch == _T('.') || container.ch == _T(')')) && container.start != 1)
+ ISANYOF2_(container.ch, _T('.'), _T(')')) && container.start != 1)
{
/* Noop. Ordered list cannot interrupt a paragraph unless the start index is 1. */
} else {
@@ -5982,7 +6018,9 @@ md_analyze_line(MD_CTX* ctx, OFF beg, OFF* p_end,
}
/* Check for ATX header. */
- if(line->indent < ctx->code_indent_offset && CH(off) == _T('#')) {
+ if(line->indent < ctx->code_indent_offset &&
+ off < ctx->size && CH(off) == _T('#'))
+ {
unsigned level;
if(md_is_atxheader_line(ctx, off, &line->beg, &off, &level)) {
@@ -5993,7 +6031,7 @@ md_analyze_line(MD_CTX* ctx, OFF beg, OFF* p_end,
}
/* Check whether we are starting code fence. */
- if(CH(off) == _T('`') || CH(off) == _T('~')) {
+ if(off < ctx->size && ISANYOF2(off, _T('`'), _T('~'))) {
if(md_is_opening_code_fence(ctx, off, &off)) {
line->type = MD_LINE_FENCEDCODE;
line->data = 1;
@@ -6002,7 +6040,8 @@ md_analyze_line(MD_CTX* ctx, OFF beg, OFF* p_end,
}
/* Check for start of raw HTML block. */
- if(CH(off) == _T('<') && !(ctx->parser.flags & MD_FLAG_NOHTMLBLOCKS))
+ if(off < ctx->size && CH(off) == _T('<')
+ && !(ctx->parser.flags & MD_FLAG_NOHTMLBLOCKS))
{
ctx->html_block_type = md_is_html_block_start_condition(ctx, off);
@@ -6023,9 +6062,9 @@ md_analyze_line(MD_CTX* ctx, OFF beg, OFF* p_end,
}
/* Check for table underline. */
- if((ctx->parser.flags & MD_FLAG_TABLES) && pivot_line->type == MD_LINE_TEXT &&
- (CH(off) == _T('|') || CH(off) == _T('-') || CH(off) == _T(':')) &&
- n_parents == ctx->n_containers)
+ if((ctx->parser.flags & MD_FLAG_TABLES) && pivot_line->type == MD_LINE_TEXT
+ && off < ctx->size && ISANYOF3(off, _T('|'), _T('-'), _T(':'))
+ && n_parents == ctx->n_containers)
{
unsigned col_count;
@@ -6157,7 +6196,7 @@ md_analyze_line(MD_CTX* ctx, OFF beg, OFF* p_end,
}
if(n_children > 0)
- MD_CHECK(md_enter_child_containers(ctx, n_children, line->data));
+ MD_CHECK(md_enter_child_containers(ctx, n_children));
abort:
return ret;
diff --git a/src/3rdparty/md4c/qt_attribution.json b/src/3rdparty/md4c/qt_attribution.json
index 8f2296e2d2..29c0666f2d 100644
--- a/src/3rdparty/md4c/qt_attribution.json
+++ b/src/3rdparty/md4c/qt_attribution.json
@@ -9,7 +9,7 @@
"License": "MIT License",
"LicenseId": "MIT",
"LicenseFile": "LICENSE.md",
- "Version": "0.4.7",
- "DownloadLocation": "https://github.com/mity/md4c/releases/tag/release-0.4.7",
+ "Version": "0.4.8",
+ "DownloadLocation": "https://github.com/mity/md4c/releases/tag/release-0.4.8",
"Copyright": "Copyright © 2016-2020 Martin Mitáš"
}
diff --git a/src/3rdparty/md5/qt_attribution.json b/src/3rdparty/md5/qt_attribution.json
index e9783f9e49..adf697e32b 100644
--- a/src/3rdparty/md5/qt_attribution.json
+++ b/src/3rdparty/md5/qt_attribution.json
@@ -2,7 +2,7 @@
"Id": "md5",
"Name": "MD5",
"QDocModule": "qtcore",
- "QtUsage": "Used in Qt Core (QCryptographicHash). Configure with -DQT_CRYPTOGRAPHICHASH_ONLY_SHA1 to avoid.",
+ "QtUsage": "Used in Qt Core (QCryptographicHash).",
"Description": "Treat as final version; no upstream known",
"Description": "MD5 message-digest algorithm.",
diff --git a/src/3rdparty/pcre2/AUTHORS b/src/3rdparty/pcre2/AUTHORS
index f001cb770e..c61b5f3aff 100644
--- a/src/3rdparty/pcre2/AUTHORS
+++ b/src/3rdparty/pcre2/AUTHORS
@@ -8,7 +8,7 @@ Email domain: gmail.com
University of Cambridge Computing Service,
Cambridge, England.
-Copyright (c) 1997-2020 University of Cambridge
+Copyright (c) 1997-2021 University of Cambridge
All rights reserved
@@ -19,7 +19,7 @@ Written by: Zoltan Herczeg
Email local part: hzmester
Emain domain: freemail.hu
-Copyright(c) 2010-2020 Zoltan Herczeg
+Copyright(c) 2010-2021 Zoltan Herczeg
All rights reserved.
@@ -30,7 +30,7 @@ Written by: Zoltan Herczeg
Email local part: hzmester
Emain domain: freemail.hu
-Copyright(c) 2009-2020 Zoltan Herczeg
+Copyright(c) 2009-2021 Zoltan Herczeg
All rights reserved.
####
diff --git a/src/3rdparty/pcre2/CMakeLists.txt b/src/3rdparty/pcre2/CMakeLists.txt
index 23b6e738cd..f44d4bbd79 100644
--- a/src/3rdparty/pcre2/CMakeLists.txt
+++ b/src/3rdparty/pcre2/CMakeLists.txt
@@ -67,10 +67,9 @@ qt_internal_extend_target(BundledPcre2 CONDITION (TEST_architecture_arch STREQUA
PCRE2_DISABLE_JIT
)
-qt_internal_extend_target(BundledPcre2 CONDITION MACOS AND (TEST_architecture_arch STREQUAL "arm64")
- DEFINES
- PCRE2_DISABLE_JIT
-)
+if (APPLE)
+ target_compile_options(BundledPcre2 PRIVATE "SHELL:-Xarch_arm64 -DPCRE2_DISABLE_JIT")
+endif()
qt_internal_extend_target(BundledPcre2 CONDITION WIN32
PUBLIC_DEFINES
diff --git a/src/3rdparty/pcre2/LICENCE b/src/3rdparty/pcre2/LICENCE
index 155d073127..18684ceaa9 100644
--- a/src/3rdparty/pcre2/LICENCE
+++ b/src/3rdparty/pcre2/LICENCE
@@ -26,7 +26,7 @@ Email domain: gmail.com
University of Cambridge Computing Service,
Cambridge, England.
-Copyright (c) 1997-2020 University of Cambridge
+Copyright (c) 1997-2021 University of Cambridge
All rights reserved.
@@ -37,7 +37,7 @@ Written by: Zoltan Herczeg
Email local part: hzmester
Email domain: freemail.hu
-Copyright(c) 2010-2020 Zoltan Herczeg
+Copyright(c) 2010-2021 Zoltan Herczeg
All rights reserved.
@@ -48,7 +48,7 @@ Written by: Zoltan Herczeg
Email local part: hzmester
Email domain: freemail.hu
-Copyright(c) 2009-2020 Zoltan Herczeg
+Copyright(c) 2009-2021 Zoltan Herczeg
All rights reserved.
diff --git a/src/3rdparty/pcre2/qt_attribution.json b/src/3rdparty/pcre2/qt_attribution.json
index e7abb56762..04bdb6cc6b 100644
--- a/src/3rdparty/pcre2/qt_attribution.json
+++ b/src/3rdparty/pcre2/qt_attribution.json
@@ -7,12 +7,12 @@
"Description": "The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5.",
"Homepage": "http://www.pcre.org/",
- "Version": "10.36",
- "DownloadLocation": "https://ftp.pcre.org/pub/pcre/pcre2-10.36.tar.bz2",
+ "Version": "10.37",
+ "DownloadLocation": "https://ftp.pcre.org/pub/pcre/pcre2-10.37.tar.bz2",
"License": "BSD 3-clause \"New\" or \"Revised\" License",
"LicenseId": "BSD-3-Clause",
"LicenseFile": "LICENCE",
- "Copyright": "Copyright (c) 1997-2020 University of Cambridge
+ "Copyright": "Copyright (c) 1997-2021 University of Cambridge
Copyright (c) 2010-2020 Zoltan Herczeg"
},
{
@@ -24,11 +24,11 @@ Copyright (c) 2010-2020 Zoltan Herczeg"
"Path": "src/sljit",
"Description": "The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5.",
"Homepage": "http://www.pcre.org/",
- "Version": "10.36",
- "DownloadLocation": "https://ftp.pcre.org/pub/pcre/pcre2-10.36.tar.bz2",
+ "Version": "10.37",
+ "DownloadLocation": "https://ftp.pcre.org/pub/pcre/pcre2-10.37.tar.bz2",
"License": "BSD 2-clause \"Simplified\" License",
"LicenseId": "BSD-2-Clause",
"LicenseFile": "LICENCE-SLJIT",
- "Copyright": "Copyright (c) 2009-2020 Zoltan Herczeg"
+ "Copyright": "Copyright (c) 2009-2021 Zoltan Herczeg"
}
]
diff --git a/src/3rdparty/pcre2/src/pcre2.h b/src/3rdparty/pcre2/src/pcre2.h
index f204ec8180..7ab6b39aeb 100644
--- a/src/3rdparty/pcre2/src/pcre2.h
+++ b/src/3rdparty/pcre2/src/pcre2.h
@@ -42,9 +42,9 @@ POSSIBILITY OF SUCH DAMAGE.
/* The current PCRE version information. */
#define PCRE2_MAJOR 10
-#define PCRE2_MINOR 36
+#define PCRE2_MINOR 37
#define PCRE2_PRERELEASE
-#define PCRE2_DATE 2020-12-04
+#define PCRE2_DATE 2021-05-26
/* When an application links to a PCRE DLL in Windows, the symbols that are
imported have to be identified as such. When building PCRE2, the appropriate
diff --git a/src/3rdparty/pcre2/src/pcre2_auto_possess.c b/src/3rdparty/pcre2/src/pcre2_auto_possess.c
index c64cf856d1..e5e0895682 100644
--- a/src/3rdparty/pcre2/src/pcre2_auto_possess.c
+++ b/src/3rdparty/pcre2/src/pcre2_auto_possess.c
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge
- New API code Copyright (c) 2016-2020 University of Cambridge
+ New API code Copyright (c) 2016-2021 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -490,6 +490,7 @@ switch(c)
list[2] = (uint32_t)(end - code);
return end;
}
+
return NULL; /* Opcode not accepted */
}
@@ -1186,12 +1187,16 @@ for (;;)
c = *repeat_opcode;
if (c >= OP_CRSTAR && c <= OP_CRMINRANGE)
{
- /* end must not be NULL. */
- end = get_chr_property_list(code, utf, ucp, cb->fcc, list);
+ /* The return from get_chr_property_list() will never be NULL when
+ *code (aka c) is one of the three class opcodes. However, gcc with
+ -fanalyzer notes that a NULL return is possible, and grumbles. Hence we
+ put in a check. */
+ end = get_chr_property_list(code, utf, ucp, cb->fcc, list);
list[1] = (c & 1) == 0;
- if (compare_opcodes(end, utf, ucp, cb, list, end, &rec_limit))
+ if (end != NULL &&
+ compare_opcodes(end, utf, ucp, cb, list, end, &rec_limit))
{
switch (c)
{
diff --git a/src/3rdparty/pcre2/src/pcre2_compile.c b/src/3rdparty/pcre2/src/pcre2_compile.c
index e811f12f02..da449ae9ed 100644
--- a/src/3rdparty/pcre2/src/pcre2_compile.c
+++ b/src/3rdparty/pcre2/src/pcre2_compile.c
@@ -1398,32 +1398,47 @@ static BOOL
read_repeat_counts(PCRE2_SPTR *ptrptr, PCRE2_SPTR ptrend, uint32_t *minp,
uint32_t *maxp, int *errorcodeptr)
{
-PCRE2_SPTR p = *ptrptr;
+PCRE2_SPTR p;
BOOL yield = FALSE;
+BOOL had_comma = FALSE;
int32_t min = 0;
int32_t max = REPEAT_UNLIMITED; /* This value is larger than MAX_REPEAT_COUNT */
-/* NB read_number() initializes the error code to zero. The only error is for a
-number that is too big. */
+/* Check the syntax */
+*errorcodeptr = 0;
+for (p = *ptrptr;; p++)
+ {
+ uint32_t c;
+ if (p >= ptrend) return FALSE;
+ c = *p;
+ if (IS_DIGIT(c)) continue;
+ if (c == CHAR_RIGHT_CURLY_BRACKET) break;
+ if (c == CHAR_COMMA)
+ {
+ if (had_comma) return FALSE;
+ had_comma = TRUE;
+ }
+ else return FALSE;
+ }
+
+/* The only error from read_number() is for a number that is too big. */
+
+p = *ptrptr;
if (!read_number(&p, ptrend, -1, MAX_REPEAT_COUNT, ERR5, &min, errorcodeptr))
goto EXIT;
-if (p >= ptrend) goto EXIT;
-
if (*p == CHAR_RIGHT_CURLY_BRACKET)
{
p++;
max = min;
}
-
else
{
- if (*p++ != CHAR_COMMA || p >= ptrend) goto EXIT;
- if (*p != CHAR_RIGHT_CURLY_BRACKET)
+ if (*(++p) != CHAR_RIGHT_CURLY_BRACKET)
{
if (!read_number(&p, ptrend, -1, MAX_REPEAT_COUNT, ERR5, &max,
- errorcodeptr) || p >= ptrend || *p != CHAR_RIGHT_CURLY_BRACKET)
+ errorcodeptr))
goto EXIT;
if (max < min)
{
@@ -1438,11 +1453,10 @@ yield = TRUE;
if (minp != NULL) *minp = (uint32_t)min;
if (maxp != NULL) *maxp = (uint32_t)max;
-/* Update the pattern pointer on success, or after an error, but not when
-the result is "not a repeat quantifier". */
+/* Update the pattern pointer */
EXIT:
-if (yield || *errorcodeptr != 0) *ptrptr = p;
+*ptrptr = p;
return yield;
}
@@ -1776,19 +1790,23 @@ else
{
oldptr = ptr;
ptr--; /* Back to the digit */
- if (!read_number(&ptr, ptrend, -1, INT_MAX/10 - 1, ERR61, &s,
- errorcodeptr))
- break;
- /* \1 to \9 are always back references. \8x and \9x are too; \1x to \7x
+ /* As we know we are at a digit, the only possible error from
+ read_number() is a number that is too large to be a group number. In this
+ case we fall through handle this as not a group reference. If we have
+ read a small enough number, check for a back reference.
+
+ \1 to \9 are always back references. \8x and \9x are too; \1x to \7x
are octal escapes if there are not that many previous captures. */
- if (s < 10 || oldptr[-1] >= CHAR_8 || s <= (int)cb->bracount)
+ if (read_number(&ptr, ptrend, -1, INT_MAX/10 - 1, 0, &s, errorcodeptr) &&
+ (s < 10 || oldptr[-1] >= CHAR_8 || s <= (int)cb->bracount))
{
if (s > (int)MAX_GROUP_NUMBER) *errorcodeptr = ERR61;
else escape = -s; /* Indicates a back reference */
break;
}
+
ptr = oldptr; /* Put the pointer back and fall through */
}
diff --git a/src/3rdparty/pcre2/src/pcre2_jit_compile.c b/src/3rdparty/pcre2/src/pcre2_jit_compile.c
index 1977d28aa5..f3a26aeee0 100644
--- a/src/3rdparty/pcre2/src/pcre2_jit_compile.c
+++ b/src/3rdparty/pcre2/src/pcre2_jit_compile.c
@@ -1226,7 +1226,7 @@ while (cc < ccend)
return TRUE;
}
-#define EARLY_FAIL_ENHANCE_MAX (1 + 1)
+#define EARLY_FAIL_ENHANCE_MAX (1 + 3)
/*
start:
@@ -1238,6 +1238,7 @@ return: current number of iterators enhanced with fast fail
*/
static int detect_early_fail(compiler_common *common, PCRE2_SPTR cc, int *private_data_start, sljit_s32 depth, int start)
{
+PCRE2_SPTR begin = cc;
PCRE2_SPTR next_alt;
PCRE2_SPTR end;
PCRE2_SPTR accelerated_start;
@@ -1475,31 +1476,19 @@ do
case OP_CBRA:
end = cc + GET(cc, 1);
- if (*end == OP_KET && PRIVATE_DATA(end) == 0)
- {
- if (*cc == OP_CBRA)
- {
- if (common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] == 0)
- break;
- cc += IMM2_SIZE;
- }
-
- cc += 1 + LINK_SIZE;
- continue;
- }
-
fast_forward_allowed = FALSE;
if (depth >= 4)
break;
end = bracketend(cc) - (1 + LINK_SIZE);
- if (*end != OP_KET || PRIVATE_DATA(end) != 0)
- break;
-
- if (*cc == OP_CBRA && common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] == 0)
+ if (*end != OP_KET || (*cc == OP_CBRA && common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] == 0))
break;
count = detect_early_fail(common, cc, private_data_start, depth + 1, count);
+
+ if (PRIVATE_DATA(cc) != 0)
+ common->private_data_ptrs[begin - common->start] = 1;
+
if (count < EARLY_FAIL_ENHANCE_MAX)
{
cc = end + (1 + LINK_SIZE);
@@ -1555,6 +1544,8 @@ do
return EARLY_FAIL_ENHANCE_MAX;
}
+ /* Cannot be part of a repeat. */
+ common->private_data_ptrs[begin - common->start] = 1;
count++;
if (count < EARLY_FAIL_ENHANCE_MAX)
@@ -1620,11 +1611,12 @@ sljit_sw length = end - begin;
sljit_s32 min, max, i;
/* Detect fixed iterations first. */
-if (end[-(1 + LINK_SIZE)] != OP_KET)
+if (end[-(1 + LINK_SIZE)] != OP_KET || PRIVATE_DATA(begin) != 0)
return FALSE;
-/* Already detected repeat. */
-if (common->private_data_ptrs[end - common->start - LINK_SIZE] != 0)
+/* /(?:AB){4,6}/ is currently converted to /(?:AB){3}(?AB){1,3}/
+ * Skip the check of the second part. */
+if (PRIVATE_DATA(end - LINK_SIZE) == 0)
return TRUE;
next = end;
@@ -1763,6 +1755,7 @@ while (cc < ccend)
if (private_data_ptr > SLJIT_MAX_LOCAL_SIZE)
break;
+ /* When the bracket is prefixed by a zero iteration, skip the repeat check (at this point). */
if (repeat_check && (*cc == OP_ONCE || *cc == OP_BRA || *cc == OP_CBRA || *cc == OP_COND))
{
if (detect_repeat(common, cc))
@@ -1813,6 +1806,7 @@ while (cc < ccend)
case OP_COND:
/* Might be a hidden SCOND. */
+ common->private_data_ptrs[cc - common->start] = 0;
alternative = cc + GET(cc, 1);
if (*alternative == OP_KETRMAX || *alternative == OP_KETRMIN)
{
@@ -13661,10 +13655,12 @@ if (!common->private_data_ptrs)
memset(common->private_data_ptrs, 0, total_length * sizeof(sljit_s32));
private_data_size = common->cbra_ptr + (re->top_bracket + 1) * sizeof(sljit_sw);
-set_private_data_ptrs(common, &private_data_size, ccend);
+
if ((re->overall_options & PCRE2_ANCHORED) == 0 && (re->overall_options & PCRE2_NO_START_OPTIMIZE) == 0 && !common->has_skip_in_assert_back)
detect_early_fail(common, common->start, &private_data_size, 0, 0);
+set_private_data_ptrs(common, &private_data_size, ccend);
+
SLJIT_ASSERT(common->early_fail_start_ptr <= common->early_fail_end_ptr);
if (private_data_size > SLJIT_MAX_LOCAL_SIZE)
diff --git a/src/3rdparty/pcre2/src/pcre2_jit_simd_inc.h b/src/3rdparty/pcre2/src/pcre2_jit_simd_inc.h
index 5673d338c0..5fd97b15bd 100644
--- a/src/3rdparty/pcre2/src/pcre2_jit_simd_inc.h
+++ b/src/3rdparty/pcre2/src/pcre2_jit_simd_inc.h
@@ -39,7 +39,29 @@ POSSIBILITY OF SUCH DAMAGE.
-----------------------------------------------------------------------------
*/
-#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86) && !(defined SUPPORT_VALGRIND)
+#if !(defined SUPPORT_VALGRIND)
+
+#if ((defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86) \
+ || (defined SLJIT_CONFIG_S390X && SLJIT_CONFIG_S390X))
+
+typedef enum {
+ vector_compare_match1,
+ vector_compare_match1i,
+ vector_compare_match2,
+} vector_compare_type;
+
+static SLJIT_INLINE sljit_u32 max_fast_forward_char_pair_offset(void)
+{
+#if PCRE2_CODE_UNIT_WIDTH == 8
+return 15;
+#elif PCRE2_CODE_UNIT_WIDTH == 16
+return 7;
+#elif PCRE2_CODE_UNIT_WIDTH == 32
+return 3;
+#else
+#error "Unsupported unit width"
+#endif
+}
#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
static struct sljit_jump *jump_if_utf_char_start(struct sljit_compiler *compiler, sljit_s32 reg)
@@ -56,6 +78,10 @@ return CMP(SLJIT_NOT_EQUAL, reg, 0, SLJIT_IMM, 0xdc00);
}
#endif
+#endif /* SLJIT_CONFIG_X86 || SLJIT_CONFIG_S390X */
+
+#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86)
+
static sljit_s32 character_to_int32(PCRE2_UCHAR chr)
{
sljit_u32 value = chr;
@@ -97,13 +123,7 @@ instruction[4] = (sljit_u8)offset;
sljit_emit_op_custom(compiler, instruction, 5);
}
-typedef enum {
- sse2_compare_match1,
- sse2_compare_match1i,
- sse2_compare_match2,
-} sse2_compare_type;
-
-static void fast_forward_char_pair_sse2_compare(struct sljit_compiler *compiler, sse2_compare_type compare_type,
+static void fast_forward_char_pair_sse2_compare(struct sljit_compiler *compiler, vector_compare_type compare_type,
int step, sljit_s32 dst_ind, sljit_s32 cmp1_ind, sljit_s32 cmp2_ind, sljit_s32 tmp_ind)
{
sljit_u8 instruction[4];
@@ -112,11 +132,11 @@ instruction[1] = 0x0f;
SLJIT_ASSERT(step >= 0 && step <= 3);
-if (compare_type != sse2_compare_match2)
+if (compare_type != vector_compare_match2)
{
if (step == 0)
{
- if (compare_type == sse2_compare_match1i)
+ if (compare_type == vector_compare_match1i)
{
/* POR xmm1, xmm2/m128 */
/* instruction[0] = 0x66; */
@@ -185,14 +205,14 @@ switch (step)
static void fast_forward_char_simd(compiler_common *common, PCRE2_UCHAR char1, PCRE2_UCHAR char2, sljit_s32 offset)
{
DEFINE_COMPILER;
+sljit_u8 instruction[8];
struct sljit_label *start;
#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
struct sljit_label *restart;
#endif
struct sljit_jump *quit;
struct sljit_jump *partial_quit[2];
-sse2_compare_type compare_type = sse2_compare_match1;
-sljit_u8 instruction[8];
+vector_compare_type compare_type = vector_compare_match1;
sljit_s32 tmp1_reg_ind = sljit_get_register_index(TMP1);
sljit_s32 str_ptr_reg_ind = sljit_get_register_index(STR_PTR);
sljit_s32 data_ind = 0;
@@ -207,12 +227,12 @@ SLJIT_UNUSED_ARG(offset);
if (char1 != char2)
{
bit = char1 ^ char2;
- compare_type = sse2_compare_match1i;
+ compare_type = vector_compare_match1i;
if (!is_powerof2(bit))
{
bit = 0;
- compare_type = sse2_compare_match2;
+ compare_type = vector_compare_match2;
}
}
@@ -349,11 +369,11 @@ if (common->utf && offset > 0)
static jump_list *fast_requested_char_simd(compiler_common *common, PCRE2_UCHAR char1, PCRE2_UCHAR char2)
{
DEFINE_COMPILER;
+sljit_u8 instruction[8];
struct sljit_label *start;
struct sljit_jump *quit;
jump_list *not_found = NULL;
-sse2_compare_type compare_type = sse2_compare_match1;
-sljit_u8 instruction[8];
+vector_compare_type compare_type = vector_compare_match1;
sljit_s32 tmp1_reg_ind = sljit_get_register_index(TMP1);
sljit_s32 str_ptr_reg_ind = sljit_get_register_index(STR_PTR);
sljit_s32 data_ind = 0;
@@ -366,12 +386,12 @@ int i;
if (char1 != char2)
{
bit = char1 ^ char2;
- compare_type = sse2_compare_match1i;
+ compare_type = vector_compare_match1i;
if (!is_powerof2(bit))
{
bit = 0;
- compare_type = sse2_compare_match2;
+ compare_type = vector_compare_match2;
}
}
@@ -476,27 +496,15 @@ return not_found;
#ifndef _WIN64
-static SLJIT_INLINE sljit_u32 max_fast_forward_char_pair_offset(void)
-{
-#if PCRE2_CODE_UNIT_WIDTH == 8
-return 15;
-#elif PCRE2_CODE_UNIT_WIDTH == 16
-return 7;
-#elif PCRE2_CODE_UNIT_WIDTH == 32
-return 3;
-#else
-#error "Unsupported unit width"
-#endif
-}
-
#define JIT_HAS_FAST_FORWARD_CHAR_PAIR_SIMD (sljit_has_cpu_feature(SLJIT_HAS_SSE2))
static void fast_forward_char_pair_simd(compiler_common *common, sljit_s32 offs1,
PCRE2_UCHAR char1a, PCRE2_UCHAR char1b, sljit_s32 offs2, PCRE2_UCHAR char2a, PCRE2_UCHAR char2b)
{
DEFINE_COMPILER;
-sse2_compare_type compare1_type = sse2_compare_match1;
-sse2_compare_type compare2_type = sse2_compare_match1;
+sljit_u8 instruction[8];
+vector_compare_type compare1_type = vector_compare_match1;
+vector_compare_type compare2_type = vector_compare_match1;
sljit_u32 bit1 = 0;
sljit_u32 bit2 = 0;
sljit_u32 diff = IN_UCHARS(offs1 - offs2);
@@ -516,7 +524,6 @@ struct sljit_label *start;
struct sljit_label *restart;
#endif
struct sljit_jump *jump[2];
-sljit_u8 instruction[8];
int i;
SLJIT_ASSERT(common->mode == PCRE2_JIT_COMPLETE && offs1 > offs2);
@@ -549,13 +556,13 @@ else
bit1 = char1a ^ char1b;
if (is_powerof2(bit1))
{
- compare1_type = sse2_compare_match1i;
+ compare1_type = vector_compare_match1i;
OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char1a | bit1));
OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, character_to_int32(bit1));
}
else
{
- compare1_type = sse2_compare_match2;
+ compare1_type = vector_compare_match2;
bit1 = 0;
OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char1a));
OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, character_to_int32(char1b));
@@ -578,13 +585,13 @@ else
bit2 = char2a ^ char2b;
if (is_powerof2(bit2))
{
- compare2_type = sse2_compare_match1i;
+ compare2_type = vector_compare_match1i;
OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char2a | bit2));
OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, character_to_int32(bit2));
}
else
{
- compare2_type = sse2_compare_match2;
+ compare2_type = vector_compare_match2;
bit2 = 0;
OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char2a));
OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, character_to_int32(char2b));
@@ -731,9 +738,6 @@ OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0));
-if (common->match_end_ptr != 0)
- OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr);
-
#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
if (common->utf)
{
@@ -760,7 +764,7 @@ if (common->match_end_ptr != 0)
#undef SSE2_COMPARE_TYPE_INDEX
-#endif /* SLJIT_CONFIG_X86 && !SUPPORT_VALGRIND */
+#endif /* SLJIT_CONFIG_X86 */
#if (defined SLJIT_CONFIG_ARM_64 && SLJIT_CONFIG_ARM_64 && (defined __ARM_NEON || defined __ARM_NEON__))
@@ -1121,3 +1125,743 @@ JUMPHERE(partial_quit);
}
#endif /* SLJIT_CONFIG_ARM_64 && SLJIT_CONFIG_ARM_64 */
+
+#if (defined SLJIT_CONFIG_S390X && SLJIT_CONFIG_S390X)
+
+#if PCRE2_CODE_UNIT_WIDTH == 8
+#define VECTOR_ELEMENT_SIZE 0
+#elif PCRE2_CODE_UNIT_WIDTH == 16
+#define VECTOR_ELEMENT_SIZE 1
+#elif PCRE2_CODE_UNIT_WIDTH == 32
+#define VECTOR_ELEMENT_SIZE 2
+#else
+#error "Unsupported unit width"
+#endif
+
+static void load_from_mem_vector(struct sljit_compiler *compiler, BOOL vlbb, sljit_s32 dst_vreg,
+ sljit_s32 base_reg, sljit_s32 index_reg)
+{
+sljit_u16 instruction[3];
+
+instruction[0] = (sljit_u16)(0xe700 | (dst_vreg << 4) | index_reg);
+instruction[1] = (sljit_u16)(base_reg << 12);
+instruction[2] = (sljit_u16)((0x8 << 8) | (vlbb ? 0x07 : 0x06));
+
+sljit_emit_op_custom(compiler, instruction, 6);
+}
+
+#if PCRE2_CODE_UNIT_WIDTH == 32
+
+static void replicate_imm_vector(struct sljit_compiler *compiler, int step, sljit_s32 dst_vreg,
+ PCRE2_UCHAR chr, sljit_s32 tmp_general_reg)
+{
+sljit_u16 instruction[3];
+
+SLJIT_ASSERT(step >= 0 && step <= 1);
+
+if (chr < 0x7fff)
+ {
+ if (step == 1)
+ return;
+
+ /* VREPI */
+ instruction[0] = (sljit_u16)(0xe700 | (dst_vreg << 4));
+ instruction[1] = (sljit_u16)chr;
+ instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0x8 << 8) | 0x45);
+ sljit_emit_op_custom(compiler, instruction, 6);
+ return;
+ }
+
+if (step == 0)
+ {
+ OP1(SLJIT_MOV, tmp_general_reg, 0, SLJIT_IMM, chr);
+
+ /* VLVG */
+ instruction[0] = (sljit_u16)(0xe700 | (dst_vreg << 4) | sljit_get_register_index(tmp_general_reg));
+ instruction[1] = 0;
+ instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0x8 << 8) | 0x22);
+ sljit_emit_op_custom(compiler, instruction, 6);
+ return;
+ }
+
+/* VREP */
+instruction[0] = (sljit_u16)(0xe700 | (dst_vreg << 4) | dst_vreg);
+instruction[1] = 0;
+instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0xc << 8) | 0x4d);
+sljit_emit_op_custom(compiler, instruction, 6);
+}
+
+#endif
+
+static void fast_forward_char_pair_sse2_compare(struct sljit_compiler *compiler, vector_compare_type compare_type,
+ int step, sljit_s32 dst_ind, sljit_s32 cmp1_ind, sljit_s32 cmp2_ind, sljit_s32 tmp_ind)
+{
+sljit_u16 instruction[3];
+
+SLJIT_ASSERT(step >= 0 && step <= 2);
+
+if (step == 1)
+ {
+ /* VCEQ */
+ instruction[0] = (sljit_u16)(0xe700 | (dst_ind << 4) | dst_ind);
+ instruction[1] = (sljit_u16)(cmp1_ind << 12);
+ instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0xe << 8) | 0xf8);
+ sljit_emit_op_custom(compiler, instruction, 6);
+ return;
+ }
+
+if (compare_type != vector_compare_match2)
+ {
+ if (step == 0 && compare_type == vector_compare_match1i)
+ {
+ /* VO */
+ instruction[0] = (sljit_u16)(0xe700 | (dst_ind << 4) | dst_ind);
+ instruction[1] = (sljit_u16)(cmp2_ind << 12);
+ instruction[2] = (sljit_u16)((0xe << 8) | 0x6a);
+ sljit_emit_op_custom(compiler, instruction, 6);
+ }
+ return;
+ }
+
+switch (step)
+ {
+ case 0:
+ /* VCEQ */
+ instruction[0] = (sljit_u16)(0xe700 | (tmp_ind << 4) | dst_ind);
+ instruction[1] = (sljit_u16)(cmp2_ind << 12);
+ instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0xe << 8) | 0xf8);
+ sljit_emit_op_custom(compiler, instruction, 6);
+ return;
+
+ case 2:
+ /* VO */
+ instruction[0] = (sljit_u16)(0xe700 | (dst_ind << 4) | dst_ind);
+ instruction[1] = (sljit_u16)(tmp_ind << 12);
+ instruction[2] = (sljit_u16)((0xe << 8) | 0x6a);
+ sljit_emit_op_custom(compiler, instruction, 6);
+ return;
+ }
+}
+
+#define JIT_HAS_FAST_FORWARD_CHAR_SIMD 1
+
+static void fast_forward_char_simd(compiler_common *common, PCRE2_UCHAR char1, PCRE2_UCHAR char2, sljit_s32 offset)
+{
+DEFINE_COMPILER;
+sljit_u16 instruction[3];
+struct sljit_label *start;
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+struct sljit_label *restart;
+#endif
+struct sljit_jump *quit;
+struct sljit_jump *partial_quit[2];
+vector_compare_type compare_type = vector_compare_match1;
+sljit_s32 tmp1_reg_ind = sljit_get_register_index(TMP1);
+sljit_s32 str_ptr_reg_ind = sljit_get_register_index(STR_PTR);
+sljit_s32 data_ind = 0;
+sljit_s32 tmp_ind = 1;
+sljit_s32 cmp1_ind = 2;
+sljit_s32 cmp2_ind = 3;
+sljit_s32 zero_ind = 4;
+sljit_u32 bit = 0;
+int i;
+
+SLJIT_UNUSED_ARG(offset);
+
+if (char1 != char2)
+ {
+ bit = char1 ^ char2;
+ compare_type = vector_compare_match1i;
+
+ if (!is_powerof2(bit))
+ {
+ bit = 0;
+ compare_type = vector_compare_match2;
+ }
+ }
+
+partial_quit[0] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
+if (common->mode == PCRE2_JIT_COMPLETE)
+ add_jump(compiler, &common->failed_match, partial_quit[0]);
+
+/* First part (unaligned start) */
+
+OP2(SLJIT_ADD, TMP2, 0, STR_PTR, 0, SLJIT_IMM, 16);
+
+#if PCRE2_CODE_UNIT_WIDTH != 32
+
+/* VREPI */
+instruction[0] = (sljit_u16)(0xe700 | (cmp1_ind << 4));
+instruction[1] = (sljit_u16)(char1 | bit);
+instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0x8 << 8) | 0x45);
+sljit_emit_op_custom(compiler, instruction, 6);
+
+if (char1 != char2)
+ {
+ /* VREPI */
+ instruction[0] = (sljit_u16)(0xe700 | (cmp2_ind << 4));
+ instruction[1] = (sljit_u16)(bit != 0 ? bit : char2);
+ /* instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0x8 << 8) | 0x45); */
+ sljit_emit_op_custom(compiler, instruction, 6);
+ }
+
+#else /* PCRE2_CODE_UNIT_WIDTH == 32 */
+
+for (int i = 0; i < 2; i++)
+ {
+ replicate_imm_vector(compiler, i, cmp1_ind, char1 | bit, TMP1);
+
+ if (char1 != char2)
+ replicate_imm_vector(compiler, i, cmp2_ind, bit != 0 ? bit : char2, TMP1);
+ }
+
+#endif /* PCRE2_CODE_UNIT_WIDTH != 32 */
+
+if (compare_type == vector_compare_match2)
+ {
+ /* VREPI */
+ instruction[0] = (sljit_u16)(0xe700 | (zero_ind << 4));
+ instruction[1] = 0;
+ instruction[2] = (sljit_u16)((0x8 << 8) | 0x45);
+ sljit_emit_op_custom(compiler, instruction, 6);
+ }
+
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+restart = LABEL();
+#endif
+
+load_from_mem_vector(compiler, TRUE, data_ind, str_ptr_reg_ind, 0);
+OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, ~15);
+
+if (compare_type != vector_compare_match2)
+ {
+ if (compare_type == vector_compare_match1i)
+ fast_forward_char_pair_sse2_compare(compiler, compare_type, 0, data_ind, cmp1_ind, cmp2_ind, tmp_ind);
+
+ /* VFEE */
+ instruction[0] = (sljit_u16)(0xe700 | (data_ind << 4) | data_ind);
+ instruction[1] = (sljit_u16)((cmp1_ind << 12) | (1 << 4));
+ instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0xe << 8) | 0x80);
+ sljit_emit_op_custom(compiler, instruction, 6);
+ }
+else
+ {
+ for (i = 0; i < 3; i++)
+ fast_forward_char_pair_sse2_compare(compiler, compare_type, i, data_ind, cmp1_ind, cmp2_ind, tmp_ind);
+
+ /* VFENE */
+ instruction[0] = (sljit_u16)(0xe700 | (data_ind << 4) | data_ind);
+ instruction[1] = (sljit_u16)((zero_ind << 12) | (1 << 4));
+ instruction[2] = (sljit_u16)((0xe << 8) | 0x81);
+ sljit_emit_op_custom(compiler, instruction, 6);
+ }
+
+/* TODO: use sljit_set_current_flags */
+
+/* VLGVB */
+instruction[0] = (sljit_u16)(0xe700 | (tmp1_reg_ind << 4) | data_ind);
+instruction[1] = 7;
+instruction[2] = (sljit_u16)((0x4 << 8) | 0x21);
+sljit_emit_op_custom(compiler, instruction, 6);
+
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
+quit = CMP(SLJIT_LESS, STR_PTR, 0, TMP2, 0);
+
+OP2(SLJIT_SUB, STR_PTR, 0, TMP2, 0, SLJIT_IMM, 16);
+
+/* Second part (aligned) */
+start = LABEL();
+
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, 16);
+
+partial_quit[1] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
+if (common->mode == PCRE2_JIT_COMPLETE)
+ add_jump(compiler, &common->failed_match, partial_quit[1]);
+
+load_from_mem_vector(compiler, TRUE, data_ind, str_ptr_reg_ind, 0);
+
+if (compare_type != vector_compare_match2)
+ {
+ if (compare_type == vector_compare_match1i)
+ fast_forward_char_pair_sse2_compare(compiler, compare_type, 0, data_ind, cmp1_ind, cmp2_ind, tmp_ind);
+
+ /* VFEE */
+ instruction[0] = (sljit_u16)(0xe700 | (data_ind << 4) | data_ind);
+ instruction[1] = (sljit_u16)((cmp1_ind << 12) | (1 << 4));
+ instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0xe << 8) | 0x80);
+ sljit_emit_op_custom(compiler, instruction, 6);
+ }
+else
+ {
+ for (i = 0; i < 3; i++)
+ fast_forward_char_pair_sse2_compare(compiler, compare_type, i, data_ind, cmp1_ind, cmp2_ind, tmp_ind);
+
+ /* VFENE */
+ instruction[0] = (sljit_u16)(0xe700 | (data_ind << 4) | data_ind);
+ instruction[1] = (sljit_u16)((zero_ind << 12) | (1 << 4));
+ instruction[2] = (sljit_u16)((0xe << 8) | 0x81);
+ sljit_emit_op_custom(compiler, instruction, 6);
+ }
+
+/* TODO: use sljit_set_current_flags */
+
+/* VLGVB */
+instruction[0] = (sljit_u16)(0xe700 | (tmp1_reg_ind << 4) | data_ind);
+instruction[1] = 7;
+instruction[2] = (sljit_u16)((0x4 << 8) | 0x21);
+sljit_emit_op_custom(compiler, instruction, 6);
+
+CMPTO(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 16, start);
+
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
+
+JUMPHERE(quit);
+
+if (common->mode != PCRE2_JIT_COMPLETE)
+ {
+ JUMPHERE(partial_quit[0]);
+ JUMPHERE(partial_quit[1]);
+ OP2(SLJIT_SUB | SLJIT_SET_GREATER, SLJIT_UNUSED, 0, STR_PTR, 0, STR_END, 0);
+ CMOV(SLJIT_GREATER, STR_PTR, STR_END, 0);
+ }
+else
+ add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0));
+
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+if (common->utf && offset > 0)
+ {
+ SLJIT_ASSERT(common->mode == PCRE2_JIT_COMPLETE);
+
+ OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-offset));
+
+ quit = jump_if_utf_char_start(compiler, TMP1);
+
+ OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+ add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0));
+
+ OP2(SLJIT_ADD, TMP2, 0, STR_PTR, 0, SLJIT_IMM, 16);
+ JUMPTO(SLJIT_JUMP, restart);
+
+ JUMPHERE(quit);
+ }
+#endif
+}
+
+#define JIT_HAS_FAST_REQUESTED_CHAR_SIMD 1
+
+static jump_list *fast_requested_char_simd(compiler_common *common, PCRE2_UCHAR char1, PCRE2_UCHAR char2)
+{
+DEFINE_COMPILER;
+sljit_u16 instruction[3];
+struct sljit_label *start;
+struct sljit_jump *quit;
+jump_list *not_found = NULL;
+vector_compare_type compare_type = vector_compare_match1;
+sljit_s32 tmp1_reg_ind = sljit_get_register_index(TMP1);
+sljit_s32 tmp3_reg_ind = sljit_get_register_index(TMP3);
+sljit_s32 data_ind = 0;
+sljit_s32 tmp_ind = 1;
+sljit_s32 cmp1_ind = 2;
+sljit_s32 cmp2_ind = 3;
+sljit_s32 zero_ind = 4;
+sljit_u32 bit = 0;
+int i;
+
+if (char1 != char2)
+ {
+ bit = char1 ^ char2;
+ compare_type = vector_compare_match1i;
+
+ if (!is_powerof2(bit))
+ {
+ bit = 0;
+ compare_type = vector_compare_match2;
+ }
+ }
+
+add_jump(compiler, &not_found, CMP(SLJIT_GREATER_EQUAL, TMP1, 0, STR_END, 0));
+
+/* First part (unaligned start) */
+
+OP2(SLJIT_ADD, TMP2, 0, TMP1, 0, SLJIT_IMM, 16);
+
+#if PCRE2_CODE_UNIT_WIDTH != 32
+
+/* VREPI */
+instruction[0] = (sljit_u16)(0xe700 | (cmp1_ind << 4));
+instruction[1] = (sljit_u16)(char1 | bit);
+instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0x8 << 8) | 0x45);
+sljit_emit_op_custom(compiler, instruction, 6);
+
+if (char1 != char2)
+ {
+ /* VREPI */
+ instruction[0] = (sljit_u16)(0xe700 | (cmp2_ind << 4));
+ instruction[1] = (sljit_u16)(bit != 0 ? bit : char2);
+ /* instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0x8 << 8) | 0x45); */
+ sljit_emit_op_custom(compiler, instruction, 6);
+ }
+
+#else /* PCRE2_CODE_UNIT_WIDTH == 32 */
+
+for (int i = 0; i < 2; i++)
+ {
+ replicate_imm_vector(compiler, i, cmp1_ind, char1 | bit, TMP3);
+
+ if (char1 != char2)
+ replicate_imm_vector(compiler, i, cmp2_ind, bit != 0 ? bit : char2, TMP3);
+ }
+
+#endif /* PCRE2_CODE_UNIT_WIDTH != 32 */
+
+if (compare_type == vector_compare_match2)
+ {
+ /* VREPI */
+ instruction[0] = (sljit_u16)(0xe700 | (zero_ind << 4));
+ instruction[1] = 0;
+ instruction[2] = (sljit_u16)((0x8 << 8) | 0x45);
+ sljit_emit_op_custom(compiler, instruction, 6);
+ }
+
+load_from_mem_vector(compiler, TRUE, data_ind, tmp1_reg_ind, 0);
+OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, ~15);
+
+if (compare_type != vector_compare_match2)
+ {
+ if (compare_type == vector_compare_match1i)
+ fast_forward_char_pair_sse2_compare(compiler, compare_type, 0, data_ind, cmp1_ind, cmp2_ind, tmp_ind);
+
+ /* VFEE */
+ instruction[0] = (sljit_u16)(0xe700 | (data_ind << 4) | data_ind);
+ instruction[1] = (sljit_u16)((cmp1_ind << 12) | (1 << 4));
+ instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0xe << 8) | 0x80);
+ sljit_emit_op_custom(compiler, instruction, 6);
+ }
+else
+ {
+ for (i = 0; i < 3; i++)
+ fast_forward_char_pair_sse2_compare(compiler, compare_type, i, data_ind, cmp1_ind, cmp2_ind, tmp_ind);
+
+ /* VFENE */
+ instruction[0] = (sljit_u16)(0xe700 | (data_ind << 4) | data_ind);
+ instruction[1] = (sljit_u16)((zero_ind << 12) | (1 << 4));
+ instruction[2] = (sljit_u16)((0xe << 8) | 0x81);
+ sljit_emit_op_custom(compiler, instruction, 6);
+ }
+
+/* TODO: use sljit_set_current_flags */
+
+/* VLGVB */
+instruction[0] = (sljit_u16)(0xe700 | (tmp3_reg_ind << 4) | data_ind);
+instruction[1] = 7;
+instruction[2] = (sljit_u16)((0x4 << 8) | 0x21);
+sljit_emit_op_custom(compiler, instruction, 6);
+
+OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP3, 0);
+quit = CMP(SLJIT_LESS, TMP1, 0, TMP2, 0);
+
+OP2(SLJIT_SUB, TMP1, 0, TMP2, 0, SLJIT_IMM, 16);
+
+/* Second part (aligned) */
+start = LABEL();
+
+OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, 16);
+
+add_jump(compiler, &not_found, CMP(SLJIT_GREATER_EQUAL, TMP1, 0, STR_END, 0));
+
+load_from_mem_vector(compiler, TRUE, data_ind, tmp1_reg_ind, 0);
+
+if (compare_type != vector_compare_match2)
+ {
+ if (compare_type == vector_compare_match1i)
+ fast_forward_char_pair_sse2_compare(compiler, compare_type, 0, data_ind, cmp1_ind, cmp2_ind, tmp_ind);
+
+ /* VFEE */
+ instruction[0] = (sljit_u16)(0xe700 | (data_ind << 4) | data_ind);
+ instruction[1] = (sljit_u16)((cmp1_ind << 12) | (1 << 4));
+ instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0xe << 8) | 0x80);
+ sljit_emit_op_custom(compiler, instruction, 6);
+ }
+else
+ {
+ for (i = 0; i < 3; i++)
+ fast_forward_char_pair_sse2_compare(compiler, compare_type, i, data_ind, cmp1_ind, cmp2_ind, tmp_ind);
+
+ /* VFENE */
+ instruction[0] = (sljit_u16)(0xe700 | (data_ind << 4) | data_ind);
+ instruction[1] = (sljit_u16)((zero_ind << 12) | (1 << 4));
+ instruction[2] = (sljit_u16)((0xe << 8) | 0x81);
+ sljit_emit_op_custom(compiler, instruction, 6);
+ }
+
+/* TODO: use sljit_set_current_flags */
+
+/* VLGVB */
+instruction[0] = (sljit_u16)(0xe700 | (tmp3_reg_ind << 4) | data_ind);
+instruction[1] = 7;
+instruction[2] = (sljit_u16)((0x4 << 8) | 0x21);
+sljit_emit_op_custom(compiler, instruction, 6);
+
+CMPTO(SLJIT_GREATER_EQUAL, TMP3, 0, SLJIT_IMM, 16, start);
+
+OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP3, 0);
+
+JUMPHERE(quit);
+add_jump(compiler, &not_found, CMP(SLJIT_GREATER_EQUAL, TMP1, 0, STR_END, 0));
+
+return not_found;
+}
+
+#define JIT_HAS_FAST_FORWARD_CHAR_PAIR_SIMD 1
+
+static void fast_forward_char_pair_simd(compiler_common *common, sljit_s32 offs1,
+ PCRE2_UCHAR char1a, PCRE2_UCHAR char1b, sljit_s32 offs2, PCRE2_UCHAR char2a, PCRE2_UCHAR char2b)
+{
+DEFINE_COMPILER;
+sljit_u16 instruction[3];
+struct sljit_label *start;
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+struct sljit_label *restart;
+#endif
+struct sljit_jump *quit;
+struct sljit_jump *jump[2];
+vector_compare_type compare1_type = vector_compare_match1;
+vector_compare_type compare2_type = vector_compare_match1;
+sljit_u32 bit1 = 0;
+sljit_u32 bit2 = 0;
+sljit_s32 diff = IN_UCHARS(offs2 - offs1);
+sljit_s32 tmp1_reg_ind = sljit_get_register_index(TMP1);
+sljit_s32 tmp2_reg_ind = sljit_get_register_index(TMP2);
+sljit_s32 str_ptr_reg_ind = sljit_get_register_index(STR_PTR);
+sljit_s32 data1_ind = 0;
+sljit_s32 data2_ind = 1;
+sljit_s32 tmp1_ind = 2;
+sljit_s32 tmp2_ind = 3;
+sljit_s32 cmp1a_ind = 4;
+sljit_s32 cmp1b_ind = 5;
+sljit_s32 cmp2a_ind = 6;
+sljit_s32 cmp2b_ind = 7;
+sljit_s32 zero_ind = 8;
+int i;
+
+SLJIT_ASSERT(common->mode == PCRE2_JIT_COMPLETE && offs1 > offs2);
+SLJIT_ASSERT(-diff <= (sljit_s32)IN_UCHARS(max_fast_forward_char_pair_offset()));
+SLJIT_ASSERT(tmp1_reg_ind != 0 && tmp2_reg_ind != 0);
+
+if (char1a != char1b)
+ {
+ bit1 = char1a ^ char1b;
+ compare1_type = vector_compare_match1i;
+
+ if (!is_powerof2(bit1))
+ {
+ bit1 = 0;
+ compare1_type = vector_compare_match2;
+ }
+ }
+
+if (char2a != char2b)
+ {
+ bit2 = char2a ^ char2b;
+ compare2_type = vector_compare_match1i;
+
+ if (!is_powerof2(bit2))
+ {
+ bit2 = 0;
+ compare2_type = vector_compare_match2;
+ }
+ }
+
+/* Initialize. */
+if (common->match_end_ptr != 0)
+ {
+ OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr);
+ OP1(SLJIT_MOV, TMP3, 0, STR_END, 0);
+ OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, IN_UCHARS(offs1 + 1));
+
+ OP2(SLJIT_SUB | SLJIT_SET_LESS, SLJIT_UNUSED, 0, TMP1, 0, STR_END, 0);
+ CMOV(SLJIT_LESS, STR_END, TMP1, 0);
+ }
+
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(offs1));
+add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0));
+OP2(SLJIT_AND, TMP2, 0, STR_PTR, 0, SLJIT_IMM, ~15);
+
+#if PCRE2_CODE_UNIT_WIDTH != 32
+
+OP2(SLJIT_SUB, TMP1, 0, STR_PTR, 0, SLJIT_IMM, -diff);
+
+/* VREPI */
+instruction[0] = (sljit_u16)(0xe700 | (cmp1a_ind << 4));
+instruction[1] = (sljit_u16)(char1a | bit1);
+instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0x8 << 8) | 0x45);
+sljit_emit_op_custom(compiler, instruction, 6);
+
+if (char1a != char1b)
+ {
+ /* VREPI */
+ instruction[0] = (sljit_u16)(0xe700 | (cmp1b_ind << 4));
+ instruction[1] = (sljit_u16)(bit1 != 0 ? bit1 : char1b);
+ /* instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0x8 << 8) | 0x45); */
+ sljit_emit_op_custom(compiler, instruction, 6);
+ }
+
+/* VREPI */
+instruction[0] = (sljit_u16)(0xe700 | (cmp2a_ind << 4));
+instruction[1] = (sljit_u16)(char2a | bit2);
+/* instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0x8 << 8) | 0x45); */
+sljit_emit_op_custom(compiler, instruction, 6);
+
+if (char2a != char2b)
+ {
+ /* VREPI */
+ instruction[0] = (sljit_u16)(0xe700 | (cmp2b_ind << 4));
+ instruction[1] = (sljit_u16)(bit2 != 0 ? bit2 : char2b);
+ /* instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0x8 << 8) | 0x45); */
+ sljit_emit_op_custom(compiler, instruction, 6);
+ }
+
+#else /* PCRE2_CODE_UNIT_WIDTH == 32 */
+
+for (int i = 0; i < 2; i++)
+ {
+ replicate_imm_vector(compiler, i, cmp1a_ind, char1a | bit1, TMP1);
+
+ if (char1a != char1b)
+ replicate_imm_vector(compiler, i, cmp1b_ind, bit1 != 0 ? bit1 : char1b, TMP1);
+
+ replicate_imm_vector(compiler, i, cmp2a_ind, char2a | bit2, TMP1);
+
+ if (char2a != char2b)
+ replicate_imm_vector(compiler, i, cmp2b_ind, bit2 != 0 ? bit2 : char2b, TMP1);
+ }
+
+OP2(SLJIT_SUB, TMP1, 0, STR_PTR, 0, SLJIT_IMM, -diff);
+
+#endif /* PCRE2_CODE_UNIT_WIDTH != 32 */
+
+/* VREPI */
+instruction[0] = (sljit_u16)(0xe700 | (zero_ind << 4));
+instruction[1] = 0;
+instruction[2] = (sljit_u16)((0x8 << 8) | 0x45);
+sljit_emit_op_custom(compiler, instruction, 6);
+
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+restart = LABEL();
+#endif
+
+jump[0] = CMP(SLJIT_LESS, TMP1, 0, TMP2, 0);
+load_from_mem_vector(compiler, TRUE, data2_ind, tmp1_reg_ind, 0);
+jump[1] = JUMP(SLJIT_JUMP);
+JUMPHERE(jump[0]);
+load_from_mem_vector(compiler, FALSE, data2_ind, tmp1_reg_ind, 0);
+JUMPHERE(jump[1]);
+
+load_from_mem_vector(compiler, TRUE, data1_ind, str_ptr_reg_ind, 0);
+OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, 16);
+
+for (i = 0; i < 3; i++)
+ {
+ fast_forward_char_pair_sse2_compare(compiler, compare1_type, i, data1_ind, cmp1a_ind, cmp1b_ind, tmp1_ind);
+ fast_forward_char_pair_sse2_compare(compiler, compare2_type, i, data2_ind, cmp2a_ind, cmp2b_ind, tmp2_ind);
+ }
+
+/* VN */
+instruction[0] = (sljit_u16)(0xe700 | (data1_ind << 4) | data1_ind);
+instruction[1] = (sljit_u16)(data2_ind << 12);
+instruction[2] = (sljit_u16)((0xe << 8) | 0x68);
+sljit_emit_op_custom(compiler, instruction, 6);
+
+/* VFENE */
+instruction[0] = (sljit_u16)(0xe700 | (data1_ind << 4) | data1_ind);
+instruction[1] = (sljit_u16)((zero_ind << 12) | (1 << 4));
+instruction[2] = (sljit_u16)((0xe << 8) | 0x81);
+sljit_emit_op_custom(compiler, instruction, 6);
+
+/* TODO: use sljit_set_current_flags */
+
+/* VLGVB */
+instruction[0] = (sljit_u16)(0xe700 | (tmp1_reg_ind << 4) | data1_ind);
+instruction[1] = 7;
+instruction[2] = (sljit_u16)((0x4 << 8) | 0x21);
+sljit_emit_op_custom(compiler, instruction, 6);
+
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
+quit = CMP(SLJIT_LESS, STR_PTR, 0, TMP2, 0);
+
+OP2(SLJIT_SUB, STR_PTR, 0, TMP2, 0, SLJIT_IMM, 16);
+OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, diff);
+
+/* Main loop. */
+start = LABEL();
+
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, 16);
+add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0));
+
+load_from_mem_vector(compiler, FALSE, data1_ind, str_ptr_reg_ind, 0);
+load_from_mem_vector(compiler, FALSE, data2_ind, str_ptr_reg_ind, tmp1_reg_ind);
+
+for (i = 0; i < 3; i++)
+ {
+ fast_forward_char_pair_sse2_compare(compiler, compare1_type, i, data1_ind, cmp1a_ind, cmp1b_ind, tmp1_ind);
+ fast_forward_char_pair_sse2_compare(compiler, compare2_type, i, data2_ind, cmp2a_ind, cmp2b_ind, tmp2_ind);
+ }
+
+/* VN */
+instruction[0] = (sljit_u16)(0xe700 | (data1_ind << 4) | data1_ind);
+instruction[1] = (sljit_u16)(data2_ind << 12);
+instruction[2] = (sljit_u16)((0xe << 8) | 0x68);
+sljit_emit_op_custom(compiler, instruction, 6);
+
+/* VFENE */
+instruction[0] = (sljit_u16)(0xe700 | (data1_ind << 4) | data1_ind);
+instruction[1] = (sljit_u16)((zero_ind << 12) | (1 << 4));
+instruction[2] = (sljit_u16)((0xe << 8) | 0x81);
+sljit_emit_op_custom(compiler, instruction, 6);
+
+/* TODO: use sljit_set_current_flags */
+
+/* VLGVB */
+instruction[0] = (sljit_u16)(0xe700 | (tmp2_reg_ind << 4) | data1_ind);
+instruction[1] = 7;
+instruction[2] = (sljit_u16)((0x4 << 8) | 0x21);
+sljit_emit_op_custom(compiler, instruction, 6);
+
+CMPTO(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 16, start);
+
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP2, 0);
+
+JUMPHERE(quit);
+
+add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0));
+
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+if (common->utf)
+ {
+ SLJIT_ASSERT(common->mode == PCRE2_JIT_COMPLETE);
+
+ OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-offs1));
+
+ quit = jump_if_utf_char_start(compiler, TMP1);
+
+ OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+ add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0));
+
+ /* TMP1 contains diff. */
+ OP2(SLJIT_AND, TMP2, 0, STR_PTR, 0, SLJIT_IMM, ~15);
+ OP2(SLJIT_SUB, TMP1, 0, STR_PTR, 0, SLJIT_IMM, -diff);
+ JUMPTO(SLJIT_JUMP, restart);
+
+ JUMPHERE(quit);
+ }
+#endif
+
+OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(offs1));
+
+if (common->match_end_ptr != 0)
+ OP1(SLJIT_MOV, STR_END, 0, TMP3, 0);
+}
+
+#endif /* SLJIT_CONFIG_S390X */
+
+#endif /* !SUPPORT_VALGRIND */
diff --git a/src/3rdparty/pcre2/src/pcre2_match.c b/src/3rdparty/pcre2/src/pcre2_match.c
index e3f78c2ca3..ed60517131 100644
--- a/src/3rdparty/pcre2/src/pcre2_match.c
+++ b/src/3rdparty/pcre2/src/pcre2_match.c
@@ -818,10 +818,12 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
/* N is now the frame of the recursion; the previous frame is at the
OP_RECURSE position. Go back there, copying the current subject position
- and mark, and move on past the OP_RECURSE. */
+ and mark, and the start_match position (\K might have changed it), and
+ then move on past the OP_RECURSE. */
P->eptr = Feptr;
P->mark = Fmark;
+ P->start_match = Fstart_match;
F = P;
Fecode += 1 + LINK_SIZE;
continue;
diff --git a/src/3rdparty/pcre2/src/sljit/sljitConfigInternal.h b/src/3rdparty/pcre2/src/sljit/sljitConfigInternal.h
index eb1132db30..ff36e5b7c6 100644
--- a/src/3rdparty/pcre2/src/sljit/sljitConfigInternal.h
+++ b/src/3rdparty/pcre2/src/sljit/sljitConfigInternal.h
@@ -158,6 +158,8 @@ extern "C" {
#define SLJIT_CONFIG_MIPS_64 1
#elif defined(__sparc__) || defined(__sparc)
#define SLJIT_CONFIG_SPARC_32 1
+#elif defined(__s390x__)
+#define SLJIT_CONFIG_S390X 1
#else
/* Unsupported architecture */
#define SLJIT_CONFIG_UNSUPPORTED 1
diff --git a/src/3rdparty/pcre2/src/sljit/sljitExecAllocator.c b/src/3rdparty/pcre2/src/sljit/sljitExecAllocator.c
index 61a32f23e9..6e5bf78e45 100644
--- a/src/3rdparty/pcre2/src/sljit/sljitExecAllocator.c
+++ b/src/3rdparty/pcre2/src/sljit/sljitExecAllocator.c
@@ -79,6 +79,7 @@
*/
#ifdef _WIN32
+#define SLJIT_UPDATE_WX_FLAGS(from, to, enable_exec)
static SLJIT_INLINE void* alloc_chunk(sljit_uw size)
{
@@ -91,96 +92,108 @@ static SLJIT_INLINE void free_chunk(void *chunk, sljit_uw size)
VirtualFree(chunk, 0, MEM_RELEASE);
}
-#else
-
-#ifdef __APPLE__
-#ifdef MAP_ANON
-/* Configures TARGET_OS_OSX when appropriate */
-#include <TargetConditionals.h>
-
-#if TARGET_OS_OSX && defined(MAP_JIT)
-#include <sys/utsname.h>
-#endif /* TARGET_OS_OSX && MAP_JIT */
-
-#ifdef MAP_JIT
+#else /* POSIX */
+#if defined(__APPLE__) && defined(MAP_JIT)
/*
On macOS systems, returns MAP_JIT if it is defined _and_ we're running on a
- version where it's OK to have more than one JIT block.
+ version where it's OK to have more than one JIT block or where MAP_JIT is
+ required.
On non-macOS systems, returns MAP_JIT if it is defined.
*/
+#include <TargetConditionals.h>
+#if TARGET_OS_OSX
+#if defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86
+#ifdef MAP_ANON
+#include <sys/utsname.h>
+#include <stdlib.h>
+
+#define SLJIT_MAP_JIT (get_map_jit_flag())
+
static SLJIT_INLINE int get_map_jit_flag()
{
-#if TARGET_OS_OSX
- sljit_sw page_size = get_page_alignment() + 1;
+ sljit_sw page_size;
void *ptr;
+ struct utsname name;
static int map_jit_flag = -1;
- /*
- The following code is thread safe because multiple initialization
- sets map_jit_flag to the same value and the code has no side-effects.
- Changing the kernel version witout system restart is (very) unlikely.
- */
- if (map_jit_flag == -1) {
- struct utsname name;
-
+ if (map_jit_flag < 0) {
map_jit_flag = 0;
uname(&name);
- /* Kernel version for 10.14.0 (Mojave) */
+ /* Kernel version for 10.14.0 (Mojave) or later */
if (atoi(name.release) >= 18) {
+ page_size = get_page_alignment() + 1;
/* Only use MAP_JIT if a hardened runtime is used */
+ ptr = mmap(NULL, page_size, PROT_WRITE | PROT_EXEC,
+ MAP_PRIVATE | MAP_ANON, -1, 0);
- ptr = mmap(NULL, page_size, PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANON, -1, 0);
-
- if (ptr == MAP_FAILED) {
- map_jit_flag = MAP_JIT;
- } else {
+ if (ptr != MAP_FAILED)
munmap(ptr, page_size);
- }
+ else
+ map_jit_flag = MAP_JIT;
}
}
-
return map_jit_flag;
-#else /* !TARGET_OS_OSX */
- return MAP_JIT;
-#endif /* TARGET_OS_OSX */
}
-
-#endif /* MAP_JIT */
#endif /* MAP_ANON */
-#endif /* __APPLE__ */
+#else /* !SLJIT_CONFIG_X86 */
+#if !(defined SLJIT_CONFIG_ARM && SLJIT_CONFIG_ARM)
+#error Unsupported architecture
+#endif /* SLJIT_CONFIG_ARM */
+#include <pthread.h>
+
+#define SLJIT_MAP_JIT (MAP_JIT)
+#define SLJIT_UPDATE_WX_FLAGS(from, to, enable_exec) \
+ apple_update_wx_flags(enable_exec)
+
+static SLJIT_INLINE void apple_update_wx_flags(sljit_s32 enable_exec)
+{
+ pthread_jit_write_protect_np(enable_exec);
+}
+#endif /* SLJIT_CONFIG_X86 */
+#else /* !TARGET_OS_OSX */
+#define SLJIT_MAP_JIT (MAP_JIT)
+#endif /* TARGET_OS_OSX */
+#endif /* __APPLE__ && MAP_JIT */
+#ifndef SLJIT_UPDATE_WX_FLAGS
+#define SLJIT_UPDATE_WX_FLAGS(from, to, enable_exec)
+#endif /* !SLJIT_UPDATE_WX_FLAGS */
+#ifndef SLJIT_MAP_JIT
+#define SLJIT_MAP_JIT (0)
+#endif /* !SLJIT_MAP_JIT */
static SLJIT_INLINE void* alloc_chunk(sljit_uw size)
{
void *retval;
- const int prot = PROT_READ | PROT_WRITE | PROT_EXEC;
-
-#ifdef MAP_ANON
+ int prot = PROT_READ | PROT_WRITE | PROT_EXEC;
+ int flags = MAP_PRIVATE;
+ int fd = -1;
- int flags = MAP_PRIVATE | MAP_ANON;
-
-#ifdef MAP_JIT
- flags |= get_map_jit_flag();
+#ifdef PROT_MAX
+ prot |= PROT_MAX(prot);
#endif
- retval = mmap(NULL, size, prot, flags, -1, 0);
+#ifdef MAP_ANON
+ flags |= MAP_ANON | SLJIT_MAP_JIT;
#else /* !MAP_ANON */
if (SLJIT_UNLIKELY((dev_zero < 0) && open_dev_zero()))
return NULL;
- retval = mmap(NULL, size, prot, MAP_PRIVATE, dev_zero, 0);
+ fd = dev_zero;
#endif /* MAP_ANON */
+ retval = mmap(NULL, size, prot, flags, fd, 0);
if (retval == MAP_FAILED)
- retval = NULL;
- else {
- if (mprotect(retval, size, prot) < 0) {
- munmap(retval, size);
- retval = NULL;
- }
+ return NULL;
+
+ if (mprotect(retval, size, PROT_READ | PROT_WRITE | PROT_EXEC) < 0) {
+ munmap(retval, size);
+ return NULL;
}
+ SLJIT_UPDATE_WX_FLAGS(retval, (uint8_t *)retval + size, 0);
+
return retval;
}
@@ -189,7 +202,7 @@ static SLJIT_INLINE void free_chunk(void *chunk, sljit_uw size)
munmap(chunk, size);
}
-#endif
+#endif /* windows */
/* --------------------------------------------------------------------- */
/* Common functions */
@@ -261,6 +274,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_malloc_exec(sljit_uw size)
while (free_block) {
if (free_block->size >= size) {
chunk_size = free_block->size;
+ SLJIT_UPDATE_WX_FLAGS(NULL, NULL, 0);
if (chunk_size > size + 64) {
/* We just cut a block from the end of the free block. */
chunk_size -= size;
@@ -326,6 +340,7 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_free_exec(void* ptr)
allocated_size -= header->size;
/* Connecting free blocks together if possible. */
+ SLJIT_UPDATE_WX_FLAGS(NULL, NULL, 0);
/* If header->prev_size == 0, free_block will equal to header.
In this case, free_block->header.size will be > 0. */
@@ -358,6 +373,7 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_free_exec(void* ptr)
}
}
+ SLJIT_UPDATE_WX_FLAGS(NULL, NULL, 1);
SLJIT_ALLOCATOR_UNLOCK();
}
@@ -367,6 +383,7 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_free_unused_memory_exec(void)
struct free_block* next_free_block;
SLJIT_ALLOCATOR_LOCK();
+ SLJIT_UPDATE_WX_FLAGS(NULL, NULL, 0);
free_block = free_blocks;
while (free_block) {
@@ -381,5 +398,6 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_free_unused_memory_exec(void)
}
SLJIT_ASSERT((total_size && free_blocks) || (!total_size && !free_blocks));
+ SLJIT_UPDATE_WX_FLAGS(NULL, NULL, 1);
SLJIT_ALLOCATOR_UNLOCK();
}
diff --git a/src/3rdparty/pcre2/src/sljit/sljitNativeS390X.c b/src/3rdparty/pcre2/src/sljit/sljitNativeS390X.c
index a8b65112d4..3d007fe8a1 100644
--- a/src/3rdparty/pcre2/src/sljit/sljitNativeS390X.c
+++ b/src/3rdparty/pcre2/src/sljit/sljitNativeS390X.c
@@ -42,7 +42,7 @@ SLJIT_API_FUNC_ATTRIBUTE const char* sljit_get_platform_name(void)
typedef sljit_uw sljit_ins;
/* Instruction tags (most significant halfword). */
-const sljit_ins sljit_ins_const = (sljit_ins)1 << 48;
+static const sljit_ins sljit_ins_const = (sljit_ins)1 << 48;
static const sljit_u8 reg_map[SLJIT_NUMBER_OF_REGISTERS + 4] = {
14, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 0, 1
@@ -66,22 +66,22 @@ typedef sljit_uw sljit_gpr;
* will be retired ASAP (TODO: carenas)
*/
-const sljit_gpr r0 = 0; /* reg_map[SLJIT_NUMBER_OF_REGISTERS + 2]: 0 in address calculations; reserved */
-const sljit_gpr r1 = 1; /* reg_map[SLJIT_NUMBER_OF_REGISTERS + 3]: reserved */
-const sljit_gpr r2 = 2; /* reg_map[1]: 1st argument */
-const sljit_gpr r3 = 3; /* reg_map[2]: 2nd argument */
-const sljit_gpr r4 = 4; /* reg_map[3]: 3rd argument */
-const sljit_gpr r5 = 5; /* reg_map[4]: 4th argument */
-const sljit_gpr r6 = 6; /* reg_map[5]: 5th argument; 1st saved register */
-const sljit_gpr r7 = 7; /* reg_map[6] */
-const sljit_gpr r8 = 8; /* reg_map[7] */
-const sljit_gpr r9 = 9; /* reg_map[8] */
-const sljit_gpr r10 = 10; /* reg_map[9] */
-const sljit_gpr r11 = 11; /* reg_map[10] */
-const sljit_gpr r12 = 12; /* reg_map[11]: GOT */
-const sljit_gpr r13 = 13; /* reg_map[12]: Literal Pool pointer */
-const sljit_gpr r14 = 14; /* reg_map[0]: return address and flag register */
-const sljit_gpr r15 = 15; /* reg_map[SLJIT_NUMBER_OF_REGISTERS + 1]: stack pointer */
+static const sljit_gpr r0 = 0; /* reg_map[SLJIT_NUMBER_OF_REGISTERS + 2]: 0 in address calculations; reserved */
+static const sljit_gpr r1 = 1; /* reg_map[SLJIT_NUMBER_OF_REGISTERS + 3]: reserved */
+static const sljit_gpr r2 = 2; /* reg_map[1]: 1st argument */
+static const sljit_gpr r3 = 3; /* reg_map[2]: 2nd argument */
+static const sljit_gpr r4 = 4; /* reg_map[3]: 3rd argument */
+static const sljit_gpr r5 = 5; /* reg_map[4]: 4th argument */
+static const sljit_gpr r6 = 6; /* reg_map[5]: 5th argument; 1st saved register */
+static const sljit_gpr r7 = 7; /* reg_map[6] */
+static const sljit_gpr r8 = 8; /* reg_map[7] */
+static const sljit_gpr r9 = 9; /* reg_map[8] */
+static const sljit_gpr r10 = 10; /* reg_map[9] */
+static const sljit_gpr r11 = 11; /* reg_map[10] */
+static const sljit_gpr r12 = 12; /* reg_map[11]: GOT */
+static const sljit_gpr r13 = 13; /* reg_map[12]: Literal Pool pointer */
+static const sljit_gpr r14 = 14; /* reg_map[0]: return address and flag register */
+static const sljit_gpr r15 = 15; /* reg_map[SLJIT_NUMBER_OF_REGISTERS + 1]: stack pointer */
/* WARNING: r12 and r13 shouldn't be used as per ABI recommendation */
/* TODO(carenas): r12 might conflict in PIC code, reserve? */
@@ -100,8 +100,8 @@ const sljit_gpr r15 = 15; /* reg_map[SLJIT_NUMBER_OF_REGISTERS + 1]: stack point
/* Link registers. The normal link register is r14, but since
we use that for flags we need to use r0 instead to do fast
calls so that flags are preserved. */
-const sljit_gpr link_r = 14; /* r14 */
-const sljit_gpr fast_link_r = 0; /* r0 */
+static const sljit_gpr link_r = 14; /* r14 */
+static const sljit_gpr fast_link_r = 0; /* r0 */
/* Flag register layout:
@@ -110,7 +110,7 @@ const sljit_gpr fast_link_r = 0; /* r0 */
| ZERO | 0 | 0 | C C |///////|
+---------------+---+---+-------+-------+
*/
-const sljit_gpr flag_r = 14; /* r14 */
+static const sljit_gpr flag_r = 14; /* r14 */
struct sljit_s390x_const {
struct sljit_const const_; /* must be first */
@@ -1465,7 +1465,8 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile
op = GET_OPCODE(op) | (op & SLJIT_I32_OP);
switch (op) {
case SLJIT_BREAKPOINT:
- /* TODO(mundaym): insert real breakpoint? */
+ /* The following invalid instruction is emitted by gdb. */
+ return push_inst(compiler, 0x0001 /* 2-byte trap */);
case SLJIT_NOP:
return push_inst(compiler, 0x0700 /* 2-byte nop */);
case SLJIT_LMUL_UW:
diff --git a/src/3rdparty/pcre2/src/sljit/sljitUtils.c b/src/3rdparty/pcre2/src/sljit/sljitUtils.c
index 08ca35cf37..9bce714735 100644
--- a/src/3rdparty/pcre2/src/sljit/sljitUtils.c
+++ b/src/3rdparty/pcre2/src/sljit/sljitUtils.c
@@ -48,7 +48,7 @@ static HANDLE allocator_lock;
static SLJIT_INLINE void allocator_grab_lock(void)
{
HANDLE lock;
- if (SLJIT_UNLIKELY(!allocator_lock)) {
+ if (SLJIT_UNLIKELY(!InterlockedCompareExchangePointer(&allocator_lock, NULL, NULL))) {
lock = CreateMutex(NULL, FALSE, NULL);
if (InterlockedCompareExchangePointer(&allocator_lock, lock, NULL))
CloseHandle(lock);
@@ -146,9 +146,13 @@ static SLJIT_INLINE sljit_sw get_page_alignment(void) {
#include <unistd.h>
static SLJIT_INLINE sljit_sw get_page_alignment(void) {
- static sljit_sw sljit_page_align;
- if (!sljit_page_align) {
+ static sljit_sw sljit_page_align = -1;
+ if (sljit_page_align < 0) {
+#ifdef _SC_PAGESIZE
sljit_page_align = sysconf(_SC_PAGESIZE);
+#else
+ sljit_page_align = getpagesize();
+#endif
/* Should never happen. */
if (sljit_page_align < 0)
sljit_page_align = 4096;
diff --git a/src/3rdparty/pcre2/src/sljit/sljitWXExecAllocator.c b/src/3rdparty/pcre2/src/sljit/sljitWXExecAllocator.c
index 6ef71f7d83..72d5b8dd2b 100644
--- a/src/3rdparty/pcre2/src/sljit/sljitWXExecAllocator.c
+++ b/src/3rdparty/pcre2/src/sljit/sljitWXExecAllocator.c
@@ -121,14 +121,18 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_malloc_exec(sljit_uw size)
static pthread_mutex_t se_lock = PTHREAD_MUTEX_INITIALIZER;
#endif
static int se_protected = !SLJIT_PROT_WX;
+ int prot = PROT_READ | PROT_WRITE | SLJIT_PROT_WX;
sljit_uw* ptr;
if (SLJIT_UNLIKELY(se_protected < 0))
return NULL;
+#ifdef PROT_MAX
+ prot |= PROT_MAX(PROT_READ | PROT_WRITE | PROT_EXEC);
+#endif
+
size += sizeof(sljit_uw);
- ptr = (sljit_uw*)mmap(NULL, size, PROT_READ | PROT_WRITE | SLJIT_PROT_WX,
- MAP_PRIVATE | MAP_ANON, -1, 0);
+ ptr = (sljit_uw*)mmap(NULL, size, prot, MAP_PRIVATE | MAP_ANON, -1, 0);
if (ptr == MAP_FAILED)
return NULL;
diff --git a/src/3rdparty/sqlite/qt_attribution.json b/src/3rdparty/sqlite/qt_attribution.json
index 1c1d9b7746..1d8f96ff03 100644
--- a/src/3rdparty/sqlite/qt_attribution.json
+++ b/src/3rdparty/sqlite/qt_attribution.json
@@ -6,8 +6,8 @@
"Description": "SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine.",
"Homepage": "https://www.sqlite.org/",
- "Version": "3.35.2",
- "DownloadLocation": "https://www.sqlite.org/2020/sqlite-amalgamation-3350200.zip",
+ "Version": "3.35.5",
+ "DownloadLocation": "https://www.sqlite.org/2020/sqlite-amalgamation-3350500.zip",
"License": "Public Domain",
"Copyright": "The authors disclaim copyright to the source code. However, a license can be obtained if needed."
}
diff --git a/src/3rdparty/sqlite/sqlite3.c b/src/3rdparty/sqlite/sqlite3.c
index 54f8277a71..df53e437ba 100644
--- a/src/3rdparty/sqlite/sqlite3.c
+++ b/src/3rdparty/sqlite/sqlite3.c
@@ -1,6 +1,6 @@
/******************************************************************************
** This file is an amalgamation of many separate C source files from SQLite
-** version 3.35.2. By combining all the individual C code files into this
+** version 3.35.5. By combining all the individual C code files into this
** single large file, the entire code can be compiled as a single translation
** unit. This allows many compilers to do optimizations that would not be
** possible if the files were compiled separately. Performance improvements
@@ -1186,9 +1186,9 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
-#define SQLITE_VERSION "3.35.2"
-#define SQLITE_VERSION_NUMBER 3035002
-#define SQLITE_SOURCE_ID "2021-03-17 19:07:21 ea80f3002f4120f5dcee76e8779dfdc88e1e096c5cdd06904c20fd26d50c3827"
+#define SQLITE_VERSION "3.35.5"
+#define SQLITE_VERSION_NUMBER 3035005
+#define SQLITE_SOURCE_ID "2021-04-19 18:32:05 1b256d97b553a9611efca188a3d995a2fff712759044ba480f9a0c9e98fae886"
/*
** CAPI3REF: Run-Time Library Version Numbers
@@ -19764,6 +19764,7 @@ SQLITE_PRIVATE Expr *sqlite3ExprFunction(Parse*,ExprList*, Token*, int);
SQLITE_PRIVATE void sqlite3ExprFunctionUsable(Parse*,Expr*,FuncDef*);
SQLITE_PRIVATE void sqlite3ExprAssignVarNumber(Parse*, Expr*, u32);
SQLITE_PRIVATE void sqlite3ExprDelete(sqlite3*, Expr*);
+SQLITE_PRIVATE void sqlite3ExprDeferredDelete(Parse*, Expr*);
SQLITE_PRIVATE void sqlite3ExprUnmapAndDelete(Parse*, Expr*);
SQLITE_PRIVATE ExprList *sqlite3ExprListAppend(Parse*,ExprList*,Expr*);
SQLITE_PRIVATE ExprList *sqlite3ExprListAppendVector(Parse*,ExprList*,IdList*,Expr*);
@@ -21071,6 +21072,7 @@ struct VdbeCursor {
Bool isEphemeral:1; /* True for an ephemeral table */
Bool useRandomRowid:1; /* Generate new record numbers semi-randomly */
Bool isOrdered:1; /* True if the table is not BTREE_UNORDERED */
+ Bool hasBeenDuped:1; /* This cursor was source or target of OP_OpenDup */
u16 seekHit; /* See the OP_SeekHit and OP_IfNoHope opcodes */
Btree *pBtx; /* Separate file holding temporary table */
i64 seqCount; /* Sequence counter */
@@ -40220,7 +40222,8 @@ static int unixBackupDir(const char *z, int *pJ){
int j = *pJ;
int i;
if( j<=0 ) return 0;
- for(i=j-1; ALWAYS(i>0) && z[i-1]!='/'; i--){}
+ for(i=j-1; i>0 && z[i-1]!='/'; i--){}
+ if( i==0 ) return 0;
if( z[i]=='.' && i==j-2 && z[i+1]=='.' ) return 0;
*pJ = i-1;
return 1;
@@ -64277,7 +64280,7 @@ struct Btree {
u8 hasIncrblobCur; /* True if there are one or more Incrblob cursors */
int wantToLock; /* Number of nested calls to sqlite3BtreeEnter() */
int nBackup; /* Number of backup operations reading this btree */
- u32 iDataVersion; /* Combines with pBt->pPager->iDataVersion */
+ u32 iBDataVersion; /* Combines with pBt->pPager->iDataVersion */
Btree *pNext; /* List of other sharable Btrees from the same db */
Btree *pPrev; /* Back pointer of the same list */
#ifdef SQLITE_DEBUG
@@ -67690,19 +67693,23 @@ static void freeTempSpace(BtShared *pBt){
*/
SQLITE_PRIVATE int sqlite3BtreeClose(Btree *p){
BtShared *pBt = p->pBt;
- BtCursor *pCur;
/* Close all cursors opened via this handle. */
assert( sqlite3_mutex_held(p->db->mutex) );
sqlite3BtreeEnter(p);
- pCur = pBt->pCursor;
- while( pCur ){
- BtCursor *pTmp = pCur;
- pCur = pCur->pNext;
- if( pTmp->pBtree==p ){
- sqlite3BtreeCloseCursor(pTmp);
+
+ /* Verify that no other cursors have this Btree open */
+#ifdef SQLITE_DEBUG
+ {
+ BtCursor *pCur = pBt->pCursor;
+ while( pCur ){
+ BtCursor *pTmp = pCur;
+ pCur = pCur->pNext;
+ assert( pTmp->pBtree!=p );
+
}
}
+#endif
/* Rollback any active transaction and free the handle structure.
** The call to sqlite3BtreeRollback() drops any table-locks held by
@@ -69084,7 +69091,7 @@ SQLITE_PRIVATE int sqlite3BtreeCommitPhaseTwo(Btree *p, int bCleanup){
sqlite3BtreeLeave(p);
return rc;
}
- p->iDataVersion--; /* Compensate for pPager->iDataVersion++; */
+ p->iBDataVersion--; /* Compensate for pPager->iDataVersion++; */
pBt->inTransaction = TRANS_READ;
btreeClearHasContent(pBt);
}
@@ -69494,7 +69501,14 @@ SQLITE_PRIVATE int sqlite3BtreeCloseCursor(BtCursor *pCur){
unlockBtreeIfUnused(pBt);
sqlite3_free(pCur->aOverflow);
sqlite3_free(pCur->pKey);
- sqlite3BtreeLeave(pBtree);
+ if( (pBt->openFlags & BTREE_SINGLE) && pBt->pCursor==0 ){
+ /* Since the BtShared is not sharable, there is no need to
+ ** worry about the missing sqlite3BtreeLeave() call here. */
+ assert( pBtree->sharable==0 );
+ sqlite3BtreeClose(pBtree);
+ }else{
+ sqlite3BtreeLeave(pBtree);
+ }
pCur->pBtree = 0;
}
return SQLITE_OK;
@@ -74607,7 +74621,7 @@ SQLITE_PRIVATE void sqlite3BtreeGetMeta(Btree *p, int idx, u32 *pMeta){
assert( idx>=0 && idx<=15 );
if( idx==BTREE_DATA_VERSION ){
- *pMeta = sqlite3PagerDataVersion(pBt->pPager) + p->iDataVersion;
+ *pMeta = sqlite3PagerDataVersion(pBt->pPager) + p->iBDataVersion;
}else{
*pMeta = get4byte(&pBt->pPage1->aData[36 + idx*4]);
}
@@ -80835,20 +80849,15 @@ SQLITE_PRIVATE void sqlite3VdbeFreeCursor(Vdbe *p, VdbeCursor *pCx){
return;
}
assert( pCx->pBtx==0 || pCx->eCurType==CURTYPE_BTREE );
+ assert( pCx->pBtx==0 || pCx->isEphemeral );
switch( pCx->eCurType ){
case CURTYPE_SORTER: {
sqlite3VdbeSorterClose(p->db, pCx);
break;
}
case CURTYPE_BTREE: {
- if( pCx->isEphemeral ){
- if( pCx->pBtx ) sqlite3BtreeClose(pCx->pBtx);
- /* The pCx->pCursor will be close automatically, if it exists, by
- ** the call above. */
- }else{
- assert( pCx->uc.pCursor!=0 );
- sqlite3BtreeCloseCursor(pCx->uc.pCursor);
- }
+ assert( pCx->uc.pCursor!=0 );
+ sqlite3BtreeCloseCursor(pCx->uc.pCursor);
break;
}
#ifndef SQLITE_OMIT_VIRTUALTABLE
@@ -81932,6 +81941,7 @@ SQLITE_PRIVATE int sqlite3VdbeCursorMoveto(VdbeCursor **pp, u32 *piCol){
assert( p->eCurType==CURTYPE_BTREE || p->eCurType==CURTYPE_PSEUDO );
if( p->deferredMoveto ){
u32 iMap;
+ assert( !p->isEphemeral );
if( p->aAltMap && (iMap = p->aAltMap[1+*piCol])>0 && !p->nullRow ){
*pp = p->pAltCursor;
*piCol = iMap - 1;
@@ -86140,11 +86150,6 @@ static VdbeCursor *allocateCursor(
assert( iCur>=0 && iCur<p->nCursor );
if( p->apCsr[iCur] ){ /*OPTIMIZATION-IF-FALSE*/
- /* Before calling sqlite3VdbeFreeCursor(), ensure the isEphemeral flag
- ** is clear. Otherwise, if this is an ephemeral cursor created by
- ** OP_OpenDup, the cursor will not be closed and will still be part
- ** of a BtShared.pCursor list. */
- if( p->apCsr[iCur]->pBtx==0 ) p->apCsr[iCur]->isEphemeral = 0;
sqlite3VdbeFreeCursor(p, p->apCsr[iCur]);
p->apCsr[iCur] = 0;
}
@@ -89830,7 +89835,7 @@ case OP_OpenDup: {
pOrig = p->apCsr[pOp->p2];
assert( pOrig );
- assert( pOrig->pBtx!=0 ); /* Only ephemeral cursors can be duplicated */
+ assert( pOrig->isEphemeral ); /* Only ephemeral cursors can be duplicated */
pCx = allocateCursor(p, pOp->p1, pOrig->nField, -1, CURTYPE_BTREE);
if( pCx==0 ) goto no_mem;
@@ -89840,7 +89845,10 @@ case OP_OpenDup: {
pCx->isTable = pOrig->isTable;
pCx->pgnoRoot = pOrig->pgnoRoot;
pCx->isOrdered = pOrig->isOrdered;
- rc = sqlite3BtreeCursor(pOrig->pBtx, pCx->pgnoRoot, BTREE_WRCSR,
+ pCx->pBtx = pOrig->pBtx;
+ pCx->hasBeenDuped = 1;
+ pOrig->hasBeenDuped = 1;
+ rc = sqlite3BtreeCursor(pCx->pBtx, pCx->pgnoRoot, BTREE_WRCSR,
pCx->pKeyInfo, pCx->uc.pCursor);
/* The sqlite3BtreeCursor() routine can only fail for the first cursor
** opened for a database. Since there is already an open cursor when this
@@ -89906,9 +89914,10 @@ case OP_OpenEphemeral: {
aMem[pOp->p3].z = "";
}
pCx = p->apCsr[pOp->p1];
- if( pCx && ALWAYS(pCx->pBtx) ){
- /* If the ephermeral table is already open, erase all existing content
- ** so that the table is empty again, rather than creating a new table. */
+ if( pCx && !pCx->hasBeenDuped ){
+ /* If the ephermeral table is already open and has no duplicates from
+ ** OP_OpenDup, then erase all existing content so that the table is
+ ** empty again, rather than creating a new table. */
assert( pCx->isEphemeral );
pCx->seqCount = 0;
pCx->cacheStatus = CACHE_STALE;
@@ -89922,33 +89931,36 @@ case OP_OpenEphemeral: {
vfsFlags);
if( rc==SQLITE_OK ){
rc = sqlite3BtreeBeginTrans(pCx->pBtx, 1, 0);
- }
- if( rc==SQLITE_OK ){
- /* If a transient index is required, create it by calling
- ** sqlite3BtreeCreateTable() with the BTREE_BLOBKEY flag before
- ** opening it. If a transient table is required, just use the
- ** automatically created table with root-page 1 (an BLOB_INTKEY table).
- */
- if( (pCx->pKeyInfo = pKeyInfo = pOp->p4.pKeyInfo)!=0 ){
- assert( pOp->p4type==P4_KEYINFO );
- rc = sqlite3BtreeCreateTable(pCx->pBtx, &pCx->pgnoRoot,
- BTREE_BLOBKEY | pOp->p5);
- if( rc==SQLITE_OK ){
- assert( pCx->pgnoRoot==SCHEMA_ROOT+1 );
- assert( pKeyInfo->db==db );
- assert( pKeyInfo->enc==ENC(db) );
- rc = sqlite3BtreeCursor(pCx->pBtx, pCx->pgnoRoot, BTREE_WRCSR,
- pKeyInfo, pCx->uc.pCursor);
+ if( rc==SQLITE_OK ){
+ /* If a transient index is required, create it by calling
+ ** sqlite3BtreeCreateTable() with the BTREE_BLOBKEY flag before
+ ** opening it. If a transient table is required, just use the
+ ** automatically created table with root-page 1 (an BLOB_INTKEY table).
+ */
+ if( (pCx->pKeyInfo = pKeyInfo = pOp->p4.pKeyInfo)!=0 ){
+ assert( pOp->p4type==P4_KEYINFO );
+ rc = sqlite3BtreeCreateTable(pCx->pBtx, &pCx->pgnoRoot,
+ BTREE_BLOBKEY | pOp->p5);
+ if( rc==SQLITE_OK ){
+ assert( pCx->pgnoRoot==SCHEMA_ROOT+1 );
+ assert( pKeyInfo->db==db );
+ assert( pKeyInfo->enc==ENC(db) );
+ rc = sqlite3BtreeCursor(pCx->pBtx, pCx->pgnoRoot, BTREE_WRCSR,
+ pKeyInfo, pCx->uc.pCursor);
+ }
+ pCx->isTable = 0;
+ }else{
+ pCx->pgnoRoot = SCHEMA_ROOT;
+ rc = sqlite3BtreeCursor(pCx->pBtx, SCHEMA_ROOT, BTREE_WRCSR,
+ 0, pCx->uc.pCursor);
+ pCx->isTable = 1;
}
- pCx->isTable = 0;
- }else{
- pCx->pgnoRoot = SCHEMA_ROOT;
- rc = sqlite3BtreeCursor(pCx->pBtx, SCHEMA_ROOT, BTREE_WRCSR,
- 0, pCx->uc.pCursor);
- pCx->isTable = 1;
+ }
+ pCx->isOrdered = (pOp->p5!=BTREE_UNORDERED);
+ if( rc ){
+ sqlite3BtreeClose(pCx->pBtx);
}
}
- pCx->isOrdered = (pOp->p5!=BTREE_UNORDERED);
}
if( rc ) goto abort_due_to_error;
pCx->nullRow = 1;
@@ -90382,13 +90394,13 @@ seek_not_found:
**
** There are three possible outcomes from this opcode:<ol>
**
-** <li> If after This.P1 steps, the cursor is still point to a place that
-** is earlier in the btree than the target row,
-** then fall through into the subsquence OP_SeekGE opcode.
+** <li> If after This.P1 steps, the cursor is still pointing to a place that
+** is earlier in the btree than the target row, then fall through
+** into the subsquence OP_SeekGE opcode.
**
** <li> If the cursor is successfully moved to the target row by 0 or more
** sqlite3BtreeNext() calls, then jump to This.P2, which will land just
-** past the OP_IdxGT opcode that follows the OP_SeekGE.
+** past the OP_IdxGT or OP_IdxGE opcode that follows the OP_SeekGE.
**
** <li> If the cursor ends up past the target row (indicating the the target
** row does not exist in the btree) then jump to SeekOP.P2.
@@ -90405,7 +90417,8 @@ case OP_SeekScan: {
/* pOp->p2 points to the first instruction past the OP_IdxGT that
** follows the OP_SeekGE. */
assert( pOp->p2>=(int)(pOp-aOp)+2 );
- assert( aOp[pOp->p2-1].opcode==OP_IdxGT );
+ assert( aOp[pOp->p2-1].opcode==OP_IdxGT || aOp[pOp->p2-1].opcode==OP_IdxGE );
+ testcase( aOp[pOp->p2-1].opcode==OP_IdxGE );
assert( pOp[1].p1==aOp[pOp->p2-1].p1 );
assert( pOp[1].p2==aOp[pOp->p2-1].p2 );
assert( pOp[1].p3==aOp[pOp->p2-1].p3 );
@@ -91940,6 +91953,8 @@ case OP_IdxRowid: { /* out2 */
pTabCur->deferredMoveto = 1;
assert( pOp->p4type==P4_INTARRAY || pOp->p4.ai==0 );
pTabCur->aAltMap = pOp->p4.ai;
+ assert( !pC->isEphemeral );
+ assert( !pTabCur->isEphemeral );
pTabCur->pAltCursor = pC;
}else{
pOut = out2Prerelease(p, pOp);
@@ -98988,15 +99003,19 @@ static int lookupName(
if( pParse->pTriggerTab!=0 ){
int op = pParse->eTriggerOp;
assert( op==TK_DELETE || op==TK_UPDATE || op==TK_INSERT );
- if( op!=TK_DELETE && zTab && sqlite3StrICmp("new",zTab) == 0 ){
+ if( pParse->bReturning ){
+ if( (pNC->ncFlags & NC_UBaseReg)!=0
+ && (zTab==0 || sqlite3StrICmp(zTab,pParse->pTriggerTab->zName)==0)
+ ){
+ pExpr->iTable = op!=TK_DELETE;
+ pTab = pParse->pTriggerTab;
+ }
+ }else if( op!=TK_DELETE && zTab && sqlite3StrICmp("new",zTab) == 0 ){
pExpr->iTable = 1;
pTab = pParse->pTriggerTab;
}else if( op!=TK_INSERT && zTab && sqlite3StrICmp("old",zTab)==0 ){
pExpr->iTable = 0;
pTab = pParse->pTriggerTab;
- }else if( pParse->bReturning && (pNC->ncFlags & NC_UBaseReg)!=0 ){
- pExpr->iTable = op!=TK_DELETE;
- pTab = pParse->pTriggerTab;
}
}
#endif /* SQLITE_OMIT_TRIGGER */
@@ -101591,8 +101610,8 @@ SQLITE_PRIVATE Expr *sqlite3ExprAnd(Parse *pParse, Expr *pLeft, Expr *pRight){
}else if( (ExprAlwaysFalse(pLeft) || ExprAlwaysFalse(pRight))
&& !IN_RENAME_OBJECT
){
- sqlite3ExprDelete(db, pLeft);
- sqlite3ExprDelete(db, pRight);
+ sqlite3ExprDeferredDelete(pParse, pLeft);
+ sqlite3ExprDeferredDelete(pParse, pRight);
return sqlite3Expr(db, TK_INTEGER, "0");
}else{
return sqlite3PExpr(pParse, TK_AND, pLeft, pRight);
@@ -101789,6 +101808,22 @@ SQLITE_PRIVATE void sqlite3ExprDelete(sqlite3 *db, Expr *p){
if( p ) sqlite3ExprDeleteNN(db, p);
}
+
+/*
+** Arrange to cause pExpr to be deleted when the pParse is deleted.
+** This is similar to sqlite3ExprDelete() except that the delete is
+** deferred untilthe pParse is deleted.
+**
+** The pExpr might be deleted immediately on an OOM error.
+**
+** The deferred delete is (currently) implemented by adding the
+** pExpr to the pParse->pConstExpr list with a register number of 0.
+*/
+SQLITE_PRIVATE void sqlite3ExprDeferredDelete(Parse *pParse, Expr *pExpr){
+ pParse->pConstExpr =
+ sqlite3ExprListAppend(pParse, pParse->pConstExpr, pExpr);
+}
+
/* Invoke sqlite3RenameExprUnmap() and sqlite3ExprDelete() on the
** expression.
*/
@@ -106414,8 +106449,7 @@ static int agginfoPersistExprCb(Walker *pWalker, Expr *pExpr){
pExpr = sqlite3ExprDup(db, pExpr, 0);
if( pExpr ){
pAggInfo->aCol[iAgg].pCExpr = pExpr;
- pParse->pConstExpr =
- sqlite3ExprListAppend(pParse, pParse->pConstExpr, pExpr);
+ sqlite3ExprDeferredDelete(pParse, pExpr);
}
}
}else{
@@ -106424,8 +106458,7 @@ static int agginfoPersistExprCb(Walker *pWalker, Expr *pExpr){
pExpr = sqlite3ExprDup(db, pExpr, 0);
if( pExpr ){
pAggInfo->aFunc[iAgg].pFExpr = pExpr;
- pParse->pConstExpr =
- sqlite3ExprListAppend(pParse, pParse->pConstExpr, pExpr);
+ sqlite3ExprDeferredDelete(pParse, pExpr);
}
}
}
@@ -108668,33 +108701,44 @@ SQLITE_PRIVATE void sqlite3AlterDropColumn(Parse *pParse, SrcList *pSrc, Token *
sqlite3OpenTable(pParse, iCur, iDb, pTab, OP_OpenWrite);
addr = sqlite3VdbeAddOp1(v, OP_Rewind, iCur); VdbeCoverage(v);
reg = ++pParse->nMem;
- pParse->nMem += pTab->nCol;
if( HasRowid(pTab) ){
sqlite3VdbeAddOp2(v, OP_Rowid, iCur, reg);
+ pParse->nMem += pTab->nCol;
}else{
pPk = sqlite3PrimaryKeyIndex(pTab);
+ pParse->nMem += pPk->nColumn;
+ for(i=0; i<pPk->nKeyCol; i++){
+ sqlite3VdbeAddOp3(v, OP_Column, iCur, i, reg+i+1);
+ }
+ nField = pPk->nKeyCol;
}
+ regRec = ++pParse->nMem;
for(i=0; i<pTab->nCol; i++){
if( i!=iCol && (pTab->aCol[i].colFlags & COLFLAG_VIRTUAL)==0 ){
int regOut;
if( pPk ){
int iPos = sqlite3TableColumnToIndex(pPk, i);
int iColPos = sqlite3TableColumnToIndex(pPk, iCol);
+ if( iPos<pPk->nKeyCol ) continue;
regOut = reg+1+iPos-(iPos>iColPos);
}else{
regOut = reg+1+nField;
}
- sqlite3ExprCodeGetColumnOfTable(v, pTab, iCur, i, regOut);
+ if( i==pTab->iPKey ){
+ sqlite3VdbeAddOp2(v, OP_Null, 0, regOut);
+ }else{
+ sqlite3ExprCodeGetColumnOfTable(v, pTab, iCur, i, regOut);
+ }
nField++;
}
}
- regRec = reg + pTab->nCol;
sqlite3VdbeAddOp3(v, OP_MakeRecord, reg+1, nField, regRec);
if( pPk ){
sqlite3VdbeAddOp4Int(v, OP_IdxInsert, iCur, regRec, reg+1, pPk->nKeyCol);
}else{
sqlite3VdbeAddOp3(v, OP_Insert, iCur, regRec, reg);
}
+ sqlite3VdbeChangeP5(v, OPFLAG_SAVEPOSITION);
sqlite3VdbeAddOp2(v, OP_Next, iCur, addr+1); VdbeCoverage(v);
sqlite3VdbeJumpHere(v, addr);
@@ -115684,7 +115728,11 @@ SQLITE_PRIVATE void sqlite3CreateIndex(
/* Clean up before exiting */
exit_create_index:
if( pIndex ) sqlite3FreeIndex(db, pIndex);
- if( pTab ){ /* Ensure all REPLACE indexes are at the end of the list */
+ if( pTab ){
+ /* Ensure all REPLACE indexes on pTab are at the end of the pIndex list.
+ ** The list was already ordered when this routine was entered, so at this
+ ** point at most a single index (the newly added index) will be out of
+ ** order. So we have to reorder at most one index. */
Index **ppFrom = &pTab->pIndex;
Index *pThis;
for(ppFrom=&pTab->pIndex; (pThis = *ppFrom)!=0; ppFrom=&pThis->pNext){
@@ -115698,6 +115746,16 @@ exit_create_index:
}
break;
}
+#ifdef SQLITE_DEBUG
+ /* Verify that all REPLACE indexes really are now at the end
+ ** of the index list. In other words, no other index type ever
+ ** comes after a REPLACE index on the list. */
+ for(pThis = pTab->pIndex; pThis; pThis=pThis->pNext){
+ assert( pThis->onError!=OE_Replace
+ || pThis->pNext==0
+ || pThis->pNext->onError==OE_Replace );
+ }
+#endif
}
sqlite3ExprDelete(db, pPIWhere);
sqlite3ExprListDelete(db, pList);
@@ -123114,7 +123172,9 @@ SQLITE_PRIVATE void sqlite3Insert(
pNx->iDataCur = iDataCur;
pNx->iIdxCur = iIdxCur;
if( pNx->pUpsertTarget ){
- sqlite3UpsertAnalyzeTarget(pParse, pTabList, pNx);
+ if( sqlite3UpsertAnalyzeTarget(pParse, pTabList, pNx) ){
+ goto insert_cleanup;
+ }
}
pNx = pNx->pNextUpsert;
}while( pNx!=0 );
@@ -124536,7 +124596,7 @@ static void codeWithoutRowidPreupdate(
Vdbe *v = pParse->pVdbe;
int r = sqlite3GetTempReg(pParse);
assert( !HasRowid(pTab) );
- assert( 0==(pParse->db->mDbFlags & DBFLAG_Vacuum) );
+ assert( 0==(pParse->db->mDbFlags & DBFLAG_Vacuum) || CORRUPT_DB );
sqlite3VdbeAddOp2(v, OP_Integer, 0, r);
sqlite3VdbeAddOp4(v, OP_Insert, iCur, regData, r, (char*)pTab, P4_TABLE);
sqlite3VdbeChangeP5(v, OPFLAG_ISNOOP);
@@ -133084,7 +133144,7 @@ SQLITE_PRIVATE int sqlite3ColumnsFromExprList(
nCol = pEList->nExpr;
aCol = sqlite3DbMallocZero(db, sizeof(aCol[0])*nCol);
testcase( aCol==0 );
- if( nCol>32767 ) nCol = 32767;
+ if( NEVER(nCol>32767) ) nCol = 32767;
}else{
nCol = 0;
aCol = 0;
@@ -136158,16 +136218,24 @@ static int resolveFromTermToCte(
pSavedWith = pParse->pWith;
pParse->pWith = pWith;
if( pSel->selFlags & SF_Recursive ){
+ int rc;
assert( pRecTerm!=0 );
assert( (pRecTerm->selFlags & SF_Recursive)==0 );
assert( pRecTerm->pNext!=0 );
assert( (pRecTerm->pNext->selFlags & SF_Recursive)!=0 );
assert( pRecTerm->pWith==0 );
pRecTerm->pWith = pSel->pWith;
- sqlite3WalkSelect(pWalker, pRecTerm);
+ rc = sqlite3WalkSelect(pWalker, pRecTerm);
pRecTerm->pWith = 0;
+ if( rc ){
+ pParse->pWith = pSavedWith;
+ return 2;
+ }
}else{
- sqlite3WalkSelect(pWalker, pSel);
+ if( sqlite3WalkSelect(pWalker, pSel) ){
+ pParse->pWith = pSavedWith;
+ return 2;
+ }
}
pParse->pWith = pWith;
@@ -137476,7 +137544,9 @@ SQLITE_PRIVATE int sqlite3Select(
sqlite3VdbeAddOp2(v, OP_OpenDup, pItem->iCursor, pPrior->iCursor);
pSub->nSelectRow = pPrior->pSelect->nSelectRow;
}else{
- /* Generate a subroutine that will materialize the view. */
+ /* Materalize the view. If the view is not correlated, generate a
+ ** subroutine to do the materialization so that subsequent uses of
+ ** the same view can reuse the materialization. */
int topAddr;
int onceAddr = 0;
int retAddr;
@@ -137503,7 +137573,7 @@ SQLITE_PRIVATE int sqlite3Select(
VdbeComment((v, "end %s", pItem->pTab->zName));
sqlite3VdbeChangeP1(v, topAddr, retAddr);
sqlite3ClearTempRegCache(pParse);
- if( pItem->fg.isCte ){
+ if( pItem->fg.isCte && pItem->fg.isCorrelated==0 ){
CteUse *pCteUse = pItem->u2.pCteUse;
pCteUse->addrM9e = pItem->addrFillSub;
pCteUse->regRtn = pItem->regReturn;
@@ -139275,6 +139345,25 @@ SQLITE_PRIVATE SrcList *sqlite3TriggerStepSrc(
return pSrc;
}
+/*
+** Return true if the pExpr term from the RETURNING clause argument
+** list is of the form "*". Raise an error if the terms if of the
+** form "table.*".
+*/
+static int isAsteriskTerm(
+ Parse *pParse, /* Parsing context */
+ Expr *pTerm /* A term in the RETURNING clause */
+){
+ assert( pTerm!=0 );
+ if( pTerm->op==TK_ASTERISK ) return 1;
+ if( pTerm->op!=TK_DOT ) return 0;
+ assert( pTerm->pRight!=0 );
+ assert( pTerm->pLeft!=0 );
+ if( pTerm->pRight->op!=TK_ASTERISK ) return 0;
+ sqlite3ErrorMsg(pParse, "RETURNING may not use \"TABLE.*\" wildcards");
+ return 1;
+}
+
/* The input list pList is the list of result set terms from a RETURNING
** clause. The table that we are returning from is pTab.
**
@@ -139292,7 +139381,8 @@ static ExprList *sqlite3ExpandReturning(
for(i=0; i<pList->nExpr; i++){
Expr *pOldExpr = pList->a[i].pExpr;
- if( ALWAYS(pOldExpr!=0) && pOldExpr->op==TK_ASTERISK ){
+ if( NEVER(pOldExpr==0) ) continue;
+ if( isAsteriskTerm(pParse, pOldExpr) ){
int jj;
for(jj=0; jj<pTab->nCol; jj++){
Expr *pNewExpr;
@@ -146825,6 +146915,7 @@ static void whereCombineDisjuncts(
int op; /* Operator for the combined expression */
int idxNew; /* Index in pWC of the next virtual term */
+ if( (pOne->wtFlags | pTwo->wtFlags) & TERM_VNULL ) return;
if( (pOne->eOperator & (WO_EQ|WO_LT|WO_LE|WO_GT|WO_GE))==0 ) return;
if( (pTwo->eOperator & (WO_EQ|WO_LT|WO_LE|WO_GT|WO_GE))==0 ) return;
if( (eOp & (WO_EQ|WO_LT|WO_LE))!=eOp
@@ -147530,6 +147621,7 @@ static void exprAnalyzeExists(
#endif
if( pSel->pPrior ) return;
if( pSel->pWhere==0 ) return;
+ if( pSel->pLimit ) return;
if( 0==exprAnalyzeExistsFindEq(pSel, 0, 0) ) return;
pDup = sqlite3ExprDup(db, pExpr, 0);
@@ -155314,6 +155406,7 @@ static void windowCheckValue(Parse *pParse, int reg, int eCond){
VdbeCoverageIf(v, eCond==2);
}
sqlite3VdbeAddOp3(v, aOp[eCond], regZero, sqlite3VdbeCurrentAddr(v)+2, reg);
+ sqlite3VdbeChangeP5(v, SQLITE_AFF_NUMERIC);
VdbeCoverageNeverNullIf(v, eCond==0); /* NULL case captured by */
VdbeCoverageNeverNullIf(v, eCond==1); /* the OP_MustBeInt */
VdbeCoverageNeverNullIf(v, eCond==2);
@@ -162308,7 +162401,7 @@ static const unsigned char aiClass[] = {
#ifdef SQLITE_EBCDIC
/* x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xa xb xc xd xe xf */
/* 0x */ 29, 28, 28, 28, 28, 7, 28, 28, 28, 28, 28, 28, 7, 7, 28, 28,
-/* 1x */ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+/* 1x */ 28, 28, 28, 28, 28, 7, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
/* 2x */ 28, 28, 28, 28, 28, 7, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
/* 3x */ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
/* 4x */ 7, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 26, 12, 17, 20, 10,
@@ -229213,7 +229306,7 @@ static void fts5SourceIdFunc(
){
assert( nArg==0 );
UNUSED_PARAM2(nArg, apUnused);
- sqlite3_result_text(pCtx, "fts5: 2021-03-17 19:07:21 ea80f3002f4120f5dcee76e8779dfdc88e1e096c5cdd06904c20fd26d50c3827", -1, SQLITE_TRANSIENT);
+ sqlite3_result_text(pCtx, "fts5: 2021-04-19 18:32:05 1b256d97b553a9611efca188a3d995a2fff712759044ba480f9a0c9e98fae886", -1, SQLITE_TRANSIENT);
}
/*
@@ -234139,9 +234232,9 @@ SQLITE_API int sqlite3_stmt_init(
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
/************** End of stmt.c ************************************************/
-#if __LINE__!=234142
+#if __LINE__!=234235
#undef SQLITE_SOURCE_ID
-#define SQLITE_SOURCE_ID "2021-03-17 19:07:21 ea80f3002f4120f5dcee76e8779dfdc88e1e096c5cdd06904c20fd26d50calt2"
+#define SQLITE_SOURCE_ID "2021-04-19 18:32:05 1b256d97b553a9611efca188a3d995a2fff712759044ba480f9a0c9e98faalt2"
#endif
/* Return the source-id for this library */
SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
diff --git a/src/3rdparty/sqlite/sqlite3.h b/src/3rdparty/sqlite/sqlite3.h
index f636b294d2..19ee767fe8 100644
--- a/src/3rdparty/sqlite/sqlite3.h
+++ b/src/3rdparty/sqlite/sqlite3.h
@@ -123,9 +123,9 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
-#define SQLITE_VERSION "3.35.2"
-#define SQLITE_VERSION_NUMBER 3035002
-#define SQLITE_SOURCE_ID "2021-03-17 19:07:21 ea80f3002f4120f5dcee76e8779dfdc88e1e096c5cdd06904c20fd26d50c3827"
+#define SQLITE_VERSION "3.35.5"
+#define SQLITE_VERSION_NUMBER 3035005
+#define SQLITE_SOURCE_ID "2021-04-19 18:32:05 1b256d97b553a9611efca188a3d995a2fff712759044ba480f9a0c9e98fae886"
/*
** CAPI3REF: Run-Time Library Version Numbers
diff --git a/src/android/jar/src/org/qtproject/qt/android/CursorHandle.java b/src/android/jar/src/org/qtproject/qt/android/CursorHandle.java
index dbadf7502d..980b172444 100644
--- a/src/android/jar/src/org/qtproject/qt/android/CursorHandle.java
+++ b/src/android/jar/src/org/qtproject/qt/android/CursorHandle.java
@@ -202,6 +202,11 @@ public class CursorHandle implements ViewTreeObserver.OnPreDrawListener
}
}
+ public int width()
+ {
+ return m_cursorView.getDrawable().getIntrinsicWidth();
+ }
+
// The handle was dragged by a given relative position
public void updatePosition(int x, int y) {
y -= m_yShift;
diff --git a/src/android/jar/src/org/qtproject/qt/android/EditPopupMenu.java b/src/android/jar/src/org/qtproject/qt/android/EditPopupMenu.java
index 131f2a103f..99940bbd02 100644
--- a/src/android/jar/src/org/qtproject/qt/android/EditPopupMenu.java
+++ b/src/android/jar/src/org/qtproject/qt/android/EditPopupMenu.java
@@ -113,10 +113,13 @@ public class EditPopupMenu implements ViewTreeObserver.OnPreDrawListener, View.O
y2 -= m_view.getHeight();
if (y2 < 0) {
- if (cursorHandle != null)
+ if (cursorHandle != null) {
y2 = cursorHandle.bottom();
- else if (leftSelectionHandle != null && rightSelectionHandle != null)
+ } else if (leftSelectionHandle != null && rightSelectionHandle != null) {
y2 = Math.max(leftSelectionHandle.bottom(), rightSelectionHandle.bottom());
+ if (y2 <= 0)
+ m_layout.requestLayout();
+ }
}
if (m_layout.getWidth() < x + m_view.getWidth() / 2)
diff --git a/src/android/jar/src/org/qtproject/qt/android/ExtractStyle.java b/src/android/jar/src/org/qtproject/qt/android/ExtractStyle.java
index ff321fabde..09a4d1bc91 100644
--- a/src/android/jar/src/org/qtproject/qt/android/ExtractStyle.java
+++ b/src/android/jar/src/org/qtproject/qt/android/ExtractStyle.java
@@ -1151,7 +1151,6 @@ public class ExtractStyle {
json.put("width", bmp.getWidth());
json.put("height", bmp.getHeight());
m_drawableCache.put(filename, new DrawableCache(json, drawable));
-// MinistroActivity.nativeChmode(filename, 0644);
} catch (JSONException e) {
e.printStackTrace();
}
@@ -1972,11 +1971,9 @@ public class ExtractStyle {
public ExtractStyle(Context context, String extractPath, boolean minimal)
{
-// Log.i(MinistroService.TAG, "Extract " + extractPath);
m_minimal = minimal;
m_extractPath = extractPath + "/";
new File(m_extractPath).mkdirs();
-// MinistroActivity.nativeChmode(m_extractPath, 0755);
m_context = context;
m_theme = context.getTheme();
TypedArray array = m_theme.obtainStyledAttributes(new int[]{
@@ -2027,7 +2024,6 @@ public class ExtractStyle {
}
jsonWriter.endObject();
jsonWriter.close();
-// MinistroActivity.nativeChmode(m_extractPath+"style.json", 0644);
}
catch (Exception e) {
e.printStackTrace();
diff --git a/src/android/jar/src/org/qtproject/qt/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt/android/QtActivityDelegate.java
index d8456e7554..9c36090c92 100644
--- a/src/android/jar/src/org/qtproject/qt/android/QtActivityDelegate.java
+++ b/src/android/jar/src/org/qtproject/qt/android/QtActivityDelegate.java
@@ -119,7 +119,6 @@ public class QtActivityDelegate
private static final String ENVIRONMENT_VARIABLES_KEY = "environment.variables";
private static final String APPLICATION_PARAMETERS_KEY = "application.parameters";
private static final String STATIC_INIT_CLASSES_KEY = "static.init.classes";
- private static final String NECESSITAS_API_LEVEL_KEY = "necessitas.api.level";
private static final String EXTRACT_STYLE_KEY = "extract.android.style";
private static final String EXTRACT_STYLE_MINIMAL_KEY = "extract.android.style.option";
@@ -513,6 +512,17 @@ public class QtActivityDelegate
private static final int CursorHandleShowSelection = 2;
private static final int CursorHandleShowEdit = 0x100;
+ public int getSelectHandleWidth()
+ {
+ int width = 0;
+ if (m_leftSelectionHandle != null && m_rightSelectionHandle != null) {
+ width = Math.max(m_leftSelectionHandle.width(), m_rightSelectionHandle.width());
+ } else if (m_cursorHandle != null) {
+ width = m_cursorHandle.width();
+ }
+ return width;
+ }
+
/* called from the C++ code when the position of the cursor or selection handles needs to
be adjusted.
mode is one of QAndroidInputContext::CursorHandleShowMode
@@ -663,14 +673,9 @@ public class QtActivityDelegate
return false;
}
- int necessitasApiLevel = 1;
- if (loaderParams.containsKey(NECESSITAS_API_LEVEL_KEY))
- necessitasApiLevel = loaderParams.getInt(NECESSITAS_API_LEVEL_KEY);
-
m_environmentVariables = loaderParams.getString(ENVIRONMENT_VARIABLES_KEY);
String additionalEnvironmentVariables = "QT_ANDROID_FONTS_MONOSPACE=Droid Sans Mono;Droid Sans;Droid Sans Fallback"
+ "\tQT_ANDROID_FONTS_SERIF=Droid Serif"
- + "\tNECESSITAS_API_LEVEL=" + necessitasApiLevel
+ "\tHOME=" + m_activity.getFilesDir().getAbsolutePath()
+ "\tTMPDIR=" + m_activity.getFilesDir().getAbsolutePath();
diff --git a/src/android/jar/src/org/qtproject/qt/android/QtNative.java b/src/android/jar/src/org/qtproject/qt/android/QtNative.java
index f9bb680cb6..c7e6c3b873 100644
--- a/src/android/jar/src/org/qtproject/qt/android/QtNative.java
+++ b/src/android/jar/src/org/qtproject/qt/android/QtNative.java
@@ -66,6 +66,7 @@ import android.os.Looper;
import android.content.ClipboardManager;
import android.content.ClipboardManager.OnPrimaryClipChangedListener;
import android.content.ClipData;
+import android.content.ClipDescription;
import android.os.ParcelFileDescriptor;
import android.util.Log;
import android.util.DisplayMetrics;
@@ -558,8 +559,8 @@ public class QtNative
synchronized (m_mainActivityMutex) {
final Looper mainLooper = Looper.getMainLooper();
final Handler handler = new Handler(mainLooper);
- final boolean actionIsQueued = !m_activityPaused && m_activity != null && mainLooper != null && handler.post(action);
- if (!actionIsQueued)
+ final boolean active = (m_activity != null && !m_activityPaused) || m_service != null;
+ if (!active || mainLooper == null || !handler.post(action))
m_lostActions.add(action);
}
}
@@ -843,13 +844,8 @@ public class QtNative
int perm = PackageManager.PERMISSION_DENIED;
synchronized (m_mainActivityMutex) {
Context context = getContext();
- try {
- if (m_checkSelfPermissionMethod == null)
- m_checkSelfPermissionMethod = Context.class.getMethod("checkSelfPermission", String.class);
- perm = (Integer)m_checkSelfPermissionMethod.invoke(context, permission);
- } catch (Exception e) {
- e.printStackTrace();
- }
+ PackageManager pm = context.getPackageManager();
+ perm = pm.checkPermission(permission, context.getPackageName());
}
return perm;
@@ -869,6 +865,11 @@ public class QtNative
});
}
+ private static int getSelectHandleWidth()
+ {
+ return m_activityDelegate.getSelectHandleWidth();
+ }
+
private static void updateHandles(final int mode,
final int editX,
final int editY,
@@ -1031,6 +1032,7 @@ public class QtNative
{
if (Build.VERSION.SDK_INT >= 28 && m_clipboardManager != null)
m_clipboardManager.clearPrimaryClip();
+ m_usePrimaryClip = false;
}
private static void setClipboardText(String text)
{
@@ -1044,10 +1046,8 @@ public class QtNative
{
try {
if (m_clipboardManager != null && m_clipboardManager.hasPrimaryClip()) {
- ClipData primaryClip = m_clipboardManager.getPrimaryClip();
- for (int i = 0; i < primaryClip.getItemCount(); ++i)
- if (primaryClip.getItemAt(i).getText() != null)
- return true;
+ ClipDescription primaryClipDescription = m_clipboardManager.getPrimaryClipDescription();
+ return primaryClipDescription.hasMimeType("text/*");
}
} catch (Exception e) {
Log.e(QtTAG, "Failed to get clipboard data", e);
@@ -1102,10 +1102,8 @@ public class QtNative
{
try {
if (m_clipboardManager != null && m_clipboardManager.hasPrimaryClip()) {
- ClipData primaryClip = m_clipboardManager.getPrimaryClip();
- for (int i = 0; i < Objects.requireNonNull(primaryClip).getItemCount(); ++i)
- if (primaryClip.getItemAt(i).getHtmlText() != null)
- return true;
+ ClipDescription primaryClipDescription = m_clipboardManager.getPrimaryClipDescription();
+ return primaryClipDescription.hasMimeType("text/html");
}
} catch (Exception e) {
Log.e(QtTAG, "Failed to get clipboard data", e);
@@ -1141,10 +1139,8 @@ public class QtNative
{
try {
if (m_clipboardManager != null && m_clipboardManager.hasPrimaryClip()) {
- ClipData primaryClip = m_clipboardManager.getPrimaryClip();
- for (int i = 0; i < primaryClip.getItemCount(); ++i)
- if (primaryClip.getItemAt(i).getUri() != null)
- return true;
+ ClipDescription primaryClipDescription = m_clipboardManager.getPrimaryClipDescription();
+ return primaryClipDescription.hasMimeType("text/uri-list");
}
} catch (Exception e) {
Log.e(QtTAG, "Failed to get clipboard data", e);
diff --git a/src/android/jar/src/org/qtproject/qt/android/extras/QtAndroidBinder.java b/src/android/jar/src/org/qtproject/qt/android/extras/QtAndroidBinder.java
new file mode 100644
index 0000000000..4e349552fe
--- /dev/null
+++ b/src/android/jar/src/org/qtproject/qt/android/extras/QtAndroidBinder.java
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 BogDan Vatra <bogdan@kde.org>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Android port 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$
+**
+****************************************************************************/
+
+package org.qtproject.qt.android.extras;
+
+import android.os.Binder;
+import android.os.Parcel;
+
+public class QtAndroidBinder extends Binder
+{
+ public QtAndroidBinder(long id)
+ {
+ m_id = id;
+ }
+
+ public void setId(long id)
+ {
+ synchronized(this)
+ {
+ m_id = id;
+ }
+ }
+ @Override
+ protected boolean onTransact(int code, Parcel data, Parcel reply, int flags)
+ {
+ synchronized(this)
+ {
+ return QtNative.onTransact(m_id, code, data, reply, flags);
+ }
+ }
+
+ private long m_id;
+}
diff --git a/src/android/jar/src/org/qtproject/qt/android/extras/QtAndroidServiceConnection.java b/src/android/jar/src/org/qtproject/qt/android/extras/QtAndroidServiceConnection.java
new file mode 100644
index 0000000000..bab4d3f4ce
--- /dev/null
+++ b/src/android/jar/src/org/qtproject/qt/android/extras/QtAndroidServiceConnection.java
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 BogDan Vatra <bogdan@kde.org>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Android port 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$
+**
+****************************************************************************/
+
+package org.qtproject.qt.android.extras;
+
+import android.content.ComponentName;
+import android.content.ServiceConnection;
+import android.os.IBinder;
+
+public class QtAndroidServiceConnection implements ServiceConnection
+{
+ public QtAndroidServiceConnection(long id)
+ {
+ m_id = id;
+ }
+
+ public void setId(long id)
+ {
+ synchronized(this)
+ {
+ m_id = id;
+ }
+ }
+
+ @Override
+ public void onServiceConnected(ComponentName name, IBinder service)
+ {
+ synchronized(this) {
+ QtNative.onServiceConnected(m_id, name.flattenToString(), service);
+ }
+ }
+
+ @Override
+ public void onServiceDisconnected(ComponentName name)
+ {
+ synchronized(this) {
+ QtNative.onServiceDisconnected(m_id, name.flattenToString());
+ }
+ }
+
+ private long m_id;
+}
diff --git a/src/android/jar/src/org/qtproject/qt/android/extras/QtNative.java b/src/android/jar/src/org/qtproject/qt/android/extras/QtNative.java
new file mode 100644
index 0000000000..86a9151500
--- /dev/null
+++ b/src/android/jar/src/org/qtproject/qt/android/extras/QtNative.java
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 BogDan Vatra <bogdan@kde.org>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Android port 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$
+**
+****************************************************************************/
+
+package org.qtproject.qt.android.extras;
+
+import android.content.ComponentName;
+import android.content.ServiceConnection;
+import android.os.IBinder;
+import android.os.Parcel;
+
+public class QtNative {
+ // Binder
+ public static native boolean onTransact(long id, int code, Parcel data, Parcel reply, int flags);
+
+
+ // ServiceConnection
+ public static native void onServiceConnected(long id, String name, IBinder service);
+ public static native void onServiceDisconnected(long id, String name);
+}
diff --git a/src/android/java/res/values-de/strings.xml b/src/android/java/res/values-de/strings.xml
index 21881ec97f..55b927ebff 100644
--- a/src/android/java/res/values-de/strings.xml
+++ b/src/android/java/res/values-de/strings.xml
@@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
- <string name="ministro_not_found_msg">Ministro-Dienst wurde nicht gefunden.\nAnwendung kann nicht gestartet werden</string>
- <string name="ministro_needed_msg">Diese Anwendung benötigt den Ministro-Dienst. Möchten Sie ihn installieren?</string>
<string name="fatal_error_msg">In Ihrer Anwendung ist ein schwerwiegender Fehler aufgetreten, sie kann nicht fortgesetzt werden</string>
<string name="unsupported_android_version">Diese Android-Version wird nicht unterstützt.</string>
</resources>
diff --git a/src/android/java/res/values-el/strings.xml b/src/android/java/res/values-el/strings.xml
index 42b2b3b49d..9dd0973f2d 100644
--- a/src/android/java/res/values-el/strings.xml
+++ b/src/android/java/res/values-el/strings.xml
@@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
- <string name="ministro_not_found_msg">Δεν ήταν δυνατή η εύρεση της υπηρεσίας Ministro. Δεν είναι δυνατή η εκκίνηση της εφαρμογής.</string>
- <string name="ministro_needed_msg">Η εφαρμογή απαιτεί την υπηρεσία Ministro. Να εγκατασταθεί η υπηρεσία?</string>
<string name="fatal_error_msg">Παρουσιάστηκε ένα κρίσιμο σφάλμα και η εφαρμογή δεν μπορεί να συνεχίσει.</string>
<string name="unsupported_android_version">Αυτή η έκδοση του Android δεν υποστηρίζεται.</string>
</resources>
diff --git a/src/android/java/res/values-es/strings.xml b/src/android/java/res/values-es/strings.xml
index 1da33a6444..ee991e15f5 100644
--- a/src/android/java/res/values-es/strings.xml
+++ b/src/android/java/res/values-es/strings.xml
@@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
- <string name="ministro_not_found_msg">Servicio Ministro inesistente. Imposible ejecutar la aplicación.</string>
- <string name="ministro_needed_msg">Esta aplicación requiere el servicio Ministro. Instalarlo?</string>
<string name="fatal_error_msg">La aplicación ha causado un error grave y no es posible continuar.</string>
<string name="unsupported_android_version">Esta versión de Android no es compatible.</string>
</resources>
diff --git a/src/android/java/res/values-et/strings.xml b/src/android/java/res/values-et/strings.xml
index 9620fd2bc8..9c5b430961 100644
--- a/src/android/java/res/values-et/strings.xml
+++ b/src/android/java/res/values-et/strings.xml
@@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
- <string name="ministro_not_found_msg">Ei suuda leida Ministro teenust.\nProgrammi ei saa käivitada.</string>
- <string name="ministro_needed_msg">See programm vajab Ministro teenust.\nKas soovite paigaldada?</string>
<string name="fatal_error_msg">Programmiga juhtus fataalne viga.\nKahjuks ei saa jätkata.</string>
<string name="unsupported_android_version">Seda Androidi versiooni ei toetata.</string>
</resources>
diff --git a/src/android/java/res/values-fa/strings.xml b/src/android/java/res/values-fa/strings.xml
index d1ee06118a..0c88c7b1a1 100644
--- a/src/android/java/res/values-fa/strings.xml
+++ b/src/android/java/res/values-fa/strings.xml
@@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
- <string name="ministro_not_found_msg">سرویس Ministro را پیدا نمی‌کند. برنامه نمی‌تواند آغاز شود.</string>
- <string name="ministro_needed_msg">این نرم‌افزار به سرویس Ministro احتیاج دارد. آیا دوست دارید آن را نصب کنید؟</string>
<string name="fatal_error_msg">خطایی اساسی در برنامه‌تان رخ داد و اجرای برنامه نمی‌تواند ادامه یابد.</string>
<string name="unsupported_android_version">این نسخه از Android پشتیبانی نمی شود</string>
</resources>
diff --git a/src/android/java/res/values-fr/strings.xml b/src/android/java/res/values-fr/strings.xml
index ce8e5f5af1..c3717f377d 100644
--- a/src/android/java/res/values-fr/strings.xml
+++ b/src/android/java/res/values-fr/strings.xml
@@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
- <string name="ministro_not_found_msg">Le service Ministro est introuvable.\nL\'application ne peut pas démarrer.</string>
- <string name="ministro_needed_msg">Cette application requiert le service Ministro. Voulez-vous l\'installer?</string>
<string name="fatal_error_msg">Votre application a rencontré une erreur fatale et ne peut pas continuer.</string>
<string name="unsupported_android_version">Cette version d\'Android n\'est pas supportée.</string>
</resources>
diff --git a/src/android/java/res/values-in/strings.xml b/src/android/java/res/values-in/strings.xml
index b25f568ee9..3499dd3ef1 100644
--- a/src/android/java/res/values-in/strings.xml
+++ b/src/android/java/res/values-in/strings.xml
@@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
- <string name="ministro_not_found_msg">Layanan Ministro tidak bisa ditemukan.\nAplikasi tidak bisa dimulai.</string>
- <string name="ministro_needed_msg">Aplikasi ini membutuhkan layanan Ministro. Apakah Anda ingin menginstalnya?</string>
<string name="fatal_error_msg">Aplikasi Anda mengalami kesalahan fatal dan tidak dapat melanjutkan.</string>
<string name="unsupported_android_version">Versi Android ini tidak didukung.</string>
</resources>
diff --git a/src/android/java/res/values-it/strings.xml b/src/android/java/res/values-it/strings.xml
index 9ba5fe2b1c..f93fa1cac7 100644
--- a/src/android/java/res/values-it/strings.xml
+++ b/src/android/java/res/values-it/strings.xml
@@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
- <string name="ministro_not_found_msg">Servizio Ministro inesistente. Impossibile eseguire \nl\'applicazione.</string>
- <string name="ministro_needed_msg">Questa applicazione richiede il servizio Ministro.Installarlo?</string>
<string name="fatal_error_msg">L\'applicazione ha provocato un errore grave e non puo\' continuare.</string>
<string name="unsupported_android_version">Questa versione di Android non è supportata.</string>
</resources>
diff --git a/src/android/java/res/values-ja/strings.xml b/src/android/java/res/values-ja/strings.xml
index 40da7dce48..f8888b407c 100644
--- a/src/android/java/res/values-ja/strings.xml
+++ b/src/android/java/res/values-ja/strings.xml
@@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
- <string name="ministro_not_found_msg">Ministroサービスが見つかりません。\nアプリケーションが起動できません。</string>
- <string name="ministro_needed_msg">このアプリケーションにはMinistroサービスが必要です。 インストールしてもよろしいですか?</string>
<string name="fatal_error_msg">アプリケーションで致命的なエラーが発生したため続行できません。</string>
<string name="unsupported_android_version">このバージョンのAndroidはサポートされていません。</string>
</resources>
diff --git a/src/android/java/res/values-ms/strings.xml b/src/android/java/res/values-ms/strings.xml
index bd27890eb2..bbf90de357 100644
--- a/src/android/java/res/values-ms/strings.xml
+++ b/src/android/java/res/values-ms/strings.xml
@@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
- <string name="ministro_not_found_msg">Tidak jumpa servis Ministro.\nAplikasi tidak boleh dimulakan.</string>
- <string name="ministro_needed_msg">Aplikasi ini memerlukan servis Ministro. Adakah anda ingin pasang servis itu?</string>
<string name="fatal_error_msg">Aplikasi anda menemui ralat muat dan tidak boleh diteruskan.</string>
<string name="unsupported_android_version">Versi Android ini tidak disokong.</string>
</resources>
diff --git a/src/android/java/res/values-nb/strings.xml b/src/android/java/res/values-nb/strings.xml
index 53529b7f52..a66e997853 100644
--- a/src/android/java/res/values-nb/strings.xml
+++ b/src/android/java/res/values-nb/strings.xml
@@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
- <string name="ministro_not_found_msg">Kan ikke finne tjenesten Ministro. Applikasjonen kan ikke starte.</string>
- <string name="ministro_needed_msg">Denne applikasjonen krever tjenesten Ministro. Vil du installere denne?</string>
<string name="fatal_error_msg">Applikasjonen fikk en kritisk feil og kan ikke fortsette</string>
<string name="unsupported_android_version">Denne versjonen av Android støttes ikke.</string>
</resources>
diff --git a/src/android/java/res/values-nl/strings.xml b/src/android/java/res/values-nl/strings.xml
index 7e54587f61..9f4d166035 100644
--- a/src/android/java/res/values-nl/strings.xml
+++ b/src/android/java/res/values-nl/strings.xml
@@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
- <string name="ministro_not_found_msg">De Ministro service is niet gevonden.\nDe applicatie kan niet starten.</string>
- <string name="ministro_needed_msg">Deze applicatie maakt gebruik van de Ministro service. Wilt u deze installeren?</string>
<string name="fatal_error_msg">Er is een fatale fout in de applicatie opgetreden. De applicatie kan niet verder gaan.</string>
<string name="unsupported_android_version">Deze versie van Android wordt niet ondersteund.</string>
</resources>
diff --git a/src/android/java/res/values-pl/strings.xml b/src/android/java/res/values-pl/strings.xml
index e7feb01392..abbd2f6394 100644
--- a/src/android/java/res/values-pl/strings.xml
+++ b/src/android/java/res/values-pl/strings.xml
@@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
- <string name="ministro_not_found_msg">Usługa Ministro nie została znaleziona.\nAplikacja nie może zostać uruchomiona.</string>
- <string name="ministro_needed_msg">Aplikacja wymaga usługi Ministro. Czy chcesz ją zainstalować?</string>
<string name="fatal_error_msg">Wystąpił błąd krytyczny. Aplikacja zostanie zamknięta.</string>
<string name="unsupported_android_version">Ta wersja Androida nie jest obsługiwana.</string>
</resources>
diff --git a/src/android/java/res/values-pt-rBR/strings.xml b/src/android/java/res/values-pt-rBR/strings.xml
index 4bac77c784..8a07b7e68a 100644
--- a/src/android/java/res/values-pt-rBR/strings.xml
+++ b/src/android/java/res/values-pt-rBR/strings.xml
@@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
- <string name="ministro_not_found_msg">Não foi possível encontrar o serviço Ministro.\nA aplicação não pode iniciar.</string>
- <string name="ministro_needed_msg">Essa aplicação requer o serviço Ministro. Gostaria de instalá-lo?</string>
<string name="fatal_error_msg">Sua aplicação encontrou um erro fatal e não pode continuar.</string>
<string name="unsupported_android_version">Esta versão do Android não é suportada.</string>
</resources>
diff --git a/src/android/java/res/values-ro/strings.xml b/src/android/java/res/values-ro/strings.xml
index d55c5b5c38..033f743cf4 100644
--- a/src/android/java/res/values-ro/strings.xml
+++ b/src/android/java/res/values-ro/strings.xml
@@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
- <string name="ministro_not_found_msg">Serviciul Ministro nu poate fi găsit.\nAplicaţia nu poate porni.</string>
- <string name="ministro_needed_msg">Această aplicaţie necesită serviciul Ministro.\nDoriţi să-l instalaţi?</string>
<string name="fatal_error_msg">Aplicaţia dumneavoastră a întâmpinat o eroare fatală şi nu poate continua.</string>
<string name="unsupported_android_version">Această versiune de Android nu este suportată.</string>
</resources>
diff --git a/src/android/java/res/values-ru/strings.xml b/src/android/java/res/values-ru/strings.xml
index ec853d22f9..73344c8f9b 100644
--- a/src/android/java/res/values-ru/strings.xml
+++ b/src/android/java/res/values-ru/strings.xml
@@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
- <string name="ministro_not_found_msg">Сервис Ministro не найден.\nПриложение нельзя запустить.</string>
- <string name="ministro_needed_msg">Этому приложению необходим сервис Ministro. Вы хотите его установить?</string>
<string name="fatal_error_msg">Ваше приложение столкнулось с фатальной ошибкой и не может более работать.</string>
<string name="unsupported_android_version">Эта версия Android не поддерживается.</string>
</resources>
diff --git a/src/android/java/res/values-se/strings.xml b/src/android/java/res/values-se/strings.xml
index 2a1e8284ce..f0927eee1f 100644
--- a/src/android/java/res/values-se/strings.xml
+++ b/src/android/java/res/values-se/strings.xml
@@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
- <string name="ministro_not_found_msg">Ministro servise nije pronađen. Aplikacija ne može biti pokrenuta.</string>
- <string name="ministro_needed_msg">Ova aplikacija zahteva Ministro servis. Želite li da ga instalirate?</string>
<string name="fatal_error_msg">Vaša aplikacija je naišla na fatalnu grešku i ne može nastaviti sa radom.</string>
<string name="unsupported_android_version">Ova verzija Android-a nije podržana.</string>
</resources>
diff --git a/src/android/java/res/values-zh-rCN/strings.xml b/src/android/java/res/values-zh-rCN/strings.xml
index 58cdd89946..d63fb0a1f2 100644
--- a/src/android/java/res/values-zh-rCN/strings.xml
+++ b/src/android/java/res/values-zh-rCN/strings.xml
@@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
- <string name="ministro_not_found_msg">无法找到Ministro服务。\n应用程序无法启动。</string>
- <string name="ministro_needed_msg">此应用程序需要Ministro服务。您想安装它吗?</string>
<string name="fatal_error_msg">您的应用程序遇到一个致命错误导致它无法继续。</string>
<string name="unsupported_android_version">这个版本的安卓系统不被支持。</string>
</resources>
diff --git a/src/android/java/res/values-zh-rTW/strings.xml b/src/android/java/res/values-zh-rTW/strings.xml
index 81d2bebdee..e6dcaac27a 100644
--- a/src/android/java/res/values-zh-rTW/strings.xml
+++ b/src/android/java/res/values-zh-rTW/strings.xml
@@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
- <string name="ministro_not_found_msg">無法找到Ministro服務。\n應用程序無法啟動。</string>
- <string name="ministro_needed_msg">此應用程序需要Ministro服務。您想安裝它嗎?</string>
<string name="fatal_error_msg">您的應用程序遇到一個致命錯誤導致它無法繼續。</string>
<string name="unsupported_android_version">這個版本的安卓系統不被支持。</string>
</resources>
diff --git a/src/android/java/res/values/strings.xml b/src/android/java/res/values/strings.xml
index 0110948dcf..42077b07db 100644
--- a/src/android/java/res/values/strings.xml
+++ b/src/android/java/res/values/strings.xml
@@ -1,8 +1,6 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<!-- %%INSERT_STRINGS -->
- <string name="ministro_not_found_msg">Can\'t find Ministro service.\nThe application can\'t start.</string>
- <string name="ministro_needed_msg">This application requires Ministro service. Would you like to install it?</string>
<string name="fatal_error_msg">Your application encountered a fatal error and cannot continue.</string>
<string name="unsupported_android_version">This version of Android is not supported.</string>
</resources>
diff --git a/src/android/java/src/org/kde/necessitas/ministro/IMinistro.aidl b/src/android/java/src/org/kde/necessitas/ministro/IMinistro.aidl
deleted file mode 100644
index bbd8116d96..0000000000
--- a/src/android/java/src/org/kde/necessitas/ministro/IMinistro.aidl
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- Copyright (c) 2011-2013, BogDan Vatra <bogdan@kde.org>
- Contact: http://www.qt.io/licensing/
-
- 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 http://www.qt.io/terms-conditions. For further
- information use the contact form at http://www.qt.io/contact-us.
-
- BSD License Usage
- Alternatively, this file may be used under 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:
-
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. 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.
-
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
-*/
-
-
-package org.kde.necessitas.ministro;
-
-import org.kde.necessitas.ministro.IMinistroCallback;
-
-interface IMinistro
-{
-/**
-* Check/download required libs to run the application
-*
-* param callback - interface used by Minsitro service to notify the client when the loader is ready
-* param parameters
-* parameters fields:
-* * Key Name Key type Explanations
-* "sources" StringArray Sources list from where Ministro will download the libs. Make sure you are using ONLY secure locations.
-* "repository" String Overwrites the default Ministro repository. Possible values: default, stable, testing and unstable
-* "required.modules" StringArray Required modules by your application
-* "application.title" String Application name, used to show more informations to user
-* "qt.provider" String Qt libs provider, currently only "necessitas" is supported.
-* "minimum.ministro.api" Integer Minimum Ministro API level, used to check if Ministro service compatible with your application. Current API Level is 3 !
-* "minimum.qt.version" Integer Minimim Qt version (e.g. 0x040800, which means Qt 4.8.0, check http://qt-project.org/doc/qt-4.8/qtglobal.html#QT_VERSION)!
-*/
- void requestLoader(in IMinistroCallback callback, in Bundle parameters);
-}
diff --git a/src/android/java/src/org/kde/necessitas/ministro/IMinistroCallback.aidl b/src/android/java/src/org/kde/necessitas/ministro/IMinistroCallback.aidl
deleted file mode 100644
index f19caa69e0..0000000000
--- a/src/android/java/src/org/kde/necessitas/ministro/IMinistroCallback.aidl
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- Copyright (c) 2011-2013, BogDan Vatra <bogdan@kde.org>
- Contact: http://www.qt.io/licensing/
-
- 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 http://www.qt.io/terms-conditions. For further
- information use the contact form at http://www.qt.io/contact-us.
-
- BSD License Usage
- Alternatively, this file may be used under 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:
-
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. 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.
-
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
-*/
-
-package org.kde.necessitas.ministro;
-
-oneway interface IMinistroCallback {
-/**
-* This method is called by the Ministro service back into the application which
-* implements this interface.
-*
-* param in - loaderParams
-* loaderParams fields:
-* * Key Name Key type Explanations
-* * "error.code" Integer See below
-* * "error.message" String Missing if no error, otherwise will contain the error message translated into phone language where available.
-* * "dex.path" String The list of jar/apk files containing classes and resources, needed to be passed to application DexClassLoader
-* * "lib.path" String The list of directories containing native libraries; may be missing, needed to be passed to application DexClassLoader
-* * "loader.class.name" String Loader class name.
-*
-* "error.code" field possible errors:
-* - 0 no error.
-* - 1 incompatible Ministro version. Ministro needs to be upgraded.
-* - 2 not all modules could be satisfy.
-* - 3 invalid parameters
-* - 4 invalid qt version
-* - 5 download canceled
-*
-* The parameter contains additional fields which are used by the loader to start your application, so it must be passed to the loader.
-*/
-
- void loaderReady(in Bundle loaderParams);
-}
diff --git a/src/android/java/src/org/qtproject/qt/android/bindings/QtActivity.java b/src/android/java/src/org/qtproject/qt/android/bindings/QtActivity.java
index 9b496089ca..17fcf0e19b 100644
--- a/src/android/java/src/org/qtproject/qt/android/bindings/QtActivity.java
+++ b/src/android/java/src/org/qtproject/qt/android/bindings/QtActivity.java
@@ -168,8 +168,6 @@ public class QtActivity extends Activity
QtApplication.invokeDelegateMethod(QtApplication.onActivityResult, requestCode, resultCode, data);
return;
}
- if (requestCode == QtLoader.MINISTRO_INSTALL_REQUEST_CODE)
- m_loader.startApp(false);
super.onActivityResult(requestCode, resultCode, data);
}
public void super_onActivityResult(int requestCode, int resultCode, Intent data)
@@ -1141,4 +1139,9 @@ public class QtActivity extends Activity
{
return QtNative.activityDelegate().isKeyboardVisible();
}
+
+ public void notifyQtAndroidPluginRunning(boolean running)
+ {
+ QtNative.activityDelegate().notifyQtAndroidPluginRunning(running);
+ }
}
diff --git a/src/android/java/src/org/qtproject/qt/android/bindings/QtActivityLoader.java b/src/android/java/src/org/qtproject/qt/android/bindings/QtActivityLoader.java
index da6b01c9a7..9251eba5d2 100644
--- a/src/android/java/src/org/qtproject/qt/android/bindings/QtActivityLoader.java
+++ b/src/android/java/src/org/qtproject/qt/android/bindings/QtActivityLoader.java
@@ -58,32 +58,6 @@ public class QtActivityLoader extends QtLoader {
super(activity, QtActivity.class);
m_activity = activity;
}
- @Override
- protected void downloadUpgradeMinistro(String msg) {
- AlertDialog.Builder downloadDialog = new AlertDialog.Builder(m_activity);
- downloadDialog.setMessage(msg);
- downloadDialog.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialogInterface, int i) {
- try {
- Uri uri = Uri.parse("market://details?id=org.kde.necessitas.ministro");
- Intent intent = new Intent(Intent.ACTION_VIEW, uri);
- m_activity.startActivityForResult(intent, MINISTRO_INSTALL_REQUEST_CODE);
- } catch (Exception e) {
- e.printStackTrace();
- ministroNotFound();
- }
- }
- });
-
- downloadDialog.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialogInterface, int i) {
- m_activity.finish();
- }
- });
- downloadDialog.show();
- }
@Override
protected String loaderClassName() {
diff --git a/src/android/java/src/org/qtproject/qt/android/bindings/QtApplication.java b/src/android/java/src/org/qtproject/qt/android/bindings/QtApplication.java
index 34a3bc28ea..e2df476181 100644
--- a/src/android/java/src/org/qtproject/qt/android/bindings/QtApplication.java
+++ b/src/android/java/src/org/qtproject/qt/android/bindings/QtApplication.java
@@ -102,9 +102,7 @@ public class QtApplication extends Application
}
}
}
- } catch (Exception e) {
- e.printStackTrace();
- }
+ } catch (Exception e) { }
}
}
diff --git a/src/android/java/src/org/qtproject/qt/android/bindings/QtLoader.java b/src/android/java/src/org/qtproject/qt/android/bindings/QtLoader.java
index 3dfac43339..ef53e91bab 100644
--- a/src/android/java/src/org/qtproject/qt/android/bindings/QtLoader.java
+++ b/src/android/java/src/org/qtproject/qt/android/bindings/QtLoader.java
@@ -1,4 +1,5 @@
/*
+ Copyright (C) 2021 The Qt Company Ltd.
Copyright (c) 2019, BogDan Vatra <bogdan@kde.org>
Contact: http://www.qt.io/licensing/
@@ -37,22 +38,16 @@
package org.qtproject.qt.android.bindings;
import android.app.AlertDialog;
-import android.content.ComponentName;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.DialogInterface;
import android.content.Intent;
-import android.content.ServiceConnection;
import android.content.pm.ComponentInfo;
+import android.content.res.Resources;
import android.os.Build;
import android.os.Bundle;
-import android.os.IBinder;
-import android.os.RemoteException;
import android.util.Log;
-import org.kde.necessitas.ministro.IMinistro;
-import org.kde.necessitas.ministro.IMinistroCallback;
-
import java.io.File;
import java.io.FileOutputStream;
import java.lang.reflect.Method;
@@ -65,11 +60,6 @@ import dalvik.system.DexClassLoader;
public abstract class QtLoader {
- public final static int MINISTRO_INSTALL_REQUEST_CODE = 0xf3ee; // request code used to know when Ministro instalation is finished
- public static final int MINISTRO_API_LEVEL = 5; // Ministro api level (check IMinistro.aidl file)
- public static final int NECESSITAS_API_LEVEL = 2; // Necessitas api level used by platform plugin
- public static final int QT_VERSION = 0x050700; // This app requires at least Qt version 5.7.0
-
public static final String ERROR_CODE_KEY = "error.code";
public static final String ERROR_MESSAGE_KEY = "error.message";
public static final String DEX_PATH_KEY = "dex.path";
@@ -81,7 +71,6 @@ public abstract class QtLoader {
public static final String BUNDLED_LIBRARIES_KEY = "bundled.libraries";
public static final String MAIN_LIBRARY_KEY = "main.library";
public static final String STATIC_INIT_CLASSES_KEY = "static.init.classes";
- public static final String NECESSITAS_API_LEVEL_KEY = "necessitas.api.level";
public static final String EXTRACT_STYLE_KEY = "extract.android.style";
private static final String EXTRACT_STYLE_MINIMAL_KEY = "extract.android.style.option";
@@ -89,20 +78,6 @@ public abstract class QtLoader {
public static final String SYSTEM_LIB_PATH = "/system/lib/";
public String[] SYSTEM_APP_PATHS = {"/system/priv-app/", "/system/app/"};
- /// Ministro server parameter keys
- public static final String REQUIRED_MODULES_KEY = "required.modules";
- public static final String APPLICATION_TITLE_KEY = "application.title";
- public static final String MINIMUM_MINISTRO_API_KEY = "minimum.ministro.api";
- public static final String MINIMUM_QT_VERSION_KEY = "minimum.qt.version";
- public static final String SOURCES_KEY = "sources"; // needs MINISTRO_API_LEVEL >=3 !!!
- // Use this key to specify any 3rd party sources urls
- // Ministro will download these repositories into their
- // own folders, check http://community.kde.org/Necessitas/Ministro
- // for more details.
-
- public static final String REPOSITORY_KEY = "repository"; // use this key to overwrite the default ministro repsitory
- public static final String ANDROID_THEMES_KEY = "android.themes"; // themes that your application uses
-
public String APPLICATION_PARAMETERS = null; // use this variable to pass any parameters to your application,
// the parameters must not contain any white spaces
// and must be separated with "\t"
@@ -129,20 +104,6 @@ public abstract class QtLoader {
public String QT_ANDROID_DEFAULT_THEME = null; // sets the default theme.
- public static final int INCOMPATIBLE_MINISTRO_VERSION = 1; // Incompatible Ministro version. Ministro needs to be upgraded.
-
- public String[] m_sources = {"https://download.qt-project.org/ministro/android/qt5/qt-5.7"}; // Make sure you are using ONLY secure locations
- public String m_repository = "default"; // Overwrites the default Ministro repository
- // Possible values:
- // * default - Ministro default repository set with "Ministro configuration tool".
- // By default the stable version is used. Only this or stable repositories should
- // be used in production.
- // * stable - stable repository, only this and default repositories should be used
- // in production.
- // * testing - testing repository, DO NOT use this repository in production,
- // this repository is used to push a new release, and should be used to test your application.
- // * unstable - unstable repository, DO NOT use this repository in production,
- // this repository is used to push Qt snapshots.
public ArrayList<String> m_qtLibs = null; // required qt libs
public int m_displayDensity = -1;
private ContextWrapper m_context;
@@ -167,10 +128,6 @@ public abstract class QtLoader {
protected void runOnUiThread(Runnable run) {
run.run();
}
- protected void downloadUpgradeMinistro(String msg)
- {
- Log.e(QtApplication.QtTAG, msg);
- }
protected abstract String loaderClassName();
protected abstract Class<?> contextClassName();
@@ -215,33 +172,29 @@ public abstract class QtLoader {
// this function is used to load and start the loader
private void loadApplication(Bundle loaderParams)
{
+ final Resources resources = m_context.getResources();
+ final String packageName = m_context.getPackageName();
try {
final int errorCode = loaderParams.getInt(ERROR_CODE_KEY);
if (errorCode != 0) {
- if (errorCode == INCOMPATIBLE_MINISTRO_VERSION) {
- downloadUpgradeMinistro(loaderParams.getString(ERROR_MESSAGE_KEY));
- return;
- }
-
// fatal error, show the error and quit
AlertDialog errorDialog = new AlertDialog.Builder(m_context).create();
errorDialog.setMessage(loaderParams.getString(ERROR_MESSAGE_KEY));
- errorDialog.setButton(m_context.getResources().getString(android.R.string.ok), new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- finish();
- }
- });
+ errorDialog.setButton(resources.getString(android.R.string.ok),
+ new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ finish();
+ }
+ });
errorDialog.show();
return;
}
// add all bundled Qt libs to loader params
- ArrayList<String> libs = new ArrayList<String>();
- if (m_contextInfo.metaData.containsKey("android.app.bundled_libs_resource_id")) {
- int resourceId = m_contextInfo.metaData.getInt("android.app.bundled_libs_resource_id");
- libs.addAll(prefferedAbiLibs(m_context.getResources().getStringArray(resourceId)));
- }
+ int id = resources.getIdentifier("bundled_libs", "array", packageName);
+ final String[] bundledLibs = resources.getStringArray(id);
+ ArrayList<String> libs = new ArrayList<>(prefferedAbiLibs(bundledLibs));
String libName = null;
if (m_contextInfo.metaData.containsKey("android.app.lib_name")) {
@@ -250,7 +203,6 @@ public abstract class QtLoader {
}
loaderParams.putStringArrayList(BUNDLED_LIBRARIES_KEY, libs);
- loaderParams.putInt(NECESSITAS_API_LEVEL_KEY, NECESSITAS_API_LEVEL);
// load and start QtLoader class
DexClassLoader classLoader = new DexClassLoader(loaderParams.getString(DEX_PATH_KEY), // .jar/.apk files
@@ -276,105 +228,33 @@ public abstract class QtLoader {
} catch (Exception e) {
e.printStackTrace();
AlertDialog errorDialog = new AlertDialog.Builder(m_context).create();
- if (m_contextInfo.metaData.containsKey("android.app.fatal_error_msg"))
- errorDialog.setMessage(m_contextInfo.metaData.getString("android.app.fatal_error_msg"));
- else
- errorDialog.setMessage("Fatal error, your application can't be started.");
-
- errorDialog.setButton(m_context.getResources().getString(android.R.string.ok), new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- finish();
- }
- });
+ int id = resources.getIdentifier("fatal_error_msg", "string",
+ packageName);
+ errorDialog.setMessage(resources.getString(id));
+ errorDialog.setButton(resources.getString(android.R.string.ok),
+ new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ finish();
+ }
+ });
errorDialog.show();
}
}
- private ServiceConnection m_ministroConnection=new ServiceConnection() {
- private IMinistro m_service = null;
- @Override
- public void onServiceConnected(ComponentName name, IBinder service)
- {
- m_service = IMinistro.Stub.asInterface(service);
- try {
- if (m_service != null) {
- Bundle parameters = new Bundle();
- parameters.putStringArray(REQUIRED_MODULES_KEY, (String[]) m_qtLibs.toArray());
- parameters.putString(APPLICATION_TITLE_KEY, getTitle());
- parameters.putInt(MINIMUM_MINISTRO_API_KEY, MINISTRO_API_LEVEL);
- parameters.putInt(MINIMUM_QT_VERSION_KEY, QT_VERSION);
- parameters.putString(ENVIRONMENT_VARIABLES_KEY, ENVIRONMENT_VARIABLES);
- if (APPLICATION_PARAMETERS != null)
- parameters.putString(APPLICATION_PARAMETERS_KEY, APPLICATION_PARAMETERS);
- parameters.putStringArray(SOURCES_KEY, m_sources);
- parameters.putString(REPOSITORY_KEY, m_repository);
- if (QT_ANDROID_THEMES != null)
- parameters.putStringArray(ANDROID_THEMES_KEY, QT_ANDROID_THEMES);
- m_service.requestLoader(m_ministroCallback, parameters);
- }
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- }
-
- private IMinistroCallback m_ministroCallback = new IMinistroCallback.Stub() {
- // this function is called back by Ministro.
- @Override
- public void loaderReady(final Bundle loaderParams) throws RemoteException {
- runOnUiThread(new Runnable() {
- @Override
- public void run() {
- m_context.unbindService(m_ministroConnection);
- loadApplication(loaderParams);
- }
- });
- }
- };
-
- @Override
- public void onServiceDisconnected(ComponentName name) {
- m_service = null;
- }
- };
-
- protected void ministroNotFound()
- {
- AlertDialog errorDialog = new AlertDialog.Builder(m_context).create();
-
- if (m_contextInfo.metaData.containsKey("android.app.ministro_not_found_msg"))
- errorDialog.setMessage(m_contextInfo.metaData.getString("android.app.ministro_not_found_msg"));
- else
- errorDialog.setMessage("Can't find Ministro service.\nThe application can't start.");
-
- errorDialog.setButton(m_context.getResources().getString(android.R.string.ok), new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- finish();
- }
- });
- errorDialog.show();
- }
-
public void startApp(final boolean firstStart)
{
try {
- if (m_contextInfo.metaData.containsKey("android.app.qt_sources_resource_id")) {
- int resourceId = m_contextInfo.metaData.getInt("android.app.qt_sources_resource_id");
- m_sources = m_context.getResources().getStringArray(resourceId);
- }
+ final Resources resources = m_context.getResources();
+ final String packageName = m_context.getPackageName();
+ int id = resources.getIdentifier("qt_libs", "array", packageName);
+ m_qtLibs = prefferedAbiLibs(resources.getStringArray(id));
- if (m_contextInfo.metaData.containsKey("android.app.repository"))
- m_repository = m_contextInfo.metaData.getString("android.app.repository");
-
- if (m_contextInfo.metaData.containsKey("android.app.qt_libs_resource_id")) {
- int resourceId = m_contextInfo.metaData.getInt("android.app.qt_libs_resource_id");
- m_qtLibs = prefferedAbiLibs(m_context.getResources().getStringArray(resourceId));
- }
+ id = resources.getIdentifier("use_local_qt_libs", "string", packageName);
+ final int useLocalLibs = Integer.parseInt(resources.getString(id));
- if (m_contextInfo.metaData.containsKey("android.app.use_local_qt_libs")
- && m_contextInfo.metaData.getInt("android.app.use_local_qt_libs") == 1) {
- ArrayList<String> libraryList = new ArrayList<String>();
+ if (useLocalLibs == 1) {
+ ArrayList<String> libraryList = new ArrayList<>();
boolean apkDeployFromSystem = false;
String apkPath = m_context.getApplicationInfo().publicSourceDir;
@@ -417,10 +297,13 @@ public abstract class QtLoader {
libraryList.add(libPrefix + lib + ".so");
}
- if (m_contextInfo.metaData.containsKey("android.app.bundle_local_qt_libs")
- && m_contextInfo.metaData.getInt("android.app.bundle_local_qt_libs") == 1) {
- int resourceId = m_contextInfo.metaData.getInt("android.app.load_local_libs_resource_id");
- for (String libs : prefferedAbiLibs(m_context.getResources().getStringArray(resourceId))) {
+ id = resources.getIdentifier("bundle_local_qt_libs", "string", packageName);
+ final int bundleLocalLibs = Integer.parseInt(resources.getString(id));
+
+ if (bundleLocalLibs == 1) {
+ id = resources.getIdentifier("load_local_libs", "array", packageName);
+ ArrayList<String> localLibs = prefferedAbiLibs(resources.getStringArray(id));
+ for (String libs : localLibs) {
for (String lib : libs.split(":")) {
if (!lib.isEmpty())
libraryList.add(libsDir + lib);
@@ -434,10 +317,11 @@ public abstract class QtLoader {
loaderParams.putInt(ERROR_CODE_KEY, 0);
loaderParams.putString(DEX_PATH_KEY, new String());
loaderParams.putString(LOADER_CLASS_NAME_KEY, loaderClassName());
- if (m_contextInfo.metaData.containsKey("android.app.static_init_classes")) {
- loaderParams.putStringArray(STATIC_INIT_CLASSES_KEY,
- m_contextInfo.metaData.getString("android.app.static_init_classes").split(":"));
- }
+
+ id = resources.getIdentifier("static_init_classes", "string", packageName);
+ loaderParams.putStringArray(STATIC_INIT_CLASSES_KEY, resources.getString(id)
+ .split(":"));
+
loaderParams.putStringArrayList(NATIVE_LIBRARIES_KEY, libraryList);
@@ -472,8 +356,7 @@ public abstract class QtLoader {
if (extractOption.equals("full"))
ENVIRONMENT_VARIABLES += "\tQT_USE_ANDROID_NATIVE_STYLE=1";
- ENVIRONMENT_VARIABLES += "\tMINISTRO_ANDROID_STYLE_PATH=" + stylePath
- + "\tQT_ANDROID_THEMES_ROOT_PATH=" + themePath;
+ ENVIRONMENT_VARIABLES += "\tANDROID_STYLE_PATH=" + stylePath;
loaderParams.putString(ENVIRONMENT_VARIABLES_KEY, ENVIRONMENT_VARIABLES);
@@ -505,23 +388,6 @@ public abstract class QtLoader {
loadApplication(loaderParams);
return;
}
-
- try {
- if (!m_context.bindService(new Intent(org.kde.necessitas.ministro.IMinistro.class.getCanonicalName()),
- m_ministroConnection,
- Context.BIND_AUTO_CREATE)) {
- throw new SecurityException("");
- }
- } catch (Exception e) {
- if (firstStart) {
- String msg = "This application requires Ministro service. Would you like to install it?";
- if (m_contextInfo.metaData.containsKey("android.app.ministro_needed_msg"))
- msg = m_contextInfo.metaData.getString("android.app.ministro_needed_msg");
- downloadUpgradeMinistro(msg);
- } else {
- ministroNotFound();
- }
- }
} catch (Exception e) {
Log.e(QtApplication.QtTAG, "Can't create main activity", e);
}
diff --git a/src/android/templates/AndroidManifest.xml b/src/android/templates/AndroidManifest.xml
index f9f4aed5c2..d352209339 100644
--- a/src/android/templates/AndroidManifest.xml
+++ b/src/android/templates/AndroidManifest.xml
@@ -1,80 +1,82 @@
<?xml version="1.0"?>
-<manifest package="org.qtproject.example" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="-- %%INSERT_VERSION_NAME%% --" android:versionCode="-- %%INSERT_VERSION_CODE%% --" android:installLocation="auto">
- <!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
- Remove the comment if you do not require these default permissions. -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="org.qtproject.example"
+ android:installLocation="auto"
+ android:versionCode="-- %%INSERT_VERSION_CODE%% --"
+ android:versionName="-- %%INSERT_VERSION_NAME%% --">
+ <!-- The comment below will be replaced with dependencies permissions upon deployment.
+ Remove the comment if you do not require these default permissions. -->
<!-- %%INSERT_PERMISSIONS -->
- <!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application.
- Remove the comment if you do not require these default features. -->
+ <!-- The comment below will be replaced with dependencies permissions upon deployment.
+ Remove the comment if you do not require these default features. -->
<!-- %%INSERT_FEATURES -->
- <supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
- <application android:hardwareAccelerated="true" android:name="org.qtproject.qt.android.bindings.QtApplication" android:label="-- %%INSERT_APP_NAME%% --" android:extractNativeLibs="true" android:requestLegacyExternalStorage="true">
- <activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density" android:name="org.qtproject.qt.android.bindings.QtActivity" android:label="-- %%INSERT_APP_NAME%% --" android:screenOrientation="unspecified" android:launchMode="singleTop">
+ <supports-screens
+ android:anyDensity="true"
+ android:largeScreens="true"
+ android:normalScreens="true"
+ android:smallScreens="true" />
+ <application
+ android:name="org.qtproject.qt.android.bindings.QtApplication"
+ android:extractNativeLibs="true"
+ android:hardwareAccelerated="true"
+ android:label="-- %%INSERT_APP_NAME%% --"
+ android:requestLegacyExternalStorage="true">
+ <activity
+ android:name="org.qtproject.qt.android.bindings.QtActivity"
+ android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density"
+ android:label="-- %%INSERT_APP_NAME%% --"
+ android:launchMode="singleTop"
+ android:screenOrientation="unspecified">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
-
- <!-- Application arguments -->
- <meta-data android:name="android.app.arguments" android:value="-- %%INSERT_APP_ARGUMENTS%% --"/>
<!-- Application arguments -->
- <meta-data android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --"/>
- <meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/>
- <meta-data android:name="android.app.repository" android:value="default"/>
- <meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/>
- <meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/>
- <!-- Deploy Qt libs as part of package -->
- <meta-data android:name="android.app.bundle_local_qt_libs" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/>
+ <meta-data
+ android:name="android.app.arguments"
+ android:value="-- %%INSERT_APP_ARGUMENTS%% --" />
+ <!-- Application arguments -->
+ <meta-data
+ android:name="android.app.lib_name"
+ android:value="-- %%INSERT_APP_LIB_NAME%% --" />
- <!-- Run with local libs -->
- <meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/>
- <meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/>
- <meta-data android:name="android.app.load_local_libs_resource_id" android:resource="@array/load_local_libs"/>
- <meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/>
- <meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/>
<!-- Used to specify custom system library path to run with local system libs -->
- <!-- <meta-data android:name="android.app.system_libs_prefix" android:value="/system/lib/"/> -->
- <!-- Messages maps -->
- <meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
- <meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
- <meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
- <meta-data android:value="@string/unsupported_android_version" android:name="android.app.unsupported_android_version"/>
- <!-- Messages maps -->
-
+<!-- <meta-data android:name="android.app.system_libs_prefix" android:value="/system/lib/"/>-->
<!-- Splash screen -->
- <!-- Orientation-specific (portrait/landscape) data is checked first. If not available for current orientation,
- then android.app.splash_screen_drawable. For best results, use together with splash_screen_sticky and
- use hideSplashScreen() with a fade-out animation from Qt Android Extras to hide the splash screen when you
- are done populating your window with content. -->
- <!-- meta-data android:name="android.app.splash_screen_drawable_portrait" android:resource="@drawable/logo_portrait" / -->
- <!-- meta-data android:name="android.app.splash_screen_drawable_landscape" android:resource="@drawable/logo_landscape" / -->
- <!-- meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/logo"/ -->
- <!-- meta-data android:name="android.app.splash_screen_sticky" android:value="true"/ -->
+ <!-- Orientation-specific (portrait/landscape) data is checked first. If not available
+ for current orientation, then android.app.splash_screen_drawable. For best
+ results, use together with splash_screen_sticky and use hideSplashScreen() with
+ a fade-out animation to hide the splash screen when you are done populating
+ your window with content. -->
+<!-- <meta-data android:name="android.app.splash_screen_drawable_portrait" android:resource="@drawable/logo_portrait" />-->
+<!-- <meta-data android:name="android.app.splash_screen_drawable_landscape" android:resource="@drawable/logo_landscape" />-->
+<!-- <meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/logo"/>-->
+<!-- <meta-data android:name="android.app.splash_screen_sticky" android:value="true"/>-->
<!-- Splash screen -->
<!-- Background running -->
<!-- Warning: changing this value to true may cause unexpected crashes if the
application still try to draw after
- "applicationStateChanged(Qt::ApplicationSuspended)"
- signal is sent! -->
- <meta-data android:name="android.app.background_running" android:value="false"/>
+ "applicationStateChanged(Qt::ApplicationSuspended)" signal is sent! -->
+ <meta-data
+ android:name="android.app.background_running"
+ android:value="false" />
<!-- Background running -->
<!-- extract android style -->
<!-- available android:values :
- * default - In most cases this will be the same as "full", but it can also be something else if needed, e.g., for compatibility reasons
+ * default - In most cases this will be the same as "full", but it can also be
+ * something else if needed, e.g., for compatibility reasons
* full - useful QWidget & Quick Controls 1 apps
* minimal - useful for Quick Controls 2 apps, it is much faster than "full"
- * none - useful for apps that don't use any of the above Qt modules
- -->
- <meta-data android:name="android.app.extract_android_style" android:value="default"/>
+ * none - useful for apps that don't use any of the above Qt modules -->
+ <meta-data
+ android:name="android.app.extract_android_style"
+ android:value="default" />
<!-- extract android style -->
- </activity>
-
- <!-- For adding service(s) please check: https://wiki.qt.io/AndroidServices -->
-
+ </activity>
</application>
-
</manifest>
diff --git a/src/android/templates/build.gradle b/src/android/templates/build.gradle
index fa8642f435..310b7106be 100644
--- a/src/android/templates/build.gradle
+++ b/src/android/templates/build.gradle
@@ -71,7 +71,7 @@ android {
defaultConfig {
resConfig "en"
- minSdkVersion = qtMinSdkVersion
- targetSdkVersion = qtTargetSdkVersion
+ minSdkVersion qtMinSdkVersion
+ targetSdkVersion qtTargetSdkVersion
}
}
diff --git a/src/android/templates/res/values/libs.xml b/src/android/templates/res/values/libs.xml
index 6b1a4a2a02..beb15ca1d8 100644
--- a/src/android/templates/res/values/libs.xml
+++ b/src/android/templates/res/values/libs.xml
@@ -1,11 +1,6 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
- <array name="qt_sources">
- <item>https://download.qt.io/ministro/android/qt5/qt-5.14</item>
- </array>
-
- <!-- The following is handled automatically by the deployment tool. It should
- not be edited manually. -->
+ <!-- DO NOT EDIT THIS: This file is populated automatically by the deployment tool. -->
<array name="bundled_libs">
<!-- %%INSERT_EXTRA_LIBS%% -->
@@ -19,4 +14,7 @@
<!-- %%INSERT_LOCAL_LIBS%% -->
</array>
+ <string name="static_init_classes"><!-- %%INSERT_INIT_CLASSES%% --></string>
+ <string name="use_local_qt_libs"><!-- %%USE_LOCAL_QT_LIBS%% --></string>
+ <string name="bundle_local_qt_libs"><!-- %%BUNDLE_LOCAL_QT_LIBS%% --></string>
</resources>
diff --git a/src/concurrent/CMakeLists.txt b/src/concurrent/CMakeLists.txt
index 876ddaf1ba..bc353f4e89 100644
--- a/src/concurrent/CMakeLists.txt
+++ b/src/concurrent/CMakeLists.txt
@@ -34,6 +34,7 @@ qt_internal_add_module(Concurrent
Qt::CorePrivate
PRECOMPILED_HEADER
"../corelib/global/qt_pch.h"
+ GENERATE_CPP_EXPORTS
)
## Scopes:
diff --git a/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentfilter.cpp b/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentfilter.cpp
index 0e0f414b13..b9ff35c798 100644
--- a/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentfilter.cpp
+++ b/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentfilter.cpp
@@ -177,9 +177,7 @@ struct StringTransform
};
QFuture<QString> fooString =
- QtConcurrent::filteredReduced<QString>(strings,
- StartsWith(QLatin1String("Foo")),
- StringTransform());
+ QtConcurrent::filteredReduced(strings, StartsWith(QLatin1String("Foo")), StringTransform());
//! [14]
//! [15]
@@ -196,7 +194,7 @@ QList<int> results = future.results();
// add up all even integers
QList<int> list3 { 1, 2, 3, 4 };
-int sum = QtConcurrent::filteredReduced<int>(list3,
+QFuture<int> sum = QtConcurrent::filteredReduced(list3,
[](int x) {
return (x & 1) == 0;
},
@@ -213,7 +211,7 @@ void intSumReduce(int &sum, int x)
}
QList<int> list { 1, 2, 3, 4 };
-int sum = QtConcurrent::filteredReduced(list,
+QFuture<int> sum = QtConcurrent::filteredReduced(list,
[] (int x) {
return (x & 1) == 0;
},
@@ -228,7 +226,7 @@ bool keepEvenIntegers(int x)
}
QList<int> list { 1, 2, 3, 4 };
-int sum = QtConcurrent::filteredReduced<int>(list,
+QFuture<int> sum = QtConcurrent::filteredReduced(list,
keepEvenIntegers,
[](int &sum, int x) {
sum += x;
diff --git a/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentmap.cpp b/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentmap.cpp
index 659925a1c6..9c91715ac0 100644
--- a/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentmap.cpp
+++ b/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentmap.cpp
@@ -165,10 +165,8 @@ struct ImageTransform
};
QFuture<QImage> thumbNails =
- QtConcurrent::mappedReduced<QImage>(images,
- Scaled(100),
- ImageTransform(),
- QtConcurrent::SequentialReduce);
+ QtConcurrent::mappedReduced(images, Scaled(100), ImageTransform(),
+ QtConcurrent::SequentialReduce);
//! [11]
//! [13]
@@ -223,7 +221,7 @@ QList<QImage> collage = QtConcurrent::mappedReduced(images,
//! [16]
//! [17]
-QList<QImage> collage = QtConcurrent::mappedReduced<QImage>(images,
+QList<QImage> collage = QtConcurrent::mappedReduced(images,
[&size](const QImage &image) {
return image.scaled(size, size);
},
diff --git a/src/concurrent/qtconcurrent_global.h b/src/concurrent/qtconcurrent_global.h
index 83c6028e20..8be7d5a12a 100644
--- a/src/concurrent/qtconcurrent_global.h
+++ b/src/concurrent/qtconcurrent_global.h
@@ -41,19 +41,6 @@
#define QTCONCURRENT_GLOBAL_H
#include <QtCore/qglobal.h>
-
-QT_BEGIN_NAMESPACE
-
-#ifndef QT_STATIC
-# if defined(QT_BUILD_CONCURRENT_LIB)
-# define Q_CONCURRENT_EXPORT Q_DECL_EXPORT
-# else
-# define Q_CONCURRENT_EXPORT Q_DECL_IMPORT
-# endif
-#else
-# define Q_CONCURRENT_EXPORT
-#endif
-
-QT_END_NAMESPACE
+#include <QtConcurrent/qtconcurrentexports.h>
#endif // include guard
diff --git a/src/concurrent/qtconcurrentfilter.cpp b/src/concurrent/qtconcurrentfilter.cpp
index 2bec2a6eb9..663507be35 100644
--- a/src/concurrent/qtconcurrentfilter.cpp
+++ b/src/concurrent/qtconcurrentfilter.cpp
@@ -148,9 +148,7 @@
\snippet code/src_concurrent_qtconcurrentfilter.cpp 13
- For the reduce function, function objects are not directly
- supported. Function objects can, however, be used
- when the type of the reduction result is explicitly specified:
+ Function objects are also supported for the reduce function:
\snippet code/src_concurrent_qtconcurrentfilter.cpp 14
@@ -168,9 +166,7 @@
\snippet code/src_concurrent_qtconcurrentfilter.cpp 16
- For the reduce function, lambda expressions are not directly supported.
- Lambda expressions can, however, be used when the type of the reduction
- result is explicitly specified:
+ You can also pass a lambda as a reduce object:
\snippet code/src_concurrent_qtconcurrentfilter.cpp 17
diff --git a/src/concurrent/qtconcurrentfilter.h b/src/concurrent/qtconcurrentfilter.h
index 891eb4b9ca..dce4f35db6 100644
--- a/src/concurrent/qtconcurrentfilter.h
+++ b/src/concurrent/qtconcurrentfilter.h
@@ -148,8 +148,8 @@ QFuture<ResultType> filteredReduced(Sequence &&sequence,
#ifndef Q_CLANG_QDOC
template <typename Sequence, typename KeepFunctor, typename ReduceFunctor,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType>
+ std::enable_if_t<QtPrivate::isInvocable<KeepFunctor, Sequence>::value, int> = 0,
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type>
QFuture<ResultType> filteredReduced(QThreadPool *pool,
Sequence &&sequence,
KeepFunctor &&keep,
@@ -163,8 +163,8 @@ QFuture<ResultType> filteredReduced(QThreadPool *pool,
}
template <typename Sequence, typename KeepFunctor, typename ReduceFunctor,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType>
+ std::enable_if_t<QtPrivate::isInvocable<KeepFunctor, Sequence>::value, int> = 0,
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type>
QFuture<ResultType> filteredReduced(Sequence &&sequence,
KeepFunctor &&keep,
ReduceFunctor &&reduce,
@@ -177,9 +177,9 @@ QFuture<ResultType> filteredReduced(Sequence &&sequence,
}
template <typename Sequence, typename KeepFunctor, typename ReduceFunctor,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType,
typename InitialValueType,
+ std::enable_if_t<QtPrivate::isInvocable<KeepFunctor, Sequence>::value, int> = 0,
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
QFuture<ResultType> filteredReduced(QThreadPool *pool,
Sequence &&sequence,
@@ -196,9 +196,9 @@ QFuture<ResultType> filteredReduced(QThreadPool *pool,
}
template <typename Sequence, typename KeepFunctor, typename ReduceFunctor,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType,
typename InitialValueType,
+ std::enable_if_t<QtPrivate::isInvocable<KeepFunctor, Sequence>::value, int> = 0,
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
QFuture<ResultType> filteredReduced(Sequence &&sequence,
KeepFunctor &&keep,
@@ -287,8 +287,7 @@ QFuture<ResultType> filteredReduced(Iterator begin,
#ifndef Q_CLANG_QDOC
template <typename Iterator, typename KeepFunctor, typename ReduceFunctor,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType>
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type>
QFuture<ResultType> filteredReduced(QThreadPool *pool,
Iterator begin,
Iterator end,
@@ -302,8 +301,7 @@ QFuture<ResultType> filteredReduced(QThreadPool *pool,
}
template <typename Iterator, typename KeepFunctor, typename ReduceFunctor,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType>
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type>
QFuture<ResultType> filteredReduced(Iterator begin,
Iterator end,
KeepFunctor &&keep,
@@ -317,8 +315,7 @@ QFuture<ResultType> filteredReduced(Iterator begin,
}
template <typename Iterator, typename KeepFunctor, typename ReduceFunctor,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType,
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type,
typename InitialValueType,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
QFuture<ResultType> filteredReduced(QThreadPool *pool,
@@ -336,8 +333,8 @@ QFuture<ResultType> filteredReduced(QThreadPool *pool,
}
template <typename Iterator, typename KeepFunctor, typename ReduceFunctor,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType,
+ std::enable_if_t<QtPrivate::isIterator<Iterator>::value, int> = 0,
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type,
typename InitialValueType,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
QFuture<ResultType> filteredReduced(Iterator begin,
@@ -480,8 +477,8 @@ ResultType blockingFilteredReduced(Sequence &&sequence,
#ifndef Q_CLANG_QDOC
template <typename Sequence, typename KeepFunctor, typename ReduceFunctor,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType>
+ std::enable_if_t<QtPrivate::isInvocable<KeepFunctor, Sequence>::value, int> = 0,
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type>
ResultType blockingFilteredReduced(QThreadPool *pool,
Sequence &&sequence,
KeepFunctor &&keep,
@@ -496,8 +493,8 @@ ResultType blockingFilteredReduced(QThreadPool *pool,
}
template <typename Sequence, typename KeepFunctor, typename ReduceFunctor,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType>
+ std::enable_if_t<QtPrivate::isInvocable<KeepFunctor, Sequence>::value, int> = 0,
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type>
ResultType blockingFilteredReduced(Sequence &&sequence,
KeepFunctor &&keep,
ReduceFunctor &&reduce,
@@ -511,9 +508,9 @@ ResultType blockingFilteredReduced(Sequence &&sequence,
}
template <typename Sequence, typename KeepFunctor, typename ReduceFunctor,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType,
typename InitialValueType,
+ std::enable_if_t<QtPrivate::isInvocable<KeepFunctor, Sequence>::value, int> = 0,
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
ResultType blockingFilteredReduced(QThreadPool *pool,
Sequence &&sequence,
@@ -531,9 +528,9 @@ ResultType blockingFilteredReduced(QThreadPool *pool,
}
template <typename Sequence, typename KeepFunctor, typename ReduceFunctor,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType,
typename InitialValueType,
+ std::enable_if_t<QtPrivate::isInvocable<KeepFunctor, Sequence>::value, int> = 0,
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
ResultType blockingFilteredReduced(Sequence &&sequence,
KeepFunctor &&keep,
@@ -627,8 +624,7 @@ ResultType blockingFilteredReduced(Iterator begin,
#ifndef Q_CLANG_QDOC
template <typename Iterator, typename KeepFunctor, typename ReduceFunctor,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType>
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type>
ResultType blockingFilteredReduced(QThreadPool *pool,
Iterator begin,
Iterator end,
@@ -644,8 +640,7 @@ ResultType blockingFilteredReduced(QThreadPool *pool,
}
template <typename Iterator, typename KeepFunctor, typename ReduceFunctor,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType>
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type>
ResultType blockingFilteredReduced(Iterator begin,
Iterator end,
KeepFunctor &&keep,
@@ -660,8 +655,7 @@ ResultType blockingFilteredReduced(Iterator begin,
}
template <typename Iterator, typename KeepFunctor, typename ReduceFunctor,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType,
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type,
typename InitialValueType,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
ResultType blockingFilteredReduced(QThreadPool *pool,
@@ -679,8 +673,8 @@ ResultType blockingFilteredReduced(QThreadPool *pool,
}
template <typename Iterator, typename KeepFunctor, typename ReduceFunctor,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType,
+ std::enable_if_t<QtPrivate::isIterator<Iterator>::value, int> = 0,
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type,
typename InitialValueType,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
ResultType blockingFilteredReduced(Iterator begin,
diff --git a/src/concurrent/qtconcurrentfunctionwrappers.h b/src/concurrent/qtconcurrentfunctionwrappers.h
index 194d020fb2..be4a09f107 100644
--- a/src/concurrent/qtconcurrentfunctionwrappers.h
+++ b/src/concurrent/qtconcurrentfunctionwrappers.h
@@ -41,7 +41,7 @@
#define QTCONCURRENT_FUNCTIONWRAPPERS_H
#include <QtConcurrent/qtconcurrentcompilertest.h>
-#include <QtCore/QStringList>
+#include <QtCore/qfuture.h>
#include <tuple>
@@ -143,17 +143,55 @@ struct ReduceResultType<T(C::*)(U) noexcept>
};
#endif
-// -- MapSequenceResultType
+template<class T, class Enable = void>
+struct hasCallOperator : std::false_type
+{
+};
-template <class InputSequence, class MapFunctor>
-struct MapSequenceResultType;
+template<class T>
+struct hasCallOperator<T, std::void_t<decltype(&T::operator())>> : std::true_type
+{
+};
-template <class MapFunctor>
-struct MapSequenceResultType<QStringList, MapFunctor>
+template<class T, class Enable = void>
+struct isIterator : std::false_type
{
- typedef QList<QtPrivate::MapResultType<QStringList, MapFunctor>> ResultType;
};
+template<class T>
+struct isIterator<T, std::void_t<typename std::iterator_traits<T>::value_type>> : std::true_type
+{
+};
+
+template <class Callable, class Sequence>
+using isInvocable = std::is_invocable<Callable, typename std::decay_t<Sequence>::value_type>;
+
+template<class Callable, class Enable = void>
+struct ReduceResultTypeHelper
+{
+};
+
+template <class Callable>
+struct ReduceResultTypeHelper<Callable,
+ typename std::enable_if_t<std::is_function_v<std::remove_pointer_t<std::decay_t<Callable>>>
+ || std::is_member_function_pointer_v<std::decay_t<Callable>>>>
+{
+ using type = typename QtPrivate::ReduceResultType<std::decay_t<Callable>>::ResultType;
+};
+
+template <class Callable>
+struct ReduceResultTypeHelper<Callable,
+ typename std::enable_if_t<!std::is_function_v<std::remove_pointer_t<std::decay_t<Callable>>>
+ && hasCallOperator<std::decay_t<Callable>>::value>>
+{
+ using type = std::decay_t<typename QtPrivate::ArgResolver<Callable>::First>;
+};
+
+// -- MapSequenceResultType
+
+template <class InputSequence, class MapFunctor>
+struct MapSequenceResultType;
+
#ifndef QT_NO_TEMPLATE_TEMPLATE_PARAMETERS
template <template <typename...> class InputSequence, typename MapFunctor, typename ...T>
diff --git a/src/concurrent/qtconcurrentmap.cpp b/src/concurrent/qtconcurrentmap.cpp
index d68dd63bb8..8abfec4baf 100644
--- a/src/concurrent/qtconcurrentmap.cpp
+++ b/src/concurrent/qtconcurrentmap.cpp
@@ -274,9 +274,7 @@
\snippet code/src_concurrent_qtconcurrentmap.cpp 14
- For the reduce function, function objects are not directly
- supported. Function objects can, however, be used
- when the type of the reduction result is explicitly specified:
+ Function objects are also supported for the reduce function:
\snippet code/src_concurrent_qtconcurrentmap.cpp 11
@@ -294,9 +292,7 @@
\snippet code/src_concurrent_qtconcurrentmap.cpp 16
- For the reduce function, lambda expressions are not directly supported.
- Lambda expressions can, however, be used when the type of the reduction
- result is explicitly specified:
+ You can also pass a lambda as a reduce object:
\snippet code/src_concurrent_qtconcurrentmap.cpp 17
diff --git a/src/concurrent/qtconcurrentmap.h b/src/concurrent/qtconcurrentmap.h
index 4043ecd8a2..3e20f8b4dc 100644
--- a/src/concurrent/qtconcurrentmap.h
+++ b/src/concurrent/qtconcurrentmap.h
@@ -47,7 +47,6 @@
#include <QtConcurrent/qtconcurrentmapkernel.h>
#include <QtConcurrent/qtconcurrentreducekernel.h>
#include <QtConcurrent/qtconcurrentfunctionwrappers.h>
-#include <QtCore/qstringlist.h>
QT_BEGIN_NAMESPACE
@@ -151,8 +150,8 @@ QFuture<ResultType> mappedReduced(Sequence &&sequence,
}
template <typename Sequence, typename MapFunctor, typename ReduceFunctor,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType>
+ std::enable_if_t<QtPrivate::isInvocable<MapFunctor, Sequence>::value, int> = 0,
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type>
QFuture<ResultType> mappedReduced(QThreadPool *pool,
Sequence &&sequence,
MapFunctor &&map,
@@ -166,8 +165,8 @@ QFuture<ResultType> mappedReduced(QThreadPool *pool,
}
template <typename Sequence, typename MapFunctor, typename ReduceFunctor,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType>
+ std::enable_if_t<QtPrivate::isInvocable<MapFunctor, Sequence>::value, int> = 0,
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type>
QFuture<ResultType> mappedReduced(Sequence &&sequence,
MapFunctor &&map,
ReduceFunctor &&reduce,
@@ -183,10 +182,9 @@ QFuture<ResultType> mappedReduced(Sequence &&sequence,
template <typename Sequence, typename MapFunctor, typename ReduceFunctor, typename ResultType,
typename InitialValueType>
#else
-template <typename Sequence, typename MapFunctor, typename ReduceFunctor,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType,
- typename InitialValueType,
+template <typename Sequence, typename MapFunctor, typename ReduceFunctor, typename InitialValueType,
+ std::enable_if_t<QtPrivate::isInvocable<MapFunctor, Sequence>::value, int> = 0,
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
#endif
QFuture<ResultType> mappedReduced(QThreadPool *pool,
@@ -207,10 +205,9 @@ QFuture<ResultType> mappedReduced(QThreadPool *pool,
template <typename Sequence, typename MapFunctor, typename ReduceFunctor, typename ResultType,
typename InitialValueType>
#else
-template <typename Sequence, typename MapFunctor, typename ReduceFunctor,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType,
- typename InitialValueType,
+template <typename Sequence, typename MapFunctor, typename ReduceFunctor, typename InitialValueType,
+ std::enable_if_t<QtPrivate::isInvocable<MapFunctor, Sequence>::value, int> = 0,
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
#endif
QFuture<ResultType> mappedReduced(Sequence &&sequence,
@@ -299,8 +296,7 @@ QFuture<ResultType> mappedReduced(Iterator begin,
}
template <typename Iterator, typename MapFunctor, typename ReduceFunctor,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType>
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type>
QFuture<ResultType> mappedReduced(QThreadPool *pool,
Iterator begin,
Iterator end,
@@ -315,7 +311,7 @@ QFuture<ResultType> mappedReduced(QThreadPool *pool,
}
template <typename Iterator, typename MapFunctor, typename ReduceFunctor,
- typename ResultType = typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType>
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type>
QFuture<ResultType> mappedReduced(Iterator begin,
Iterator end,
MapFunctor &&map,
@@ -333,8 +329,7 @@ template <typename Iterator, typename MapFunctor, typename ReduceFunctor, typena
typename InitialValueType>
#else
template <typename Iterator, typename MapFunctor, typename ReduceFunctor,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType,
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type,
typename InitialValueType,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
#endif
@@ -357,8 +352,8 @@ template <typename Iterator, typename MapFunctor, typename ReduceFunctor, typena
typename InitialValueType>
#else
template<typename Iterator, typename MapFunctor, typename ReduceFunctor,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType,
+ std::enable_if_t<QtPrivate::isIterator<Iterator>::value, int> = 0,
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type,
typename InitialValueType,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
#endif
@@ -528,8 +523,8 @@ ResultType blockingMappedReduced(Sequence &&sequence,
}
template <typename MapFunctor, typename ReduceFunctor, typename Sequence,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType>
+ std::enable_if_t<QtPrivate::isInvocable<MapFunctor, Sequence>::value, int> = 0,
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type>
ResultType blockingMappedReduced(QThreadPool *pool,
Sequence &&sequence,
MapFunctor &&map,
@@ -545,8 +540,8 @@ ResultType blockingMappedReduced(QThreadPool *pool,
}
template <typename MapFunctor, typename ReduceFunctor, typename Sequence,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType>
+ std::enable_if_t<QtPrivate::isInvocable<MapFunctor, Sequence>::value, int> = 0,
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type>
ResultType blockingMappedReduced(Sequence &&sequence,
MapFunctor &&map,
ReduceFunctor &&reduce,
@@ -564,10 +559,9 @@ ResultType blockingMappedReduced(Sequence &&sequence,
template <typename MapFunctor, typename ReduceFunctor, typename Sequence, typename ResultType,
typename InitialValueType>
#else
-template <typename MapFunctor, typename ReduceFunctor, typename Sequence,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType,
- typename InitialValueType,
+template <typename MapFunctor, typename ReduceFunctor, typename Sequence, typename InitialValueType,
+ std::enable_if_t<QtPrivate::isInvocable<MapFunctor, Sequence>::value, int> = 0,
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
#endif
ResultType blockingMappedReduced(QThreadPool *pool,
@@ -589,10 +583,9 @@ ResultType blockingMappedReduced(QThreadPool *pool,
template <typename MapFunctor, typename ReduceFunctor, typename Sequence, typename ResultType,
typename InitialValueType>
#else
-template<typename MapFunctor, typename ReduceFunctor, typename Sequence,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType,
- typename InitialValueType,
+template<typename MapFunctor, typename ReduceFunctor, typename Sequence, typename InitialValueType,
+ std::enable_if_t<QtPrivate::isInvocable<MapFunctor, Sequence>::value, int> = 0,
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
#endif
ResultType blockingMappedReduced(Sequence &&sequence,
@@ -687,8 +680,7 @@ ResultType blockingMappedReduced(Iterator begin,
}
template <typename Iterator, typename MapFunctor, typename ReduceFunctor,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType>
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type>
ResultType blockingMappedReduced(QThreadPool *pool,
Iterator begin,
Iterator end,
@@ -704,8 +696,7 @@ ResultType blockingMappedReduced(QThreadPool *pool,
}
template <typename Iterator, typename MapFunctor, typename ReduceFunctor,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType>
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type>
ResultType blockingMappedReduced(Iterator begin,
Iterator end,
MapFunctor &&map,
@@ -724,8 +715,7 @@ template <typename Iterator, typename MapFunctor, typename ReduceFunctor, typena
typename InitialValueType>
#else
template <typename Iterator, typename MapFunctor, typename ReduceFunctor,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType,
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type,
typename InitialValueType,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
#endif
@@ -749,8 +739,8 @@ template <typename Iterator, typename MapFunctor, typename ReduceFunctor, typena
typename InitialValueType>
#else
template <typename Iterator, typename MapFunctor, typename ReduceFunctor,
- typename ResultType =
- typename QtPrivate::ReduceResultType<std::decay_t<ReduceFunctor>>::ResultType,
+ std::enable_if_t<QtPrivate::isIterator<Iterator>::value, int> = 0,
+ typename ResultType = typename QtPrivate::ReduceResultTypeHelper<ReduceFunctor>::type,
typename InitialValueType,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
#endif
diff --git a/src/concurrent/qtconcurrentthreadengine.cpp b/src/concurrent/qtconcurrentthreadengine.cpp
index fcc504a96c..399afb6195 100644
--- a/src/concurrent/qtconcurrentthreadengine.cpp
+++ b/src/concurrent/qtconcurrentthreadengine.cpp
@@ -176,39 +176,6 @@ void ThreadEngineBase::startSingleThreaded()
finish();
}
-void ThreadEngineBase::startBlocking()
-{
- start();
- barrier.acquire();
- startThreads();
-
- bool throttled = false;
-#ifndef QT_NO_EXCEPTIONS
- try {
-#endif
- while (threadFunction() == ThrottleThread) {
- if (threadThrottleExit()) {
- throttled = true;
- break;
- }
- }
-#ifndef QT_NO_EXCEPTIONS
- } catch (QException &e) {
- handleException(e);
- } catch (...) {
- handleException(QUnhandledException(std::current_exception()));
- }
-#endif
-
- if (throttled == false) {
- barrier.release();
- }
-
- barrier.wait();
- finish();
- exceptionStore.throwPossibleException();
-}
-
void ThreadEngineBase::startThread()
{
startThreadInternal();
diff --git a/src/concurrent/qtconcurrentthreadengine.h b/src/concurrent/qtconcurrentthreadengine.h
index 4cd5b85210..5a78377e71 100644
--- a/src/concurrent/qtconcurrentthreadengine.h
+++ b/src/concurrent/qtconcurrentthreadengine.h
@@ -91,7 +91,6 @@ public:
ThreadEngineBase(QThreadPool *pool);
virtual ~ThreadEngineBase();
void startSingleThreaded();
- void startBlocking();
void startThread();
bool isCanceled();
void waitForResume();
@@ -154,15 +153,6 @@ public:
}
// Runs the user algorithm using multiple threads.
- // This function blocks until the algorithm is finished,
- // and then returns the result.
- T *startBlocking()
- {
- ThreadEngineBase::startBlocking();
- return result();
- }
-
- // Runs the user algorithm using multiple threads.
// Does not block, returns a future.
QFuture<T> startAsynchronously()
{
@@ -242,13 +232,6 @@ class ThreadEngineStarter : public ThreadEngineStarterBase<T>
public:
ThreadEngineStarter(TypedThreadEngine *eng)
: Base(eng) { }
-
- T startBlocking()
- {
- T t = *this->threadEngine->startBlocking();
- delete this->threadEngine;
- return t;
- }
};
// Full template specialization where T is void.
@@ -258,12 +241,6 @@ class ThreadEngineStarter<void> : public ThreadEngineStarterBase<void>
public:
ThreadEngineStarter(ThreadEngine<void> *_threadEngine)
: ThreadEngineStarterBase<void>(_threadEngine) {}
-
- void startBlocking()
- {
- this->threadEngine->startBlocking();
- delete this->threadEngine;
- }
};
//! [qtconcurrentthreadengine-1]
diff --git a/src/corelib/.prev_configure.cmake b/src/corelib/.prev_configure.cmake
deleted file mode 100644
index 893acda953..0000000000
--- a/src/corelib/.prev_configure.cmake
+++ /dev/null
@@ -1,965 +0,0 @@
-
-
-#### Inputs
-
-# input doubleconversion
-set(INPUT_doubleconversion "undefined" CACHE STRING "")
-set_property(CACHE INPUT_doubleconversion PROPERTY STRINGS undefined no qt system)
-
-# input libb2
-set(INPUT_libb2 "undefined" CACHE STRING "")
-set_property(CACHE INPUT_libb2 PROPERTY STRINGS undefined no qt system)
-
-
-
-#### Libraries
-
-if((UNIX) OR QT_FIND_ALL_PACKAGES_ALWAYS)
- qt_find_package(WrapBacktrace PROVIDED_TARGETS WrapBacktrace::WrapBacktrace MODULE_NAME core QMAKE_LIB backtrace)
-endif()
-qt_find_package(WrapDoubleConversion PROVIDED_TARGETS WrapDoubleConversion::WrapDoubleConversion MODULE_NAME core QMAKE_LIB doubleconversion)
-qt_find_package(GLIB2 PROVIDED_TARGETS GLIB2::GLIB2 MODULE_NAME core QMAKE_LIB glib)
-qt_find_package(ICU COMPONENTS i18n uc data PROVIDED_TARGETS ICU::i18n ICU::uc ICU::data MODULE_NAME core QMAKE_LIB icu)
-if(QT_FEATURE_dlopen)
- qt_add_qmake_lib_dependency(icu libdl)
-endif()
-qt_find_package(Libsystemd PROVIDED_TARGETS PkgConfig::Libsystemd MODULE_NAME core QMAKE_LIB journald)
-qt_find_package(WrapAtomic PROVIDED_TARGETS WrapAtomic::WrapAtomic MODULE_NAME core QMAKE_LIB libatomic)
-qt_find_package(Libb2 PROVIDED_TARGETS Libb2::Libb2 MODULE_NAME core QMAKE_LIB libb2)
-qt_find_package(WrapRt PROVIDED_TARGETS WrapRt::WrapRt MODULE_NAME core QMAKE_LIB librt)
-qt_find_package(LTTngUST PROVIDED_TARGETS LTTng::UST MODULE_NAME core QMAKE_LIB lttng-ust)
-qt_add_qmake_lib_dependency(lttng-ust libdl)
-qt_find_package(WrapSystemPCRE2 10.20 PROVIDED_TARGETS WrapSystemPCRE2::WrapSystemPCRE2 MODULE_NAME core QMAKE_LIB pcre2)
-set_package_properties(WrapPCRE2 PROPERTIES TYPE REQUIRED)
-if((QNX) OR QT_FIND_ALL_PACKAGES_ALWAYS)
- qt_find_package(PPS PROVIDED_TARGETS PPS::PPS MODULE_NAME core QMAKE_LIB pps)
-endif()
-qt_find_package(Slog2 PROVIDED_TARGETS Slog2::Slog2 MODULE_NAME core QMAKE_LIB slog2)
-
-
-#### Tests
-
-# atomicfptr
-qt_config_compile_test(atomicfptr
- LABEL "working std::atomic for function pointers"
- CODE
-"#include <atomic>
-typedef void (*fptr)(int);
-typedef std::atomic<fptr> atomicfptr;
-void testfunction(int) { }
-void test(volatile atomicfptr &a)
-{
- fptr v = a.load(std::memory_order_acquire);
- while (!a.compare_exchange_strong(v, &testfunction,
- std::memory_order_acq_rel,
- std::memory_order_acquire)) {
- v = a.exchange(&testfunction);
- }
- a.store(&testfunction, std::memory_order_release);
-}
-
-int main(void)
-{
- /* BEGIN TEST: */
-atomicfptr fptr(testfunction);
-test(fptr);
- /* END TEST: */
- return 0;
-}
-")
-
-# clock-monotonic
-qt_config_compile_test(clock_monotonic
- LABEL "POSIX monotonic clock"
- LIBRARIES
- WrapRt::WrapRt
- CODE
-"#include <unistd.h>
-#include <time.h>
-
-int main(void)
-{
- /* BEGIN TEST: */
-#if defined(_POSIX_MONOTONIC_CLOCK) && (_POSIX_MONOTONIC_CLOCK-0 >= 0)
-timespec ts;
-clock_gettime(CLOCK_MONOTONIC, &ts);
-#else
-# error Feature _POSIX_MONOTONIC_CLOCK not available
-#endif
- /* END TEST: */
- return 0;
-}
-")
-
-# cloexec
-qt_config_compile_test(cloexec
- LABEL "O_CLOEXEC"
- CODE
-"#define _GNU_SOURCE 1
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-int main(void)
-{
- /* BEGIN TEST: */
-int pipes[2];
-(void) pipe2(pipes, O_CLOEXEC | O_NONBLOCK);
-(void) fcntl(0, F_DUPFD_CLOEXEC, 0);
-(void) dup3(0, 3, O_CLOEXEC);
-#if defined(__NetBSD__)
-(void) paccept(0, 0, 0, NULL, SOCK_CLOEXEC | SOCK_NONBLOCK);
-#else
-(void) accept4(0, 0, 0, SOCK_CLOEXEC | SOCK_NONBLOCK);
-#endif
- /* END TEST: */
- return 0;
-}
-")
-
-# cxx11_future
-qt_config_compile_test(cxx11_future
- LABEL "C++11 <future>"
- CODE
-"#include <future>
-
-int main(void)
-{
- /* BEGIN TEST: */
-std::future<int> f = std::async([]() { return 42; });
-(void)f.get();
- /* END TEST: */
- return 0;
-}
-"# FIXME: qmake: unix:!android:LIBS += -lpthread
-)
-
-# cxx11_random
-qt_config_compile_test(cxx11_random
- LABEL "C++11 <random>"
- CODE
-"#include <random>
-
-int main(void)
-{
- /* BEGIN TEST: */
-std::mt19937 mt(0);
- /* END TEST: */
- return 0;
-}
-")
-
-# cxx17_filesystem
-qt_config_compile_test(cxx17_filesystem
- LABEL "C++17 <filesystem>"
- CODE
-"#include <filesystem>
-
-int main(void)
-{
- /* BEGIN TEST: */
-std::filesystem::copy(
- std::filesystem::path(\"./file\"),
- std::filesystem::path(\"./other\"));
- /* END TEST: */
- return 0;
-}
-"# FIXME: qmake: CONFIG += c++17
-)
-
-# eventfd
-qt_config_compile_test(eventfd
- LABEL "eventfd"
- CODE
-"#include <sys/eventfd.h>
-
-int main(void)
-{
- /* BEGIN TEST: */
-eventfd_t value;
-int fd = eventfd(0, EFD_CLOEXEC);
-eventfd_read(fd, &value);
-eventfd_write(fd, value);
- /* END TEST: */
- return 0;
-}
-")
-
-# futimens
-qt_config_compile_test(futimens
- LABEL "futimens()"
- CODE
-"#include <sys/stat.h>
-
-int main(void)
-{
- /* BEGIN TEST: */
-futimens(-1, 0);
- /* END TEST: */
- return 0;
-}
-"# FIXME: qmake: ["# Block futimens() on Apple platforms unless it's available on ALL", '# deployment targets. This simplifies the logic at the call site', "# dramatically, as it isn't strictly needed compared to futimes().", 'darwin: QMAKE_CXXFLAGS += -Werror=unguarded-availability -Werror=unguarded-availability-new', 'CONFIG += warn_on']
-)
-
-# futimes
-qt_config_compile_test(futimes
- LABEL "futimes()"
- CODE
-"#include <sys/time.h>
-
-int main(void)
-{
- /* BEGIN TEST: */
-futimes(-1, 0);
- /* END TEST: */
- return 0;
-}
-")
-
-# getauxval
-qt_config_compile_test(getauxval
- LABEL "getauxval()"
- CODE
-"#include <sys/auxv.h>
-
-int main(void)
-{
- /* BEGIN TEST: */
-(void) getauxval(AT_NULL);
- /* END TEST: */
- return 0;
-}
-")
-
-# getentropy
-qt_config_compile_test(getentropy
- LABEL "getentropy()"
- CODE
-"#include <unistd.h>
-
-int main(void)
-{
- /* BEGIN TEST: */
-char buf[32];
-(void) getentropy(buf, sizeof(buf));
- /* END TEST: */
- return 0;
-}
-")
-
-# glibc
-qt_config_compile_test(glibc
- LABEL "GNU libc"
- CODE
-"#include <stdlib.h>
-
-int main(void)
-{
- /* BEGIN TEST: */
-return __GLIBC__;
- /* END TEST: */
- return 0;
-}
-")
-
-# inotify
-qt_config_compile_test(inotify
- LABEL "inotify"
- CODE
-"#include <sys/inotify.h>
-
-int main(void)
-{
- /* BEGIN TEST: */
-inotify_init();
-inotify_add_watch(0, \"foobar\", IN_ACCESS);
-inotify_rm_watch(0, 1);
- /* END TEST: */
- return 0;
-}
-")
-
-# ipc_sysv
-qt_config_compile_test(ipc_sysv
- LABEL "SysV IPC"
- CODE
-"#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/sem.h>
-#include <sys/shm.h>
-#include <fcntl.h>
-
-int main(void)
-{
- /* BEGIN TEST: */
-key_t unix_key = ftok(\"test\", 'Q');
-semctl(semget(unix_key, 1, 0666 | IPC_CREAT | IPC_EXCL), 0, IPC_RMID, 0);
-shmget(unix_key, 0, 0666 | IPC_CREAT | IPC_EXCL);
-shmctl(0, 0, (struct shmid_ds *)(0));
- /* END TEST: */
- return 0;
-}
-")
-
-# ipc_posix
-if (LINUX)
- set(ipc_posix_TEST_LIBRARIES pthread rt)
-endif()
-qt_config_compile_test(ipc_posix
- LABEL "POSIX IPC"
- LIBRARIES
- "${ipc_posix_TEST_LIBRARIES}"
- CODE
-"#include <sys/types.h>
-#include <sys/mman.h>
-#include <semaphore.h>
-#include <fcntl.h>
-
-int main(void)
-{
- /* BEGIN TEST: */
-sem_close(sem_open(\"test\", O_CREAT | O_EXCL, 0666, 0));
-shm_open(\"test\", O_RDWR | O_CREAT | O_EXCL, 0666);
-shm_unlink(\"test\");
- /* END TEST: */
- return 0;
-}
-")
-
-# linkat
-qt_config_compile_test(linkat
- LABEL "linkat()"
- CODE
-"#define _ATFILE_SOURCE 1
-#include <fcntl.h>
-#include <unistd.h>
-
-int main(void)
-{
- /* BEGIN TEST: */
-linkat(AT_FDCWD, \"foo\", AT_FDCWD, \"bar\", AT_SYMLINK_FOLLOW);
- /* END TEST: */
- return 0;
-}
-")
-
-# ppoll
-qt_config_compile_test(ppoll
- LABEL "ppoll()"
- CODE
-"#include <signal.h>
-#include <poll.h>
-
-int main(void)
-{
- /* BEGIN TEST: */
-struct pollfd pfd;
-struct timespec ts;
-sigset_t sig;
-ppoll(&pfd, 1, &ts, &sig);
- /* END TEST: */
- return 0;
-}
-")
-
-# pollts
-qt_config_compile_test(pollts
- LABEL "pollts()"
- CODE
-"#include <poll.h>
-#include <signal.h>
-#include <time.h>
-
-int main(void)
-{
- /* BEGIN TEST: */
-struct pollfd pfd;
-struct timespec ts;
-sigset_t sig;
-pollts(&pfd, 1, &ts, &sig);
- /* END TEST: */
- return 0;
-}
-")
-
-# poll
-qt_config_compile_test(poll
- LABEL "poll()"
- CODE
-"#include <poll.h>
-
-int main(void)
-{
- /* BEGIN TEST: */
-struct pollfd pfd;
-poll(&pfd, 1, 0);
- /* END TEST: */
- return 0;
-}
-")
-
-# renameat2
-qt_config_compile_test(renameat2
- LABEL "renameat2()"
- CODE
-"#define _ATFILE_SOURCE 1
-#include <fcntl.h>
-#include <stdio.h>
-
-int main(void)
-{
- /* BEGIN TEST: */
-renameat2(AT_FDCWD, argv[1], AT_FDCWD, argv[2], RENAME_NOREPLACE | RENAME_WHITEOUT);
- /* END TEST: */
- return 0;
-}
-")
-
-# statx
-qt_config_compile_test(statx
- LABEL "statx() in libc"
- CODE
-"#define _ATFILE_SOURCE 1
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-int main(void)
-{
- /* BEGIN TEST: */
-struct statx statxbuf;
-unsigned int mask = STATX_BASIC_STATS;
-return statx(AT_FDCWD, \"\", AT_STATX_SYNC_AS_STAT, mask, &statxbuf);
- /* END TEST: */
- return 0;
-}
-")
-
-# syslog
-qt_config_compile_test(syslog
- LABEL "syslog"
- CODE
-"#include <syslog.h>
-
-int main(void)
-{
- /* BEGIN TEST: */
-openlog(\"qt\", 0, LOG_USER);
-syslog(LOG_INFO, \"configure\");
-closelog();
- /* END TEST: */
- return 0;
-}
-")
-
-# xlocalescanprint
-qt_config_compile_test(xlocalescanprint
- LABEL "xlocale.h (or equivalents)"
- CODE
-"#define QT_BEGIN_NAMESPACE
-#define QT_END_NAMESPACE
-
-#ifdef _MSVC_VER
-#define Q_CC_MSVC _MSVC_VER
-#endif
-
-#define QT_NO_DOUBLECONVERSION
-
-#include QDSP_P_H
-
-int main(void)
-{
- /* BEGIN TEST: */
-#ifdef _MSVC_VER
-_locale_t invalidLocale = NULL;
-#else
-locale_t invalidLocale = NULL;
-#endif
-double a = 3.4;
-qDoubleSnprintf(argv[0], 1, invalidLocale, \"invalid format\", a);
-qDoubleSscanf(argv[0], invalidLocale, \"invalid format\", &a, &argc);
- /* END TEST: */
- return 0;
-}
-"# FIXME: qmake: DEFINES += QDSP_P_H=$$shell_quote(\"@PWD@/text/qdoublescanprint_p.h\")
-)
-
-
-
-#### Features
-
-qt_feature("clock-gettime" PRIVATE
- LABEL "clock_gettime()"
- CONDITION UNIX AND WrapRt_FOUND
-)
-qt_feature("clock-monotonic" PUBLIC
- LABEL "POSIX monotonic clock"
- CONDITION QT_FEATURE_clock_gettime AND TEST_clock_monotonic
-)
-qt_feature_definition("clock-monotonic" "QT_NO_CLOCK_MONOTONIC" NEGATE VALUE "1")
-qt_feature("doubleconversion" PUBLIC PRIVATE
- LABEL "DoubleConversion"
-)
-qt_feature_definition("doubleconversion" "QT_NO_DOUBLECONVERSION" NEGATE VALUE "1")
-qt_feature("system-doubleconversion" PRIVATE
- LABEL " Using system DoubleConversion"
- CONDITION QT_FEATURE_doubleconversion AND WrapDoubleConversion_FOUND
- ENABLE INPUT_doubleconversion STREQUAL 'system'
- DISABLE INPUT_doubleconversion STREQUAL 'qt'
-)
-qt_feature("cxx11_future" PUBLIC
- LABEL "C++11 <future>"
- CONDITION TEST_cxx11_future
-)
-qt_feature("cxx17_filesystem" PUBLIC
- LABEL "C++17 <filesystem>"
- CONDITION TEST_cxx17_filesystem
-)
-qt_feature("eventfd" PUBLIC
- LABEL "eventfd"
- CONDITION NOT WASM AND TEST_eventfd
-)
-qt_feature_definition("eventfd" "QT_NO_EVENTFD" NEGATE VALUE "1")
-qt_feature("futimens" PRIVATE
- LABEL "futimens()"
- CONDITION NOT WIN32 AND TEST_futimens
-)
-qt_feature("futimes" PRIVATE
- LABEL "futimes()"
- CONDITION NOT WIN32 AND NOT QT_FEATURE_futimens AND TEST_futimes
-)
-qt_feature("getauxval" PRIVATE
- LABEL "getauxval()"
- CONDITION LINUX AND TEST_getauxval
-)
-qt_feature("getentropy" PRIVATE
- LABEL "getentropy()"
- CONDITION UNIX AND TEST_getentropy
-)
-qt_feature("glib" PUBLIC PRIVATE
- LABEL "GLib"
- AUTODETECT NOT WIN32
- CONDITION GLIB2_FOUND
-)
-qt_feature_definition("glib" "QT_NO_GLIB" NEGATE VALUE "1")
-qt_feature("glibc" PRIVATE
- LABEL "GNU libc"
- AUTODETECT LINUX
- CONDITION TEST_glibc
-)
-qt_feature("icu" PRIVATE
- LABEL "ICU"
- AUTODETECT NOT WIN32
- CONDITION ICU_FOUND
-)
-qt_feature("inotify" PUBLIC PRIVATE
- LABEL "inotify"
- CONDITION TEST_inotify
-)
-qt_feature_definition("inotify" "QT_NO_INOTIFY" NEGATE VALUE "1")
-qt_feature("ipc_posix"
- LABEL "Using POSIX IPC"
- AUTODETECT NOT WIN32
- CONDITION NOT TEST_ipc_sysv AND TEST_ipc_posix
-)
-qt_feature_definition("ipc_posix" "QT_POSIX_IPC")
-qt_feature("journald" PRIVATE
- LABEL "journald"
- AUTODETECT OFF
- CONDITION Libsystemd_FOUND
-)
-# Used by QCryptographicHash for the BLAKE2 hashing algorithms
-qt_feature("system-libb2" PRIVATE
- LABEL "Using system libb2"
- CONDITION Libb2_FOUND
- ENABLE INPUT_libb2 STREQUAL 'system'
- DISABLE INPUT_libb2 STREQUAL 'no' OR INPUT_libb2 STREQUAL 'qt'
-)
-# Currently only used by QTemporaryFile; linkat() exists on Android, but hardlink creation fails due to security rules
-qt_feature("linkat" PRIVATE
- LABEL "linkat()"
- AUTODETECT LINUX AND NOT ANDROID
- CONDITION TEST_linkat
-)
-qt_feature("std-atomic64" PUBLIC
- LABEL "64 bit atomic operations"
- CONDITION WrapAtomic_FOUND
-)
-qt_feature("mimetype" PUBLIC
- SECTION "Utilities"
- LABEL "Mimetype handling"
- PURPOSE "Provides MIME type handling."
-)
-qt_feature_definition("mimetype" "QT_NO_MIMETYPE" NEGATE VALUE "1")
-qt_feature("mimetype-database" PRIVATE
- LABEL "Built-in copy of the MIME database"
- CONDITION QT_FEATURE_mimetype
-)
-qt_feature("pcre2"
- LABEL "PCRE2"
- ENABLE INPUT_pcre STREQUAL 'qt' OR QT_FEATURE_system_pcre2
- DISABLE INPUT_pcre STREQUAL 'no'
-)
-qt_feature_config("pcre2" QMAKE_PRIVATE_CONFIG)
-qt_feature("system-pcre2" PRIVATE
- LABEL " Using system PCRE2"
- CONDITION WrapSystemPCRE2_FOUND
- ENABLE INPUT_pcre STREQUAL 'system'
- DISABLE INPUT_pcre STREQUAL 'no' OR INPUT_pcre STREQUAL 'qt'
-)
-qt_feature("poll_ppoll" PRIVATE
- LABEL "Native ppoll()"
- CONDITION NOT WASM AND TEST_ppoll
- EMIT_IF NOT WIN32
-)
-qt_feature("poll_pollts" PRIVATE
- LABEL "Native pollts()"
- CONDITION NOT QT_FEATURE_poll_ppoll AND TEST_pollts
- EMIT_IF NOT WIN32
-)
-qt_feature("poll_poll" PRIVATE
- LABEL "Native poll()"
- CONDITION NOT QT_FEATURE_poll_ppoll AND NOT QT_FEATURE_poll_pollts AND TEST_poll
- EMIT_IF NOT WIN32
-)
-qt_feature("poll_select" PRIVATE
- LABEL "Emulated poll()"
- CONDITION NOT QT_FEATURE_poll_ppoll AND NOT QT_FEATURE_poll_pollts AND NOT QT_FEATURE_poll_poll
- EMIT_IF NOT WIN32
-)
-qt_feature_definition("poll_select" "QT_NO_NATIVE_POLL")
-qt_feature("qqnx_pps" PRIVATE
- LABEL "PPS"
- CONDITION PPS_FOUND
- EMIT_IF QNX
-)
-qt_feature("renameat2" PRIVATE
- LABEL "renameat2()"
- CONDITION LINUX AND TEST_renameat2
-)
-qt_feature("slog2" PRIVATE
- LABEL "slog2"
- CONDITION Slog2_FOUND
-)
-qt_feature("statx" PRIVATE
- LABEL "statx() in libc"
- CONDITION LINUX AND TEST_statx
-)
-qt_feature("syslog" PRIVATE
- LABEL "syslog"
- AUTODETECT OFF
- CONDITION TEST_syslog
-)
-qt_feature("threadsafe-cloexec"
- LABEL "Threadsafe pipe creation"
- CONDITION TEST_cloexec
-)
-qt_feature_definition("threadsafe-cloexec" "QT_THREADSAFE_CLOEXEC" VALUE "1")
-qt_feature_config("threadsafe-cloexec" QMAKE_PUBLIC_QT_CONFIG)
-qt_feature("properties" PUBLIC
- SECTION "Kernel"
- LABEL "Properties"
- PURPOSE "Supports scripting Qt-based applications."
-)
-qt_feature_definition("properties" "QT_NO_PROPERTIES" NEGATE VALUE "1")
-qt_feature("regularexpression" PUBLIC
- SECTION "Kernel"
- LABEL "QRegularExpression"
- PURPOSE "Provides an API to Perl-compatible regular expressions."
- CONDITION QT_FEATURE_system_pcre2 OR QT_FEATURE_pcre2
-)
-qt_feature_definition("regularexpression" "QT_NO_REGULAREXPRESSION" NEGATE VALUE "1")
-qt_feature("backtrace" PRIVATE
- LABEL "backtrace"
- CONDITION UNIX AND QT_FEATURE_regularexpression AND WrapBacktrace_FOUND
-)
-qt_feature("sharedmemory" PUBLIC
- SECTION "Kernel"
- LABEL "QSharedMemory"
- PURPOSE "Provides access to a shared memory segment."
- CONDITION ( ANDROID OR WIN32 OR ( NOT VXWORKS AND ( TEST_ipc_sysv OR TEST_ipc_posix ) ) )
-)
-qt_feature_definition("sharedmemory" "QT_NO_SHAREDMEMORY" NEGATE VALUE "1")
-qt_feature("shortcut" PUBLIC
- SECTION "Kernel"
- LABEL "QShortcut"
- PURPOSE "Provides keyboard accelerators and shortcuts."
-)
-qt_feature_definition("shortcut" "QT_NO_SHORTCUT" NEGATE VALUE "1")
-qt_feature("systemsemaphore" PUBLIC
- SECTION "Kernel"
- LABEL "QSystemSemaphore"
- PURPOSE "Provides a general counting system semaphore."
- CONDITION ( NOT INTEGRITY AND NOT VXWORKS AND NOT rtems ) AND ( ANDROID OR WIN32 OR TEST_ipc_sysv OR TEST_ipc_posix )
-)
-qt_feature_definition("systemsemaphore" "QT_NO_SYSTEMSEMAPHORE" NEGATE VALUE "1")
-qt_feature("xmlstream" PUBLIC
- SECTION "Kernel"
- LABEL "XML Streaming APIs"
- PURPOSE "Provides a simple streaming API for XML."
-)
-qt_feature_definition("xmlstream" "QT_NO_XMLSTREAM" NEGATE VALUE "1")
-qt_feature("xmlstreamreader" PUBLIC
- SECTION "Kernel"
- LABEL "QXmlStreamReader"
- PURPOSE "Provides a well-formed XML parser with a simple streaming API."
- CONDITION QT_FEATURE_xmlstream
-)
-qt_feature_definition("xmlstreamreader" "QT_NO_XMLSTREAMREADER" NEGATE VALUE "1")
-qt_feature("xmlstreamwriter" PUBLIC
- SECTION "Kernel"
- LABEL "QXmlStreamWriter"
- PURPOSE "Provides a XML writer with a simple streaming API."
- CONDITION QT_FEATURE_xmlstream
-)
-qt_feature_definition("xmlstreamwriter" "QT_NO_XMLSTREAMWRITER" NEGATE VALUE "1")
-qt_feature("textdate" PUBLIC
- SECTION "Data structures"
- LABEL "Text Date"
- PURPOSE "Supports month and day names in dates."
-)
-qt_feature_definition("textdate" "QT_NO_TEXTDATE" NEGATE VALUE "1")
-qt_feature("datestring" PUBLIC
- SECTION "Data structures"
- LABEL "QDate/QTime/QDateTime"
- PURPOSE "Provides conversion between dates and strings."
- CONDITION QT_FEATURE_textdate
-)
-qt_feature_definition("datestring" "QT_NO_DATESTRING" NEGATE VALUE "1")
-qt_feature("process" PUBLIC
- SECTION "File I/O"
- LABEL "QProcess"
- PURPOSE "Supports external process invocation."
- CONDITION QT_FEATURE_processenvironment AND ( QT_FEATURE_thread OR NOT UNIX ) AND NOT UIKIT AND NOT INTEGRITY AND NOT VXWORKS AND NOT rtems
-)
-qt_feature_definition("process" "QT_NO_PROCESS" NEGATE VALUE "1")
-qt_feature("processenvironment" PUBLIC
- SECTION "File I/O"
- LABEL "QProcessEnvironment"
- PURPOSE "Provides a higher-level abstraction of environment variables."
- CONDITION NOT INTEGRITY AND NOT rtems
-)
-qt_feature("temporaryfile" PUBLIC
- SECTION "File I/O"
- LABEL "QTemporaryFile"
- PURPOSE "Provides an I/O device that operates on temporary files."
-)
-qt_feature_definition("temporaryfile" "QT_NO_TEMPORARYFILE" NEGATE VALUE "1")
-qt_feature("library" PUBLIC
- SECTION "File I/O"
- LABEL "QLibrary"
- PURPOSE "Provides a wrapper for dynamically loaded libraries."
- CONDITION WIN32 OR HPUX OR ( NOT NACL AND QT_FEATURE_dlopen )
-)
-qt_feature_definition("library" "QT_NO_LIBRARY" NEGATE VALUE "1")
-qt_feature("settings" PUBLIC
- SECTION "File I/O"
- LABEL "QSettings"
- PURPOSE "Provides persistent application settings."
-)
-qt_feature_definition("settings" "QT_NO_SETTINGS" NEGATE VALUE "1")
-qt_feature("filesystemwatcher" PUBLIC
- SECTION "File I/O"
- LABEL "QFileSystemWatcher"
- PURPOSE "Provides an interface for monitoring files and directories for modifications."
-)
-qt_feature_definition("filesystemwatcher" "QT_NO_FILESYSTEMWATCHER" NEGATE VALUE "1")
-qt_feature("filesystemiterator" PUBLIC
- SECTION "File I/O"
- LABEL "QFileSystemIterator"
- PURPOSE "Provides fast file system iteration."
-)
-qt_feature_definition("filesystemiterator" "QT_NO_FILESYSTEMITERATOR" NEGATE VALUE "1")
-qt_feature("itemmodel" PUBLIC
- SECTION "ItemViews"
- LABEL "Qt Item Model"
- PURPOSE "Provides the item model for item views"
-)
-qt_feature_definition("itemmodel" "QT_NO_ITEMMODEL" NEGATE VALUE "1")
-qt_feature("proxymodel" PUBLIC
- SECTION "ItemViews"
- LABEL "QAbstractProxyModel"
- PURPOSE "Supports processing of data passed between another model and a view."
- CONDITION QT_FEATURE_itemmodel
-)
-qt_feature_definition("proxymodel" "QT_NO_PROXYMODEL" NEGATE VALUE "1")
-qt_feature("sortfilterproxymodel" PUBLIC
- SECTION "ItemViews"
- LABEL "QSortFilterProxyModel"
- PURPOSE "Supports sorting and filtering of data passed between another model and a view."
- CONDITION QT_FEATURE_proxymodel AND QT_FEATURE_regularexpression
-)
-qt_feature_definition("sortfilterproxymodel" "QT_NO_SORTFILTERPROXYMODEL" NEGATE VALUE "1")
-qt_feature("identityproxymodel" PUBLIC
- SECTION "ItemViews"
- LABEL "QIdentityProxyModel"
- PURPOSE "Supports proxying a source model unmodified."
- CONDITION QT_FEATURE_proxymodel
-)
-qt_feature_definition("identityproxymodel" "QT_NO_IDENTITYPROXYMODEL" NEGATE VALUE "1")
-qt_feature("transposeproxymodel" PUBLIC
- SECTION "ItemViews"
- LABEL "QTransposeProxyModel"
- PURPOSE "Provides a proxy to swap rows and columns of a model."
- CONDITION QT_FEATURE_proxymodel
-)
-qt_feature_definition("transposeproxymodel" "QT_NO_TRANSPOSEPROXYMODEL" NEGATE VALUE "1")
-qt_feature("concatenatetablesproxymodel" PUBLIC
- SECTION "ItemViews"
- LABEL "QConcatenateTablesProxyModel"
- PURPOSE "Supports concatenating source models."
- CONDITION QT_FEATURE_proxymodel
-)
-qt_feature_definition("concatenatetablesproxymodel" "QT_NO_CONCATENATETABLESPROXYMODEL" NEGATE VALUE "1")
-qt_feature("stringlistmodel" PUBLIC
- SECTION "ItemViews"
- LABEL "QStringListModel"
- PURPOSE "Provides a model that supplies strings to views."
- CONDITION QT_FEATURE_itemmodel
-)
-qt_feature_definition("stringlistmodel" "QT_NO_STRINGLISTMODEL" NEGATE VALUE "1")
-qt_feature("translation" PUBLIC
- SECTION "Internationalization"
- LABEL "Translation"
- PURPOSE "Supports translations using QObject::tr()."
-)
-qt_feature_definition("translation" "QT_NO_TRANSLATION" NEGATE VALUE "1")
-qt_feature("easingcurve" PUBLIC
- SECTION "Utilities"
- LABEL "Easing curve"
- PURPOSE "Provides easing curve."
-)
-qt_feature("animation" PUBLIC
- SECTION "Utilities"
- LABEL "Animation"
- PURPOSE "Provides a framework for animations."
- CONDITION QT_FEATURE_properties AND QT_FEATURE_easingcurve
-)
-qt_feature_definition("animation" "QT_NO_ANIMATION" NEGATE VALUE "1")
-qt_feature("gestures" PUBLIC
- SECTION "Utilities"
- LABEL "Gesture"
- PURPOSE "Provides a framework for gestures."
-)
-qt_feature_definition("gestures" "QT_NO_GESTURES" NEGATE VALUE "1")
-qt_feature("sha3-fast" PRIVATE
- SECTION "Utilities"
- LABEL "Speed optimized SHA3"
- PURPOSE "Optimizes SHA3 for speed instead of size."
-)
-qt_feature("jalalicalendar" PUBLIC
- SECTION "Utilities"
- LABEL "QJalaliCalendar"
- PURPOSE "Support the Jalali (Persian) calendar"
-)
-qt_feature("hijricalendar" PRIVATE
- SECTION "Utilities"
- LABEL "QHijriCalendar"
- PURPOSE "Generic basis for Islamic calendars, providing shared locale data"
-)
-qt_feature("islamiccivilcalendar" PUBLIC
- SECTION "Utilities"
- LABEL "QIslamicCivilCalendar"
- PURPOSE "Support the Islamic Civil calendar"
- CONDITION QT_FEATURE_hijricalendar
-)
-qt_feature("timezone" PUBLIC
- SECTION "Utilities"
- LABEL "QTimeZone"
- PURPOSE "Provides support for time-zone handling."
-)
-qt_feature("datetimeparser" PRIVATE
- SECTION "Utilities"
- LABEL "QDateTimeParser"
- PURPOSE "Provides support for parsing date-time texts."
- CONDITION QT_FEATURE_datestring
-)
-qt_feature("commandlineparser" PUBLIC
- SECTION "Utilities"
- LABEL "QCommandlineParser"
- PURPOSE "Provides support for command line parsing."
-)
-qt_feature("lttng" PRIVATE
- LABEL "LTTNG"
- AUTODETECT OFF
- CONDITION LINUX AND LTTNGUST_FOUND
- ENABLE INPUT_trace STREQUAL 'lttng' OR ( INPUT_trace STREQUAL 'yes' AND LINUX )
- DISABLE INPUT_trace STREQUAL 'etw' OR INPUT_trace STREQUAL 'no'
-)
-qt_feature("etw" PRIVATE
- LABEL "ETW"
- AUTODETECT OFF
- CONDITION WIN32
- ENABLE INPUT_trace STREQUAL 'etw' OR ( INPUT_trace STREQUAL 'yes' AND WIN32 )
- DISABLE INPUT_trace STREQUAL 'lttng' OR INPUT_trace STREQUAL 'no'
-)
-qt_feature("forkfd_pidfd" PRIVATE
- LABEL "CLONE_PIDFD support in forkfd"
- CONDITION LINUX
-)
-qt_feature("cborstreamreader" PUBLIC
- SECTION "Utilities"
- LABEL "CBOR stream reading"
- PURPOSE "Provides support for reading the CBOR binary format. Note that this is required for plugin loading. Qt GUI needs QPA plugins for basic operation."
-)
-qt_feature("cborstreamwriter" PUBLIC
- SECTION "Utilities"
- LABEL "CBOR stream writing"
- PURPOSE "Provides support for writing the CBOR binary format."
-)
-qt_configure_add_summary_section(NAME "Qt Core")
-qt_configure_add_summary_entry(ARGS "backtrace")
-qt_configure_add_summary_entry(ARGS "doubleconversion")
-qt_configure_add_summary_entry(ARGS "system-doubleconversion")
-qt_configure_add_summary_entry(ARGS "glib")
-qt_configure_add_summary_entry(ARGS "icu")
-qt_configure_add_summary_entry(ARGS "system-libb2")
-qt_configure_add_summary_entry(ARGS "mimetype-database")
-qt_configure_add_summary_entry(
- TYPE "firstAvailableFeature"
- ARGS "etw lttng"
- MESSAGE "Tracing backend"
-)
-qt_configure_add_summary_section(NAME "Logging backends")
-qt_configure_add_summary_entry(ARGS "journald")
-qt_configure_add_summary_entry(ARGS "syslog")
-qt_configure_add_summary_entry(ARGS "slog2")
-qt_configure_end_summary_section() # end of "Logging backends" section
-qt_configure_add_summary_entry(
- ARGS "qqnx_pps"
- CONDITION QNX
-)
-qt_configure_add_summary_entry(ARGS "pcre2")
-qt_configure_add_summary_entry(ARGS "system-pcre2")
-qt_configure_add_summary_entry(
- ARGS "forkfd_pidfd"
- CONDITION LINUX
-)
-qt_configure_end_summary_section() # end of "Qt Core" section
-qt_configure_add_report_entry(
- TYPE NOTE
- MESSAGE "journald, syslog or slog2 integration is enabled. If your users intend to develop applications against this build, ensure that the IDEs they use either set QT_FORCE_STDERR_LOGGING to 1 or are able to read the logged output from journald, syslog or slog2."
- CONDITION QT_FEATURE_journald OR QT_FEATURE_syslog OR ( QNX AND QT_FEATURE_slog2 )
-)
-qt_configure_add_report_entry(
- TYPE ERROR
- MESSAGE "C++11 <random> is required and is missing or failed to compile."
- CONDITION NOT TEST_cxx11_random
-)
-qt_configure_add_report_entry(
- TYPE ERROR
- MESSAGE "Your C library does not provide sscanf_l or snprintf_l. You need to use libdouble-conversion for double/string conversion."
- CONDITION INPUT_doubleconversion STREQUAL 'no' AND NOT TEST_xlocalescanprint
-)
-qt_configure_add_report_entry(
- TYPE ERROR
- MESSAGE "detected a std::atomic implementation that fails for function pointers. Please apply the patch corresponding to your Standard Library vendor, found in qtbase/config.tests/atomicfptr"
- CONDITION NOT TEST_atomicfptr
-)
-qt_configure_add_report_entry(
- TYPE ERROR
- MESSAGE "Qt requires poll(), ppoll(), poll_ts() or select() on this platform"
- CONDITION ( UNIX OR INTEGRITY ) AND ( NOT QT_FEATURE_poll_ppoll ) AND ( NOT QT_FEATURE_poll_pollts ) AND ( NOT QT_FEATURE_poll_poll ) AND ( NOT QT_FEATURE_poll_select )
-)
diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt
index 06acea216b..b77cf35b92 100644
--- a/src/corelib/CMakeLists.txt
+++ b/src/corelib/CMakeLists.txt
@@ -35,7 +35,9 @@ qt_internal_add_module(Core
NO_GENERATE_METATYPES # metatypes are extracted manually below
EXCEPTIONS
SOURCES
+ compat/removed_api.cpp
global/archdetect.cpp
+ global/qcompare_impl.h
global/qcompare.h
global/qcompilerdetection.h
global/qcontainerinfo.h
@@ -49,6 +51,7 @@ qt_internal_add_module(Core
global/qlogging.cpp global/qlogging.h
global/qmalloc.cpp
global/qnamespace.h # this header is specified on purpose so AUTOMOC processes it
+ global/qnativeinterface.h
global/qnumeric.cpp global/qnumeric.h global/qnumeric_p.h
global/qoperatingsystemversion.cpp global/qoperatingsystemversion.h global/qoperatingsystemversion_p.h
global/qprocessordetection.h
@@ -57,6 +60,7 @@ qt_internal_add_module(Core
global/qsysinfo.h
global/qsystemdetection.h
global/qtypeinfo.h
+ global/qvolatile_p.h
io/qabstractfileengine.cpp io/qabstractfileengine_p.h
io/qbuffer.cpp io/qbuffer.h
io/qdataurl.cpp io/qdataurl_p.h
@@ -91,8 +95,6 @@ qt_internal_add_module(Core
io/qurlidna.cpp
io/qurlquery.cpp io/qurlquery.h
io/qurlrecode.cpp
- itemmodels/qabstractitemmodel.cpp itemmodels/qabstractitemmodel.h itemmodels/qabstractitemmodel_p.h
- itemmodels/qitemselectionmodel.cpp itemmodels/qitemselectionmodel.h itemmodels/qitemselectionmodel_p.h
kernel/qabstracteventdispatcher.cpp kernel/qabstracteventdispatcher.h kernel/qabstracteventdispatcher_p.h
kernel/qabstractnativeeventfilter.cpp kernel/qabstractnativeeventfilter.h
kernel/qassociativeiterable.cpp kernel/qassociativeiterable.h
@@ -119,7 +121,7 @@ qt_internal_add_module(Core
kernel/qobjectcleanuphandler.cpp kernel/qobjectcleanuphandler.h
kernel/qobjectdefs.h
kernel/qobjectdefs_impl.h
- kernel/qpermission.h
+ kernel/qapplicationpermission.h
kernel/qpointer.cpp kernel/qpointer.h
kernel/qproperty.cpp kernel/qproperty.h kernel/qproperty_p.h
kernel/qpropertyprivate.h
@@ -248,6 +250,7 @@ qt_internal_add_module(Core
DEFINES
QT_NO_FOREACH
QT_NO_USING_NAMESPACE
+ QT_TYPESAFE_FLAGS
INCLUDE_DIRECTORIES
"${CMAKE_CURRENT_BINARY_DIR}/global" # special case
"${CMAKE_CURRENT_BINARY_DIR}/kernel" # for moc_qobject.cpp to be found by qobject.cpp
@@ -270,14 +273,17 @@ qt_internal_add_module(Core
# special case end
)
-qt_update_ignore_pch_source(Core kernel/qmetatype.cpp )
+set(corelib_no_pch_sources
+ compat/removed_api.cpp
+ kernel/qmetatype.cpp
+)
+
+foreach(src ${corelib_no_pch_sources})
+ qt_update_ignore_pch_source(Core ${src})
+endforeach()
# special case begin
add_dependencies(Core qmodule_pri)
-add_dependencies(Core ${QT_CMAKE_EXPORT_NAMESPACE}::moc)
-add_dependencies(Core ${QT_CMAKE_EXPORT_NAMESPACE}::rcc)
-add_dependencies(CorePrivate ${QT_CMAKE_EXPORT_NAMESPACE}::moc)
-add_dependencies(CorePrivate ${QT_CMAKE_EXPORT_NAMESPACE}::rcc)
if (NOT QT_NAMESPACE STREQUAL "")
target_compile_definitions(Core PUBLIC "QT_NAMESPACE=${QT_NAMESPACE}")
@@ -312,8 +318,7 @@ 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
- COPY_OVER_INSTALL INSTALL_DIR "${QT_BUILD_DIR}/${metatypes_install_dir}")
+ list(APPEND core_metatype_args __QT_INTERNAL_NO_INSTALL)
else()
list(APPEND core_metatype_args INSTALL_DIR "${metatypes_install_dir}")
endif()
@@ -977,12 +982,11 @@ qt_internal_extend_target(Core CONDITION UNIX AND NOT APPLE
qt_internal_extend_target(Core CONDITION ANDROID AND NOT ANDROID_EMBEDDED
SOURCES
io/qstandardpaths_android.cpp
- kernel/qcoreapplication_android.cpp
io/qstorageinfo_unix.cpp
- kernel/qjni.cpp kernel/qjni_p.h
kernel/qjnienvironment.cpp kernel/qjnienvironment.h
kernel/qjniobject.cpp kernel/qjniobject.h
kernel/qjnihelpers.cpp kernel/qjnihelpers_p.h
+ platform/android/qandroidextras_p.h platform/android/qandroidextras.cpp
platform/android/qandroidnativeinterface.cpp
)
@@ -1000,6 +1004,12 @@ qt_internal_extend_target(Core CONDITION UNIX AND NOT APPLE AND NOT HAIKU AND (A
io/qstorageinfo_unix.cpp
)
+qt_internal_extend_target(Core CONDITION QT_FEATURE_itemmodel
+ SOURCES
+ itemmodels/qabstractitemmodel.cpp itemmodels/qabstractitemmodel.h itemmodels/qabstractitemmodel_p.h
+ itemmodels/qitemselectionmodel.cpp itemmodels/qitemselectionmodel.h itemmodels/qitemselectionmodel_p.h
+)
+
qt_internal_extend_target(Core CONDITION QT_FEATURE_proxymodel
SOURCES
itemmodels/qabstractproxymodel.cpp itemmodels/qabstractproxymodel.h itemmodels/qabstractproxymodel_p.h
@@ -1012,7 +1022,7 @@ qt_internal_extend_target(Core CONDITION QT_FEATURE_concatenatetablesproxymodel
qt_internal_extend_target(Core CONDITION QT_FEATURE_identityproxymodel AND QT_FEATURE_proxymodel
SOURCES
- itemmodels/qidentityproxymodel.cpp itemmodels/qidentityproxymodel.h
+ itemmodels/qidentityproxymodel.cpp itemmodels/qidentityproxymodel.h itemmodels/qidentityproxymodel_p.h
)
qt_internal_extend_target(Core CONDITION QT_FEATURE_proxymodel AND QT_FEATURE_sortfilterproxymodel
@@ -1314,10 +1324,10 @@ qt_internal_apply_gc_binaries_conditional(Core PUBLIC)
# Add entry-point on platforms that need it. A project can opt-out of using the
# entrypoint by setting the qt_no_entrypoint property to TRUE on a target.
if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "iOS")
- # find_package(Qt6Core) should call find_package(Qt6EntryPoint) so that we can
- # link against EntryPoint. Normally this is handled automatically for deps, but
- # for some reason it doesn't work for the EntryPoint, so we need to add it manually.
- qt_record_extra_qt_package_dependency(Core EntryPoint "${PROJECT_VERSION}")
+ # find_package(Qt6Core) should call find_package(Qt6EntryPointPrivate) so that we can
+ # link against EntryPointPrivate. Normally this is handled automatically for deps, but
+ # for some reason it doesn't work for the EntryPointPrivate, so we need to add it manually.
+ qt_record_extra_qt_package_dependency(Core EntryPointPrivate "${PROJECT_VERSION}")
set(entrypoint_conditions "$<NOT:$<BOOL:$<TARGET_PROPERTY:qt_no_entrypoint>>>")
list(APPEND entrypoint_conditions "$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>")
@@ -1329,7 +1339,9 @@ if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "iOS")
list(JOIN entrypoint_conditions "," entrypoint_conditions)
set(entrypoint_conditions "$<AND:${entrypoint_conditions}>")
- target_link_libraries(Core INTERFACE "$<${entrypoint_conditions}:${QT_CMAKE_EXPORT_NAMESPACE}::EntryPoint>")
+ target_link_libraries(Core INTERFACE
+ "$<${entrypoint_conditions}:${QT_CMAKE_EXPORT_NAMESPACE}::EntryPointPrivate>"
+ )
endif()
# Record darwin minimum deployment target.
@@ -1350,7 +1362,7 @@ qt_internal_add_docs(Core
# Handle qtzlib.pro to create headers for the
# QtZlibPrivate target, equivalent to Qt += zlib-private
if(NOT QT_FEATURE_system_zlib)
- qt_internal_add_module(Zlib
+ qt_internal_add_module(ZlibPrivate
INTERNAL_MODULE
HEADER_MODULE
NO_CONFIG_HEADER_FILE
diff --git a/src/corelib/Qt6AndroidMacros.cmake b/src/corelib/Qt6AndroidMacros.cmake
index ab793d3499..e37ce287bd 100644
--- a/src/corelib/Qt6AndroidMacros.cmake
+++ b/src/corelib/Qt6AndroidMacros.cmake
@@ -206,7 +206,7 @@ function(qt6_android_generate_deployment_settings target)
endif()
# Override qmlimportscanner binary path
- set(qml_importscanner_binary_path "${QT_HOST_PATH}/${QT6_HOST_INFO_BINDIR}/qmlimportscanner")
+ set(qml_importscanner_binary_path "${QT_HOST_PATH}/${QT6_HOST_INFO_LIBEXECDIR}/qmlimportscanner")
if (WIN32)
string(APPEND qml_importscanner_binary_path ".exe")
endif()
@@ -281,41 +281,110 @@ function(qt6_android_add_apk_target target)
message(FATAL_ERROR "Target ${target} is not a valid android executable target\n")
endif()
- # Create a top-level "apk" target for convenience, so that users can call 'ninja apk'.
- # It will trigger building all the target specific apk build targets that are added via this
- # function.
- # Allow opt-out.
- if(NOT QT_NO_GLOBAL_APK_TARGET)
- if(NOT TARGET apk)
- add_custom_target(apk
- DEPENDS ${target}_prepare_apk_dir
- COMMENT "Building all apks"
- )
- endif()
- set(should_add_to_global_apk TRUE)
+ # Make global apk target depend on the current apk target.
+ if(TARGET apk)
+ add_dependencies(apk ${target}_make_apk)
+ _qt_internal_create_global_apk_all_target_if_needed()
endif()
set(deployment_tool "${QT_HOST_PATH}/${QT6_HOST_INFO_BINDIR}/androiddeployqt")
- set(apk_dir "$<TARGET_PROPERTY:${target},BINARY_DIR>/android-build")
- add_custom_target(${target}_prepare_apk_dir
+ set(apk_final_dir "$<TARGET_PROPERTY:${target},BINARY_DIR>/android-build")
+ set(apk_intermediate_dir "${CMAKE_CURRENT_BINARY_DIR}/android-build")
+ set(apk_file_name "${target}.apk")
+ set(dep_file_name "${target}.d")
+ set(apk_final_file_path "${apk_final_dir}/${apk_file_name}")
+ set(apk_intermediate_file_path "${apk_intermediate_dir}/${apk_file_name}")
+ set(dep_intermediate_file_path "${apk_intermediate_dir}/${dep_file_name}")
+
+ # This target is used by Qt Creator's Android support and by the ${target}_make_apk target
+ # in case DEPFILEs are not supported.
+ add_custom_target(${target}_prepare_apk_dir ALL
DEPENDS ${target}
COMMAND ${CMAKE_COMMAND}
- -E copy $<TARGET_FILE:${target}>
- "${apk_dir}/libs/${CMAKE_ANDROID_ARCH_ABI}/$<TARGET_FILE_NAME:${target}>"
+ -E copy_if_different $<TARGET_FILE:${target}>
+ "${apk_final_dir}/libs/${CMAKE_ANDROID_ARCH_ABI}/$<TARGET_FILE_NAME:${target}>"
COMMENT "Copying ${target} binary to apk folder"
)
- add_custom_target(${target}_make_apk
- DEPENDS ${target}_prepare_apk_dir
- COMMAND ${deployment_tool}
- --input ${deployment_file}
- --output ${apk_dir}
- --apk ${apk_dir}/${target}.apk
- COMMENT "Creating APK for ${target}"
- )
+ # The DEPFILE argument to add_custom_command is only available with Ninja or CMake>=3.20 and make.
+ if (CMAKE_GENERATOR MATCHES "Ninja" OR
+ (CMAKE_VERSION VERSION_GREATER_EQUAL 3.20 AND CMAKE_GENERATOR MATCHES "Makefiles"))
+ # Add custom command that creates the apk in an intermediate location.
+ # We need the intermediate location, because we cannot have target-dependent generator
+ # expressions in OUTPUT.
+ add_custom_command(OUTPUT "${apk_intermediate_file_path}"
+ COMMAND ${CMAKE_COMMAND}
+ -E copy "$<TARGET_FILE:${target}>"
+ "${apk_intermediate_dir}/libs/${CMAKE_ANDROID_ARCH_ABI}/$<TARGET_FILE_NAME:${target}>"
+ COMMAND "${deployment_tool}"
+ --input "${deployment_file}"
+ --output "${apk_intermediate_dir}"
+ --apk "${apk_intermediate_file_path}"
+ --depfile "${dep_intermediate_file_path}"
+ --builddir "${CMAKE_BINARY_DIR}"
+ COMMENT "Creating APK for ${target}"
+ DEPENDS "${target}" "${deployment_file}"
+ DEPFILE "${dep_intermediate_file_path}")
+
+ # Create a ${target}_make_apk target to copy the apk from the intermediate to its final
+ # location. If the final and intermediate locations are identical, this is a no-op.
+ add_custom_target(${target}_make_apk
+ COMMAND "${CMAKE_COMMAND}"
+ -E copy_if_different "${apk_intermediate_file_path}" "${apk_final_file_path}"
+ DEPENDS "${apk_intermediate_file_path}")
+ else()
+ add_custom_target(${target}_make_apk
+ DEPENDS ${target}_prepare_apk_dir
+ COMMAND ${deployment_tool}
+ --input ${deployment_file}
+ --output ${apk_final_dir}
+ --apk ${apk_final_file_path}
+ COMMENT "Creating APK for ${target}"
+ )
+ endif()
+endfunction()
+
+function(_qt_internal_create_global_apk_target)
+ # Create a top-level "apk" target for convenience, so that users can call 'ninja apk'.
+ # It will trigger building all the apk build targets that are added as part of the project.
+ # Allow opting out.
+ if(NOT QT_NO_GLOBAL_APK_TARGET)
+ if(NOT TARGET apk)
+ add_custom_target(apk COMMENT "Building all apks")
+ endif()
+ endif()
+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.
+#
+# It does so by creating a custom 'apk_all' target as an implementation detail.
+#
+# This is needed to ensure that the decision is made only when the value of QT_BUILDING_QT is
+# available, which is defined in qt_repo_build() -> include(QtSetup), which is included after the
+# execution of _qt_internal_create_global_apk_target.
+function(_qt_internal_create_global_apk_all_target_if_needed)
+ if(TARGET apk AND NOT TARGET apk_all)
+ # Some Qt tests helper executables have their apk build process failing.
+ # qt_internal_add_executables that are excluded from ALL should also not have apks built
+ # for them.
+ # Don't build apks by default when doing a Qt build.
+ set(skip_add_to_all FALSE)
+ if(QT_BUILDING_QT)
+ set(skip_add_to_all TRUE)
+ endif()
+
+ option(QT_NO_GLOBAL_APK_TARGET_PART_OF_ALL
+ "Skip building apks as part of the default 'ALL' target" ${skip_add_to_all})
+
+ set(part_of_all "ALL")
+ if(QT_NO_GLOBAL_APK_TARGET_PART_OF_ALL)
+ set(part_of_all "")
+ endif()
- if(should_add_to_global_apk)
- add_dependencies(apk "${target}_make_apk")
+ add_custom_target(apk_all ${part_of_all})
+ add_dependencies(apk_all apk)
endif()
endfunction()
diff --git a/src/corelib/Qt6CTestMacros.cmake b/src/corelib/Qt6CTestMacros.cmake
index 4e1abe904c..13d794024a 100644
--- a/src/corelib/Qt6CTestMacros.cmake
+++ b/src/corelib/Qt6CTestMacros.cmake
@@ -50,6 +50,17 @@ if (NO_DBUS)
list(APPEND BUILD_OPTIONS_LIST "-DNO_DBUS=True")
endif()
+if(APPLE AND CMAKE_OSX_ARCHITECTURES)
+ list(LENGTH CMAKE_OSX_ARCHITECTURES osx_arch_count)
+
+ # When Qt is built as universal config (macOS or iOS), force CMake build tests to build one
+ # architecture instead of all of them, because the build machine that builds the cmake tests
+ # might not have a universal SDK installed.
+ if(osx_arch_count GREATER 1)
+ list(APPEND BUILD_OPTIONS_LIST "-DQT_FORCE_SINGLE_QT_OSX_ARCHITECTURE=ON")
+ endif()
+endif()
+
foreach(module ${CMAKE_MODULES_UNDER_TEST})
list(APPEND BUILD_OPTIONS_LIST
"-DCMAKE_${module}_MODULE_MAJOR_VERSION=${CMAKE_${module}_MODULE_MAJOR_VERSION}"
@@ -121,15 +132,39 @@ endfunction()
# This makes possible to have relative paths to the source files in the
# generated ninja rules.
#
+# BUILD_DIR: A custom build dir relative to the calling project CMAKE_CURRENT_BINARY_DIR.
+# Useful when configuring the same test project with different options in separate
+# build dirs.
+#
# BINARY: Path to the test artifact that will be executed after the build is complete. If a
# relative path is specified, it will be counted from the build directory.
+# Can also be passed a random executable to be found in PATH, like 'ctest'.
+#
+# BINARY_ARGS: Additional arguments to pass to the BINARY.
#
# TESTNAME: a custom test name to use instead of the one derived from the source directory name
#
# 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)
- cmake_parse_arguments(_ARGS "SIMULATE_IN_SOURCE" "BINARY;TESTNAME" "BUILD_OPTIONS" ${ARGN})
+ set(_test_option_args
+ SIMULATE_IN_SOURCE
+ )
+ set(_test_single_args
+ BINARY
+ TESTNAME
+ BUILD_DIR
+ )
+ set(_test_multi_args
+ BUILD_OPTIONS
+ BINARY_ARGS
+ )
+ cmake_parse_arguments(_ARGS
+ "${_test_option_args}"
+ "${_test_single_args}"
+ "${_test_multi_args}"
+ ${ARGN}
+ )
if(_ARGS_TESTNAME)
set(testname "${_ARGS_TESTNAME}")
else()
@@ -142,6 +177,10 @@ macro(_qt_internal_test_expect_pass _dir)
string(REPLACE ";" "\;" __expect_pass_prefixes "${__expect_pass_prefixes}")
set(__expect_pass_build_dir "${CMAKE_CURRENT_BINARY_DIR}/${_dir}")
+ if(_ARGS_BUILD_DIR)
+ set(__expect_pass_build_dir "${CMAKE_CURRENT_BINARY_DIR}/${_ARGS_BUILD_DIR}")
+ endif()
+
set(__expect_pass_source_dir "${CMAKE_CURRENT_SOURCE_DIR}/${_dir}")
if(_ARGS_SIMULATE_IN_SOURCE)
set(__expect_pass_in_source_build_dir "${CMAKE_CURRENT_BINARY_DIR}/in_source")
@@ -181,7 +220,7 @@ macro(_qt_internal_test_expect_pass _dir)
--build-project "${_dir}"
--build-options "-DCMAKE_PREFIX_PATH=${__expect_pass_prefixes}" ${BUILD_OPTIONS_LIST}
${_ARGS_BUILD_OPTIONS}
- --test-command ${_ARGS_BINARY}
+ --test-command ${_ARGS_BINARY} ${_ARGS_BINARY_ARGS}
)
add_test(${testname} ${CMAKE_CTEST_COMMAND} ${ctest_command_args})
if(_ARGS_SIMULATE_IN_SOURCE)
diff --git a/src/corelib/Qt6CoreConfigExtras.cmake.in b/src/corelib/Qt6CoreConfigExtras.cmake.in
index 25b3f5acd5..f86d4ad5bf 100644
--- a/src/corelib/Qt6CoreConfigExtras.cmake.in
+++ b/src/corelib/Qt6CoreConfigExtras.cmake.in
@@ -46,6 +46,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()
endif()
if(EMSCRIPTEN)
diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake
index 804718df86..42116cba69 100644
--- a/src/corelib/Qt6CoreMacros.cmake
+++ b/src/corelib/Qt6CoreMacros.cmake
@@ -384,12 +384,25 @@ function(qt6_add_big_resources outfiles )
foreach(it ${rcc_files})
get_filename_component(outfilename ${it} NAME_WE)
+
+ # Provide unique targets and output file names
+ # in case we add multiple .qrc files with the same base name.
+ string(MAKE_C_IDENTIFIER "_qt_big_resource_count_${outfilename}" prop)
+ get_property(count GLOBAL PROPERTY ${prop})
+ if(count)
+ string(APPEND outfilename "_${count}")
+ else()
+ set(count 0)
+ endif()
+ math(EXPR count "${count} + 1")
+ set_property(GLOBAL PROPERTY ${prop} ${count})
+
get_filename_component(infile ${it} ABSOLUTE)
set(tmpoutfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}tmp.cpp)
set(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.o)
_qt6_parse_qrc_file(${infile} _out_depends _rc_depends)
- set_source_files_properties(${infile} PROPERTIES SKIP_AUTORCC ON)
+ set_source_files_properties(${infile} PROPERTIES SKIP_AUTOGEN ON)
add_custom_command(OUTPUT ${tmpoutfile}
COMMAND ${QT_CMAKE_EXPORT_NAMESPACE}::rcc ${rcc_options} --name ${outfilename} --pass 1 --output ${tmpoutfile} ${infile}
DEPENDS ${infile} ${_rc_depends} "${out_depends}" ${QT_CMAKE_EXPORT_NAMESPACE}::rcc
@@ -475,7 +488,7 @@ function(qt6_add_executable target)
_qt_internal_create_executable("${target}" ${arg_UNPARSED_ARGUMENTS})
if(arg_MANUAL_FINALIZATION)
- # Caller says they will call qt6_finalize_executable() themselves later
+ # Caller says they will call qt6_finalize_target() themselves later
return()
endif()
@@ -485,9 +498,10 @@ function(qt6_add_executable target)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.19)
# Need to wrap in an EVAL CODE or else ${target} won't be evaluated
# due to special behavior of cmake_language() argument handling
- cmake_language(EVAL CODE "cmake_language(DEFER CALL qt6_finalize_executable ${target})")
+ cmake_language(EVAL CODE "cmake_language(DEFER CALL qt6_finalize_target ${target})")
else()
- qt6_finalize_executable("${target}")
+ set_target_properties("${target}" PROPERTIES _qt_is_immediately_finalized TRUE)
+ qt6_finalize_target("${target}")
endif()
endfunction()
@@ -504,6 +518,7 @@ function(_qt_internal_create_executable target)
set_property(TARGET "${target}" PROPERTY OBJC_VISIBILITY_PRESET default)
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)
else()
add_executable("${target}" ${ARGN})
endif()
@@ -511,13 +526,20 @@ function(_qt_internal_create_executable target)
target_link_libraries("${target}" PRIVATE Qt6::Core)
endfunction()
-# This function is currently in Technical Preview.
-# It's signature and behavior might change.
-function(qt6_finalize_executable target)
+function(_qt_internal_finalize_executable target)
+ get_target_property(is_finalized "${target}" _qt_executable_is_finalized)
+ if(is_finalized)
+ message(AUTHOR_WARNING
+ "Tried to call qt6_finalize_target twice on executable: '${target}'. \
+ Did you forget to specify MANUAL_FINALIZATION to qt6_add_executable?")
+ return()
+ endif()
# We can't evaluate generator expressions at configure time, so we can't
# ask for any transitive properties or even the full library dependency
- # chain. We can still look at the immediate dependencies though and query
+ # chain.
+ # We can still look at the immediate dependencies
+ # (and recursively their dependencies) and query
# any that are not expressed as generator expressions. For any we can
# identify as a CMake target known to the current scope, we can check if
# that target has a finalizer to be called. This is expected to cover the
@@ -526,12 +548,11 @@ function(qt6_finalize_executable target)
# responsible for calling any relevant functions themselves instead of
# relying on these automatic finalization calls.
set(finalizers)
- get_target_property(immediate_deps ${target} LINK_LIBRARIES)
- if(immediate_deps)
- foreach(dep IN LISTS immediate_deps)
- if(NOT TARGET ${dep})
- continue()
- endif()
+
+ __qt_internal_collect_all_target_dependencies("${target}" dep_targets)
+
+ if(dep_targets)
+ foreach(dep IN LISTS dep_targets)
get_target_property(dep_finalizers ${dep}
INTERFACE_QT_EXECUTABLE_FINALIZERS
)
@@ -541,6 +562,7 @@ function(qt6_finalize_executable target)
endforeach()
list(REMOVE_DUPLICATES finalizers)
endif()
+
if(finalizers)
if(CMAKE_VERSION VERSION_LESS 3.18)
# cmake_language() not available
@@ -563,7 +585,33 @@ function(qt6_finalize_executable target)
qt_wasm_add_target_helpers("${target}")
endif()
if(IOS)
- qt6_finalize_ios_app("${target}")
+ _qt_internal_finalize_ios_app("${target}")
+ endif()
+
+ # For finalizer mode of plugin importing to work safely, we need to know the list of Qt
+ # dependencies the target has, but those might be added later than the qt_add_executable call.
+ # Most of our examples are like that. Only enable finalizer mode when we are sure that the user
+ # manually called qt_finalize_target at the end of their CMake project, or it was automatically
+ # done via a deferred call. This is also applicable to the resource object finalizer.
+ get_target_property(is_immediately_finalized "${target}" _qt_is_immediately_finalized)
+ if(NOT is_immediately_finalized)
+ __qt_internal_apply_plugin_imports_finalizer_mode("${target}")
+ __qt_internal_process_dependency_object_libraries("${target}")
+ endif()
+
+ set_target_properties(${target} PROPERTIES _qt_executable_is_finalized TRUE)
+endfunction()
+
+function(qt6_finalize_target target)
+ if(NOT TARGET "${target}")
+ message(FATAL_ERROR "No target '${target}' found in current scope.")
+ endif()
+
+ get_target_property(target_type ${target} TYPE)
+ get_target_property(is_android_executable "${target}" _qt_is_android_executable)
+
+ if(target_type STREQUAL "EXECUTABLE" OR is_android_executable)
+ _qt_internal_finalize_executable(${ARGV})
endif()
endfunction()
@@ -665,8 +713,7 @@ function(_qt_internal_get_default_ios_bundle_identifier out_var)
set("${out_var}" "${prefix}.\${PRODUCT_NAME:rfc1034identifier}" PARENT_SCOPE)
endfunction()
-
-function(qt6_finalize_ios_app target)
+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.
if(NOT CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM AND NOT QT_NO_SET_XCODE_DEVELOPMENT_TEAM_ID)
@@ -706,17 +753,16 @@ if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
function(qt_add_executable)
qt6_add_executable(${ARGV})
endfunction()
+ function(qt_finalize_target)
+ qt6_finalize_target(${ARGV})
+ endfunction()
+
+ # Kept for compatibility with Qt Creator 4.15 wizards
function(qt_finalize_executable)
- qt6_finalize_executable(${ARGV})
+ qt6_finalize_target(${ARGV})
endfunction()
endif()
-# Temporarily keep compatibility, until all repositories are migrated.
-function(add_qt_gui_executable)
- message(AUTHOR_WARNING "Please replace add_qt_gui_executable with qt_add_executable instead. The former will be removed shortly.")
- qt6_add_executable(${ARGV})
-endfunction()
-
function(_qt_get_plugin_name_with_version target out_var)
string(REGEX REPLACE "^Qt::(.+)" "Qt${QT_DEFAULT_MAJOR_VERSION}::\\1"
qt_plugin_with_version "${target}")
@@ -803,10 +849,14 @@ function(qt6_import_plugins target)
# Check if passed plugin target name is a version-less one, and make a version-full
# one.
+ set_property(TARGET "${target}" APPEND PROPERTY "QT_PLUGINS_${_current_type}" "${_arg}")
+ set_property(TARGET "${target}" APPEND PROPERTY "_qt_plugins_by_type" "${_arg}")
_qt_get_plugin_name_with_version("${_arg}" qt_plugin_with_version)
- if(TARGET "${_arg}" OR TARGET "${qt_plugin_with_version}")
- set_property(TARGET "${target}" APPEND PROPERTY "QT_PLUGINS_${_current_type}" "${_arg}")
- else()
+
+ # TODO: Do we really need this check? We didn't have it in Qt5, and plugin targets
+ # wrapped in genexes end up causing warnings, but we explicitly use GENEX_EVAL to
+ # support them.
+ if(NOT TARGET "${_arg}" AND NOT TARGET "${qt_plugin_with_version}")
message("Warning: plug-in ${_arg} is not known to the current Qt installation.")
endif()
endif()
@@ -829,6 +879,50 @@ 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")
+ 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()
+
+# 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})
+endfunction()
+
+if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
+ function(qt_enable_object_libraries_finalizer_mode)
+ qt6_enable_object_libraries_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
@@ -840,8 +934,7 @@ endif()
# 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.
-# COPY_OVER_INSTALL: (Qt Internal) When present will install the file via a post build step
-# copy rather than using install.
+# __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)
@@ -849,7 +942,8 @@ function(qt6_extract_metatypes target)
return()
endif()
- cmake_parse_arguments(arg "COPY_OVER_INSTALL" "INSTALL_DIR" "MANUAL_MOC_JSON_FILES" ${ARGN})
+ cmake_parse_arguments(arg
+ "__QT_INTERNAL_NO_INSTALL" "INSTALL_DIR" "MANUAL_MOC_JSON_FILES" ${ARGN})
get_target_property(target_type ${target} TYPE)
if (target_type STREQUAL "INTERFACE_LIBRARY")
@@ -862,24 +956,6 @@ function(qt6_extract_metatypes target)
return()
endif()
- # Whether the generated json file needs to be installed for prefix-builds, or copied for
- # non-prefix builds. Regardless of the type of build, executable metatypes.json files should
- # not be installed. Only library .json files should be installed.
- set(should_install "TRUE")
- if (target_type STREQUAL "EXECUTABLE")
- set(should_install "FALSE")
- endif()
-
- # Automatically fill default install args when not specified.
- if (NOT arg_INSTALL_DIR)
- # INSTALL_LIBDIR is not set when QtBuildInternals is not loaded (when not doing a Qt build).
- if(INSTALL_LIBDIR)
- set(arg_INSTALL_DIR "${INSTALL_LIBDIR}/metatypes")
- else()
- set(arg_INSTALL_DIR "lib/metatypes")
- endif()
- endif()
-
get_target_property(target_binary_dir ${target} BINARY_DIR)
set(type_list_file "${target_binary_dir}/meta_types/${target}_json_file_list.txt")
set(type_list_file_manual "${target_binary_dir}/meta_types/${target}_json_file_list_manual.txt")
@@ -894,16 +970,17 @@ function(qt6_extract_metatypes target)
AUTOMOC_MOC_OPTIONS "--output-json"
)
- if(NOT CMAKE_CONFIGURATION_TYPES)
+ get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+ if(NOT is_multi_config)
set(cmake_autogen_cache_file
"${target_binary_dir}/CMakeFiles/${target}_autogen.dir/ParseCache.txt")
- set(mutli_config_args
+ set(multi_config_args
--cmake-autogen-include-dir-path "${target_binary_dir}/${target}_autogen/include"
)
else()
set(cmake_autogen_cache_file
"${target_binary_dir}/CMakeFiles/${target}_autogen.dir/ParseCache_$<CONFIG>.txt")
- set(mutli_config_args
+ set(multi_config_args
--cmake-autogen-include-dir-path "${target_binary_dir}/${target}_autogen/include_$<CONFIG>"
"--cmake-multi-config")
endif()
@@ -919,6 +996,32 @@ function(qt6_extract_metatypes target)
endif()
if (NOT use_dep_files)
+ # When a project is configured with a Visual Studio generator, CMake's
+ # cmQtAutoGenInitializer::InitAutogenTarget() can take one of two code paths on how to
+ # handle AUTOMOC rules.
+ # It either creates a ${target}_autogen custom target or uses PRE_BUILD build events.
+ #
+ # The latter in considered an optimization and is used by CMake when possible.
+ # Unfortunately that breaks our add_dependency call because we expect on _autogen target
+ # to always exist.
+ #
+ # Ensure the PRE_BUILD path is not taken by generating a dummy header file and adding it
+ # as a source file to the target. This causes the file to be added to
+ # cmQtAutoGenInitializer::AutogenTarget.DependFiles, which disables the PRE_BUILD path.
+ if(CMAKE_GENERATOR MATCHES "Visual Studio")
+ # The file name should be target specific, but still short, so we don't hit path
+ # length issues.
+ string(MAKE_C_IDENTIFIER "ddf_${target}" dummy_dependency_file)
+ set(dummy_out_file "${CMAKE_CURRENT_BINARY_DIR}/${dummy_dependency_file}.h")
+
+ # The content shouldn't be empty so we don't trigger AUTOMOC warnings about it.
+ file(GENERATE OUTPUT "${dummy_out_file}" CONTENT "//")
+ set_source_files_properties("${dummy_out_file}" PROPERTIES
+ GENERATED TRUE
+ SKIP_AUTOGEN OFF)
+ target_sources("${target}" PRIVATE "${dummy_out_file}")
+ endif()
+
add_custom_target(${target}_automoc_json_extraction
DEPENDS ${QT_CMAKE_EXPORT_NAMESPACE}::cmake_automoc_parser
BYPRODUCTS ${type_list_file}
@@ -927,8 +1030,8 @@ function(qt6_extract_metatypes target)
--cmake-autogen-cache-file "${cmake_autogen_cache_file}"
--cmake-autogen-info-file "${cmake_autogen_info_file}"
--output-file-path "${type_list_file}"
- ${mutli_config_args}
- COMMENT "Running Automoc file extraction"
+ ${multi_config_args}
+ COMMENT "Running AUTOMOC file extraction for target ${target}"
COMMAND_EXPAND_LISTS
)
add_dependencies(${target}_automoc_json_extraction ${target}_autogen)
@@ -945,8 +1048,8 @@ function(qt6_extract_metatypes target)
--cmake-autogen-cache-file "${cmake_autogen_cache_file}"
--cmake-autogen-info-file "${cmake_autogen_info_file}"
--output-file-path "${type_list_file}"
- ${mutli_config_args}
- COMMENT "Running Automoc file extraction"
+ ${multi_config_args}
+ COMMENT "Running AUTOMOC file extraction for target ${target}"
COMMAND_EXPAND_LISTS
)
@@ -971,7 +1074,7 @@ function(qt6_extract_metatypes target)
message(FATAL_ERROR "Metatype generation requires either the use of AUTOMOC or a manual list of generated json files")
endif()
- if (CMAKE_BUILD_TYPE)
+ if (CMAKE_BUILD_TYPE AND NOT is_multi_config)
string(TOLOWER ${target}_${CMAKE_BUILD_TYPE} target_lowercase)
else()
string(TOLOWER ${target} target_lowercase)
@@ -997,18 +1100,10 @@ function(qt6_extract_metatypes target)
file(TOUCH ${metatypes_file})
endif()
- # Need to make the path absolute during a Qt non-prefix build, otherwise files are written
- # to the source dir because the paths are relative to the source dir when using file(TOUCH).
- if(arg_COPY_OVER_INSTALL AND NOT IS_ABSOLUTE "${arg_INSTALL_DIR}/${metatypes_file_name}")
- set(arg_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${arg_INSTALL_DIR}")
- endif()
-
- if (should_install AND arg_COPY_OVER_INSTALL
- AND NOT EXISTS ${arg_INSTALL_DIR}/${metatypes_file_name})
- file(MAKE_DIRECTORY "${arg_INSTALL_DIR}")
- file(TOUCH "${arg_INSTALL_DIR}/${metatypes_file_name}")
- endif()
- add_custom_command(OUTPUT ${metatypes_file_gen} ${metatypes_file}
+ add_custom_command(
+ OUTPUT
+ ${metatypes_file_gen}
+ ${metatypes_file}
DEPENDS ${QT_CMAKE_EXPORT_NAMESPACE}::moc ${automoc_dependencies} ${manual_dependencies}
COMMAND ${QT_CMAKE_EXPORT_NAMESPACE}::moc
-o ${metatypes_file_gen}
@@ -1016,80 +1111,57 @@ function(qt6_extract_metatypes target)
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${metatypes_file_gen}
${metatypes_file}
- COMMENT "Running automoc with --collect-json"
+ COMMENT "Running moc --collect-json for target ${target}"
)
- # We still need to add this file as a source of Core, otherwise the file
+ # 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(metatypes_file_genex_build)
- set(metatypes_file_genex_install)
- if (arg_COPY_OVER_INSTALL)
- if(should_install)
- set(metatypes_file_genex_build
- "$<BUILD_INTERFACE:$<$<BOOL:$<TARGET_PROPERTY:QT_CONSUMES_METATYPES>>:${arg_INSTALL_DIR}/${metatypes_file_name}>>"
- )
- endif()
- else()
- set(metatypes_file_genex_build
- "$<BUILD_INTERFACE:$<$<BOOL:$<TARGET_PROPERTY:QT_CONSUMES_METATYPES>>:${metatypes_file}>>"
- )
- if(should_install)
- set(metatypes_file_genex_install
- "$<INSTALL_INTERFACE:$<$<BOOL:$<TARGET_PROPERTY:QT_CONSUMES_METATYPES>>:$<INSTALL_PREFIX>/${arg_INSTALL_DIR}/${metatypes_file_name}>>"
- )
- endif()
- endif()
set_source_files_properties(${metatypes_file} PROPERTIES HEADER_FILE_ONLY TRUE)
set_target_properties(${target} PROPERTIES
INTERFACE_QT_MODULE_HAS_META_TYPES YES
- INTERFACE_QT_MODULE_META_TYPES_FROM_BUILD YES
INTERFACE_QT_META_TYPES_BUILD_FILE "${metatypes_file}"
- QT_MODULE_META_TYPES_FILE_GENEX_BUILD "${metatypes_file_genex_build}"
- QT_MODULE_META_TYPES_FILE_GENEX_INSTALL "${metatypes_file_genex_install}"
)
- target_sources(${target} INTERFACE ${metatypes_file_genex_build} ${metatypes_file_genex_install})
-
- # Installation is complicated, because there are multiple combinations.
- # In non-prefix builds (signaled by arg_COPY_OVER_INSTALL == TRUE), Qt modules are /copied/
- # into the qt_prefix/lib/metatypes.
- # In prefix builds (signaled by arg_COPY_OVER_INSTALL == FALSE), Qt modules are /installed/
- # into the qt_prefix/lib/metatypes.
- # Currently only the internal qt_add_module sets arg_COPY_OVER_INSTALL.
- #
- # Tests and examples are executables, and thus will not have their meta types installed, but
- # they will have them generated (if this function is called).
- #
- # Regular libraries and plugins (which are not part of the Qt build), will be /installed/
- # into a lib/metatypes directory relative to their prefix, rather than the Qt prefix (only
- # outside of a Qt build).
- # We don't support non-prefix builds for libraries or plugins which are not part of the official
- # Qt build. Aka everything non-prefix / COPY_OVER_INSTALL related are implementation details
- # that users shouldn't use.
- if(should_install)
- if (arg_COPY_OVER_INSTALL)
- set(command_args
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- "${metatypes_file}"
- "${arg_INSTALL_DIR}/${metatypes_file_name}"
- )
- if (target_type STREQUAL "OBJECT_LIBRARY")
- add_custom_target(${target}_metatypes_copy
- DEPENDS "${metatypes_file}"
- ${command_args}
- )
- add_dependencies(${target} ${target}_metatypes_copy)
- else()
- add_custom_command(TARGET ${target} POST_BUILD
- ${command_args}
- )
- endif()
+
+ # Set up consumption of files via INTERFACE_SOURCES.
+ set(consumes_metatypes "$<BOOL:$<TARGET_PROPERTY:QT_CONSUMES_METATYPES>>")
+ set(metatypes_file_genex_build
+ "$<BUILD_INTERFACE:$<${consumes_metatypes}:${metatypes_file}>>"
+ )
+ target_sources(${target} INTERFACE ${metatypes_file_genex_build})
+
+ # Chech 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")
+ endif()
+
+ # Automatically fill default install args when not specified.
+ if (NOT arg_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")
else()
- install(FILES "${metatypes_file}" DESTINATION "${arg_INSTALL_DIR}")
+ set(arg_INSTALL_DIR "lib/metatypes")
endif()
endif()
+
+ if(should_install)
+ set(metatypes_file_install_path "${arg_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}")
+ endif()
endfunction()
if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
@@ -1289,10 +1361,24 @@ END
# We would like to do the following:
# target_sources(${target} PRIVATE "$<$<CONFIG:${cfg}>:${output}>")
- # However, https://gitlab.kitware.com/cmake/cmake/-/issues/20682 doesn't let us.
- # Work-around by compiling the resources in an object lib and linking that.
- add_library(${target}_rc OBJECT "${output}")
- target_link_libraries(${target} PRIVATE $<TARGET_OBJECTS:${target}_rc>)
+ #
+ # However, https://gitlab.kitware.com/cmake/cmake/-/issues/20682 doesn't let us do that
+ # in CMake 3.19 and earlier.
+ # We can do it in CMake 3.20 and later.
+ # And we have to do it with CMake 3.21.0 to avoid a different issue
+ # https://gitlab.kitware.com/cmake/cmake/-/issues/22436
+ #
+ # So use the object lib work around for <= 3.19 and target_sources directly for later
+ # versions.
+ set(use_obj_lib FALSE)
+ set(end_target "${target}")
+ if(CMAKE_VERSION VERSION_LESS 3.20)
+ set(use_obj_lib TRUE)
+ set(end_target "${target}_rc")
+ add_library(${target}_rc OBJECT "${output}")
+ target_link_libraries(${target} PRIVATE $<TARGET_OBJECTS:${target}_rc>)
+ endif()
+
while(outputs)
list(POP_FRONT cfgs cfg)
list(POP_FRONT outputs output)
@@ -1301,7 +1387,7 @@ END
DEPENDS "${input}"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${input}" "${output}"
)
- target_sources(${target}_rc PRIVATE "$<$<CONFIG:${cfg}>:${output}>")
+ target_sources(${end_target} PRIVATE "$<$<CONFIG:${cfg}>:${output}>")
endwhile()
endif()
endfunction()
@@ -1314,6 +1400,144 @@ function(__qt_get_relative_resource_path_for_file output_alias file)
set(${output_alias} ${alias} PARENT_SCOPE)
endfunction()
+# Performs linking and propagation of the object library via the target's usage requirements.
+# Arguments:
+# NO_LINK_OBJECT_LIBRARY_REQUIREMENTS_TO_TARGET skip linking of ${object_library} to ${target}, only
+# propagate $<TARGET_OBJECTS:${object_library}> by linking it to ${target}. It's useful in case
+# if ${object_library} depends on the ${target}. E.g. resource libraries depend on the Core
+# library so linking them back to Core will cause a CMake error.
+#
+# EXTRA_CONDITIONS object library specific conditions to be checked before link the object library
+# to the end-point executable.
+function(__qt_internal_propagate_object_library target object_library)
+ set(options NO_LINK_OBJECT_LIBRARY_REQUIREMENTS_TO_TARGET)
+ set(single_args "")
+ set(multi_args EXTRA_CONDITIONS)
+ cmake_parse_arguments(arg "${options}" "${single_args}" "${multi_args}" ${ARGN})
+
+ get_target_property(is_imported ${object_library} IMPORTED)
+ if(NOT is_imported)
+ target_link_libraries(${object_library} PRIVATE ${QT_CMAKE_EXPORT_NAMESPACE}::Platform)
+ _qt_internal_copy_dependency_properties(${object_library} ${target} PRIVATE_ONLY)
+ endif()
+
+ # After internal discussion we decided to not rely on the linker order that CMake
+ # offers, until CMake provides the guaranteed linking order that suites our needs in a
+ # future CMake version.
+ # 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.
+ #
+ # 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
+ # libraries.
+ set_property(TARGET ${object_library} PROPERTY _is_qt_propagated_object_library TRUE)
+ if(NOT is_imported)
+ set_property(TARGET ${object_library} APPEND PROPERTY
+ EXPORT_PROPERTIES _is_qt_propagated_object_library
+ )
+ endif()
+
+ # Keep the implicit linking if finalizers are not used.
+ set(not_finalizer_mode_condition
+ "$<NOT:$<BOOL:$<TARGET_PROPERTY:_qt_object_libraries_finalizer_mode>>>"
+ )
+
+ # Collect object library specific conditions.
+ if(arg_EXTRA_CONDITIONS)
+ list(JOIN arg_EXTRA_CONDITIONS "," extra_conditions)
+ else()
+ set(extra_conditions "$<BOOL:TRUE>")
+ endif()
+
+ # Do not litter the static libraries
+ set(not_static_condition
+ "$<NOT:$<STREQUAL:$<TARGET_PROPERTY:TYPE>,STATIC_LIBRARY>>"
+ )
+
+ # Check if link order matters for the Platform.
+ set(platform_link_order_property
+ "$<TARGET_PROPERTY:${QT_CMAKE_EXPORT_NAMESPACE}::Platform,_qt_link_order_matters>"
+ )
+ set(platform_link_order_condition
+ "$<BOOL:${platform_link_order_property}>"
+ )
+
+ # Check if link options are propagated according to CMP0099
+ # In user builds the _qt_cmp0099_policy_check is set to FALSE or $<TARGET_POLICY:CMP0099>
+ # depending on the used CMake version.
+ # See __qt_internal_check_cmp0099_available for details.
+ set(cmp0099_policy_check_property
+ "$<TARGET_PROPERTY:${QT_CMAKE_EXPORT_NAMESPACE}::Platform,_qt_cmp0099_policy_check>"
+ )
+ set(link_objects_using_link_options_condition
+ "$<BOOL:$<GENEX_EVAL:${cmp0099_policy_check_property}>>"
+ )
+
+ # Use TARGET_NAME to have the correct namespaced name in the exports.
+ set(objects "$<TARGET_OBJECTS:$<TARGET_NAME:${object_library}>>")
+
+ # Collect link conditions for the target_sources call.
+ string(JOIN "" target_sources_genex
+ "$<"
+ "$<AND:"
+ "${not_finalizer_mode_condition},"
+ "${not_static_condition},"
+ "${platform_link_order_condition},"
+ "$<NOT:${link_objects_using_link_options_condition}>,"
+ "${extra_conditions}"
+ ">"
+ ":${objects}>"
+ )
+ target_sources(${target} INTERFACE
+ "${target_sources_genex}"
+ )
+
+ # Collect link conditions for the target_link_options call.
+ string(JOIN "" target_link_options_genex
+ "$<"
+ "$<AND:"
+ "${not_static_condition},"
+ "${platform_link_order_condition},"
+ "${link_objects_using_link_options_condition},"
+ "${extra_conditions}"
+ ">"
+ ":${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
+ # 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...).
+ target_link_options(${target} INTERFACE
+ "${target_link_options_genex}"
+ )
+
+ # Collect link conditions for the target_link_libraries call.
+ string(JOIN "" target_link_libraries_genex
+ "$<"
+ "$<AND:"
+ "${not_finalizer_mode_condition},"
+ "${not_static_condition},"
+ "$<NOT:${platform_link_order_condition}>,"
+ "${extra_conditions}"
+ ">"
+ ":${objects}>"
+ )
+ target_link_libraries(${target} INTERFACE
+ "${target_link_libraries_genex}"
+ )
+
+ if(NOT arg_NO_LINK_OBJECT_LIBRARY_REQUIREMENTS_TO_TARGET)
+ # It's necessary to link the object library target, since we want to pass the object library
+ # dependencies to the 'target'. Interface linking doesn't add the objects of the library to
+ # the end-point linker line but propagates all the dependencies of the object_library added
+ # before or AFTER the line below.
+ target_link_libraries(${target} INTERFACE ${object_library})
+ endif()
+endfunction()
+
function(__qt_propagate_generated_resource target resource_name generated_source_code output_generated_target)
get_target_property(type ${target} TYPE)
if(type STREQUAL STATIC_LIBRARY)
@@ -1329,14 +1553,12 @@ function(__qt_propagate_generated_resource target resource_name generated_source
target_compile_definitions("${resource_target}" PRIVATE
"$<TARGET_PROPERTY:${QT_CMAKE_EXPORT_NAMESPACE}::Core,INTERFACE_COMPILE_DEFINITIONS>"
)
-
- target_link_libraries(${resource_target} PRIVATE ${QT_CMAKE_EXPORT_NAMESPACE}::Platform)
- _qt_internal_copy_dependency_properties(${resource_target} ${target} PRIVATE_ONLY)
+ _qt_internal_set_up_static_runtime_library("${resource_target}")
# Special handling is required for the Core library resources. The linking of the Core
# library to the resources adds a circular dependency. This leads to the wrong
- # objects/library order in the linker command line, since the Core library target is resolved
- # first.
+ # objects/library order in the linker command line, since the Core library target is
+ # resolved first.
if(NOT target STREQUAL "Core")
target_link_libraries(${resource_target} INTERFACE ${QT_CMAKE_EXPORT_NAMESPACE}::Core)
endif()
@@ -1353,24 +1575,14 @@ function(__qt_propagate_generated_resource target resource_name generated_source
set_property(TARGET ${resource_target} APPEND PROPERTY
_qt_resource_generated_cpp_relative_path "${generated_cpp_file_relative_path}")
- # Use TARGET_NAME genex to map to the correct prefixed target name when it is exported
- # via qt_install(EXPORT), so that the consumers of the target can find the object library
- # as well.
- target_sources(${target} INTERFACE
- "$<TARGET_OBJECTS:$<TARGET_NAME:${resource_target}>>"
- )
- if(NOT target STREQUAL "Core")
- # It's necessary to link the object library target, since we want to pass
- # the object library dependencies to the 'target'. Interface linking doesn't
- # add the objects of the resource library to the end-point linker line
- # but propagates all the dependencies of the resource_target added before
- # or AFTER the line below.
- target_link_libraries(${target} INTERFACE ${resource_target})
+ if(target STREQUAL "Core")
+ set(skip_direct_linking NO_LINK_OBJECT_LIBRARY_REQUIREMENTS_TO_TARGET)
endif()
- set(${output_generated_target} "${resource_target}" PARENT_SCOPE)
+ __qt_internal_propagate_object_library(${target} ${resource_target}
+ ${skip_direct_linking}
+ )
- # No need to compile Q_IMPORT_PLUGIN-containing files for non-executables.
- _qt_internal_disable_static_default_plugins("${resource_target}")
+ set(${output_generated_target} "${resource_target}" PARENT_SCOPE)
else()
set(${output_generated_target} "" PARENT_SCOPE)
target_sources(${target} PRIVATE ${generated_source_code})
@@ -1378,15 +1590,10 @@ function(__qt_propagate_generated_resource target resource_name generated_source
endfunction()
# Creates fake targets and adds resource files to IDE's tree
+# FIXME: We shouldn't need to create a separate target for this, the files
+# should be added to the actual target instead.
function(_qt_internal_expose_source_file_to_ide target file)
- set(ide_target_extension "other_files")
- set(qml_extensions ".qml" ".js")
- get_filename_component(resource_extension "${file}" LAST_EXT)
- if(resource_extension IN_LIST qml_extensions)
- set(ide_target_extension "qml_files")
- endif()
-
- set(ide_target ${target}_${ide_target_extension})
+ set(ide_target ${target}_other_files)
if(NOT TARGET ${ide_target})
add_custom_target(${ide_target} SOURCES "${file}")
else()
@@ -1396,13 +1603,12 @@ endfunction()
#
# Process resources via file path instead of QRC files. Behind the
-# scnenes, it will generate a qrc file and apply post processing steps
-# when applicable. (e.g.: QtQuickCompiler)
+# scenes, it will generate a qrc file.
#
# The QRC Prefix is set via the PREFIX parameter.
#
# Alias settings for files need to be set via the QT_RESOURCE_ALIAS property
-# via the set_soure_files_properties() command.
+# via the set_source_files_properties() command.
#
# When using this command with static libraries, one or more special targets
# will be generated. Should you wish to perform additional processing on these
@@ -1420,23 +1626,17 @@ function(_qt_internal_process_resource target resourceName)
string(REPLACE "." "_" resourceName ${resourceName})
set(output_targets "")
- # Apply base to all files
- if (rcc_BASE)
- foreach(file IN LISTS rcc_FILES)
- set(resource_file "${rcc_BASE}/${file}")
- __qt_get_relative_resource_path_for_file(alias ${resource_file})
- # Handle case where resources were generated from a directory
- # different than the one where the main .pro file resides.
- # Unless otherwise specified, we should use the original file path
- # as alias.
- if (alias STREQUAL resource_file)
- set_source_files_properties(${resource_file} PROPERTIES QT_RESOURCE_ALIAS ${file})
+ set(resource_files ${rcc_FILES})
+ if(NOT "${rcc_BASE}" STREQUAL "")
+ get_filename_component(abs_base "${rcc_BASE}" ABSOLUTE)
+ foreach(file_path IN LISTS resource_files)
+ get_source_file_property(alias "${file_path}" QT_RESOURCE_ALIAS)
+ if(alias STREQUAL "NOTFOUND")
+ get_filename_component(abs_file "${file_path}" ABSOLUTE)
+ file(RELATIVE_PATH rel_file "${abs_base}" "${abs_file}")
+ set_property(SOURCE "${file_path}" PROPERTY QT_RESOURCE_ALIAS "${rel_file}")
endif()
- file(TO_CMAKE_PATH ${resource_file} resource_file)
- list(APPEND resource_files ${resource_file})
endforeach()
- else()
- set(resource_files ${rcc_FILES})
endif()
if(NOT rcc_PREFIX)
@@ -1446,29 +1646,14 @@ function(_qt_internal_process_resource target resourceName)
endif()
endif()
- # Apply quick compiler pass. This is only enabled when Qt6QmlMacros is
- # parsed.
- if (QT6_ADD_RESOURCE_DECLARATIVE_EXTENSIONS)
- _qt_internal_quick_compiler_process_resources(${target} ${resourceName}
- FILES ${resource_files}
- PREFIX ${rcc_PREFIX}
- OUTPUT_REMAINING_RESOURCES resources
- OUTPUT_RESOURCE_NAME newResourceName
- OUTPUT_GENERATED_TARGET output_target_quick
- )
- else()
- set(newResourceName ${resourceName})
- set(resources ${resource_files})
- endif()
-
- if (NOT resources)
+ if (NOT resource_files)
if (rcc_OUTPUT_TARGETS)
set(${rcc_OUTPUT_TARGETS} "${output_target_quick}" PARENT_SCOPE)
endif()
return()
endif()
list(APPEND output_targets ${output_target_quick})
- set(generatedBaseName "${newResourceName}")
+ set(generatedBaseName "${resourceName}")
set(generatedResourceFile "${CMAKE_CURRENT_BINARY_DIR}/.rcc/${generatedBaseName}.qrc")
# Generate .qrc file:
@@ -1484,7 +1669,7 @@ function(_qt_internal_process_resource target resourceName)
string(APPEND qrcContents ">\n")
set(resource_dependencies)
- foreach(file IN LISTS resources)
+ foreach(file IN LISTS resource_files)
__qt_get_relative_resource_path_for_file(file_resource_path ${file})
if (NOT IS_ABSOLUTE ${file})
@@ -1516,7 +1701,7 @@ function(_qt_internal_process_resource target resourceName)
set(qt_core_configure_file_contents "${qrcContents}")
configure_file("${template_file}" "${generatedResourceFile}")
- set(rccArgs --name "${newResourceName}" "${generatedResourceFile}")
+ set(rccArgs --name "${resourceName}" "${generatedResourceFile}")
if(rcc_OPTIONS)
list(APPEND rccArgs ${rcc_OPTIONS})
@@ -1547,7 +1732,7 @@ function(_qt_internal_process_resource target resourceName)
endif()
endif()
else()
- set(generatedOutfile "${CMAKE_CURRENT_BINARY_DIR}/.rcc/qrc_${newResourceName}.cpp")
+ set(generatedOutfile "${CMAKE_CURRENT_BINARY_DIR}/.rcc/qrc_${resourceName}.cpp")
endif()
list(PREPEND rccArgs --output "${generatedOutfile}")
@@ -1559,7 +1744,7 @@ function(_qt_internal_process_resource target resourceName)
${resource_dependencies}
${generatedResourceFile}
"${QT_CMAKE_EXPORT_NAMESPACE}::rcc"
- COMMENT "RCC ${newResourceName}"
+ COMMENT "Running rcc for resource ${resourceName}"
VERBATIM)
if(isBinary)
@@ -1569,15 +1754,8 @@ function(_qt_internal_process_resource target resourceName)
set_property(SOURCE "${generatedOutfile}" PROPERTY SKIP_AUTOGEN ON)
set_property(TARGET ${target} APPEND PROPERTY _qt_generated_qrc_files "${generatedResourceFile}")
- # Only do this if newResourceName is the same as resourceName, since
- # the resource will be chainloaded by the qt quickcompiler
- # qml cache loader
- if(newResourceName STREQUAL resourceName)
- __qt_propagate_generated_resource(${target} ${resourceName} "${generatedOutfile}" output_target)
- list(APPEND output_targets ${output_target})
- else()
- target_sources(${target} PRIVATE "${generatedOutfile}")
- endif()
+ __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()
@@ -1626,31 +1804,33 @@ function(qt6_add_plugin target)
)
endif()
- # If no explicit STATIC/SHARED option is set, default to the flavor of the Qt build.
- if(QT6_IS_SHARED_LIBS_BUILD)
- set(create_static_plugin FALSE)
- else()
- set(create_static_plugin TRUE)
- endif()
-
# Explicit option takes priority over the computed default.
if(arg_STATIC)
set(create_static_plugin TRUE)
elseif(arg_SHARED)
set(create_static_plugin FALSE)
+ else()
+ # If no explicit STATIC/SHARED option is set, default to the flavor of the Qt build.
+ if(QT6_IS_SHARED_LIBS_BUILD)
+ set(create_static_plugin FALSE)
+ else()
+ set(create_static_plugin TRUE)
+ endif()
endif()
- if (create_static_plugin)
- add_library(${target} STATIC)
- target_compile_definitions(${target} PRIVATE QT_STATICPLUGIN)
+ # The default of _qt_internal_add_library creates SHARED in a shared Qt build, so we need to
+ # be explicit about the MODULE.
+ if(create_static_plugin)
+ set(type_to_create STATIC)
else()
- add_library(${target} MODULE)
- if(APPLE)
- # CMake defaults to using .so extensions for loadable modules, aka plugins,
- # but Qt plugins are actually suffixed with .dylib.
- set_property(TARGET "${target}" PROPERTY SUFFIX ".dylib")
- endif()
- _qt_internal_apply_win_prefix_and_suffix(${target})
+ set(type_to_create MODULE)
+ endif()
+
+ _qt_internal_add_library(${target} ${type_to_create})
+
+ get_target_property(target_type "${target}" TYPE)
+ if (target_type STREQUAL "STATIC_LIBRARY")
+ target_compile_definitions(${target} PRIVATE QT_STATICPLUGIN)
endif()
set(output_name ${target})
@@ -1660,7 +1840,6 @@ function(qt6_add_plugin target)
set_property(TARGET "${target}" PROPERTY OUTPUT_NAME "${output_name}")
if (ANDROID)
- qt6_android_apply_arch_suffix("${target}")
set_target_properties(${target}
PROPERTIES
LIBRARY_OUTPUT_NAME "plugins_${arg_TYPE}_${output_name}"
@@ -1668,7 +1847,6 @@ function(qt6_add_plugin target)
endif()
# Derive the class name from the target name if it's not explicitly specified.
- # Don't set it for qml plugins though.
set(plugin_class_name "")
if (NOT "${arg_TYPE}" STREQUAL "qml_plugin")
if (NOT arg_CLASS_NAME)
@@ -1676,7 +1854,16 @@ function(qt6_add_plugin target)
else()
set(plugin_class_name "${arg_CLASS_NAME}")
endif()
+ else()
+ # Make sure to set any passed-in class name for qml plugins as well, because it's used for
+ # building the qml plugin foo_init object libraries.
+ if(arg_CLASS_NAME)
+ set(plugin_class_name "${arg_CLASS_NAME}")
+ else()
+ message(FATAL_ERROR "Qml plugin target has no CLASS_NAME specified: '${target}'")
+ endif()
endif()
+
set_target_properties(${target} PROPERTIES QT_PLUGIN_CLASS_NAME "${plugin_class_name}")
target_compile_definitions(${target} PRIVATE
@@ -1691,6 +1878,107 @@ if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
endfunction()
endif()
+# Creates a library by forwarding arguments to add_library, applies some Qt naming file name naming
+# conventions and ensures the execution of Qt specific finalizers.
+function(qt6_add_library target)
+ cmake_parse_arguments(PARSE_ARGV 1 arg "MANUAL_FINALIZATION" "" "")
+
+ _qt_internal_add_library("${target}" ${arg_UNPARSED_ARGUMENTS})
+
+ if(arg_MANUAL_FINALIZATION)
+ # Caller says they will call qt6_finalize_target() themselves later
+ return()
+ endif()
+
+ # Defer the finalization if we can. When the caller's project requires
+ # CMake 3.19 or later, this makes the calls to this function concise while
+ # still allowing target property modification before finalization.
+ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.19)
+ # Need to wrap in an EVAL CODE or else ${target} won't be evaluated
+ # due to special behavior of cmake_language() argument handling
+ cmake_language(EVAL CODE "cmake_language(DEFER CALL qt6_finalize_target ${target})")
+ else()
+ set_target_properties("${target}" PROPERTIES _qt_is_immediately_finalized TRUE)
+ qt6_finalize_target("${target}")
+ endif()
+endfunction()
+
+# Creates a library target by forwarding the arguments to add_library.
+#
+# Applies some Qt specific behaviors:
+# - If no type option is specified, rather than defaulting to STATIC it defaults to STATIC or SHARED
+# depending on the Qt configuration.
+# - Applies Qt specific prefixes and suffixes to file names depending on platform.
+function(_qt_internal_add_library target)
+ set(opt_args
+ STATIC
+ SHARED
+ MODULE
+ INTERFACE
+ OBJECT
+ )
+ set(single_args "")
+ set(multi_args "")
+ cmake_parse_arguments(PARSE_ARGV 1 arg "${opt_args}" "${single_args}" "${multi_args}")
+
+ set(option_type_count 0)
+ if(arg_STATIC)
+ set(type_to_create STATIC)
+ math(EXPR option_type_count "${option_type_count}+1")
+ elseif(arg_SHARED)
+ set(type_to_create SHARED)
+ math(EXPR option_type_count "${option_type_count}+1")
+ elseif(arg_MODULE)
+ set(type_to_create MODULE)
+ math(EXPR option_type_count "${option_type_count}+1")
+ elseif(arg_INTERFACE)
+ set(type_to_create INTERFACE)
+ math(EXPR option_type_count "${option_type_count}+1")
+ elseif(arg_OBJECT)
+ set(type_to_create OBJECT)
+ math(EXPR option_type_count "${option_type_count}+1")
+ endif()
+
+ if(option_type_count GREATER 1)
+ message(FATAL_ERROR
+ "Multiple type options were given. Only one should be used."
+ )
+ endif()
+
+ # If no explicit type option is set, default to the flavor of the Qt build.
+ # This in contrast to CMake which defaults to STATIC.
+ if(NOT arg_STATIC AND NOT arg_SHARED AND NOT arg_MODULE AND NOT arg_INTERFACE
+ AND NOT arg_OBJECT)
+ if(QT6_IS_SHARED_LIBS_BUILD)
+ set(type_to_create SHARED)
+ else()
+ set(type_to_create STATIC)
+ endif()
+ endif()
+
+ add_library(${target} ${type_to_create} ${arg_UNPARSED_ARGUMENTS})
+
+ if(NOT type_to_create STREQUAL "INTERFACE" AND NOT type_to_create STREQUAL "OBJECT")
+ _qt_internal_apply_win_prefix_and_suffix("${target}")
+ endif()
+
+ if(arg_MODULE AND APPLE)
+ # CMake defaults to using .so extensions for loadable modules, aka plugins,
+ # but Qt plugins are actually suffixed with .dylib.
+ set_property(TARGET "${target}" PROPERTY SUFFIX ".dylib")
+ endif()
+
+ if(ANDROID)
+ qt6_android_apply_arch_suffix("${target}")
+ endif()
+endfunction()
+
+if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
+ function(qt_add_library)
+ qt6_add_library(${ARGV})
+ 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.
@@ -1792,3 +2080,14 @@ 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()
+
+if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
+ function(qt_disable_unicode_defines)
+ qt6_disable_unicode_defines(${ARGV})
+ endfunction()
+endif()
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index 18dab48e5a..16621036e2 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -1346,6 +1346,12 @@ void QAbstractAnimation::setCurrentTime(int msecs)
if (d->currentLoop != oldLoop)
d->currentLoop.notify();
+ /* Notify before calling stop: As seen in tst_QSequentialAnimationGroup::clear
+ * we might delete the animation when stop is called. Thus after stop no member
+ * of the object must be used anymore.
+ */
+ if (oldCurrentTime != d->totalCurrentTime)
+ d->totalCurrentTime.notify();
// All animations are responsible for stopping the animation when their
// own end state is reached; in this case the animation is time driven,
// and has reached the end.
@@ -1353,8 +1359,6 @@ void QAbstractAnimation::setCurrentTime(int msecs)
|| (d->direction == Backward && d->totalCurrentTime == 0)) {
stop();
}
- if (oldCurrentTime != d->totalCurrentTime)
- d->totalCurrentTime.notify();
}
/*!
diff --git a/src/corelib/animation/qpropertyanimation.h b/src/corelib/animation/qpropertyanimation.h
index 5768ec6f01..0edd4d9b72 100644
--- a/src/corelib/animation/qpropertyanimation.h
+++ b/src/corelib/animation/qpropertyanimation.h
@@ -51,9 +51,9 @@ class Q_CORE_EXPORT QPropertyAnimation : public QVariantAnimation
{
Q_OBJECT
Q_PROPERTY(QByteArray propertyName READ propertyName WRITE setPropertyName
- BINDABLE bindablePropertyName)
+ BINDABLE bindablePropertyName)
Q_PROPERTY(QObject* targetObject READ targetObject WRITE setTargetObject
- BINDABLE bindableTargetObject)
+ BINDABLE bindableTargetObject)
public:
QPropertyAnimation(QObject *parent = nullptr);
diff --git a/src/corelib/animation/qsequentialanimationgroup.h b/src/corelib/animation/qsequentialanimationgroup.h
index 34be474fe2..4b222069cf 100644
--- a/src/corelib/animation/qsequentialanimationgroup.h
+++ b/src/corelib/animation/qsequentialanimationgroup.h
@@ -52,8 +52,8 @@ class QSequentialAnimationGroupPrivate;
class Q_CORE_EXPORT QSequentialAnimationGroup : public QAnimationGroup
{
Q_OBJECT
- Q_PROPERTY(QAbstractAnimation *currentAnimation READ currentAnimation NOTIFY
- currentAnimationChanged BINDABLE bindableCurrentAnimation)
+ Q_PROPERTY(QAbstractAnimation *currentAnimation READ currentAnimation
+ NOTIFY currentAnimationChanged BINDABLE bindableCurrentAnimation)
public:
QSequentialAnimationGroup(QObject *parent = nullptr);
@@ -67,7 +67,7 @@ public:
int duration() const override;
Q_SIGNALS:
- void currentAnimationChanged(QAbstractAnimation *current) const;
+ void currentAnimationChanged(QAbstractAnimation *current);
protected:
QSequentialAnimationGroup(QSequentialAnimationGroupPrivate &dd, QObject *parent);
diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp
index dec81abd8b..a0f0e176b6 100644
--- a/src/corelib/animation/qvariantanimation.cpp
+++ b/src/corelib/animation/qvariantanimation.cpp
@@ -439,8 +439,8 @@ void QVariantAnimation::registerInterpolator(QVariantAnimation::Interpolator fun
// to continue causes the app to crash on exit with a SEGV
if (interpolators) {
const auto locker = qt_scoped_lock(registeredInterpolatorsMutex);
- if (int(interpolationType) >= interpolators->count())
- interpolators->resize(int(interpolationType) + 1);
+ if (interpolationType >= interpolators->count())
+ interpolators->resize(interpolationType + 1);
interpolators->replace(interpolationType, func);
}
}
diff --git a/src/corelib/compat/removed_api.cpp b/src/corelib/compat/removed_api.cpp
new file mode 100644
index 0000000000..d5d71ce75a
--- /dev/null
+++ b/src/corelib/compat/removed_api.cpp
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+#define QT_BUILD_REMOVED_API
+
+#include "qglobal.h"
+
+QT_USE_NAMESPACE
+
+#if QT_REMOVED_SINCE(6, 3)
+
+#include "tools/qcryptographichash.h"
+
+void QCryptographicHash::addData(const QByteArray &data)
+{
+ addData(QByteArrayView{data});
+}
+
+QByteArray QCryptographicHash::hash(const QByteArray &data, Algorithm method)
+{
+ return hash(QByteArrayView{data}, method);
+}
+
+#include "quuid.h"
+
+QUuid QUuid::fromRfc4122(const QByteArray &bytes)
+{
+ return fromRfc4122(qToByteArrayViewIgnoringNull(bytes));
+}
+
+// #include <qotherheader.h>
+// // implement removed functions from qotherheader.h
+
+#endif // QT_REMOVED_SINCE(6, 3)
diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake
index e82ac8bf93..9ff06f0792 100644
--- a/src/corelib/configure.cmake
+++ b/src/corelib/configure.cmake
@@ -156,6 +156,28 @@ std::mt19937 mt(0);
}
")
+# cxx17_bm_searcher
+qt_config_compile_test(cxx17_bm_searcher
+ LABEL "C++17 boyer_moore_searcher"
+ CODE
+"#include <algorithm>
+#include <functional>
+
+int main(void)
+{
+ /* BEGIN TEST: */
+const char haystack[] = \"hello\";
+const char needle[] = \"e\";
+const auto it =
+std::search(haystack + 0, haystack + std::size(haystack),
+std::boyer_moore_searcher(needle + 0, needle + std::size(needle)));
+(void)it;
+ /* END TEST: */
+ return 0;
+}
+"# FIXME: qmake: CONFIG += c++17
+)
+
# cxx17_filesystem
qt_config_compile_test(cxx17_filesystem
LABEL "C++17 <filesystem>"
@@ -519,6 +541,10 @@ qt_feature("cxx11_future" PUBLIC
LABEL "C++11 <future>"
CONDITION TEST_cxx11_future
)
+qt_feature("cxx17_bm_searcher" PRIVATE
+ LABEL "C++17 boyer_moore_searcher"
+ CONDITION TEST_cxx17_bm_searcher
+)
qt_feature("cxx17_filesystem" PUBLIC
LABEL "C++17 <filesystem>"
CONDITION TEST_cxx17_filesystem
@@ -567,8 +593,8 @@ qt_feature("inotify" PUBLIC PRIVATE
qt_feature_definition("inotify" "QT_NO_INOTIFY" NEGATE VALUE "1")
qt_feature("ipc_posix"
LABEL "Using POSIX IPC"
- AUTODETECT NOT WIN32
- CONDITION NOT TEST_ipc_sysv AND TEST_ipc_posix
+ AUTODETECT NOT WIN32 AND ( ( APPLE AND QT_FEATURE_appstore_compliant ) OR NOT TEST_ipc_sysv )
+ CONDITION TEST_ipc_posix
)
qt_feature_definition("ipc_posix" "QT_POSIX_IPC")
qt_feature("journald" PRIVATE
diff --git a/src/corelib/configure.json b/src/corelib/configure.json
deleted file mode 100644
index 4643531135..0000000000
--- a/src/corelib/configure.json
+++ /dev/null
@@ -1,1065 +0,0 @@
-{
- "module": "core",
- "testDir": "../../config.tests",
-
- "commandline": {
- "options": {
- "doubleconversion": { "type": "enum", "values": [ "no", "qt", "system" ] },
- "eventfd": "boolean",
- "glib": "boolean",
- "icu": "boolean",
- "inotify": "boolean",
- "journald": "boolean",
- "libb2": { "type": "enum", "values": [ "no", "qt", "system" ] },
- "mimetype-database": "boolean",
- "pcre": { "type": "enum", "values": [ "no", "qt", "system" ] },
- "posix-ipc": { "type": "boolean", "name": "ipc_posix" },
- "pps": { "type": "boolean", "name": "qqnx_pps" },
- "slog2": "boolean",
- "syslog": "boolean",
- "trace": { "type": "optionalString", "values": [ "etw", "lttng", "no", "yes" ] }
- }
- },
-
- "libraries": {
- "backtrace": {
- "label": "backtrace",
- "test": {
- "main":
- [ "void *buffer[100];",
- "int nptrs = backtrace(buffer, 100);"
- ]
- },
- "headers": "execinfo.h",
- "sources": [ "-lexecinfo" ]
- },
- "doubleconversion": {
- "label": "DoubleConversion",
- "test": {
- "main": "(void) double_conversion::StringToDoubleConverter::NO_FLAGS;"
- },
- "headers": "double-conversion/double-conversion.h",
- "sources": [
- "-ldouble-conversion"
- ]
- },
- "glib": {
- "label": "GLib",
- "test": {
- "head": "typedef struct _GMainContext GMainContext;",
- "main": [
- "g_thread_init(NULL);",
- "(void) g_main_context_default();",
- "(void) g_source_new(0, 0);",
- "g_source_add_poll(NULL, NULL);"
- ]
- },
- "headers": "glib.h",
- "sources": [
- { "type": "pkgConfig", "args": "glib-2.0 gthread-2.0" }
- ]
- },
- "icu": {
- "label": "ICU",
- "test": {
- "main": [
- "UErrorCode status = U_ZERO_ERROR;",
- "UCollator *collator = ucol_open(\"ru_RU\", &status);",
- "if (!U_FAILURE(status))",
- " ucol_close(collator);"
- ]
- },
- "headers": [ "unicode/utypes.h", "unicode/ucol.h", "unicode/ustring.h" ],
- "sources": [
- {
- "builds": {
- "debug": "-lsicuind -lsicuucd -lsicudtd",
- "release": "-lsicuin -lsicuuc -lsicudt"
- },
- "condition": "config.win32 && !features.shared"
- },
- { "libs": "-licuin -licuuc -licudt", "condition": "config.win32 && features.shared" },
- { "libs": "-licui18n -licuuc -licudata", "condition": "!config.win32" }
- ],
- "use": [
- { "lib": "libdl", "condition": "features.dlopen" }
- ]
- },
- "journald": {
- "label": "journald",
- "test": {
- "main": "sd_journal_send(\"PRIORITY=%i\", LOG_INFO, NULL);"
- },
- "headers": [ "systemd/sd-journal.h", "syslog.h" ],
- "sources": [
- { "type": "pkgConfig", "args": "libsystemd" },
- { "type": "pkgConfig", "args": "libsystemd-journal" }
- ]
- },
- "libatomic": {
- "label": "64 bit atomics",
- "test": {
- "tail": [
- "void test(volatile std::atomic<std::int64_t> &a)",
- "{",
- " std::int64_t v = a.load(std::memory_order_acquire);",
- " while (!a.compare_exchange_strong(v, v + 1,",
- " std::memory_order_acq_rel,",
- " std::memory_order_acquire)) {",
- " v = a.exchange(v - 1);",
- " }",
- " a.store(v + 1, std::memory_order_release);",
- "}"
- ],
- "main": [
- "void *ptr = (void*)0xffffffc0; // any random pointer",
- "test(*reinterpret_cast<std::atomic<std::int64_t> *>(ptr));"
- ],
- "qmake": "CONFIG += c++11"
- },
- "headers": [ "atomic", "cstdint" ],
- "sources": [
- "",
- "-latomic"
- ]
- },
- "libb2": {
- "label": "libb2",
- "test": {
- "main": "BLAKE2B_BLOCKBYTES;"
- },
- "headers": "blake2.h",
- "sources": [
- { "type": "pkgConfig", "args": "libb2" },
- "-lb2"
- ]
- },
- "librt": {
- "label": "clock_gettime()",
- "test": {
- "main": "timespec ts; clock_gettime(CLOCK_REALTIME, &ts);"
- },
- "headers": [ "unistd.h", "time.h" ],
- "sources": [
- "",
- "-lrt"
- ]
- },
- "lttng-ust": {
- "label": "lttng-ust",
- "test": {
- "main": "lttng_session_destroy(nullptr);"
- },
- "headers": "lttng/ust-events.h",
- "sources": [
- { "type": "pkgConfig", "args": "lttng-ust" },
- "-llttng-ust"
- ],
- "use": "libdl"
- },
- "pcre2": {
- "label": "PCRE2",
- "test": {
- "head": "#define PCRE2_CODE_UNIT_WIDTH 16",
- "tail": [
- "#if (PCRE2_MAJOR < 10) || ((PCRE2_MAJOR == 10) && (PCRE2_MINOR < 20))",
- "# error This PCRE version is not supported",
- "#endif"
- ]
- },
- "headers": "pcre2.h",
- "sources": [
- { "type": "pkgConfig", "args": "libpcre2-16" },
- "-lpcre2-16"
- ]
- },
- "pps": {
- "label": "PPS",
- "test": {
- "main": [
- "pps_decoder_t decoder;",
- "pps_decoder_initialize(&decoder, NULL);"
- ]
- },
- "headers": "sys/pps.h",
- "sources": [
- "-lpps"
- ]
- },
- "slog2": {
- "label": "slog2",
- "test": {
- "main": "slog2_set_default_buffer((slog2_buffer_t)-1);"
- },
- "export": "",
- "headers": "sys/slog2.h",
- "sources": [
- "-lslog2"
- ]
- }
- },
-
- "tests": {
- "atomicfptr": {
- "label": "working std::atomic for function pointers",
- "type": "compile",
- "test": {
- "include": "atomic",
- "tail": [
- "typedef void (*fptr)(int);",
- "typedef std::atomic<fptr> atomicfptr;",
- "void testfunction(int) { }",
- "void test(volatile atomicfptr &a)",
- "{",
- " fptr v = a.load(std::memory_order_acquire);",
- " while (!a.compare_exchange_strong(v, &testfunction,",
- " std::memory_order_acq_rel,",
- " std::memory_order_acquire)) {",
- " v = a.exchange(&testfunction);",
- " }",
- " a.store(&testfunction, std::memory_order_release);",
- "}"
- ],
- "main": [
- "atomicfptr fptr(testfunction);",
- "test(fptr);"
- ],
- "qmake": "CONFIG += c++11"
- }
- },
- "clock-monotonic": {
- "label": "POSIX monotonic clock",
- "type": "compile",
- "test": {
- "include": [ "unistd.h", "time.h" ],
- "main": [
- "#if defined(_POSIX_MONOTONIC_CLOCK) && (_POSIX_MONOTONIC_CLOCK-0 >= 0)",
- "timespec ts;",
- "clock_gettime(CLOCK_MONOTONIC, &ts);",
- "#else",
- "# error Feature _POSIX_MONOTONIC_CLOCK not available",
- "#endif"
- ]
- },
- "use": "librt"
- },
- "cloexec": {
- "label": "O_CLOEXEC",
- "type": "compile",
- "test": {
- "head": "#define _GNU_SOURCE 1",
- "include": [ "sys/types.h", "sys/socket.h", "fcntl.h", "unistd.h" ],
- "main": [
- "int pipes[2];",
- "(void) pipe2(pipes, O_CLOEXEC | O_NONBLOCK);",
- "(void) fcntl(0, F_DUPFD_CLOEXEC, 0);",
- "(void) dup3(0, 3, O_CLOEXEC);",
- "#if defined(__NetBSD__)",
- "(void) paccept(0, 0, 0, NULL, SOCK_CLOEXEC | SOCK_NONBLOCK);",
- "#else",
- "(void) accept4(0, 0, 0, SOCK_CLOEXEC | SOCK_NONBLOCK);",
- "#endif"
- ]
- }
- },
- "cxx11_future": {
- "label": "C++11 <future>",
- "type": "compile",
- "test": {
- "include": "future",
- "main": [
- "std::future<int> f = std::async([]() { return 42; });",
- "(void)f.get();"
- ],
- "qmake": "unix:!android:LIBS += -lpthread"
- }
- },
- "cxx11_random": {
- "label": "C++11 <random>",
- "type": "compile",
- "test": {
- "include": "random",
- "main": "std::mt19937 mt(0);"
- }
- },
- "cxx17_filesystem": {
- "label": "C++17 <filesystem>",
- "type": "compile",
- "test": {
- "include": "filesystem",
- "main": [
- "std::filesystem::copy(",
- " std::filesystem::path(\"./file\"),",
- " std::filesystem::path(\"./other\"));"
- ],
- "qmake": "CONFIG += c++17"
- }
- },
- "eventfd": {
- "label": "eventfd",
- "type": "compile",
- "test": {
- "include": "sys/eventfd.h",
- "main": [
- "eventfd_t value;",
- "int fd = eventfd(0, EFD_CLOEXEC);",
- "eventfd_read(fd, &value);",
- "eventfd_write(fd, value);"
- ]
- }
- },
- "futimens": {
- "label": "futimens()",
- "type": "compile",
- "test": {
- "include": "sys/stat.h",
- "main": "futimens(-1, 0);",
- "qmake": [
- "# Block futimens() on Apple platforms unless it's available on ALL",
- "# deployment targets. This simplifies the logic at the call site",
- "# dramatically, as it isn't strictly needed compared to futimes().",
- "darwin: QMAKE_CXXFLAGS += -Werror=unguarded-availability -Werror=unguarded-availability-new",
- "CONFIG += warn_on"
- ]
- }
- },
- "futimes": {
- "label": "futimes()",
- "type": "compile",
- "test": {
- "include": "sys/time.h",
- "main": "futimes(-1, 0);"
- }
- },
- "getauxval": {
- "label": "getauxval()",
- "type": "compile",
- "test": {
- "include": "sys/auxv.h",
- "main": "(void) getauxval(AT_NULL);"
- }
- },
- "getentropy": {
- "label": "getentropy()",
- "type": "compile",
- "test": {
- "include": "unistd.h",
- "main": [
- "char buf[32];",
- "(void) getentropy(buf, sizeof(buf));"
- ]
- }
- },
- "glibc": {
- "label": "GNU libc",
- "type": "compile",
- "test": {
- "include": "stdlib.h",
- "main": [
- "return __GLIBC__;"
- ]
- }
- },
- "inotify": {
- "label": "inotify",
- "type": "compile",
- "test": {
- "include": "sys/inotify.h",
- "main": [
- "inotify_init();",
- "inotify_add_watch(0, \"foobar\", IN_ACCESS);",
- "inotify_rm_watch(0, 1);"
- ]
- }
- },
- "ipc_sysv": {
- "label": "SysV IPC",
- "type": "compile",
- "test": {
- "include": [ "sys/types.h", "sys/ipc.h", "sys/sem.h", "sys/shm.h", "fcntl.h" ],
- "main": [
- "key_t unix_key = ftok(\"test\", 'Q');",
- "semctl(semget(unix_key, 1, 0666 | IPC_CREAT | IPC_EXCL), 0, IPC_RMID, 0);",
- "shmget(unix_key, 0, 0666 | IPC_CREAT | IPC_EXCL);",
- "shmctl(0, 0, (struct shmid_ds *)(0));"
- ]
- }
- },
- "ipc_posix": {
- "label": "POSIX IPC",
- "type": "compile",
- "test": {
- "include": [ "sys/types.h", "sys/mman.h", "semaphore.h", "fcntl.h" ],
- "main": [
- "sem_close(sem_open(\"test\", O_CREAT | O_EXCL, 0666, 0));",
- "shm_open(\"test\", O_RDWR | O_CREAT | O_EXCL, 0666);",
- "shm_unlink(\"test\");"
- ],
- "qmake": "linux: LIBS += -lpthread -lrt"
- }
- },
- "linkat": {
- "label": "linkat()",
- "type": "compile",
- "test": {
- "head": "#define _ATFILE_SOURCE 1",
- "include": [ "fcntl.h", "unistd.h" ],
- "main": "linkat(AT_FDCWD, \"foo\", AT_FDCWD, \"bar\", AT_SYMLINK_FOLLOW);"
- }
- },
- "ppoll": {
- "label": "ppoll()",
- "type": "compile",
- "test": {
- "include": [ "signal.h", "poll.h" ],
- "main": [
- "struct pollfd pfd;",
- "struct timespec ts;",
- "sigset_t sig;",
- "ppoll(&pfd, 1, &ts, &sig);"
- ]
- }
- },
- "pollts": {
- "label": "pollts()",
- "type": "compile",
- "test": {
- "include": [ "poll.h", "signal.h", "time.h" ],
- "main": [
- "struct pollfd pfd;",
- "struct timespec ts;",
- "sigset_t sig;",
- "pollts(&pfd, 1, &ts, &sig);"
- ]
- }
- },
- "poll": {
- "label": "poll()",
- "type": "compile",
- "test": {
- "include": "poll.h",
- "main": [
- "struct pollfd pfd;",
- "poll(&pfd, 1, 0);"
- ]
- }
- },
- "renameat2": {
- "label": "renameat2()",
- "type": "compile",
- "test": {
- "head": "#define _ATFILE_SOURCE 1",
- "include": [ "fcntl.h", "stdio.h" ],
- "main": "renameat2(AT_FDCWD, argv[1], AT_FDCWD, argv[2], RENAME_NOREPLACE | RENAME_WHITEOUT);"
- }
- },
- "statx": {
- "label": "statx() in libc",
- "type": "compile",
- "test": {
- "head": "#define _ATFILE_SOURCE 1",
- "include": [ "sys/types.h", "sys/stat.h", "unistd.h", "fcntl.h" ],
- "main": [
- "struct statx statxbuf;",
- "unsigned int mask = STATX_BASIC_STATS;",
- "return statx(AT_FDCWD, \"\", AT_STATX_SYNC_AS_STAT, mask, &statxbuf);"
- ]
- }
- },
- "syslog": {
- "label": "syslog",
- "type": "compile",
- "test": {
- "include": "syslog.h",
- "main": [
- "openlog(\"qt\", 0, LOG_USER);",
- "syslog(LOG_INFO, \"configure\");",
- "closelog();"
- ]
- }
- },
- "xlocalescanprint": {
- "label": "xlocale.h (or equivalents)",
- "type": "compile",
- "test": {
- "files": {
- "qglobal.h": [
- "#ifndef QGLOBAL_H",
- "#define QGLOBAL_H",
- "#endif"
- ]
- },
- "tail": [
- "#define QT_BEGIN_NAMESPACE",
- "#define QT_END_NAMESPACE",
- "",
- "#ifdef _MSVC_VER",
- "#define Q_CC_MSVC _MSVC_VER",
- "#endif",
- "",
- "#define QT_NO_DOUBLECONVERSION",
- "",
- "#include QDSP_P_H"
- ],
- "main": [
- "#ifdef _MSVC_VER",
- "_locale_t invalidLocale = NULL;",
- "#else",
- "locale_t invalidLocale = NULL;",
- "#endif",
- "double a = 3.4;",
- "qDoubleSnprintf(argv[0], 1, invalidLocale, \"invalid format\", a);",
- "qDoubleSscanf(argv[0], invalidLocale, \"invalid format\", &a, &argc);"
- ],
- "qmake": "DEFINES += QDSP_P_H=$$shell_quote(\\\"@PWD@/text/qdoublescanprint_p.h\\\")"
- }
- }
- },
-
- "features": {
- "clock-gettime": {
- "label": "clock_gettime()",
- "condition": "config.unix && libs.librt",
- "output": [ "privateFeature" ]
- },
- "clock-monotonic": {
- "label": "POSIX monotonic clock",
- "condition": "features.clock-gettime && tests.clock-monotonic",
- "output": [ "feature" ]
- },
- "doubleconversion": {
- "label": "DoubleConversion",
- "output": [ "privateFeature", "feature" ]
- },
- "system-doubleconversion": {
- "label": " Using system DoubleConversion",
- "enable": "input.doubleconversion == 'system'",
- "disable": "input.doubleconversion == 'qt'",
- "condition": "features.doubleconversion && libs.doubleconversion",
- "output": [ "privateFeature" ]
- },
- "cxx11_future": {
- "label": "C++11 <future>",
- "condition": "tests.cxx11_future",
- "output": [ "publicFeature" ]
- },
- "cxx17_filesystem": {
- "label": "C++17 <filesystem>",
- "condition": "tests.cxx17_filesystem",
- "output": [
- "publicFeature"
- ]
- },
- "eventfd": {
- "label": "eventfd",
- "condition": "!config.wasm && tests.eventfd",
- "output": [ "feature" ]
- },
- "futimens": {
- "label": "futimens()",
- "condition": "!config.win32 && tests.futimens",
- "output": [ "privateFeature" ]
- },
- "futimes": {
- "label": "futimes()",
- "condition": "!config.win32 && !features.futimens && tests.futimes",
- "output": [ "privateFeature" ]
- },
- "getauxval": {
- "label": "getauxval()",
- "condition": "config.linux && tests.getauxval",
- "output": [ "privateFeature" ]
- },
- "getentropy": {
- "label": "getentropy()",
- "condition": "config.unix && tests.getentropy",
- "output": [ "privateFeature" ]
- },
- "glib": {
- "label": "GLib",
- "autoDetect": "!config.win32",
- "condition": "libs.glib",
- "output": [ "privateFeature", "feature" ]
- },
- "glibc": {
- "label": "GNU libc",
- "autoDetect": "config.linux",
- "condition": "tests.glibc",
- "output": [ "privateFeature" ]
- },
- "icu": {
- "label": "ICU",
- "autoDetect": "!config.win32",
- "condition": "libs.icu",
- "output": [ "privateFeature" ]
- },
- "inotify": {
- "label": "inotify",
- "condition": "tests.inotify",
- "output": [ "privateFeature", "feature" ]
- },
- "ipc_posix": {
- "label": "Using POSIX IPC",
- "autoDetect": "!config.win32",
- "condition": "!tests.ipc_sysv && tests.ipc_posix",
- "output": [ { "type": "define", "name": "QT_POSIX_IPC" } ]
- },
- "journald": {
- "label": "journald",
- "autoDetect": false,
- "condition": "libs.journald",
- "output": [ "privateFeature" ]
- },
- "system-libb2": {
- "label": "Using system libb2",
- "comment": "Used by QCryptographicHash for the BLAKE2 hashing algorithms",
- "disable": "input.libb2 == 'no' || input.libb2 == 'qt'",
- "enable": "input.libb2 == 'system'",
- "condition": "libs.libb2",
- "output": [ "privateFeature" ]
- },
- "linkat": {
- "label": "linkat()",
- "comment": "Currently only used by QTemporaryFile; linkat() exists on Android, but hardlink creation fails due to security rules",
- "autoDetect": "config.linux && !config.android",
- "condition": "tests.linkat",
- "output": [ "privateFeature" ]
- },
- "std-atomic64": {
- "label": "64 bit atomic operations",
- "condition": "libs.libatomic",
- "output": [ "publicFeature" ]
- },
- "mimetype": {
- "label": "Mimetype handling",
- "purpose": "Provides MIME type handling.",
- "section": "Utilities",
- "output": [ "publicFeature", "feature" ]
- },
- "mimetype-database": {
- "label": "Built-in copy of the MIME database",
- "condition": "features.mimetype",
- "output": [ "privateFeature" ]
- },
- "pcre2": {
- "label": "PCRE2",
- "disable": "input.pcre == 'no'",
- "enable": "input.pcre == 'qt' || features.system-pcre2",
- "output": [ "privateConfig" ]
- },
- "system-pcre2": {
- "label": " Using system PCRE2",
- "disable": "input.pcre == 'no' || input.pcre == 'qt'",
- "enable": "input.pcre == 'system'",
- "condition": "libs.pcre2",
- "output": [ "privateFeature" ]
- },
- "poll_ppoll": {
- "label": "Native ppoll()",
- "emitIf": "!config.win32",
- "condition": "!config.wasm && tests.ppoll",
- "output": [ "privateFeature" ]
- },
- "poll_pollts": {
- "label": "Native pollts()",
- "emitIf": "!config.win32",
- "condition": "!features.poll_ppoll && tests.pollts",
- "output": [ "privateFeature" ]
- },
- "poll_poll": {
- "label": "Native poll()",
- "emitIf": "!config.win32",
- "condition": "!features.poll_ppoll && !features.poll_pollts && tests.poll",
- "output": [ "privateFeature" ]
- },
- "poll_select": {
- "label": "Emulated poll()",
- "emitIf": "!config.win32",
- "condition": "!features.poll_ppoll && !features.poll_pollts && !features.poll_poll",
- "output": [
- "privateFeature",
- { "type": "define", "name": "QT_NO_NATIVE_POLL" }
- ]
- },
- "qqnx_pps": {
- "label": "PPS",
- "emitIf": "config.qnx",
- "condition": "libs.pps",
- "output": [ "privateFeature" ]
- },
- "renameat2": {
- "label": "renameat2()",
- "condition": "config.linux && tests.renameat2",
- "output": [ "privateFeature" ]
- },
- "slog2": {
- "label": "slog2",
- "condition": "libs.slog2",
- "output": [ "privateFeature" ]
- },
- "statx": {
- "label": "statx() in libc",
- "condition": "config.linux && tests.statx",
- "output": [ "privateFeature" ]
- },
- "syslog": {
- "label": "syslog",
- "autoDetect": false,
- "condition": "tests.syslog",
- "output": [ "privateFeature" ]
- },
- "threadsafe-cloexec": {
- "label": "Threadsafe pipe creation",
- "condition": "tests.cloexec",
- "output": [
- "publicQtConfig",
- { "type": "define", "name": "QT_THREADSAFE_CLOEXEC", "value": 1 }
- ]
- },
- "properties": {
- "label": "Properties",
- "purpose": "Supports scripting Qt-based applications.",
- "section": "Kernel",
- "output": [ "publicFeature", "feature" ]
- },
- "regularexpression": {
- "label": "QRegularExpression",
- "purpose": "Provides an API to Perl-compatible regular expressions.",
- "section": "Kernel",
- "condition": "features.system-pcre2 || features.pcre2",
- "output": [ "publicFeature", "feature" ]
- },
- "backtrace": {
- "label": "backtrace",
- "condition": "config.unix && features.regularexpression && libs.backtrace",
- "output": [ "privateFeature" ]
- },
- "sharedmemory": {
- "label": "QSharedMemory",
- "purpose": "Provides access to a shared memory segment.",
- "section": "Kernel",
- "condition": [
- "config.android || config.win32 || (!config.vxworks && (tests.ipc_sysv || tests.ipc_posix))"
- ],
- "output": [ "publicFeature", "feature" ]
- },
- "shortcut": {
- "label": "QShortcut",
- "purpose": "Provides keyboard accelerators and shortcuts.",
- "section": "Kernel",
- "output": [ "publicFeature", "feature" ]
- },
- "systemsemaphore": {
- "label": "QSystemSemaphore",
- "purpose": "Provides a general counting system semaphore.",
- "section": "Kernel",
- "condition": [
- "!config.integrity && !config.vxworks && !config.rtems",
- "config.android || config.win32 || tests.ipc_sysv || tests.ipc_posix"
- ],
- "output": [ "publicFeature", "feature" ]
- },
- "xmlstream": {
- "label": "XML Streaming APIs",
- "purpose": "Provides a simple streaming API for XML.",
- "section": "Kernel",
- "output": [ "publicFeature", "feature" ]
- },
- "xmlstreamreader": {
- "label": "QXmlStreamReader",
- "purpose": "Provides a well-formed XML parser with a simple streaming API.",
- "section": "Kernel",
- "condition": "features.xmlstream",
- "output": [ "publicFeature", "feature" ]
- },
- "xmlstreamwriter": {
- "label": "QXmlStreamWriter",
- "purpose": "Provides a XML writer with a simple streaming API.",
- "section": "Kernel",
- "condition": "features.xmlstream",
- "output": [ "publicFeature", "feature" ]
- },
- "textdate": {
- "label": "Text Date",
- "purpose": "Supports month and day names in dates.",
- "section": "Data structures",
- "output": [ "publicFeature", "feature" ]
- },
- "datestring": {
- "label": "QDate/QTime/QDateTime",
- "purpose": "Provides conversion between dates and strings.",
- "section": "Data structures",
- "condition": "features.textdate",
- "output": [ "publicFeature", "feature" ]
- },
- "process": {
- "label": "QProcess",
- "purpose": "Supports external process invocation.",
- "section": "File I/O",
- "condition": "features.processenvironment && (features.thread || !config.unix) && !config.uikit && !config.integrity && !config.vxworks && !config.rtems",
- "output": [ "publicFeature", "feature" ]
- },
- "processenvironment": {
- "label": "QProcessEnvironment",
- "purpose": "Provides a higher-level abstraction of environment variables.",
- "section": "File I/O",
- "condition": "!config.integrity && !config.rtems",
- "output": [ "publicFeature" ]
- },
- "temporaryfile": {
- "label": "QTemporaryFile",
- "purpose": "Provides an I/O device that operates on temporary files.",
- "section": "File I/O",
- "output": [ "publicFeature", "feature" ]
- },
- "library": {
- "label": "QLibrary",
- "purpose": "Provides a wrapper for dynamically loaded libraries.",
- "section": "File I/O",
- "condition": "config.win32 || config.hpux || (!config.nacl && features.dlopen)",
- "output": [ "publicFeature", "feature" ]
- },
- "settings": {
- "label": "QSettings",
- "purpose": "Provides persistent application settings.",
- "section": "File I/O",
- "output": [ "publicFeature", "feature" ]
- },
- "filesystemwatcher": {
- "label": "QFileSystemWatcher",
- "purpose": "Provides an interface for monitoring files and directories for modifications.",
- "section": "File I/O",
- "output": [ "publicFeature", "feature" ]
- },
- "filesystemiterator": {
- "label": "QFileSystemIterator",
- "purpose": "Provides fast file system iteration.",
- "section": "File I/O",
- "output": [ "publicFeature", "feature" ]
- },
- "itemmodel": {
- "label": "Qt Item Model",
- "purpose": "Provides the item model for item views",
- "section": "ItemViews",
- "output": [ "publicFeature", "feature" ]
- },
- "proxymodel": {
- "label": "QAbstractProxyModel",
- "purpose": "Supports processing of data passed between another model and a view.",
- "section": "ItemViews",
- "condition": "features.itemmodel",
- "output": [ "publicFeature", "feature" ]
- },
- "sortfilterproxymodel": {
- "label": "QSortFilterProxyModel",
- "purpose": "Supports sorting and filtering of data passed between another model and a view.",
- "section": "ItemViews",
- "condition": "features.proxymodel && features.regularexpression",
- "output": [ "publicFeature", "feature" ]
- },
- "identityproxymodel": {
- "label": "QIdentityProxyModel",
- "purpose": "Supports proxying a source model unmodified.",
- "section": "ItemViews",
- "condition": "features.proxymodel",
- "output": [ "publicFeature", "feature" ]
- },
- "transposeproxymodel": {
- "label": "QTransposeProxyModel",
- "purpose": "Provides a proxy to swap rows and columns of a model.",
- "section": "ItemViews",
- "condition": "features.proxymodel",
- "output": [ "publicFeature", "feature" ]
- },
- "concatenatetablesproxymodel": {
- "label": "QConcatenateTablesProxyModel",
- "purpose": "Supports concatenating source models.",
- "section": "ItemViews",
- "condition": "features.proxymodel",
- "output": [ "publicFeature", "feature" ]
- },
- "stringlistmodel": {
- "label": "QStringListModel",
- "purpose": "Provides a model that supplies strings to views.",
- "section": "ItemViews",
- "condition": "features.itemmodel",
- "output": [ "publicFeature", "feature" ]
- },
- "translation": {
- "label": "Translation",
- "purpose": "Supports translations using QObject::tr().",
- "section": "Internationalization",
- "output": [ "publicFeature", "feature" ]
- },
- "easingcurve": {
- "label": "Easing curve",
- "purpose": "Provides easing curve.",
- "section": "Utilities",
- "output": [ "publicFeature" ]
- },
- "animation": {
- "label": "Animation",
- "purpose": "Provides a framework for animations.",
- "section": "Utilities",
- "condition": "features.properties && features.easingcurve",
- "output": [ "publicFeature", "feature" ]
- },
- "gestures": {
- "label": "Gesture",
- "purpose": "Provides a framework for gestures.",
- "section": "Utilities",
- "output": [ "publicFeature", "feature" ]
- },
- "sha3-fast": {
- "label": "Speed optimized SHA3",
- "purpose": "Optimizes SHA3 for speed instead of size.",
- "section": "Utilities",
- "output": [ "privateFeature" ]
- },
- "jalalicalendar": {
- "label": "QJalaliCalendar",
- "purpose": "Support the Jalali (Persian) calendar",
- "section": "Utilities",
- "output": [ "publicFeature" ]
- },
- "hijricalendar": {
- "label": "QHijriCalendar",
- "purpose": "Generic basis for Islamic calendars, providing shared locale data",
- "section": "Utilities",
- "output": [ "privateFeature" ]
- },
- "islamiccivilcalendar": {
- "label": "QIslamicCivilCalendar",
- "purpose": "Support the Islamic Civil calendar",
- "section": "Utilities",
- "condition": "features.hijricalendar",
- "output": [ "publicFeature" ]
- },
- "timezone": {
- "label": "QTimeZone",
- "purpose": "Provides support for time-zone handling.",
- "section": "Utilities",
- "output": [ "publicFeature" ]
- },
- "datetimeparser": {
- "label": "QDateTimeParser",
- "purpose": "Provides support for parsing date-time texts.",
- "section": "Utilities",
- "condition": "features.datestring",
- "output": [ "privateFeature" ]
- },
- "commandlineparser": {
- "label": "QCommandlineParser",
- "purpose": "Provides support for command line parsing.",
- "section": "Utilities",
- "output": [ "publicFeature" ]
- },
- "lttng": {
- "label": "LTTNG",
- "autoDetect": false,
- "enable": "input.trace == 'lttng' || (input.trace =='yes' && config.linux)",
- "disable": "input.trace == 'etw' || input.trace =='no'",
- "condition": "config.linux && libs.lttng-ust",
- "output": [ "privateFeature" ]
- },
- "etw": {
- "label": "ETW",
- "autoDetect": false,
- "enable": "input.trace == 'etw' || (input.trace == 'yes' && config.win32)",
- "disable": "input.trace == 'lttng' || input.trace == 'no'",
- "condition": "config.win32",
- "output": [ "privateFeature" ]
- },
- "forkfd_pidfd": {
- "label": "CLONE_PIDFD support in forkfd",
- "condition": "config.linux",
- "output": [ "privateFeature" ]
- },
- "cborstreamreader": {
- "label": "CBOR stream reading",
- "purpose": "Provides support for reading the CBOR binary format.
-
-Note that this is required for plugin loading. Qt GUI needs QPA plugins for basic operation.",
- "section": "Utilities",
- "output": [ "publicFeature" ]
- },
- "cborstreamwriter": {
- "label": "CBOR stream writing",
- "purpose": "Provides support for writing the CBOR binary format.",
- "section": "Utilities",
- "output": [ "publicFeature" ]
- }
- },
-
- "report": [
- {
- "type": "note",
- "condition": "features.journald || features.syslog || (config.qnx && features.slog2)",
- "message": "journald, syslog or slog2 integration is enabled. If your users intend to develop applications against this build, ensure that the IDEs they use either set QT_FORCE_STDERR_LOGGING to 1 or are able to read the logged output from journald, syslog or slog2."
- },
- {
- "type": "error",
- "condition": "!tests.cxx11_random",
- "message": "C++11 <random> is required and is missing or failed to compile."
- },
- {
- "type": "error",
- "condition": "input.doubleconversion == 'no' && !tests.xlocalescanprint",
- "message": "Your C library does not provide sscanf_l or snprintf_l. You need to use libdouble-conversion for double/string conversion."
- },
- {
- "type": "error",
- "condition": "!tests.atomicfptr",
- "message": "detected a std::atomic implementation that fails for function pointers. Please apply the patch corresponding to your Standard Library vendor, found in qtbase/config.tests/atomicfptr"
- },
- {
- "type": "error",
- "condition": [
- "config.unix || config.integrity",
- "!features.poll_ppoll",
- "!features.poll_pollts",
- "!features.poll_poll",
- "!features.poll_select"
- ],
- "message": "Qt requires poll(), ppoll(), poll_ts() or select() on this platform"
- }
- ],
-
- "summary": [
- {
- "section": "Qt Core",
- "entries": [
- "backtrace",
- "doubleconversion",
- "system-doubleconversion",
- "glib",
- "icu",
- "system-libb2",
- "mimetype-database",
- {
- "message": "Tracing backend",
- "type": "firstAvailableFeature",
- "args": "etw lttng"
- },
- {
- "section": "Logging backends",
- "entries": [
- "journald", "syslog", "slog2"
- ]
- },
- {
- "type": "feature",
- "args": "qqnx_pps",
- "condition": "config.qnx"
- },
- "pcre2",
- "system-pcre2",
- {
- "type": "feature",
- "args": "forkfd_pidfd",
- "condition": "config.linux"
- }
- ]
- }
- ]
-}
diff --git a/src/corelib/debug_script.py b/src/corelib/debug_script.py
index 9111213ef7..7aaa1a79d1 100644
--- a/src/corelib/debug_script.py
+++ b/src/corelib/debug_script.py
@@ -34,7 +34,7 @@ from distutils.version import LooseVersion
MODULE_NAME = 'qt'
-def import_bridge(path, debugger, session_dict, reload_module = False):
+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]
@@ -58,8 +58,8 @@ def import_bridge(path, debugger, session_dict, reload_module = False):
return bridge
def report_success(bridge):
- print "Using Qt summary providers from Creator %s in '%s'" \
- % (bridge.CREATOR_VERSION, bridge.CREATOR_PATH)
+ print("Using Qt summary providers from Creator {} in '{}'".format(
+ bridge.CREATOR_VERSION, bridge.CREATOR_PATH))
def __lldb_init_module(debugger, session_dict):
# Check if the module has already been imported globally. This ensures
@@ -87,7 +87,7 @@ def __lldb_init_module(debugger, session_dict):
for version in sorted(versions, key=LooseVersion, reverse=True):
path = versions[version]
- bridge_path = path + '/Contents/Resources/debugger/lldbbridge.py'
+ bridge_path = '{}/Contents/Resources/debugger/lldbbridge.py'.format(path)
bridge = import_bridge(bridge_path, debugger, session_dict)
if bridge:
bridge.CREATOR_VERSION = version
@@ -95,4 +95,4 @@ def __lldb_init_module(debugger, session_dict):
report_success(bridge)
return
- print "Could not find Qt Creator installation, no Qt summary providers installed"
+ print("Could not find Qt Creator installation, no Qt summary providers installed")
diff --git a/src/corelib/doc/include/QtCoreDoc b/src/corelib/doc/include/QtCoreDoc
new file mode 100644
index 0000000000..3dc7ce46e5
--- /dev/null
+++ b/src/corelib/doc/include/QtCoreDoc
@@ -0,0 +1,2 @@
+#include <QtCore/QtCore>
+#include "../../platform/android/qandroidextras_p.h"
diff --git a/src/corelib/doc/include/jni.h b/src/corelib/doc/include/jni.h
index 09186969dd..03b289a229 100644
--- a/src/corelib/doc/include/jni.h
+++ b/src/corelib/doc/include/jni.h
@@ -58,5 +58,7 @@ struct _jclass;
typedef _jclass* jclass;
struct _jobject;
typedef _jobject* jobject;
+typedef int jint;
+typedef int jmethodID;
typedef void* JavaVM;
#endif
diff --git a/src/corelib/doc/qtcore.qdocconf b/src/corelib/doc/qtcore.qdocconf
index 3699bc84c3..750c5d2762 100644
--- a/src/corelib/doc/qtcore.qdocconf
+++ b/src/corelib/doc/qtcore.qdocconf
@@ -5,6 +5,7 @@ project = QtCore
description = Qt Core Reference Documentation
version = $QT_VERSION
+moduleheader = QtCoreDoc
includepaths += ./include
examplesinstallpath = corelib
diff --git a/src/corelib/doc/snippets/cmake-macros/examples.cmake b/src/corelib/doc/snippets/cmake-macros/examples.cmake
index 7515d7fdb2..56d667914d 100644
--- a/src/corelib/doc/snippets/cmake-macros/examples.cmake
+++ b/src/corelib/doc/snippets/cmake-macros/examples.cmake
@@ -22,6 +22,13 @@ qt_add_resources(SOURCES example.qrc)
add_executable(myapp ${SOURCES})
#! [qt_add_resources]
+#! [qt_add_resources_target]
+add_executable(myapp main.cpp)
+qt_add_resources(myapp "images"
+ PREFIX "/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)
@@ -81,7 +88,7 @@ qt_add_executable(simpleapp main.cpp)
#! [qt_add_executable_deferred]
qt_add_executable(complexapp MANUAL_FINALIZATION complex.cpp)
set_target_properties(complexapp PROPERTIES OUTPUT_NAME Complexify)
-qt_finalize_executable(complexapp)
+qt_finalize_target(complexapp)
#! [qt_add_executable_deferred]
#! [qt_android_deploy_basic]
diff --git a/src/corelib/doc/snippets/code/src_corelib_global_qrandom.cpp b/src/corelib/doc/snippets/code/src_corelib_global_qrandom.cpp
index 9f2884667c..d0813ef824 100644
--- a/src/corelib/doc/snippets/code/src_corelib_global_qrandom.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_global_qrandom.cpp
@@ -127,5 +127,5 @@
//! [15]
//! [16]
- qint64 value = QRandomGenerator64::generate() & std::numeric_limits<qint64>::max();
+ qint64 value = QRandomGenerator64::global()->generate() & std::numeric_limits<qint64>::max();
//! [16]
diff --git a/src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp b/src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp
index fddda64b19..8a007899e3 100644
--- a/src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp
@@ -449,7 +449,7 @@ QListWidget *list = parentWidget->findChild<QListWidget *>(QString(), Qt::FindDi
//! [43]
-QList<QPushButton *> childButtons = parentWidget.findChildren<QPushButton *>(QString(), Qt::FindDirectChildrenOnly);
+QList<QPushButton *> childButtons = parentWidget.findChildren<QPushButton *>(Qt::FindDirectChildrenOnly);
//! [43]
//! [44]
diff --git a/src/corelib/doc/snippets/code/src_corelib_kernel_qvariant.cpp b/src/corelib/doc/snippets/code/src_corelib_kernel_qvariant.cpp
index 1df3fa9edb..2dac3aefd7 100644
--- a/src/corelib/doc/snippets/code/src_corelib_kernel_qvariant.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_kernel_qvariant.cpp
@@ -53,7 +53,6 @@ QDataStream out(...);
QVariant v(123); // The variant now contains an int
int x = v.toInt(); // x = 123
out << v; // Writes a type tag and an int to out
-v = QVariant("hello"); // The variant now contains a QByteArray
v = QVariant(tr("hello")); // The variant now contains a QString
int y = v.toInt(); // y = 0 since v cannot be converted to an int
QString s = v.toString(); // s = tr("hello") (see QObject::tr())
@@ -64,16 +63,13 @@ in >> v; // Reads an Int variant
int z = v.toInt(); // z = 123
qDebug("Type is %s", // prints "Type is int"
v.typeName());
-v = v.toInt() + 100; // The variant now hold the value 223
-v = QVariant(QStringList());
+v = v.toInt() + 100; // The variant now holds the value 223
+v = QVariant(QStringList()); // The variant now holds a QStringList
//! [0]
-
//! [1]
-QVariant x, y(QString()), z(QString(""));
-x.convert(QMetaType::Int);
-// x.isNull() == true
-// y.isNull() == true, z.isNull() == false
+QVariant x; // x.isNull() == true
+QVariant y = QVariant::fromValue(nullptr); // y.isNull() == true
//! [1]
@@ -95,7 +91,7 @@ QVariant v;
v.setValue(5);
int i = v.toInt(); // i is now 5
-QString s = v.toString() // s is now "5"
+QString s = v.toString(); // s is now "5"
MyCustomStruct c;
v.setValue(c);
diff --git a/src/corelib/doc/snippets/code/src_corelib_text_qstring.cpp b/src/corelib/doc/snippets/code/src_corelib_text_qstring.cpp
index fade47cfc6..fe44bee4a8 100644
--- a/src/corelib/doc/snippets/code/src_corelib_text_qstring.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_text_qstring.cpp
@@ -49,7 +49,7 @@
****************************************************************************/
//! [1]
-QString url = QLatin1String("http://www.unicode.org/");
+QString url = QLatin1String("https://www.unicode.org/");
//! [1]
diff --git a/src/corelib/doc/snippets/code/src_corelib_text_qstringconverter.cpp b/src/corelib/doc/snippets/code/src_corelib_text_qstringconverter.cpp
index 97d28d5428..3ad0880bca 100644
--- a/src/corelib/doc/snippets/code/src_corelib_text_qstringconverter.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_text_qstringconverter.cpp
@@ -58,7 +58,7 @@ QString string = toUtf16(encodedString);
//! [1]
QString string = "...";
auto fromUtf16 = QStringEncoder(QStringEncoder::Utf8);
-QByteArray encodedString = fromUtf16(encodedString);
+QByteArray encodedString = fromUtf16(string);
//! [1]
diff --git a/src/corelib/doc/snippets/jni/src_qjniobject.cpp b/src/corelib/doc/snippets/jni/src_qjniobject.cpp
index b729987d4f..dc58fda798 100644
--- a/src/corelib/doc/snippets/jni/src_qjniobject.cpp
+++ b/src/corelib/doc/snippets/jni/src_qjniobject.cpp
@@ -97,8 +97,9 @@ static void fromJavaTwo(JNIEnv *env, jobject thiz, jint x)
void foo()
{
// register the native methods first, ideally it better be done with the app start
- JNINativeMethod methods[] {{"callNativeOne", "(I)V", reinterpret_cast<void *>(fromJavaOne)},
- {"callNativeTwo", "(I)V", reinterpret_cast<void *>(fromJavaTwo)}};
+ const JNINativeMethod methods[] =
+ {{"callNativeOne", "(I)V", reinterpret_cast<void *>(fromJavaOne)},
+ {"callNativeTwo", "(I)V", reinterpret_cast<void *>(fromJavaTwo)}};
QJniEnvironment env;
env.registerNativeMethods("my/java/project/FooJavaClass", methods, 2);
diff --git a/src/corelib/doc/snippets/permissions/permissions.cpp b/src/corelib/doc/snippets/permissions/permissions.cpp
index 2eac419226..a2c05db423 100644
--- a/src/corelib/doc/snippets/permissions/permissions.cpp
+++ b/src/corelib/doc/snippets/permissions/permissions.cpp
@@ -58,8 +58,8 @@ void requestCameraPermissionAndroid()
{
//! [Request camera permission on Android]
QCoreApplication::requestPermission(QStringLiteral("android.permission.CAMERA"))
- .then([=](QPermission::PermissionResult result) {
- if (result == QPermission::Authorized)
+ .then([=](QApplicationPermission::PermissionResult result) {
+ if (result == QApplicationPermission::Authorized)
takeSelfie();
});
//! [Request camera permission on Android]
@@ -68,9 +68,9 @@ void requestCameraPermissionAndroid()
void requestCameraPermission()
{
//! [Request camera permission]
- QCoreApplication::requestPermission(QPermission::Camera)
- .then([=](QPermission::PermissionResult result) {
- if (result == QPermission::Authorized)
+ QCoreApplication::requestPermission(QApplicationPermission::Camera)
+ .then([=](QApplicationPermission::PermissionResult result) {
+ if (result == QApplicationPermission::Authorized)
takeSelfie();
});
//! [Request camera permission]
@@ -81,7 +81,7 @@ 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 == QPermission::Authorized)
+ if (result == QApplicationPermission::Authorized)
takeSelfie();
//! [Request camera permission sync on Android]
}
@@ -89,9 +89,9 @@ void requestCameraPermissionSyncAndroid()
void requestCameraPermissionSync()
{
//! [Request camera permission sync]
- auto future = QCoreApplication::requestPermission(QPermission::Camera);
+ auto future = QCoreApplication::requestPermission(QApplicationPermission::Camera);
auto result = future.result(); // blocks and waits for the result to be ready
- if (result == QPermission::Authorized)
+ if (result == QApplicationPermission::Authorized)
takeSelfie();
//! [Request camera permission sync]
}
@@ -100,8 +100,8 @@ void checkCameraPermissionAndroid()
{
//! [Check camera permission on Android]
QCoreApplication::checkPermission(QStringLiteral("android.permission.CAMERA"))
- .then([=](QPermission::PermissionResult result) {
- if (result == QPermission::Authorized)
+ .then([=](QApplicationPermission::PermissionResult result) {
+ if (result == QApplicationPermission::Authorized)
takeSelfie();
});
//! [Check camera permission on Android]
@@ -110,9 +110,9 @@ void checkCameraPermissionAndroid()
void checkCameraPermission()
{
//! [Check camera permission]
- QCoreApplication::checkPermission(QPermission::Camera)
- .then([=](QPermission::PermissionResult result) {
- if (result == QPermission::Authorized)
+ QCoreApplication::checkPermission(QApplicationPermission::Camera)
+ .then([=](QApplicationPermission::PermissionResult result) {
+ if (result == QApplicationPermission::Authorized)
takeSelfie();
});
//! [Check camera permission]
@@ -124,7 +124,7 @@ void checkCameraPermissionAndroidSync()
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 == QPermission::Authorized)
+ if (result == QApplicationPermission::Authorized)
takeSelfie();
//! [Check camera permission sync on Android]
}
@@ -132,10 +132,10 @@ void checkCameraPermissionAndroidSync()
void checkCameraPermissionSync()
{
//! [Check camera permission sync]
- auto future = QCoreApplication::checkPermission(QPermission::Camera);
+ 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 == QPermission::Authorized)
+ if (result == QApplicationPermission::Authorized)
takeSelfie();
//! [Check camera permission sync]
}
diff --git a/src/corelib/doc/snippets/resource-system/CMakeLists.txt b/src/corelib/doc/snippets/resource-system/CMakeLists.txt
new file mode 100644
index 0000000000..29727bd958
--- /dev/null
+++ b/src/corelib/doc/snippets/resource-system/CMakeLists.txt
@@ -0,0 +1,23 @@
+project(my_app)
+cmake_minimum_required(VERSION 3.16)
+find_package(Qt6 REQUIRED COMPONENTS Widgets)
+
+#! [AUTORCC]
+set(CMAKE_AUTORCC ON)
+
+qt_add_executable(my_app
+ application.qrc
+ mainwindow.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")
+#! [qt_add_resources]
diff --git a/src/corelib/doc/snippets/settings/settings.cpp b/src/corelib/doc/snippets/settings/settings.cpp
index 49312b9cfc..a3491d8c76 100644
--- a/src/corelib/doc/snippets/settings/settings.cpp
+++ b/src/corelib/doc/snippets/settings/settings.cpp
@@ -152,8 +152,7 @@ void MainWindow::writeSettings()
QSettings settings("Moose Soft", "Clipper");
settings.beginGroup("MainWindow");
- settings.setValue("size", size());
- settings.setValue("pos", pos());
+ settings.setValue("geometry", saveGeometry());
settings.endGroup();
}
//! [16]
@@ -164,8 +163,11 @@ void MainWindow::readSettings()
QSettings settings("Moose Soft", "Clipper");
settings.beginGroup("MainWindow");
- resize(settings.value("size", QSize(400, 400)).toSize());
- move(settings.value("pos", QPoint(200, 200)).toPoint());
+ const auto geometry = settings.value("geometry", QByteArray()).toByteArray();
+ if (geometry.isEmpty())
+ setGeometry(200, 200, 400, 400);
+ else
+ restoreGeometry(geometry)
settings.endGroup();
}
//! [17]
diff --git a/src/corelib/doc/src/cmake-macros.qdoc b/src/corelib/doc/src/cmake-macros.qdoc
index 29c1785b67..9b486712f7 100644
--- a/src/corelib/doc/src/cmake-macros.qdoc
+++ b/src/corelib/doc/src/cmake-macros.qdoc
@@ -95,22 +95,77 @@ 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
-Creates source code from Qt resource files using the
-\l{Resource Compiler (rcc)}. Paths to the generated source files are added to
-\c{<VAR>}.
+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.
-\section1 Arguments
+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.
*/
/*!
@@ -366,7 +421,7 @@ for you as a convenience.
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_executable}{qt_finalize_executable()} command.
+\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).
@@ -377,11 +432,11 @@ 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_executable}{qt_finalize_executable()}
+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_executable}{qt_finalize_executable()}
+\sa {qt6_finalize_target}{qt_finalize_target()}
\section1 Examples
@@ -402,11 +457,11 @@ for finalizing the target by adding the \c{MANUAL_FINALIZATION} keyword.
*/
/*!
-\page qt_finalize_executable.html
+\page qt_finalize_target.html
\ingroup cmake-macros-qtcore
-\title qt_finalize_executable
-\target qt6_finalize_executable
+\title qt_finalize_target
+\target qt6_finalize_target
\brief Handles various common platform-specific tasks associated with Qt targets.
@@ -415,9 +470,9 @@ for finalizing the target by adding the \c{MANUAL_FINALIZATION} keyword.
\section1 Synopsis
\badcode
-qt_finalize_executable(target)
+qt_finalize_target(target)
-qt6_finalize_executable(target)
+qt6_finalize_target(target)
\endcode
\section1 Description
@@ -518,7 +573,7 @@ Some are provided by Qt, others by CMake or the Android NDK.
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_executable}{qt_finalize_executable()}). If you are using
+\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
@@ -542,7 +597,7 @@ 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_executable}{qt_finalize_executable()}
+ {qt6_finalize_target}{qt_finalize_target()}
\section1 Example
@@ -584,7 +639,7 @@ 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_executable}{qt_finalize_executable()}
+ {qt6_finalize_target}{qt_finalize_target()}
\section1 Example
diff --git a/src/corelib/doc/src/cmake-properties.qdoc b/src/corelib/doc/src/cmake-properties.qdoc
index ced2798f62..9627187bec 100644
--- a/src/corelib/doc/src/cmake-properties.qdoc
+++ b/src/corelib/doc/src/cmake-properties.qdoc
@@ -298,3 +298,20 @@ That library provides implementations of main (or WinMain).
On targets that must provide their own entry point, set the property \c qt_no_entrypoint to inhibit linking against Qt's entrypoint library.
*/
+
+/*!
+\page cmake-target-property-qt_resource_prefix.html
+\ingroup cmake-properties-qtcore
+\ingroup cmake-target-properties-qtcore
+
+\title QT_RESOURCE_PREFIX
+\target cmake-target-property-QT_RESOURCE_PREFIX
+
+\brief Specifies the default Qt resource prefix.
+
+\preliminarycmakeproperty
+
+When using \l{qt6_add_resources}{qt_add_resources} without a \c PREFIX
+argument, then the value of this target property will be used as
+resource prefix.
+*/
diff --git a/src/corelib/doc/src/external-resources.qdoc b/src/corelib/doc/src/external-resources.qdoc
index e8f1d3348d..62e6b7ea1d 100644
--- a/src/corelib/doc/src/external-resources.qdoc
+++ b/src/corelib/doc/src/external-resources.qdoc
@@ -105,3 +105,8 @@
\externalpage https://doc.qt.io/qtcreator/creator-deploying-android.html#editing-manifest-files
\title Qt Creator: Editing Manifest Files
*/
+
+/*!
+ \externalpage https://developer.android.com/training/articles/perf-anr
+ \title Android: Keeping your app responsive
+*/
diff --git a/src/corelib/doc/src/includes/qfile-copy.qdocinc b/src/corelib/doc/src/includes/qfile-copy.qdocinc
new file mode 100644
index 0000000000..5ff68eac81
--- /dev/null
+++ b/src/corelib/doc/src/includes/qfile-copy.qdocinc
@@ -0,0 +1,11 @@
+This file is closed before it is copied.
+
+If the copied file is a symbolic link (symlink), the
+file it refers to is copied, not the link itself. With the
+exception of permissions, which are copied, no other file metadata
+is copied.
+
+Returns \c true if successful; otherwise returns \c false.
+
+Note that if a file with the name \a newName already exists,
+copy() returns \c false. This means QFile will not overwrite it.
diff --git a/src/corelib/doc/src/objectmodel/bindableproperties.qdoc b/src/corelib/doc/src/objectmodel/bindableproperties.qdoc
index 1bb20935d0..5c9685656a 100644
--- a/src/corelib/doc/src/objectmodel/bindableproperties.qdoc
+++ b/src/corelib/doc/src/objectmodel/bindableproperties.qdoc
@@ -167,6 +167,39 @@
Here, code triggered in change handlers might use the circle, while it has
the new radius, but still the old area.
+ \section1 Bindable Properties with Virtual Setters and Getters
+
+ Property setters and getters should normally be minimal and do nothing but
+ setting the property; hence it is not normally appropriate for such setters
+ and getters to be virtual. There is nothing it makes sense for the derived
+ class to do.
+
+ However some Qt classes can have properties with virtual setters. When
+ subclassing such a Qt class, overriding such setters requires special care.
+
+ In any case the base implementation \e must be called for the binding to
+ work correctly.
+
+ The following illustrates this approach.
+
+ \badcode
+ void DerivedClass::setValue(int val)
+ {
+ // do something
+ BaseClass::setValue(val);
+ // probably do something else
+ }
+ \endcode
+
+ All the common rules and recomendations 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
+ implementation.
+
+ In the rare case where such virtual getters or setters are necessary, the
+ base class should document the requirements it imposes on overrides.
+
\section1 Formulating a Property Binding
Any C++ expression evaluating to the correct type can be used as a binding
diff --git a/src/corelib/doc/src/qt6-changes.qdoc b/src/corelib/doc/src/qt6-changes.qdoc