summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Rework checkValidDateTime() to avoid needless spec-checksEdward Welbourne2020-09-171-77/+74
| | | | | | | | | | | | | | When we know the spec already, we can route to the correct branch of the check directly. This also prepares the way for avoiding duplicating the expensive check for LocalTime during setMSecsSinceEpoch(). In the process, move duplicated code into massageAdjustedDateTime() from its callers, to avoid adding verification to the duplication; and clean up refresh{now: Zoned}DateTime(). Change-Id: I04d7a417110109d1f246a891b5aa94945821804b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QEventDispatcherWin32: remove unused memberAlex Trotsenko2020-09-172-3/+1
| | | | | Change-Id: I9ec54aca7af190cd7ba7744ff52b05451dd7050a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Tidy up QTimeZone method bodiesEdward Welbourne2020-09-171-55/+27
| | | | | | | | | | | Use ternary operator form, or boolean algebra, for the short returns. Handling invalid differently from valid isn't symmetric, they're qualitatively different branches. Skip a fatuous default-initialization. Change-Id: I01a8a06055c315ecf08fc87d208808c0fe71eb31 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix typo in QDateTime::fromSecsSinceEpoch() parameter nameEdward Welbourne2020-09-171-1/+1
| | | | | | | Task-number: QTBUG-86400 Change-Id: I03f0cca08e05862e2a84ae6ec606a62713766462 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Make usage of forkfd_pidfd in QProcess a configurable featureAlexandru Croitor2020-09-174-1/+33
| | | | | | | | | | | | | | | | | | | Our CI cross-compiling arm qemu builds have issues in tests that use QProcess, due to user-space qemu seemingly not supporting pidfds properly. Add a 'forkfd_pidfd' configure.json feature, which can be manually disabled when configuring Qt, causing QProcess to do a regular fork instead of using the new pidfd kernel feature. This will help us avoid the regression of multiple tests failing on the new Ubuntu 20.04 CI host images when they are run via qemu. Task-number: QTBUG-86285 Task-number: QTBUG-86187 Task-number: QTBUG-86198 Change-Id: Ib2209d7e95126e0fb738bf59e39070d5a62c482f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Rename size parameter to QCommonArrayOps::sizeToInsertAtBegin()Ulf Hermann2020-09-161-8/+8
| | | | | | | | | ... in order to avoid a bogus compiler warning. Change-Id: I25eb435d6d57bdd5ef5c05ccacb0e6413631f6c9 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QFile: for filesystem::path, use iteratorsMårten Nordheim2020-09-161-5/+2
| | | | | Change-Id: I06477d48191e5c02ebf362ee31d8db5b1f76247a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Normalize roundingAllan Sandfeld Jensen2020-09-162-8/+8
| | | | | | | | Change the rounding of negative half values to match standard C++ round, this will also allow future optimizations. Change-Id: I8f8c71bed1f05891e82ea787c6bc284297de9c5c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Add porting guide documentsPaul Wicking2020-09-161-0/+2
| | | | | | | | Also add existing such docs to the new document group Task-number: QTBUG-84051 Change-Id: I76f033f0846e09943f249d2beeb1606869eef382 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QEventDispatcherWin32: create internal window on constructionAlex Trotsenko2020-09-162-39/+12
| | | | | | | | | | | | | | | | | When QCoreApplication object is instantiated, creation of the internal message window is delayed until QEventDispatcherWin32::processEvents() is called or socket/event notifier is registered. But, if the user uses a native event loop, posted events are not delivered and timers do not work. This problem was fixed in a4ac4b326318ed9034466305222280ed8d1651b5 for QWindowsGuiEventDispatcher in the same way. So, the risk of regression is minimal. Change-Id: I7bbb721d96046f64d21a7b0e553e46798b37189c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add a QMetaAssociationUlf Hermann2020-09-153-303/+996
| | | | | | | | | | This requires refactoring of QMetaSequence, as they share a lot of common functionality. QMetaAssociation provides a low level interface to an associative container. Task-number: QTBUG-81716 Change-Id: I273e00abd82f1549ba8803c323d82aa3a2d12ded Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Update QString documentation relevant to prepend optimizationAndrei Golubev2020-09-151-0/+27
| | | | | | | | | [ChangeLog][QtCore][QString] QString is a prepend optimized container similar to QList. Task-number: QTBUG-84320 Change-Id: Id035aac859a6f404e389f2eeaf20f9eee5bff20c Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Only include <bit> if using post C++17Allan Sandfeld Jensen2020-09-153-3/+3
| | | | | | | Otherwise we hit an #error statement in MSVC standard library. Change-Id: Ib029edf0be8513a80f2640fd9ca75541615a0448 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QObjectBindableProperty: Fix QDoc-specific typo in headerTopi Reinio2020-09-151-1/+1
| | | | | | | This prevented QDoc from parsing the properties correctly. Change-Id: Ib3e02eb29a5c35034c30a3dd9fdf797d4c7e1550 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Use UTF-8 when converting 8 bit data in QTextStreamLars Knoll2020-09-152-13/+18
| | | | | | | | | This was overlooked when doing the conversion to use UTF-8 as the standard 8 bit encoding for text. Fixes: QTBUG-54942 Change-Id: Ib7b1b75b4d694648ab7143f6930b6bb1dcad19c9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove deprecated APILars Knoll2020-09-152-8/+0
| | | | | | | And replace it's few remaining usages Change-Id: I2dfbbaa5259acfece028606bef1e872c5692f9fe Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Add qHash implementation for QPointMitch Curtis2020-09-152-0/+15
| | | | | | | | | [ChangeLog][QtCore][QPoint] Added qHash() implementation. Change-Id: I65332e7aafab53af40a6e11457b9b457196d584c Fixes: QTBUG-86457 Reviewed-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Remove outdated informationPaul Wicking2020-09-141-5/+0
| | | | | | | | | Seems this information is obsolete, get rid of it. Fixes: QTBUG-86607 Pick-to: 5.15 Change-Id: I0250e32b3c312c7da0363dd1b0d7f676bbfa0115 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add QVariantRef, QVariantPointer, QVariantConstPointerUlf Hermann2020-09-142-0/+158
| | | | | Change-Id: Ia329265826ab2f76e77ac14bb8d8e415a1b41dd6 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Plumb application quit through platform pluginTor Arne Vestbø2020-09-142-3/+12
| | | | | | | | | | | | | | | | | | If we have a platform plugin we ask the platform to quit, and if not we fall back to the base implementation of QCoreApplication that sends Quit events directly. This allows the platform to involve the rest of the system in the process. The platform will then come back with a spontaneous quit via QWSI::handleApplicationTermination(), which will then send the corresponding Quit even from QGuiApplication like normal. Task-number: QTBUG-45262 Task-number: QTBUG-33235 Task-number: QTBUG-72013 Task-number: QTBUG-59782 Change-Id: I0000aaf7192e4b905933c5da0e53901c6c88f26a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QUuid: merge toString() overloads and toByteArray() overloadsEdward Welbourne2020-09-142-94/+4
| | | | | | | | | | In each case, simply give WithBraces as default for mode, since that's what _q_uuidToHex() used internally. Task-number: QTBUG-85700 Change-Id: I9f6fddb259703917129d4be742bbdd2eb1647f44 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Purge Q_{STDLIB,COMPILER}_UNICODE_STRINGSEdward Welbourne2020-09-147-22/+4
| | | | | | | | | These were now always defined, hence redundant. Leave the #define in place so that we can verify we actually do always define it, in a #else of an existing #if check on it. Change-Id: Iea4c3dbc8f9982268bcf81da5ef17fe2ebf5c462 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Clean up the last of QT6_(NOT_)?VIRTUALEdward Welbourne2020-09-141-5/+1
| | | | | | | | | This follows up on commit d273076b4474bb473d90e996960c4c773745761a which left a comment asking for the clean-up this finishes. Task-number: QTBUG-85700 Change-Id: I1c6896a42a09b873302ad7ec8273879f2a4a4ce6 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QString: use QCommonArrayOps::erase instead of custom logicAndrei Golubev2020-09-141-4/+2
| | | | | | | | | | With 6e8985e3576a4439bd66c0767f9912d1e124682c merged we can now use generic erase logic provided by array operations. This commit aligns QString with QList/QByteArray Task-number: QTBUG-84320 Change-Id: I83e9349e2461afd98737df25613aa2d0fd817a71 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Compile on QNX after QFlags constructor deprecationThiago Macieira2020-09-131-2/+2
| | | | | | | | | | The QFlags constructor taking a plain zero literal was deprecated in commit af2daafde72db02454d24b7d691aa6861525ab99. Pick-to: 5.15 Fixes: QTBUG-86585 Change-Id: I2fc68c725ba649218bd9fffd1633d6251649d2bd Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Use universal C++20 bit operations when availableAllan Sandfeld Jensen2020-09-133-19/+67
| | | | | | | Avoids using compiler builtins, and can in future replace them. Change-Id: I3f0afe7d28b6ba05bcd1c1132b44a8db7b182d8a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Restore qWait() implementationLars Knoll2020-09-132-4/+21
| | | | | | | | | | | | qWait() and qWaitFor() have one subtle difference in behavior, where qWait passes the remaining time to processEvents() and qWaitFor() does not. This lead to instability on timing sensitive tests on macOS. Amends 1abea5f5f13b4b8ec2a1c282e643b791cea12f30 Change-Id: I20f516813ca67d9e86de468c4403e475f08edc26 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Make QStringList an alias to QList<QString>Lars Knoll2020-09-1213-245/+114
| | | | | | | | | | | | | | | | | | Fix our API, so that QStringList and QList<QString> are the same thing. This required a bit of refactoring in QList and moving the indexOf(), lastIndexOf() and contains() method into QListSpecialMethods. In addition, we need to ensure that the QStringList(const QString&) constructor is still available for compatibility with Qt 5. Once those two are done, all methods in QStringList can be moved into QListSpecialMethods<QString>. Change-Id: Ib8afbf5b6d9df4d0d47051252233506f62335fa3 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix generated forward declarations in qdbusxml.cppLars Knoll2020-09-121-0/+4
| | | | | | | Simply use qcontainerfwd.h, instead of declaring those manually. Change-Id: I6d87bf14b60469b457e8e9335868f8cdb0303817 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Rename QLibraryInfo::location() to path()Lars Knoll2020-09-125-14/+27
| | | | | | | | As per ### Qt6 comment. Also rename the LibraryLocation enum to LibraryPath. Change-Id: I556025a19c5bcdf2ff52598eaba32269522d4128 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Inline one method as per ###Qt6Lars Knoll2020-09-122-8/+6
| | | | | | Change-Id: I4bf0ddf4ddf4044a60d881a57ef63b96d4bac262 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Remap QMetaType ids to create more space for builtin typesLars Knoll2020-09-122-54/+90
| | | | | | | | | | | We were starting to run out of space for builtin core types. Remap the type id's to create lots of additional space. We now reserve the first 64k id's for Qt, and have 16k id's for Qt Core. That should hopfully be enough for a while ;-) Fixes: QTBUG-85914 Change-Id: I0dab6bf23652e46a9557d9b38af7990b68c572b6 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Partially revert "Inline QTest::qSleep()"Lars Knoll2020-09-122-1/+32
| | | | | | | | | | | | | | | | | | This change partially reverts change a0e0b51001edfc1c7aea113c472ce995efa833fd. Replacing the QTest specific sleep function with QThread::msleep() was not a good idea. The reason is that QThread::msleep() will force the thread to sleep to x mseconds, even if a signal woke the thread in the meantime. This would cause qWaitFor() to not call processEvents(), in some cases, leading to flakyness and test failures in tests that rely on timing, such as the animation tests in Qt Qml. Change-Id: I0ad132cdf32be5813b2e73552d772251fe1d7f89 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QMetaContainer: Add function to erase ranges from sequencesUlf Hermann2020-09-123-0/+48
| | | | | Change-Id: Ic51103c36d288f236106e2d3aec1401d53b97a15 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Make QMetaSequence's d_ptr constUlf Hermann2020-09-121-1/+1
| | | | | | | The container interface should really never change. Change-Id: I31dedf5b776da97a747f0eb26f3bc83ce46f3caa Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Provide methods for adding values to a sequential iterableUlf Hermann2020-09-124-75/+321
| | | | | | | | | | | Provide functionality to add and remove values, so that you can use a sequential iterable as stack or queue if the underlying container supports this. To this end, provide a way to specify whether the value should be added or removed at the beginning or the end of the iterable. Change-Id: If63d302f3ca085e56d601116ce4dfaa6b94a0c4f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QMetaContainer: Add an "input" iterator capabilityUlf Hermann2020-09-122-3/+24
| | | | | | | | | For completeness' sake we should expose this. The iterators provided by QIterable and friends will check the category at runtime, and should give sensible feedback. Change-Id: I778894f340c862f79a18c6c5607bcbba98dd7598 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix Qt6 related comments in qdebugLars Knoll2020-09-112-45/+33
| | | | | Change-Id: I9861d29a6615863094cd007178f214a816865eb7 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Get rid of QEnableIfLars Knoll2020-09-112-9/+3
| | | | | | | Use std::enable_if instead. Change-Id: I02a2f3066f9e4cab6db1909681a17330afdbbedb Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Remove pre-C++17 code pathLars Knoll2020-09-111-17/+0
| | | | | Change-Id: Iaa7f677f45cee50f0b9ed236cf5bef18d5764bfa Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Revert "Remove timeStep parameter from QAnimationDrive::advanceAnimation"Lars Knoll2020-09-113-14/+19
| | | | | | | | | | This reverts commit f51b690e91bb2d7c8a03c5cef42abca37d97f8bb. The commit made all animation tests in qtdeclarative on macOS flaky. Change-Id: I4ccaa879df7e2ba7e253657de01cbabc9b2c655f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Rename QMetaSequence's "elements" to "values"Ulf Hermann2020-09-113-176/+176
| | | | | | | | | | This is so that they are in line with the "value_type" usually found in containers. Associative containers have "key_type" and "mapped_type" and we will use those names for access to elements in QMetaAssociation. Using "value" as name for sequential containers improves consistency. Change-Id: I628b7e1446bb2d56843b843bca72d279a6b247e6 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Prepare QSequentialIterable for non-const operationUlf Hermann2020-09-112-12/+66
| | | | | | | | | Introduce a smart pointer that saves its constness, even if the constness of the parent object changes. This allows us to implement the const and mutable iterators in the same class. Change-Id: I156e564c7fa2ecc8981c6d71861d796a5cbfec66 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QVariant: guard usage of fromType.metaObject()Richard Moe Gustavsen2020-09-111-1/+1
| | | | | | | | | | | | | | | | This patch amends 19874d6a63. That patch caused a crash to occur when running the auto test tst_QQuickApplicationWindow::attachedProperties(). The crash can be traced back to QMetaType trying to access fromType.metaObject(), which is null. This patch will add a guard to ensure that we don't try to call a function on an object that is null. Fixes: QTBUG-86517 Change-Id: Idafd154a7b6a43e16126038fc5f9b30d7871f0d0 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Document that this method got added in 6.0Lars Knoll2020-09-111-0/+1
| | | | | | Change-Id: I6a7f35f81b9df83f911781516ec7e0ed82e09303 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* CMake: Fix race condition in -trace configured buildJoerg Bornemann2020-09-101-0/+5
| | | | | | | | | | | | qt_create_tracepoints(Core) creates a dependency from Core to Core_tracepoints_header, but the helper library Core_qobject also uses qtcore_tracepoints_p.h and must therefore depend on Core_tracepoints_header too. This amends 5c092c2b401. Change-Id: I0ed51f3ab9accea00f524c170cd319bb8af11df7 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Introduce QProcess::startCommand(QString, OpenMode)Joerg Bornemann2020-09-103-3/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The removal of the QProcess::start(QString, OpenMode) leads to more porting work than anticipated. A call like QProcess p; p.start(cmdline); must be transformed in the following cumbersome way: QProcess p; QStringList args = QProcess::splitCommand(cmdline); QString program = args.takeFirst(); p.start(program, args); This patch revives QProcess::start(QString, OpenMode) and renames it to QProcess::startCommand. This is still source-incompatible, but the transformation is much simpler: QProcess p; p.startCommand(cmdline); [ChangeLog][QtCore][QProcess] Added QProcess::startCommand(QString, OpenMode) as replacement for the removed QProcess::start(QString, OpenMode). Change-Id: I5499bbb39a025e115042c43a4cc63affddae585c Reviewed-by: hjk <hjk@qt.io>
* Android: use bin for instead of QT6_HOST_INFO_BINDIRAssam Boudjelthia2020-09-101-3/+3
| | | | | | | | | | | ${QT6_HOST_INFO_BINDIR} is returning an empty string making the tools paths unusable, and android apps building fails. Partially revert 09ac1bdfc5d2ee7a537c63e54348a8cf8d905fcf. Task-number: QTBUG-86557 Change-Id: I1522b3a4b45fbcb41894ea3bd7c714f7a79eb954 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QString/QBA: change realloc*Data signatures to use qsizetypeAndrei Golubev2020-09-104-26/+26
| | | | | | | | | | Changed reallocData, reallocGrowData signatures to use qsizetype instead of size_t Change-Id: Iebe7def5430d3d3f4660e19cb6c12612543c5abc Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Remove '\0' space reservation logic in QStringAndrei Golubev2020-09-102-32/+43
| | | | | | | | | Changed QString to use implicit element reserved by QArrayData Task-number: QTBUG-84320 Change-Id: If517500b3f0e71bb8d2989c64815a634aa8dd554 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>