summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qbasictimer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QAbstractEventDispatcher: port timer uses to the V2 APIThiago Macieira2024-03-131-2/+2
| | | | | | Change-Id: I83dda2d36c904517b3c0fffd17b52b71739928dc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
* Mention QChronoTimer in API docsAhmad Samir2024-03-031-1/+2
| | | | | Change-Id: Iaf9fb31994f1580b2051dbd0b1b8eef2a218aa39 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Fix warnings and linking issuesTopi Reinio2023-10-091-3/+0
| | | | | | | | | | | | | | | | | | | | Remove or replace links to examples that were removed or moved under manual tests. Replace code snippets that were quoting the now-missing examples. Fix documentation of QSet::removeIf(). Fix typo in documentation macro: Unknown command '\examplecateogry'. Add qtopengl, qtshadertools dependencies to Qt Widgets documentation project to enable correct linking to those topics. Mark all documentation sets in qtbase as free of warnings. Pick-to: 6.6 6.5 Change-Id: I058cd5f2063aa933ea310bceff906f05422a7cb2 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: Add \relates command to two global swap() functionsTopi Reinio2023-06-231-1/+9
| | | | | | | | | And fix incorrect copy-paste error in QBasicTimer's swap() description, 'string' -> 'timer'. Pick-to: 6.6 Change-Id: I28f5e4d6c8e3b8698ab9b4587d503b06c5628b78 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QBasicTimer: replace new qint64 overloads with chrono onesMarc Mutz2023-03-021-14/+22
| | | | | | | | | | | | | | | Found in API review. As per "chrono first" initiative[1], implement the int overload via the chrono one, not vice versa [1] https://lists.qt-project.org/pipermail/development/2023-January/043563.html Pick-to: 6.5 Change-Id: I65fe7039ad8ae5f9eb21d9c59a46b9c5c152fac3 Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Doc: point at tetrix example for QBasicTimer usageVolker Hilsheimer2023-03-011-2/+2
| | | | | | | | | The wiggly example is gone, but tetrix shows how to use QBasicTimer as well. Pick-to: 6.5 Change-Id: Iaad78b0d7e2136ef41d98f634d0680e6f7f3c4e1 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Remove wiggly exampleJan Arve Sæther2023-01-311-1/+1
| | | | | | | | | It demonstrates timerEvent() and some QFontMetrics There are other examples that demonstrates this Pick-to: 6.5 Change-Id: I4ad6f30c8ef93c995f980545ed88ab13b9aa9c7d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Migrate QBasicTimer from int to qint64Konrad Kujawa2022-08-301-3/+9
| | | | | | | QBasicTimer::start() now accepts qint64 instead of int. Change-Id: Iba3f394b6c20daf762f1add5a9eed22c8a67c802 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* corelib: Fix typos in documentationJonas Kvinge2021-10-121-1/+1
| | | | | | Pick-to: 5.15 6.2 Change-Id: I64d63af708bc6ddaabd12450eb3089e5077f849e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QBasicTimer: purge deprecated APIEdward Welbourne2020-07-201-24/+1
| | | | | | | Since 5.14, copy constructor and assignment. Change-Id: Id569968ee3879caea2f69e373d392881901965f2 Reviewed-by: David Faure <david.faure@kdab.com>
* QBasicTimer: release timer id on exitAlex Trotsenko2019-11-131-6/+4
| | | | | | | | | | | In some cases of inheritance, timer deletion can be triggered from the event dispatcher destructor where QThreadData::eventDispatcher is already nullptr. Despite the fact that the application is in shutdown phase, we should free the resource. Change-Id: I61ed1d817fd7638953f7d629823f19d4f6f1ee00 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove a few usages of deprecated APIShawn Rutledge2019-06-131-0/+2
| | | | | | Change-Id: I94bad0b8d3891c6b4a55178836cfff2a4312e330 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Don't allow to copy QBasicTimer in Qt 6, it would stop the timerSérgio Martins2019-05-251-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | Fixing this in Qt 5 would be BIC. Although it could be okayish, there are many more classes that shouldn't be copyable. I need to go through clazy's output and fix them, and would rather do this noise for Qt 6 and leave Qt 5 alone and purely BIC free. Added a move-ctor and move-assign, as well as swap(), deprecated copy-ctor and copy-assign. The new copy special member functions warn at runtime if they are called. In order to not pollute client code with the warning strings, lock them away by defining the functions out-of-line. [ChangeLog][QtCore][QBasicTimer] QBasicTimer is now a move-only class. Copying is now deprecated and will be removed in Qt 6. [ChangeLog][QtCore][QBasicTimer] Added swap() member and free function. Change-Id: Ic3e6a26f3989d4c8d125c06e8b0b825411c6e106 Done-with: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QBasicTimer: share some codeMarc Mutz2019-05-231-25/+2
| | | | | | | | Saves 0.5KiB on optimized GCC 9.1 Linux AMD64 builds, and is more maintainable going forward. Change-Id: I11e6dd33eacf276d1205a63734c66fa7c70c5118 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Improve checking for event/socket notifiers and timersJonathan Liu2014-09-231-9/+29
| | | | | | | | | | | | | | | | Starting/stopping timers from another thread may result in errors that may not appear until hours, days or weeks after if a release build of Qt is used with the GLib/UNIX event dispatchers. Such errors may manifest as warnings such as "QObject::killTimer(): Error: timer id 7 is not valid for object 0x2a51b488 (), timer has not been killed" and application crashes (e.g. crashes in malloc, realloc and malloc_consolidate). Initial-patch-by: Eike Ziller <eike.ziller@digia.com> Task-number: QTBUG-40636 Change-Id: I2de50d50eb1fc7467fcebb9c73b74d2f85137933 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-081-3/+3
| | | | | | | | | | | | | | | | | Default values should have mark-up to denote that they are code. This commit changes: -"property is true" to "property is \c true". -"Returns true" to "Returns \c true". -"property is false" to "property is \c false". -"returns true" to "returns \c true". -"returns false" to "returns \c false". src/3rdparty and non-documentation instances were ignored. Task-number: QTBUG-33360 Change-Id: Ie87eaa57af947caa1230602b61c5c46292a4cf4e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Doc: Add \inmodule QtCore to all QtCore class doc bodiesThiago Macieira2012-08-231-0/+1
| | | | | Change-Id: I19100755c97cc155c76a859e19940e9f9222d34e Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* fix "No such ..." doc error in QBasicTimer::start()Jeremy Katz2012-07-191-1/+1
| | | | | Change-Id: I52feb5f2ebcc8821470468fc51ed3acc6df92a67 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Doc: Prepare for building modular QtCore docs.Casper van Donderen2012-04-191-4/+4
| | | | | | | | | | | | This change fixes most qdoc errors in QtCore. There are about 900 left. The main thing this change does is moving documentation from qtcore from /doc/src to /src/corelib/doc. Other issues resolved are mis-use of qdoc commands. Change-Id: I002d01edfb13575e8bf27ce91596a577a92562d1 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Document that QBasicTimer::start(int, QObject*) uses Qt::CoarseTimerBradley T. Hughes2012-01-051-3/+4
| | | | | | | Change-Id: I553b33ac7adffb0a4fcdfc14d6e34b4e7a494c4d Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Warn when using QBasicTimer::start() incorrectlyBradley T. Hughes2012-01-051-2/+6
| | | | | | | | | | | Previously, QObject::startTimer() would warn when called from QBasicTimer::start() if there was no event dispatcher for the object's thread. QBasicTimer::start() should output a similar warning when there is no event dispatcher for the current thread. Change-Id: I1152f73216c3551c252a7a6995defebc9e1506c8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Don't release timer ids in event dispatcher codeBradley T. Hughes2012-01-041-5/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3rdparty event dispatchers are impossible to write without using the internal API QAbstractEventDispatcherPrivate::releaseTimerId(). Fix this by having each QObject keep track of its own timer ids, and release them when they are no longer used. As a side effect, this makes the QObjectData::pendTimer bit unnecessary. This also removes the QObjectData::inThreadChangeEvent hack that the event dispatchers used to avoid releasing timer ids when moving timers to a new thread. QBasicTimer becomes even more low-level. It cannot use QObject::startTimer() anymore, since we do not have a way to call QObject::killTimer() from QBasicTimer::stop(). QBasicTimer uses the QAbstractEventDispatcher interface directly, and releases the timer id explicitly as well when stopping the timer. This change also fixes some rare timer id "leaks" when destroying or stopping timers after a thread has exited and destroyed its event dispatcher (the timer ids would never be released when no dispatcher exists). Globally destructed QObjects that have running timers may try to release their timer ids after the timer id freelist has been destroyed. This commit accomodates such objects by avoiding the null dereference in QAbstractEventDispatcherPrivate::releaseTimerId(). Change-Id: I2d7cd8221fae441f3cf02b6c0b4bc16063834d00 Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Add Qt::TimerType and the QTimer::timerType propertyBradley T. Hughes2012-01-021-1/+18
| | | | | | | | | | | | | | | | | | | | The timer type will control the accuracy of the timer. By default, all timers are CoarseTimers, which allows for +/- 5% interval adjustment. PreciseTimers will not have any interval adjustments, VeryCoarseTimers will have intervals adjusted to full second resolution. Use QTimer::setTimerType() or the QTimer::singleShot() overload to specify the type. QObject::startTimer() now takes a Qt::TimerType argument which defaults to Qt::CoarseTimer. QBasicTimer::startTimer() gets an overload that takes a Qt::TimerType argument. The argument is unused for now, since the QAbstractEventDispatcher interface needs to change (done in a separate commit). Author: Thiago Macieira <thiago.macieira@nokia.com> Change-Id: I3100da5aa1fe17ec30b8644897d0fe6ec4a07f52 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update licenseheader text in source files for qtbase Qt moduleJyri Tahtela2011-05-241-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+138
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12