summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Remove some long-deprecated methods of QLibraryInfoEdward Welbourne2020-06-292-52/+0
| | | | | | Change-Id: If5e85f813921b44971ca8572858051b53e1127a8 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Sune Vuorela <sune@vuorela.dk>
* Remove pthread storage for thread local dataMike Achtelik2020-06-281-59/+21
| | | | | | | | | | | | | | | | | The thread specific QThreadData is currently referenced as a thread_local variable and using a thread specific value via pthread_setspecific. Having both is not necessary, as the pthread value is never directly accessed and only used in the pthread destructor. Using a holder, we can achieve the same and get rid of the pthread handling altogether. This also fixes a bug, where the thread_local currentThreadData is already null, when entering the pthread destructor. In this case it would lead to a new QThreadData being created, when finishing an adopted thread. Pick-to: 5.15 Change-Id: Ib23b840f804637e6b7cebd89016672a34a575380 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CMake: Make the path variables in Qt6CoreConfigExtras.cmake relativeJoerg Bornemann2020-06-281-13/+13
| | | | | | | | | | | | | To be consistent with the Qt6HostInfo package, we're providing paths without prefix in the variables like QT6_INSTALL_BINDIR. The full path can be easily obtained by combining the relative path with the QT6_INSTALL_PREFIX variable. Also, the value of QT6_INSTALL_SYSCONFDIR was wrong. It usually is located outside of the prefix. Change-Id: I0035633a8c1c865d86d5ffc8b36565ceb2e7ea25 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QList: use =default for its default constructorGiuseppe D'Angelo2020-06-261-1/+1
| | | | | Change-Id: Id5270eac2464bf2d3810de18579d4dc295e98b38 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Improve deprecation message for QLine::angle(QLine)Eirik Aavitsland2020-06-261-1/+1
| | | | | | | | | | | | | | angleTo() always gives an answer measured ccw, so between 0 and 360 degrees. The deprecated angle() would give either cw or ccw, depending on which is smaller, so between 0 and 180 degrees. Help users porting by showing a simple way to achieve the angle() behavior in the deprecation message. Change-Id: I66f77d2b4e688562e443428209737aa3332a448f Pick-to: 5.15 Fixes: QTBUG-85087 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add explicit encode()/decode() methods to QStringConverterLars Knoll2020-06-262-4/+28
| | | | | | | | | The functional style interface is nice, but does feel alien in some contexts, so better also have explicit encode and decode methods. Change-Id: Ic07ced15f65cdb3a7f1cf044041e341d2ef87f79 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Unexport QModelIndexGiuseppe D'Angelo2020-06-261-1/+1
| | | | | | | It is entirely inline. Change-Id: I626d6e4f6338dabfcc1e34127c898ed13c5a513b Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QThread: Fix unnecessary stricter accesses to QThreadData::threadThiago Macieira2020-06-251-6/+6
| | | | | | | | | Commit ec6556a2b99df373eb43ca009340a7f0f19bacbd changed the member from a plain pointer to a QAtomicPointer. Not all accesses were caught. Pick-to: 5.15 Change-Id: I3d4f433ff6e94fd390a9fffd161b4ff25508c48d Reviewed-by: David Faure <david.faure@kdab.com>
* Use QList instead of QVector in corelibJarek Kobus2020-06-2549-198/+166
| | | | | | | | | | Applied to headers only. Source file to be changed separately. Omitted statemachine for now to avoid conflicts. Omitted qmetatype.h for now - to be handled later. Task-number: QTBUG-84469 Change-Id: I317376037a62467c313467d92955ad0b7473aa97 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* moc: Fix QProperty code generationFabian Kosmale2020-06-251-3/+3
| | | | | | | | | | | | | | | | This addresses two issues: 1. The generated code for QNotifiedProperty<T, ...> was broken when T is a pointer. Notably, const S* & is not a constant reference to S*. This is addressed by consistently using T const& instead of const T&. 2. The Q_PRIVATE_QPROPERTY approach assumed that the property name and the getter are equal. This does break when they are not, and we are unable to change either of them due to API compatibility concerns. An example of this would be QQuickItem's parent property with a parentItem getter. Therefore, we now allow the usage of NAME to override the name of the property. Change-Id: Idf2e85576c74371b5b0f6db15dbe6f2d17c5e33d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Remove QPropertyMemberChangeHandler againSimon Hausmann2020-06-251-23/+0
| | | | | | | | | | | | Adding support for a static notifier within QProperty itself - through a QProperty "sister" class - is more efficient in terms of memory consumption and run-time performance. The MemberChangeHandler permanently takes up at least three pointers, while the notified properties only cost one pointer in the binding. Change-Id: Ia1a8c2b66f1f3c2fe13ae0ad9f12cdb6bdcc35ef Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QNotifiedProperty: Add guard callbackFabian Kosmale2020-06-255-59/+104
| | | | | | | | | | | | | | | A guard callback is a predicate which takes the new value set by setValue or computed as the result of a binding expression. If it returns false, the value is discarded and the old value is kept. Note that due to lazyness, when setting a binding, we still notify everyone as the binding is only evaluated on demand, and the guard can thus only run when someone actually queries the value. Note further that a guard is allowed to modify the value that is passed to it (e.g. to clamp it to a certain range). Task-number: QTBUG-85032 Change-Id: I3551e4357fe5780fb75da80bf8be208ec152dc2a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QNotifiedProperty: pass old value to callback if requestedFabian Kosmale2020-06-255-30/+88
| | | | | | | | | Check at compile time whether the static callback takes an argument (which has to be of the same time as the type of the property). If so, retrieve the old value and pass it to the callback. Change-Id: Ib1c4c9e05b826b6be492b03f66fa72ad015963ee Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix QPropertyFabian Kosmale2020-06-251-0/+11
| | | | | | | | | | | | | | | | | This fixes two issues with QPropery: 1. QPropertyBindingPrivate::evaluateIfDirtyAndReturnTrueIfValueChanged calls a user provided evaluaton function. That one might actually destroy the binding and delete the QPropertyBindingPrivate instance. We need however to keep it alive until the function returns. 2. There was an infinite loop between QPropertyObserverPointer::notify and QPropertyBindingPrivate::markDirtyAndNotifyObservers. This can be observed when running tst_palette in qqc2. By returning early in markDirtyAndNotifyObservers if dirty is already set, the issue is avoided. Change-Id: I1f0df05a5a9fa98554183263a25e16747c4d2274 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Simon Hausmann <hausmann@gmail.com>
* cmake: Apply symbol visibility settings to Objective-C/C++ sourcesTor Arne Vestbø2020-06-251-0/+2
| | | | | | | | | | | | | | | Otherwise the Objective-C++ sources will be built with the default compiler visibility (visible), and then linked with moc-generated C++ sources that have the Qt overridden hidden visibility, resulting in linker warnings such as: ld: warning: direct access in function 'X' from file 'moc_foo.cpp.o' to global weak symbol 'Y' from file 'bar.mm.o' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility setting Change-Id: I22e15e7e181a74de8c0a22c73d06e600e582d7fd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Improve castingAllan Sandfeld Jensen2020-06-255-9/+9
| | | | | | | Make a handful of narrowing casts explicit Change-Id: I318e9778840f2437963377b6b97f269d569909dc Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Remove QByteArray's methods taking QString and their usesSona Kurazyan2020-06-253-247/+0
| | | | | | | | | | [ChangeLog][QtCore][QByteArray] Remove method overloads taking QString as argument, all of which were equivalent to passing the toUtf8() of the string instead. Change-Id: I9251733a9b3711153b2faddbbc907672a7cba190 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Allow qMin, qMax and qBound for types that can be losslessly convertedLars Knoll2020-06-251-0/+43
| | | | | | | | | | | | | | | | Add overloads for qMin and friends where the arguments are of different type, but one can be easily promoted to the other. Return the promoted type. Promotions are only allowed if both types are either signed, unsigned or floating point numbers. This should simplify writing code in many case (as for example qMin(myint64, 1)) and also help reduce source incompatibilities between Qt 5 and Qt 6, where the return types for sizes of our containers changes from int to qsizetype. Change-Id: Ia6bcf16bef0469ea568063e7c32f532da610d1cd Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMetaObject: Compare threadIds when checking receiver threadMike Achtelik2020-06-251-9/+16
| | | | | | | | | Comparing threadIds is faster, especially if invoked from a non qt thread, where QThread::currentThread() needs to create a QAdoptedThread/QThreadData first. Pick-to: 5.15 Change-Id: I44b3013283754f1a5ac9d62debcf4c82be77c554 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix conversion of QVariant() in QJsonArrays and Objects (through CBOR)Thiago Macieira2020-06-241-7/+3
| | | | | | | | | | | | | | | | | | | | | When I wrote the QCborValue to QJsonValue conversion, I used QJsonValue::Undefined because it allowed to keep some level of compatibility in CBOR, despite the function documentation saying that CBOR undefineds became JSON nulls. Which they did. But when we converted QJson{Array,Object} to be backed by CBOR classes, that Undefined meant the insertion into the array/object actually deleted the entry. [ChangeLog][JSON] Fixed a regression from 5.14 that caused values of default-constructed QVariants in QVariantLists, QVariantMaps and QVariantHashes to disappear when converting to JSON via fromVariant{,List,Map,Hash}. Fixes: QTBUG-84610 Pick-to: 5.15 Change-Id: Ic0987177fe463f352db9bd84993f116e2bdacc75 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add a warning and tidy some triviaEdward Welbourne2020-06-231-8/+3
| | | | | | | | | | | | | An attempt to setSpec(TimeZone) gets treated as setSpec(LocalTime), as the method has no parameter to carry *which* zone; this was done silently, but should be brought to the caller's attention. So warn. Moved a declaration closer to its use, folded an if/else into a single assignment using ?: and removed a fatuous \fn just before the function it desribed. Change-Id: Ia35c87e0ba373675d3ae1e6ef3bf05016c06c48d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Save DST status when computed for a mutable QDateTimeDataEdward Welbourne2020-06-231-0/+1
| | | | | | | | | | Most calls to localMSecsToEpochMSecs() happen from functions that can't save the DST status it repots (due to the data being const); but refreshDateTime() can and (given its name) clearly should. Pick-to: 5.15 Change-Id: Ib53c88d2233925da275f0ac52f768cada92c5d2d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QString: add char8_t overload of fromUtf8()Marc Mutz2020-06-233-0/+19
| | | | | | | | | | | | | Use the overload-with-template trick from P1423 to avoid ambiguities when existing callers pass 0 or nullptr. Add a qdoc-ignored macro to hide the fact that the overload is a template. [ChangeLog][QtCore][QString] Added char8_t overload of fromUtf8(). Change-Id: Iaa2d365bfa161ef36cc73fa3bad50aabf34d01db Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix living QObject after shutdown of QCoreApplicationAndré Klitzing2020-06-232-4/+11
| | | | | | | | | | | | QThreadPool is a QObject and must be deleted if the QCoreApplication is being destroyed to release the underlying ThreadData. A Q_GLOBAL_STATIC won't release any memory is not able to manually release it. Pick-to: 5.15 Task-number: QTBUG-84234 Change-Id: Ia82bcff2b564b753ed687f025ff86fa1bed1e64c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QCborMap: remove the optimization not to detach from non-const find()Thiago Macieira2020-06-231-8/+4
| | | | | | | | | | | | | | | | | All our tests were find() == end() or !=, which depends on the evaluation order of the arguments to operator==(). If end() is called first, then the detach happens before find() and all is well. But if find() is called first, it may return end() before end() detaches. [ChangeLog][QCborMap] Fixed a bug that could cause the iterator returned from a failing key search with find() not to match end(). Now, every call to find() will detach in shared QCborMaps; to avoid this, use constFind() and constEnd(). Fixes: QTBUG-84583 Pick-to: 5.15 5.12 Change-Id: I552d244076a447ab92d7fffd161793496a8d03a8 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QMimeDatabase/zlib: fix build with z_const macro emptyThiago Macieira2020-06-231-1/+1
| | | | | | | | | | | The next_in pointer in z_stream is defined as "z_const Bytef *" but z_const is actually an empty macro in most builds. Since our data is read-only constexpr, we need this const_cast to compile. Fixes: QTBUG-84457 Pick-to: 5.15 Change-Id: Ied637aece2a7427b8a2dfffd1612a01ae46f7c1a Reviewed-by: David Faure <david.faure@kdab.com>
* QVarLengthArray: add missing move special member functionsMarc Mutz2020-06-223-0/+73
| | | | | | | | | | | | | | | | A QVLA is copyable, so it should be movable, too. Added a helper function a la P1144's uninitialized_relocate_n to deal with the QTypeInfoQuery stuff. This way, the code is re-usable everywhere it's needed. The same cannot be said for QArrayDataOps, which only a parent can love... [ChangeLog][QtCore][QVarLengthArray] Added missing move constructor and move-assignment operator. Task-number: QTBUG-39111 Change-Id: If0dc2aa78eb29062d73dcd3dc4647ba345ae39e6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move implementation of QVector/List back to qlist.hLars Knoll2020-06-2015-1108/+1085
| | | | | | | | | | | | | And name the main class QList. That's also the one we document. This gives less porting pain for our users, and a lot less churn in our API, as we use QList in Qt 5 in 95% of our API. In addition, it gives more consistent naming with QStringList and QByteArrayList and disambiguates QList vs QVector(2|3|4)D. Fixes: QTBUG-84468 Change-Id: I3cba9d1d3179969d8bf9320b31be2230d021d1a9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove deprecated roles BackgroundColorRole and TextColorRoleChristian Ehrlicher2020-06-201-4/+0
| | | | | Change-Id: I2729102d1efa9f3809ec22c29517961800e7dc6d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QRect(F): remove deprecated functionsChristian Ehrlicher2020-06-202-38/+0
| | | | | | | They were deprecated since Qt5.0 so it's time to go away. Change-Id: Ib0192f9048ff15c9d47fb1a23046ccfe0ee7d807 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QSortFilterProxyModel: remove deprecated functionsChristian Ehrlicher2020-06-202-29/+0
| | | | | Change-Id: I1775fafc6cca88c0c65032a1fd126dc3b42975c9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Move QTextCodec support out of QtCoreKarsten Heimrich2020-06-2055-45000/+29
| | | | | | | | | | * Assume UTF-8 on all Unix like systems * Export some functions to be able to compile QTextCodec once moved to Qt5Compat. Task-number: QTBUG-75665 Change-Id: I52ec47a848bc0ba72e9c7689668b1bcc5d736c29 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Port Q_STATIC_ASSERT(_X) to static_assertGiuseppe D'Angelo2020-06-1957-197/+197
| | | | | | | | | | | | | | | | | There is no reason for keep using our macro now that we have C++17. The macro itself is left in for the moment being, as well as its detection logic, because it's needed for C code (not everything supports C11 yet). A few more cleanups will arrive in the next few patches. Note that this is a mere search/replace; some places were using double braces to work around the presence of commas in a macro, no attempt has been done to fix those. tst_qglobal had just some minor changes to keep testing the macro. Change-Id: I1c1c397d9f3e63db3338842bf350c9069ea57639 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Don't truncate parameters passed to QStringView::{first/last/from/slice}Sona Kurazyan2020-06-191-4/+4
| | | | | | | | QStringView doesn't need to convert qsizetype parameters to int. Change-Id: Iba8b5259ab3ed7a24a57bb6748446fd3e45bb182 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QProcess/Win: Avoid reentering the code in _q_processDied()Alex Trotsenko2020-06-191-1/+1
| | | | | | | | | | | | | In case drainOutputPipes() makes a recursion, setting 'dying' to true should protect the code from reentering. But, the next call to QProcessPrivate::cleanup() resets this variable, which allows a secondary pass. So, we should postpone setting 'dying' to false until a new process session is started. Fixes: QTBUG-33731 Change-Id: I269ad3b8defa32aa714ea13f8803a07259f475dc Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CMake: Provide the minimum darwin deployment target needed by QtAlexandru Croitor2020-06-191-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is useful information for people that want to use Qt in their project with CMake. Unfortunately there is no good way to actually set CMAKE_OSX_DEPLOYMENT_TARGET automatically with the Qt provided value, because it needs to be set before the first project() call in a CMake project. This means it can be set either on the command line, or manually by the application developer in CMakeLists.txt before the first project() call or via a CMake toolchain. In Qt 6 we provide a CMake toolchain file with the deployment target already set, so if the application developer uses the Qt generated toolchain, they will get the value automatically. In Qt 5 the value can only be read for informational purposes only, from the QT_DARWIN_MIN_DEPLOYMENT_TARGET property on the Qt5::Core target. The same property is set in Qt 6 for compatibility resons. Task-number: QTBUG-76167 Task-number: QTCREATORBUG-22466 Pick-to: 5.15 Change-Id: Id61d70dc9a1b7a0e7cdb90b1e679171ea178126b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Fix note alignmentAndreas Schwab2020-06-191-1/+1
| | | | | | | | | It is architecture defined whether .align means .palign or .balign. Use .balign to make that explicit. Change-Id: I8c7e3760b37edfb207b7088319a338a1f583255b Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Document QPromise APIAndrei Golubev2020-06-183-1/+238
| | | | | | | | | Documented QPromise. Added snippets under auto tests to ensure they are compiled and run in CI. Task-number: QTBUG-81586 Change-Id: I20084e38f9d2f6fc8540f95ee03ec3d2827177e8 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Fix QString{Encoder|Decoder} documentationKarsten Heimrich2020-06-182-11/+13
| | | | | | Change-Id: I8e29846db77581953d90c818060950744cb9f521 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Remove unused functionality from QTypeInfoLars Knoll2020-06-181-31/+1
| | | | | Change-Id: I10fe4cde7a18047599e656cc3bb67b0dfe18a986 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QMetaMethod: implement returnType via returnMetaTypeFabian Kosmale2020-06-181-3/+1
| | | | | Change-Id: I6c77331c3bfe83b00e4bbdf960216df696aadabd Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Undef Q_DECL_ENUMERATOR_DEPRECATED when having no deprecation warningsAndy Shaw2020-06-181-0/+2
| | | | | | | | | | | Since Q_DECL_ENUMERATOR_DEPRECATED can be explicitly set to something other than QT_DEPRECATED, then it needs to be explicitly undefined when QT_NO_DEPRECATED_WARNINGS is used to prevent it from showing a warning. Pick-to: 5.15 Change-Id: Ibe73ff5e7b5aa5eff93d0c4c0a38a33855a9a330 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove some dead codeLars Knoll2020-06-172-51/+3
| | | | | Change-Id: I4e3906d5e6313014b207aa7bc63a0ff5e21b0261 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Cleanup float-equal warningsLars Knoll2020-06-175-14/+5
| | | | | | | | Consistently use the macro from qcompilerdetection.h instead of manually disabling the warning for three different compilers. Change-Id: Id59d30047c8a504e1082d7e47c02f4746fddf9d6 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QMath: make the math-related functions templatesGiuseppe D'Angelo2020-06-172-27/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This way we can take and return more datatypes than qreal, just piggy-backing on the std:: functions (which take any integral and any fp datatype). This makes these functions pure ADL enablers (like qSwap). A type (hi, QAngle!) that wants to have math related functions simply needs those defined in its own namespace using the "standard" names (sin, cos, etc.); and we'll find them using the q-prefixed function. qCeil and qFloor signatures however still return int to avoid too much breakage. The FP-related functions (qIsInf, etc.) have been left alone. Those are "special"; a lot of care is in qnumeric because some implementations define them as macros, which blocks any possibility of user-defined overloads found via ADL. [ChangeLog][QtCore][QtMath] The math-related functions (such as qSin, qCos, qPow and so on) can now take an arbitrary parameter rather than just qreal. They will do a ADL-enabled call to the respective free function, using the functions in namespace std as a fallback. Moreover, they will now return whatever datatype is returned by the free function (e.g. long double if the call is placed on a long double). Change-Id: I111084eda52556663802e65a85e082187c2a6861 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* CMake: Write object libs of Qt resources to .prl filesJoerg Bornemann2020-06-161-0/+1
| | | | | | | | | | | | | | | Since commit e343affd634 we're creating object libraries for Qt resources in static libraries. Those must be reflected in the generated .prl files for static builds of Qt. In qt_add_resource, we now calculate the install locations of the object files of rcc-generated C++ files and save them in the target property QT_RCC_OBJECTS. This property is then passed to QtFinishPrlFile to write the object file paths to the .prl file. Change-Id: Ic383892d723d02fc91f712bc2dbcbc90babad074 Reviewed-by: Simon Hausmann <hausmann@gmail.com> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Document that Q_INIT_RESOURCE is not necessary for CMake-based projectsJoerg Bornemann2020-06-161-2/+6
| | | | | | | | | | | | | | | | | | Since commit e343affd634 we're creating object libraries for Qt resources in static libraries when building Qt or a Qt-based project with CMake. The purpose of this is to remove the need for calling Q_INIT_RESOURCE in static libraries. Add a note to the documentation and a changelog entry. [ChangeLog][CMake] Calling Q_INIT_RESOURCE in static libraries is not strictly necessary anymore for CMake-based projects. There, for each resource, an object library is created which is linked into consuming projects. This ensures that the linker does not discard the resource's object file, and its initializer is called automatically. Change-Id: I70de439f964dc7257a2255683eda4d434fa451d0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Use qsizetype instead of int in QByteArray's helper methodsSona Kurazyan2020-06-162-33/+34
| | | | | | | | | This is needed as a preperation for introducing QByteArrayView, which will use qsizetype instead of int for size. Since these methods will be reused by QByteArrayView, they need to use qsizetype. Change-Id: Ia2d94ec70742d4f9326de9548fd7534d56d3a5ac Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Warn about constructing QMetaTypes/QVariants with invalid type idsLars Knoll2020-06-162-3/+2
| | | | | | | | | | | Warn about using an invalid type id in all cases. So far, only some constructors of QVariant would warn. Move the warning over to the place where we map a typeid to a QMetaTypeInterface to catch all cases. Change-Id: I4cd48a2b5d6c597dbf2afbeae9b811cd0819b768 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Make the default constructor of QMetaType constexprLars Knoll2020-06-162-5/+2
| | | | | | | And inline the copy constructor forwarding to another one. Change-Id: I3c4f76f7b14edd84f512ef0687416b20940e333a Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>