summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Remove mentioning of outdated QDataStream versionKai Köhne47 min.1-1/+1
| | | | | | | | The exact version doesn't add much information, and will most likely go stale again; so just remove the mentioning. Change-Id: Ifd87f7cf655a610aa45e341cf5a3491ae7d91171 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Mark C++11/C++14 portability macros as deprecatedKai Köhne30 hours1-31/+5
| | | | | | | Pick-to: 6.4 Fixes: QTBUG-105542 Change-Id: If99a47858c5b48a726ad323fba6bf871bfda37d0 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Move macros for Darwin-based operating systems to qsystemdetection.hSona Kurazyan3 days2-52/+54
| | | | | | | | Task-number: QTBUG-99313 Change-Id: I5198baa1369e296cd06db964a6286978bb874859 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Move the checks for disabling useless warnings to qcompilerdetection.hSona Kurazyan3 days2-31/+31
| | | | | | Task-number: QTBUG-99313 Change-Id: I7b4a62e7a8f8a07a9386a6f1f41a33c3fc802daf Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move Q_{OUTOFLINE, INLINE}_TEMPLATE definitions to qcompilerdetection.hSona Kurazyan3 days2-7/+7
| | | | | | | | | | These seem to be leftovers after 475cef58f96d1d274e5c7b448df7231415783af0. Task-number: QTBUG-99313 Change-Id: I6059cfe1ea0a0f85e3617338215effb114d3b60b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Move some compiler-specific macros to qcompilerdetection.hSona Kurazyan3 days2-68/+74
| | | | | | | Task-number: QTBUG-99313 Change-Id: Ia381fc0242090ee08ae734421274dcef15709778 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* CMake: Add QT_ANDROID_SIGN_AAB variableJoerg Bornemann3 days2-0/+31
| | | | | | | | | | [ChangeLog][CMake] Added the QT_ANDROID_SIGN_AAB variable that can be set to ON to enable signing of .aab packages. Pick-to: 6.4 Fixes: QTBUG-105529 Change-Id: Ic06cc452851dc81b10a2721b544641cb5eeea8be Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* QLocale: port locale_data indexing to qsizetypeMarc Mutz3 days2-15/+17
| | | | | | | | | | | | | | | Not a bug, just porting to avoid the next reader having to wonder whether the ints and uints are 64-bit safe. As a drive-by, make a static variable constexpr and replace sizeof foo/sizeof *foo with q20::ssize(foo). Pick-to: 6.4 Task-number: QTBUG-103531 Change-Id: Iccc5a5896ab87981f4535820cea7f274e568f325 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QLocale: fix UB in defaultIndex() (using < on unrelated pointers)Marc Mutz3 days1-2/+2
| | | | | | | | | | | | | | It's undefined behavior to compare pointers with <, >, <=, >=, unless they point into the same subobject (or one past the last element, for arrays). The Q_ASSERT() should detect UB. For that, it mustn't cause UB itself. Fix by using q_points_into_range(), which uses std::less, which is guaranteed to define a total order on pointer values. Pick-to: 6.4 6.3 6.2 Change-Id: I725eb9e4a9304d2edcd0776e756e6a67e224c1a7 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QMetaType: don't use global relocations to the lambdas and structuresThiago Macieira3 days1-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | The way the Qt 6.0 QMetaTypeInterface was designed, using a static inline variable in a template, would normally require the linker and dynamic linker to merge all copies and choose a single copy as the official one. But because of hidden visibility and of Windows DLLs, QMetaType already copes with multiple copies NOT getting merged. So we may as well ask the linkers not to bother and use simpler, local relocations to find those symbols. They are all supposed to still be equivalent and it's an ODR violation if they're not. The Apple ld64 linker complains if you use this type of global relocation: ld: warning: direct access in function [...] to global weak symbol 'QtPrivate::QMetaTypeInterfaceWrapper<int>::metaType' Fixes: QTBUG-93471 Pick-to: 6.3 6.4 Change-Id: Id0fb9ab0089845ee8843fffd16f98a10aa719434 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QChar: replace uint with char32_t in the implementationMarc Mutz3 days1-10/+10
| | | | | | | | | | Finishes the port from uint to char32_t started in Qt 5. Task-number: QTBUG-103531 Pick-to: 6.4 Change-Id: I97c29deb30a9a4563e2eafdb25e1f290a079726f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QString: finish migration to qsizetypeMarc Mutz3 days1-4/+4
| | | | | | | | | | | | | These don't look like they could cause bugs, because their range of values is physically limited, but port them to qsizetype nonetheless, for consistency, and to save the next reader the task of proving that they're, indeed, ok. Pick-to: 6.4 Task-number: QTBUG-103531 Change-Id: I337ea327b54bcf5960928f5d1d72c6fc80dcda31 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use the local file APIs to save/load files on WASMMikolaj Boc3 days2-2/+9
| | | | | | | | | | | | QFileDialog::saveFileContent, QFileDialog::getOpenFileContent are now using local file APIs to access files on any browser that passes a feature check. The feature is thoroughly tested using sinon and a new mock library. Task-number: QTBUG-99611 Change-Id: I3dd27a9d21eb143c71ea7db0563f70ac7db3a3ac Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QUnicodeTools: mark a test-only flag constexpr/constinitMarc Mutz3 days1-3/+6
| | | | | | | | | | | | | | | | | | | For QT_BUILD_INTERNAL, mark the flag constinit, because tests may want to set it (which they better do before Qt spins up threads, because otherwise this non-atomic flag runs into UB (data races)). For non-QT_BUILD_INTERNAL, mark the flag constexpr, so dead code elimination can do its job. Inconsistently, of the two readers of the flag, one was ifdef'ed on QT_BUILD_INTERNAL, while the other wasn't. Settle on exposing both, which increases the compiler coverage of the code. Pick-to: 6.4 Task-number: QTBUG-100486 Task-number: QTBUG-100485 Change-Id: I6e041359b8214b40d80eefa92c26422aada3eb59 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QStringConverter: add Q_CONSTINIT to function-level QBasicAtomicMarc Mutz3 days1-0/+1
| | | | | | | Task-number: QTBUG-100486 Pick-to: 6.4 Change-Id: Ia55b743fd7ad4716b82425410ed0cf9ff2ee30e8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QLocale: port findTag to std::string_viewMarc Mutz3 days1-6/+6
| | | | | | | | | | | | | | | QStringView lacks the equivalent of find_first_of, so use string_view for now. Fixes an unnecessary QString ctor/dtor call, as well as the int/qsizetype mismatch, looking for which I found this code. The function can now be properly noexcept. Task-number: QTBUG-103531 Pick-to: 6.4 6.3 Change-Id: I1198c082a2ee0addbe7c0d2192073b017d9f8dd7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Port qt_readEscapedFormatString() to qsizetypeMarc Mutz3 days4-7/+7
| | | | | | | | | More of the usual missing int -> qsizetype porting... Pick-to: 6.4 6.3 6.2 Task-number: QTBUG-103531 Change-Id: I53faff5fe306c1d207741bc93a1e5c15d3eefa4f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTextBoundaryFinder: fix a flawed buffer size calculationMarc Mutz3 days1-1/+1
| | | | | | | | | | | | | | | | | | | | | There were two problems: 1. The cast to uint truncates the input qsizetype bufferSize mod UINT_MAX, which, if the original value was qsizetype(UINT_MAX) + 1, would yield a false negative check, so remove the cast. 2. The multiplication of the input string size with sizeof(QCharAttributes) looks like it could overflow, esp. on 32-bit platforms. It can't, because sizeof(QCharAttributes) == 1 atm, but the next attribute that's added to the struct will turn that into sizeof 2, so play it safe and use division on the LHS instead of multiplication on the RHS to avoid this arithmetic 101 antipattern. Task-number: QTBUG-103531 Pick-to: 6.4 6.3 Change-Id: Icae3bea1c3cb52a235b8aae181af35c86c3f5d6f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Finish porting cross-platform parts of QStringConverter to qsizetype/size_tMarc Mutz3 days2-3/+3
| | | | | | | | | | | | | | There are still problems with platforms-specific APIs that are 32-bit only (cf. QTBUG-105105), but this patch finishes the port of the cross-platform parts of QStringConverter. None of these changes have a user-visible effect. They just avoid the Code Smell that int has become since Qt 6.0. Pick-to: 6.4 Task-number: QTBUG-103531 Change-Id: I267e2e1268a18c130892fa2fd80d1b5dabb3d9b9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QStringConverter: make a narrowing conversion explicitMarc Mutz3 days1-1/+1
| | | | | | | | | | | Int variables are a code smell these days, so make the narrowing conversion (from ptrdiff_t to int) explicit and add a comment. Pick-to: 6.4 6.3 6.2 Task-number: QTBUG-105105 Change-Id: Ia4e14f1cc132ca36d15e9684bfcb4605d7b9251f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QStringConverter: fix -Wc++20-compatMarc Mutz3 days2-9/+11
| | | | | | | | | | | | | | | GCC 13 warns: qstringconverter_p.h:29:6: warning: identifier ‘char8_t’ is a keyword in C++20 [-Wc++20-compat] 29 | enum char8_t : uchar {}; Fix by calling the replacement qchar8_t (and making it a typedef to char8_t when the latter is available). Pick-to: 6.4 6.3 6.2 Change-Id: If59a9d55667bf1f5245e3a34189687995b000daa Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QString: fix arg() for >2Gi repeated lowest-escape-sequence-numbersMarc Mutz4 days1-4/+4
| | | | | | | | | | | | | | | Building on 15a80cf8a9d59203f8e2b436a5c804197c044807, this patch fixes the case where there are more than INT_MAX occurrences of the lowest-escape-sequence number, as in QString("%0").repeated(qsizetype(INT_MAX) + 1).arg(42); by replacing the corresponding int variables with qsizetype ones. Task-number: QTBUG-103531 Pick-to: 6.4 6.3 Change-Id: I6f4593a86d8d605031bc1d6520a247676091b2c2 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* wasm: allow apps to override EXPORT_RUNTIME_METHODSLorn Potter4 days2-0/+19
| | | | | | | | | | | | | | | | | | | | | | | Developers can add to Emscripten's EXPORT_RUNTIME_METHODS by defining their own using: QT_WASM_EXTRA_EXPORTED_METHODS Which will add on to Qt's default exported runtime methods of UTF16ToString,stringToUTF16 for cmake: set_target_properties(<target> PROPERTIES QT_WASM_EXTRA_EXPORTED_METHODS "ccall,cwrap") or set(QT_WASM_EXTRA_EXPORTED_METHODS "ccall,cwrap") for qmake: QT_WASM_EXTRA_EXPORTED_METHODS = ccall,cwrap Done-with: Mikolaj Boc Fixes: QTBUG-104882 Pick-to: 6.4 Change-Id: I9678bdb7b077aaa8527057212ea4e161c0be0b60 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Move Q_OF_ELF/Q_OF_MACH_O macros to qsystemdetection.hSona Kurazyan4 days2-7/+7
| | | | | | | | | Task-number: QTBUG-99313 Change-Id: I373fad6f8339a0bad1ebc5d81386b18794bf32cc Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Move Qt 6/7 specific macros to qtversionchecks.hSona Kurazyan4 days2-52/+59
| | | | | | Task-number: QTBUG-99313 Change-Id: I57032bf5d0edcb7345267512e12837b1d90d1485 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Move qMin/qMax/qBound() to a separate qminmax.h headerIvan Solovev4 days6-106/+137
| | | | | | | | | | | | | Also replaced qMin() uses in qnumeric.h with QtPrivate::min(). Including qassert.h in qminmax.h leads to indirect include of qglobal.h (through qcompilerdetection.h), which in turn leads to qMin() declaration not being available at the point the compiler sees qFuzzyCompare() definitions in qnumeric.h. This makes the headersclean build fail. Task-number: QTBUG-99313 Change-Id: I824422698b06f94a4a62e2f19d4507c87f90334e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Extract header qtypes.h from qglobal.hSona Kurazyan4 days6-453/+497
| | | | | | | | | | | And move the related checks from qglobal.cpp to qtypes.cpp. This requires removing the unnecessary include statement for qglobal.h from qprocessordetection.h, that now needs to be included in qtypes.h. Task-number: QTBUG-99313 Change-Id: Ifd72b956326909be82c162f37854cad0878010e2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* [docs] Fix return value of QStringIterator::next()Marc Mutz4 days1-1/+1
| | | | | | | | | | It's char32_t these days, not uint. Task-number: QTBUG-103531 Pick-to: 6.4 6.3 6.2 Change-Id: Iaa03f97d0d1266a6763eb858edb45ae0f2a4729d Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QUnicodeTools: fix truncation in debug statementsMarc Mutz4 days1-5/+5
| | | | | | | | | | | Instead of casting to int, cast to qlonglong, which is guaranteed to be able to hold all qsizetype values. Task-number: QTBUG-103531 Pick-to: 6.4 6.3 6.2 Change-Id: I3e89892defd091fa6ef305b8ed5c3819a2cc13da Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QUnicodeTools: fix data race in initialization of libthai symbolsMarc Mutz4 days1-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The facilities of qunicodetools.cpp are not limited to the GUI thread, so initialization must be thread-safe. The old code wasn't, though, and contained several data races - non-atomic initialized was read while another thead may write it - th_brk and th_next_cell were read while another thead may write them Fix by using Double-Checked Locking. This also prepares the code for an eventual port to th_brk_find_breaks() (th_brk is deprecated). The function pointers don't need to be atomic, because all reads from them are guaranteed to happen-after the writes to them (as long as all users call init_libthai() and don't proceeed if it returns false; this could be ensured by returning a struct with the function pointers from init_libthai() instead of maintaining them as statically-visible globals, but that's outsize the scope of this patch). As a drive-by, remove a pointless static_cast<int>(~~int expression~~). Fixes: QTBUG-105543 Pick-to: 6.4 6.3 6.2 Change-Id: I492acd7e9a257e5c4b91f576e9bc448b6bb96ad1 Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> Reviewed-by: Lars Knoll <lars.knoll@gmail.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QUnicodeTools: fix types used around th_brk()Marc Mutz4 days1-2/+2
| | | | | | | | | | | | | | | | Libthai's th_brk() takes the breakpoints array lengths as size_t, so use that. This still doesn't fix thaiAssignAttributes() for ≥ 2 Gi characters, because th_brk returns break positions in an array of int, thus limiting any results to the first INT_MAX characters. Created QTBUG-105541 to track this. Task-number: QTBUG-103531 Pick-to: 6.4 6.3 6.2 Change-Id: Iba468cc9389f4533401bc18dd326c4ca7e85a5da Reviewed-by: Lars Knoll <lars.knoll@gmail.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QUnicodeTools: fix types used around th_next_cellMarc Mutz4 days1-3/+4
| | | | | | | | | | | | | | | | Libthai's th_next_cell takes and returns lengths as size_t. - pass size_t, not qsizetype (the value can never be negative) - receive size_t, don't cast to uint As a drive-by, scope variables tighter. Task-number: QTBUG-103531 Pick-to: 6.4 6.3 6.2 Change-Id: Ib1eeb1f0e8974ee8b0f88d080d06136b307c324f Reviewed-by: Lars Knoll <lars.knoll@gmail.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* qlocale: Fix some flags not being exposed to the metatype systemMaximilian Goldstein4 days1-0/+2
| | | | | | | | | This caused it to be unavailable in metatypes and thus to not work in qml. Change-Id: I22b6fa3b43fe609bdc1167dc081290eb93845491 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CMake: Put Qt-internal targets into a dedicated FOLDERJoerg Bornemann4 days4-0/+77
| | | | | | | | | | | | | | | | | | | | | | | | | When loading a Qt CMake project in an IDE like Visual Studio, many Qt-internal targets are visible, right next to the user's targets. This is inconvenient and confusing. Use CMake's FOLDER concept, and put Qt-internal targets into a dedicated FOLDER. For that we introduce the new global property QT_TARGETS_FOLDER that, analoguous to AUTOGEN_TARGETS_FOLDER, is the folder name for Qt-internal targets. By default, it's not set, nor is folder support enabled. Change qt_standard_project_setup() to - enable folder support - initialize QT_TARGETS_FOLDER if unset - initialize AUTOGEN_TARGETS_FOLDER to the same value if unset Set the FOLDER property of qtbase's internal targets for user projects to the value of QT_TARGETS_FOLDER. Task-number: QTBUG-99808 Change-Id: I880ac7731f88faa83a384dcdec98b1b88ac6cc2e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Move Q_STATIC_ASSERT* macros to qassert.hSona Kurazyan4 days2-29/+29
| | | | | | | | | | | | | | This requires moving the include statement for qassert.h in qglobal.h up, outside the #if defined(__cplusplus) check, to make the macros available when __cplusplus isn't defined. Also move qt_noop() up, before the include of qassert.h, this will later go to a separate header. Task-number: QTBUG-99313 Change-Id: I0f3f1ca77819a86623eebaf8adeba226c190fd37 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move QT_SHARED, QT_STATIC and QT_CONFIG macos to qtconfigmacros.hSona Kurazyan4 days2-39/+38
| | | | | | | Change-Id: Icf4621fa22f41355f98ed38b47560706258b41b7 Pick-to: 6.4 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Rename qtnamespacemacros.h -> qtconfigmacros.hSona Kurazyan4 days4-78/+88
| | | | | | | | | | | But keep qtnamespacemacros.h for now, some modules include it explicitly, so need to change those to include qtconfigmacros.h first. The plan is to move QT_SHARED, QT_STATIC and QT_CONFIG macros there too. Change-Id: I945b3dfffbd9cd394a6cf42a36df6657d1703d5b Pick-to: 6.4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTranslator: generalize a UNIX-only pathGiuseppe D'Angelo5 days1-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QTranslator builds a list of "candidate" names in order to find out the translation file to load. Part of the name comes from the UI languages, as determined by the QLocale object passed to load() (via QLocale::uiLanguages()). On UNIX this list of languages is processed by adding a lowercase version of each language. In other words, if the list is something like: {"en-Latn-US", "en-US", "en"} then it is changed to contain: {"en-Latn-US", "en-latn-us", "en-US", "en-us", "en"} (The last element is not needlessly duplicated, since it's already fully lowercase.) I am not sure why this is done only on UNIX: the commit introducing this behavior predates public history. If I have to take a guess, it's done because the language is then used to assemble a file name that QTranslator tries to open. On UNIX file names are case sensitive, so if the translation file is called "translations_en_us.qm" it would fail to load under a "en-US" locale (the "-" -> "_" processing is done later). But what about Windows? In principle, turning the names in lowercase is not necessary as Windows' filesystem is case insensitive; a translation file called "translations_en_us.qm" will still be loaded if opened as "translations_en_US.qm"... ... *except* if the file is in the resource system! In that case, filesystem access is still case sensitive, and will fail to load the translation file (which instead would load just fine on UNIX). Plug this silly cross-platform difference by also lowercasing on Windows. Change-Id: I2573721e33d9da08f60a5bb56e35e4553cbe4efe Pick-to: 5.15 6.2 6.3 6.4 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Remove redundant define for QT_LARGEFILE_SUPPORTSona Kurazyan5 days1-4/+0
| | | | | | | | It's unconditionally set in qconfig.h by configure.cmake. Pick-to: 6.4 6.3 6.2 Change-Id: If10b5a34111856f4c279a1cf7bfc4ea3a995ef2b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Generate forward headers for Q{,Const, NonConst}OverloadSona Kurazyan5 days1-1/+0
| | | | | | | | These headers were generated before extracting qoverload.h. This amends ff8de321e22b1e91f7fc04ffe54609b045f23835. Change-Id: I8f0e8dc3725f9776b8f6dc96782c97b0b5566b9d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove assertion from ownMethodIndex that breaks testswip/protobufSami Shalayel6 days1-4/+3
| | | | | | | | | | | | | | | | | | | | ownMethodIndex works for all kind of methods, also for constructors. Therefore, remove the assertion there (that checks for non constructors) and add a test in qtbase so it does not happen again. The test broken by the assertion is in qtdeclarative: tst_QJSEngine::newQMetaObject(). Also rename QMetaMethodPrivate::ownConstructorIndex() to ownConstructorMethodIndex() as the previous naming implied that ownMethodIndex() could not be used for constructors. amends b73ab954dffffc462b6f6efe5a2dd97efeab0038 Task-number: QTBUG-105360 Change-Id: I0244993ed79bee055645b5443f5d02e1c089a6c6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add pragmas to the header files that needs to be skipped by syncqtAlexey Edelev6 days3-0/+15
| | | | | | | | | | | | | Add the qt_sync_skip_header_check and qt_sync_stop_processing pragmas to: qtbase/src/corelib/global/qsystemdetection.h qtbase/src/corelib/global/qprocessordetection.h qtbase/src/corelib/global/qcompilerdetection.h to avoid checking by synqt. These files were previously blacklisted in syncqt.profile. Change-Id: I268a3063e7eafb9a78e9e8d1cb67cd2def490b35 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CMake: Support big resources in qt_add_resourcesJoerg Bornemann6 days2-93/+228
| | | | | | | | | | [ChangeLog][CMake] The target-based variant of qt6_add_resource gained the option BIG_RESOURCES. This can be used instead of qt6_add_big_resources, which is not target-based. Fixes: QTBUG-100268 Change-Id: Ib3fa783cbfbfd10f59c2f952bc88508a91f25e26 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Doc: Document the .base modifier for qmake resourcesJoerg Bornemann6 days1-0/+9
| | | | | | Pick-to: 6.4 Change-Id: If8484e9bcf0aa7f0f59102b7b0120defdcd7b3fb Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix QT6_CALL_NEW_OVERLOAD_TAILIvan Solovev7 days1-1/+1
| | | | | | | | | | | There was a typo in the used macro name. This commit amends 0a3ff697380555538a0d035b768ddf10f772b55a Pick-to: 6.4 Change-Id: I6b8cb1e3872cb96780af26bfaf722d83d17ba4fe Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qputenv: port to QByteArrayViewMarc Mutz9 days3-12/+26
| | | | | | | | | | | | | | | | | | | | The vast majority of in-tree users pass simple and short C string literals as the value. By porting to QByteArrayView, we document that we'll accept non-NUL-terminated data, and do the NUL-termination internally, using SSO'ed std::string, saving memory allocations in the common case of short strings. I didn't bother to check which direction std::string takes for nullptrs these days (there was a change accepted in that area for C++20 or 23), so play it safe and protect against them. Follow-up to Task-number: QTBUG-105302 Change-Id: I2369acc62f1d5cbc26135396cfe0602d8c75300c Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QMetaType: don't create a registry just to query its emptiness [2/2]Marc Mutz10 days1-2/+2
| | | | | | | | | | The previous commit, b0e4d53b637e6c34457d14ed3f0be705098bf2f5, missed this one. Same rationale as back then. Pick-to: 6.4 6.3 Change-Id: Ibad4c130e0d61c64808275fa7b97b58ebd479acc Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMetaType: make all atomic operations explicitMarc Mutz10 days1-3/+4
| | | | | | | | | | In one case, optimize away an unnecessary extra load. Pick-to: 6.4 Task-number: QTBUG-103834 Change-Id: Iabbf58a09627dd2fd7a40c713a878d74cb522d60 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qputenv: defend against non-NUL-terminated QByteArray valuesMarc Mutz10 days1-0/+8
| | | | | | | | | | | | | | | | | | | | | | | The old code assumed that a QByteArray's data() is always NUL-terminated. Due to the conflation of owners and non-owners in QByteArray (but also in case we ever get efficient substringing), this is not always the case, e.g. QByteArray::fromRawData() does not ensure NUL-termination. From QString::utf16(), we learn that the condition to check for is QArrayData::isMutable(). After working around the fact that QByteArray::data_ptr() doesn't exist for const QBAs and that empty QBAs always refer to QByteArray::empty_, which is !isMutable(), we can detect this situation and re-allocate without introducing new API. This is the fix for Qt ≤ 6.4. For Qt 6.5, we'll port the function to QByteArrayView. Pick-to: 6.4 6.3 6.2 5.15 Fixes: QTBUG-105302 Change-Id: I3416535ab09d601e0e87b2767f2c024ba1217e64 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Doc: Fix return type of QLEInteger/QBEInteger post-in/decrement opsJoerg Bornemann10 days1-4/+4
| | | | | | | | | Those operators return a value, not a reference. Fixes: QTBUG-104940 Pick-to: 5.15 6.2 6.3 6.4 Change-Id: I117892f12d20c6bf32a12f37c1bdfec1817614c6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>