summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Allow QWindowsPipe{Reader|Writer} to work with foreign event loops, take 2Alex Trotsenko2021-03-024-341/+570
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a foreign event loop that does not enter an alertable wait state is running (which is also the case when a native dialog window is modal), pipe handlers would freeze temporarily due to their APC callbacks not being invoked. We address this problem by moving the I/O callbacks to the Windows thread pool, and only posting completion events to the main loop from there. That makes the actual I/O completely independent from any main loop, while the signal delivery works also with foreign loops (because Qt event delivery uses Windows messages, which foreign loops typically handle correctly). As a nice side effect, performance (and in particular scalability) is improved. Several other approaches have been tried: 1) Using QWinEventNotifier was about a quarter slower and scaled much worse. Additionally, it also required a rather egregious hack to handle the (pathological) case of a single thread talking to both ends of a QLocalSocket synchronously. 2) Queuing APCs from the thread pool to the main thread and also posting wake-up events to its event loop, and handling I/O on the main thread; this performed roughly like this solution, but scaled half as well, and the separate wake-up path was still deemed hacky. 3) Only posting wake-up events to the main thread from the thread pool, and still handling I/O on the main thread; this still performed comparably to 2), and the pathological case was not handled at all. 4) Using this approach for reads and that of 3) for writes was slightly faster with big amounts of data, but scaled slightly worse, and the diverging implementations were deemed not desirable. Fixes: QTBUG-64443 Change-Id: I66443c3021d6ba98639a214c3e768be97d2cf14b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Add the 6.2 deprecation macrosGiuseppe D'Angelo2021-03-021-0/+8
| | | | | | | | | ... which makes me wonder, why isn't this stuff bumped automatically when a minor version branch is created? Change-Id: Ia43f898163a4baa0896a09bd13d65cf534fe1df5 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Don't access moved-from objectVolker Hilsheimer2021-03-021-7/+6
| | | | | | | | | | | | | | | | | | | Clang's static analyzer tooling warns about this access-after-move [1]. While the comment above the function indicated that this was deliberate and relying on a moved-from QString being valid, it is still bad practice. Since 'str' is empty in moved-from state if - and only if - it was a non-const reference, make a compile-time check of the constness of type T instead. [1] https://testresults.qt.io/codechecker/daily_analyses/qtbase/dev/qtbase-dev-20210301-e14ccf0553/qstring.cpp_clang-tidy_b0545db57a2cc5dac67a56f76322ffd0.plist.html#reportHash=209ee3db0b17d21919326a1ad6635318 Pick-to: 6.1 Change-Id: Iac1813b61b6a3c2ef4053b911a4043c5382f85e4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Canonical type conversionHou Lei2021-03-021-1/+1
| | | | | | | Avoid C-style casts when possible. Change-Id: I623d7bc62bd0e48a5e0493c892d6ad9b11b0ca0c Reviewed-by: David Faure <david.faure@kdab.com>
* QCommandLineParser: fix crash if there's no QCoreApplicationDavid Faure2021-03-011-3/+4
| | | | | | | | It'll display <executable_name> instead in the help output. Fixes: QTBUG-91430 Change-Id: Ib6211b24cdaa4683a4f62c90b5a1a20ba69f1cff Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge "Brush up the imageviewer example"Friedemann Kleint2021-03-011-6/+0
|\
| * Simplify prefix-related functionality of qmakeAlexey Edelev2021-03-011-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Since the QT_CONFIGURE_HOSTBINDIR_TO_HOSTPREFIX_PATH and QT_CONFIGURE_HOSTBINDIR_TO_EXTPREFIX_PATH definitions keep the same value in modern CMake build, no need to have special handling in cases where these values are used in qmake. Also it will be useful to specify the relative path to the prefix directory from the directories different of 'bin' when use QMakeLibraryInfo. Task-number: QTBUG-75870 Change-Id: I5a777001eb334dcf05e22853a514d4257352d59b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
| * Remove unused definitionsAlexey Edelev2021-03-011-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | QT_CONFIGURE_CROSSBUILD is always '0', so it's not necessary to keep conditional compilation in QMakeLibraryInfo. Also the QT_CONFIGURE_SYSROOTIFY_PREFIX definition is never used in the project. Task-number: QTBUG-75870 Change-Id: I1fe42dce40fddc6a72254736883f93aa4727f6b3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Simplify QDateTimeParser::fromString() to always record the date-timeEdward Welbourne2021-03-011-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, *datetime was only written to if the parse was a success. When parsing a date-time that's invalid by virtue of falling in a spring-forward gap, the parser returns a date-time that is invalid but has a toMSecsSinceEpoch() suitable for use in creating a sensible interpretation of the parsed string (in offset by the width of the gap from the specified position in the gap). It is more useful to return this value than a default-created QDateTime. Change-Id: I89f39e729b1f9fede1532d8b82f6f676477ddadb Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* | Try again if mktime() fails when we thought we knew DST-nessEdward Welbourne2021-03-011-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When refreshing a QDateTime(,, Qt::LocalTime) we call mktime on data obtained from it, passing in the DST status (when known; this keeps two otherwise identical times in a fall-back distinct). One of the tests relies on changing zone under the feet of such a date-time, created in Hawaiian standard time; it serializes it, the reads it back in Western Australian Daylight-saving time and expects the results to be equal. However, the two differ in DST-ness, which leads to mktime() failing for the Hawaiian original, with unwelcome results. Notice this case, failure with DST-ness claimed known, and retry without the claim, so as to correct the DST-ness. Change-Id: Id0278df53130f76fc587769efe946ca9af1adc26 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QTimeZonePrivate::dataForLocalTime: avoid {ov,und}erflowEdward Welbourne2021-03-011-10/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | When computing a recent and imminent time, to bracket the time for which we want data, take care not to cycle round to the other end of the range of representable times. Rephrased comments on this function, in the process, to more accurately reflect what we're doing. Change-Id: Iacd36186abc6b19d0ca03981aec80b2c5af077b3 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Only store offsetFromUtc when sane (and assert sanity)Edward Welbourne2021-03-011-4/+8
| | | | | | | | | | | | | | | | | | | | | | The addition of a sanity-assertion revealed that, for an invalid time-zone, refreshZonedDateTime() left epochMSecs unset but computed offsetFromUtc from it none the less. Leave it as zero in that case, or any other where the conversion to UTC didn't give valid date and time. Change-Id: I0ebd955798532e91e7e211bf065667e313ee5c2d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Rework an assertion to eliminate a common sub-expression using a lambdaEdward Welbourne2021-03-011-8/+9
| | | | | | | | | | | | | | | | | | | | This take more lines but makes the condition clearer and the lines shorter, even after converting to use the names for constants in the condition. Change-Id: I9e5b7b79ff62095ed11b8723be238444fd32d9c1 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Use qint64 as base-type for an enum mostly cast to that typeEdward Welbourne2021-03-011-45/+47
|/ | | | | | | | | | | | | Various constants used in qdatetime.cpp were cast to qint64() where used. There ware also some Q_INT64_C()s, two of which should have used members of this enum; the third suggested a new addition to the enum. Adding that and basing the enum on qint64 eliminates the need for casting, although one asprintf() does now require a cast back to int. There were also some redundant casts to qint64(), so I removed those. Change-Id: Ia51ad8020f037badb1506ca379da19098a8655f8 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Kill qHash(QPointF)Giuseppe D'Angelo2021-02-281-0/+2
| | | | | | | | | QPointF operator== is fuzzy, hence it can't be hashed efficiently. Prevent the erroneous addition of the overload by client code by providing it as deleted. Change-Id: I2cfaaf5c2c8896ec9a7929f7c7bf52a912d0450f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMetaType: Store QMetaObject for pointer to const QObject, tooFabian Kosmale2021-02-262-0/+4
| | | | | | | | | | | | | | | | | Before this change, the QMetaType for T const* where T is derived from QObject would not store the static QMetaObject of T. This commit changes this. As a consequence, the metatype system can now convert between const and non-const pointers to QObject. Note that this allows casting const away; but so does C++ with const_cast. In addition, a new flag, QMetaType::IsImmutable is introduced, and used to tag the metatypes of pointer to const types. This allows code to discern between pointers to mutable and const QObjects, which is relevant for the QML engine. Task-number: QTBUG-82354 Change-Id: I3e4e4f39f565bd99a65e161528ce5304df73d6d6 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QJsonValueRef: add missing operator[]Fabian Kosmale2021-02-261-0/+4
| | | | | Change-Id: Iae165cd7bb2a7ea02d819fa25e0618d81f9a54f4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Document requirements for getters and setters of bindable propertiesAndreas Buhr2021-02-252-6/+38
| | | | | | | | | | | | | Getters and setters of bindable properties have to be carefully written to avoid several problems. This patch adds documentation for this. Task-number: QTBUG-89505 Task-number: QTBUG-90511 Change-Id: Ib25590b3d8d95c490d9555c0f258f48cb6cfe4a9 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QEventDispatcherWin32: get rid of the hook procedureAlex Trotsenko2021-02-252-30/+9
| | | | | | | | | | | | | | | | | | Instead of intercepting the WM_QT_SENDPOSTEDEVENTS message in the hook procedure, we can handle it at receive points, making qt_GetMessageHook() unnecessary. Including general performance improvements, this patch fixes the issue where some applications (e.g. Ableton Live) do not call a chain of nested hooks for plugins. Pick-to: 6.1 5.15 Fixes: QTBUG-90949 Change-Id: If8e96848392c6f10d45af2aac0567707d16af673 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Nuno Santos <nunosantos@imaginando.net>
* Add more support for structured bindingsGiuseppe D'Angelo2021-02-251-0/+44
| | | | | | | | | | | | | | | | | | | | | | | After QPoint(F), it's now the time of QSize(F) and QVectorND, which can be unambiguously decomposed. [ChangeLog][QtCore][QSize] QSize is now usable in a structured binding declaration. [ChangeLog][QtCore][QSizeF] QSizeF is now usable in a structured binding declaration. [ChangeLog][QtGui][QVector2D] QVector2D is now usable in a structured binding declaration. [ChangeLog][QtGui][QVector3D] QVector3D is now usable in a structured binding declaration. [ChangeLog][QtGui][QVector4D] QVector4D is now usable in a structured binding declaration. Change-Id: I67bb152f4210f2be27607179cd2ec522174cc483 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use Core library for qmake instead of the Bootstrap libraryAlexey Edelev2021-02-2516-330/+95
| | | | | | | | | | | | | | | | | | | Move the qmake-specific logic of the QLibraryInfo class to qmake internals. 'qconfig.cpp.in' now stores information about the library info entries to keep them consistent between qmake and the Core library. qmake requires specific features enabled in the Core library, so building qmake will be skipped if the features are not enabled. All flags directly related to the qmake have been removed from Core lib. Remove all bootstrap related sections from qmake CMakeLists.txt Task-number: QTBUG-89369 Change-Id: I26de157d3bfd4a5526699296e9d46e1c180b89ae Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Improve docs for QFuture::then() with contextSona Kurazyan2021-02-252-0/+21
| | | | | | | | | | | | | Be more precise about attaching a continuation with the default (QtFuture::Launch::Sync) launch policy after a continuation with context. Pick-to: 6.1 Change-Id: I5b80063df2443e5742033864ba012bf34ed4cdf7 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Assert that setCurrentAnimation has the assumed side effectVolker Hilsheimer2021-02-251-1/+3
| | | | | | | | | | | setCurrentAnimation(0) is expected to set the currentAnimation pointer - which it does, as long as there are any animations. Fixes static analyzer warning 106daf11ddfe9bb4fa7cf98c9097962c Pick-to: 6.1 Change-Id: I3739bcfda103db391d21f135485f0b700c48ead1 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QSystemSemaphore: Fix broken translated messagesFriedemann Kleint2021-02-245-28/+15
| | | | | | | | Add Q_DECLARE_TR_FUNCTIONS() and use tr(). Pick-to: 6.1 Change-Id: I31a27afa06ee2a592a7e588283e5ff08b5d14f3b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QStandardPaths: Add translation comment for macOS-specific itemFriedemann Kleint2021-02-241-1/+3
| | | | | | | Pick-to: 6.1 Change-Id: Idde81ee9badb41ff7893dcbdfd39ec4cb8db9742 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Fix transitionEachZone() failures on AndroidEdward Welbourne2021-02-241-0/+5
| | | | | | | | | | | | | | | | | | | In QTimeZonePrivate::dataForLocalTime(), mistrust the Android backend's hasDaylightTime(), as it has a comment saying it only knows about future transitions, not past. This caller of it really needs to query "has ever had a transition", which this doesn't answer. Many zones that have no plans for future transitions have had transitions in the past; these were failing the transitionEachZone() test. In the process, refine the test itself, making sure we catch some quirk cases that shouldn't arise and making the debug message on failure more informative (while eliding the zone name, as this is part of the test name anyway, so added to the output by qDebug() itself). Fixes: QTBUG-69131 Change-Id: I88a0528182c247acb8b6327b40516178e455bcc0 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Assert that either both or neither pointer are nullptrVolker Hilsheimer2021-02-241-0/+10
| | | | | | | | | | | | | | If called by QMetaType::canConvert with two nullptr values, the QMETATYPE_CONVERTER_ASSIGN macro will expand to code dereferencing both 'to' and 'from' pointers. Assert that others callers provide two valid pointers. Fixes static analyzer warning 02dc34cc2ad1d4c3c6e55b44e08983f2 Pick-to: 6.1 Change-Id: I24de914faa25dc7cb1da5eae09a125506caac389 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qt6_finalize_executable(): Enable finalizers to be set per-targetCraig Scott2021-02-242-8/+53
| | | | | | | | | | | | | | | | | | | | | Some plugins need to append additional processing to targets that use them. This is most commonly needed for static builds to identify additional plugins that need to be linked, but which cannot be determined automatically by CMake as part of its transitive dependency handling. Check for finalizers on directly linked targets as a way to help automate common scenarios. Because we need to lookup dependency targets and these may have visibility limited to the depender target's scope, we now formally document that finalizers should be called from the same scope as the one in which the target was created. This was loosely expected before, but is now made explicit. Task-number: QTBUG-90819 Task-number: QTBUG-86669 Pick-to: 6.1 Change-Id: I065a3f3a4ab6eeff6a98a655835427949e2fe0f1 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Move build tools to libexec instead of the bin dirJoerg Bornemann2021-02-231-1/+1
| | | | | | | | | | | | | | [ChangeLog][Build System] Tools that are called by the build system and are unlikely to be called by the user are now installed to the libexec directory. This is a step towards easier co-installability of different Qt versions. Pick-to: 6.1 Task-number: QTBUG-88791 Change-Id: Id19575b5ba27795f7715e4ea6a09391b26dd4942 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Re-order includes in qjniobject.cppAssam Boudjelthia2021-02-221-1/+2
| | | | | | Pick-to: 6.1 Change-Id: I80acd829bfd0940d17170f2277e92bc9620ce929 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QProcess/Unix: remove outdated notices about use of posix_spawn() on QNXThiago Macieira2021-02-211-4/+0
| | | | | | | | | We haven't used the spawn functionality on QNX since Qt 5.7 (commit 005a8bfbf0022f03dafafcf2b5c438ccf0675a49) because that's when we dropped support for QNX 6.5.0. Change-Id: Ic90d8429a0eb4837971dfffd1664f9712bdce2d8 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QProcess::startDetached/Unix: report which function failedThiago Macieira2021-02-211-30/+42
| | | | | | | | Like QProcess::start(). Pick-to: 6.1 Change-Id: Ic90d8429a0eb4837971dfffd1664ef1293a6523d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QProcess::startDetached/Unix: simplify handling of the pipesThiago Macieira2021-02-211-21/+26
| | | | | | | | | | | | | Use a structure that will automatically close them for us. This doesn't apply to startProcess() because the pipes there are long-lived (though each of them in QProcessPrivate could be an AutoPipe...). The destructor only runs in the parent process, so the child processes don't need to worry about setting file descriptors to -1. Pick-to: 6.1 Change-Id: Ic90d8429a0eb4837971dfffd1664ed98f3d74d1c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QProcess::startDetached/Unix: remove unnecessary ignoring of SIGPIPEThiago Macieira2021-02-211-10/+0
| | | | | | | | | This is unnecessary because we can only get SIGPIPE if the reading end of the pipe is closed. And that can only happen if the parent process has exited, meaning there's no one to read our message anyway. Change-Id: Ic90d8429a0eb4837971dfffd1664ec6821993ada Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QProcess::startDetached/Unix: fix the resetting of SIGPIPEThiago Macieira2021-02-221-5/+1
| | | | | | | | | | | | | This should have been SIG_DFL, as we're about to execute a child process. It's the child's responsibility to ignore SIGPIPE if it wants to, or get killed by it when it writes to an pipe with no readers. Qt itself does this for its own purposes (see qt_ignore_sigpipe() [until I can get some time to teach Linux about O_NOSIGPIPE]). Therefore, we ought to reset what we've done. Change-Id: Ic90d8429a0eb4837971dfffd166585a686790dde Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QProcess::startDetached: set the error condition on failure to startThiago Macieira2021-02-213-14/+31
| | | | | | | | | | | | And set *pid to -1. [ChangeLog][QtCore][QProcess] If a startDetached() fails to start the target application, the QProcess object should now have a proper error string in errorString(). Pick-to: 6.1 Change-Id: Ic90d8429a0eb4837971dfffd1664e825ffcb923e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Add QAndroidApplication as a nativeInterfaceAssam Boudjelthia2021-02-206-28/+166
| | | | | | | | | | QAndroidApplication provides the Android specific app context() and isActivityContext() to determine whether the context is an Activity or otherwise a Service. Task-number: QTBUG-90499 Change-Id: Iae2eef7ec44859a89825b09f52f09506b20b5420 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QProcess::startDetached/Unix: move up the chdir() and remove qWarningThiago Macieira2021-02-181-6/+6
| | | | | | | | | | That qWarning cannot be in the child process (we don't know if a user logger is fork-no-exec-safe) and the failure to chdir() should be reported as a failure in QProcess::startDetached() instead. Change-Id: Ic90d8429a0eb4837971dfffd1664e7577c81610b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: David Llewellyn-Jones <david.llewellyn-jones@jolla.com>
* QProcess/Unix: remove unnecessary chdir("/") before _exit()Thiago Macieira2021-02-181-2/+0
| | | | | | | | | That only created an opportunity for qWarning(), which should never be in the child process in the first place. Change-Id: Ic90d8429a0eb4837971dfffd1664e57a2291ea78 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: David Llewellyn-Jones <david.llewellyn-jones@jolla.com>
* Doc: Fix qdoc warnings in qtbaseNico Vertriest2021-02-181-1/+1
| | | | | | | Task-number: QTBUG-90662 Change-Id: I894ed70ca8514cfb0afc7e547c7fe3efadcaad50 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QJsonObject: Fix operator<=()Ulf Hermann2021-02-181-1/+1
| | | | | | | | | | We had a copy-paste error there. Pick-to: 6.0 6.1 Change-Id: Ib1448197ac4f4641c6559f133f41dcf326f210f1 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qmake: Introduce QT_HOST_LIBEXECS propertyJoerg Bornemann2021-02-182-1/+9
| | | | | | | | | This will be used to access host tools that are installed in ${prefix}/libexec instead of ${prefix}/bin. Pick-to: 6.1 Change-Id: I36c4b5736330f8229d267a117c65d55cd5e12758 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Mark QSocketNotifier::activated(int) QT_MOC_COMPATMårten Nordheim2021-02-181-1/+1
| | | | | | | Fixes: QTBUG-83888 Pick-to: 6.1 Change-Id: I0833812376a5bf1a024a4b036c09b23760437862 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Correct qt_mktime()'s check for last second in 1969Edward Welbourne2021-02-181-1/+1
| | | | | | | | | | | It was comparing time->second() to MSECS_PER_DAY - 1, but time->second() is the second within its minute, so is at most 59. It should be comparing seconds into the day to SECS_PER_DAY - 1. Prompted by a PVS-studio article. Pick-to: 6.1 6.0 5.15 Change-Id: I1802c49fa18818f4b4fe74f187da5f799df7d1de Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Provide calendar backends with a unique IDEdward Welbourne2021-02-1813-138/+292
| | | | | | | | | | | | | | | | | | | | Registration by ID allows for detection of duplicate instantiation of built-in back-ends, which can be detected and flagged by setting the ID to ~size_t(0) instead of the enum value for which it sought to be registered. A new method, calendarId(), is provided to access this; while the old calendarSystem() becomes non-virtual, as it can be inferred (when registration was successful) from the ID. Make registration by name or alias conditional on successful registration by ID. Previously, failed registration by name precluded registration by ID, which now becomes the authoritative registration. This incidentally makes it possible to add a QCalendar constructor taking the unique ID of a backend, for use in conjunction with custom calendar implementations. Change-Id: Ib22925a8ac3ef9439a09ec3855f6231cf9b91c21 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix a typo, simplify an increment, add an assertionEdward Welbourne2021-02-181-3/+5
| | | | | | | | | Trivial details picked up during the course of investigating a time-zone issue. Change-Id: I4d6e7ab1787a2500bd950e7f12ed8618a31f1f8e Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Drop some over-rides that duplicated the base-class's implementationEdward Welbourne2021-02-182-23/+2
| | | | | | | | | | | QAndroidTimeZonePrivate overrode the transition-related methods of its base, but there was no point in doing so, since our Android backend has no access to transition data, just the same as the base implementation. Change-Id: Ie4ff375381b463078b412f50e8ddc925ab1587a3 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix some qdoc-warnings for 6.1Friedemann Kleint2021-02-182-1/+7
| | | | | | | | | | | | | | | | | Fix: qtbase/src/testlib/qtestelementattribute.cpp:89: (qdoc) warning: Undocumented enum item 'LET_Message' in QTest::LogElementType qtbase/src/testlib/qtestelementattribute.cpp:89: (qdoc) warning: No such enum item 'LET_Error' in QTest::LogElementType qtbase/src/testlib/qtestelementattribute.cpp:89: (qdoc) warning: Undocumented enum item 'LET_SystemOutput' in QTest::LogElementType qtbase/src/network/ssl/qsslsocket.cpp:1666: (qdoc) warning: Unknown command '\cl' qtbase/src/corelib/kernel/qproperty.cpp:883: (qdoc) warning: Unknown command '\T' qtbase/src/corelib/kernel/qproperty.cpp:799: (qdoc) warning: Undocumented return value (hint: use 'return' or 'returns' in the text qtbase/src/corelib/kernel/qjnienvironment.cpp:250: (qdoc) warning: Undocumented return value (hint: use 'return' or 'returns' in the text Pick-to: 6.1 Change-Id: I116f5d8ace2c29ba7b6b93256d5761591e01296a Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
* QMetaType::id: add fastpathFabian Kosmale2021-02-182-13/+22
| | | | | | | | | This inlines the fastpath of QMetaType::id and splits the slowpath into its own function. With that change, we can also use id in operator==, simplifying the code there. Change-Id: I286fe173b43a495dbda8faa151a93895b4fd22e4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Bump the version of QDataStreamFriedemann Kleint2021-02-182-2/+4
| | | | | | | Amends f731802ba82ad260e155783e0427fb3f6ebd99fe. Change-Id: I1ba758ef4c9d80fbc11ecc78e0480f57c95007e2 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>