summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qpointer.h
Commit message (Collapse)AuthorAgeFilesLines
* Make it possible to use QPointer<const T>Stephen Kelly2013-02-131-34/+22
| | | | | | | | | | | | | This is possible with QWeakPointer, so allow it for migrating code too. In the process, replace the QPointerBase with a member variable for simplicity. The functionality of the QPointerBase is replaced by a TypeSelector template. Change-Id: I3b4c77bdeda2b863cc33e84a3da8a25bae928c8c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Remove dead code from QPointer.Stephen Kelly2013-02-111-40/+0
| | | | | | | | | | | The compilers checked here are not supported in Qt 5. Additionally, the QSharedPointer implementation has similar operators without such guards, so in reality these compilers may not have worked with Qt 4.6+ either. Change-Id: I208f3cde7c689770ae15245a555e3a58b749a8a3 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-291-4/+0
| | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.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>
* Replace macro qdoc with Q_QDOCDebao Zhang2013-01-081-1/+1
| | | | | | | | Both qdoc and Q_QDOC are used in source code, which looks not good. Change-Id: I4f3a71670278b0758d92bfa5db086a07e1b1acfd Reviewed-by: hjk <qthjk@ovi.com> Reviewed-by: Paul Olav Tvete <paul.tvete@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>
* Fix QPointer qdoc errorsLars Knoll2012-08-151-1/+1
| | | | | Change-Id: I54082a87f076aa511329cfb7a6ed6ecabcfb40f7 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Add some internal API for extracting a QSharedPointer<T> from QVariant.Stephen Kelly2012-06-201-0/+8
| | | | | | | | | | | | | The T must be derived from QObject, or it will fail to compile. This will allow scripting or other 'wrapping' and runtime environments like QtDeclarative to handle QSharedPointers to types derived from QObject properly. A QSharedPointer<T> can be inserted into a QVariant, and where T derives from QObject, a QSharedPointer<QObject> can be extracted from the QVariant, and its properties are then accessible. Change-Id: I68d6d89aceceb019267bd7301baa2047f9c09b90 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Deprecate the use of QWeakPointer to track QObjects.Stephen Kelly2012-06-071-2/+2
| | | | | | | | | | | | | | The main problem with using QWeakPointer to track QObjects is that it has API to convert to QSharedPointer, which is undefined behavior. There is no need to overload the meaning of QWeakPointer with QObject tracking. QPointer is more suitable and should be used instead. Because QPointer is implemented in terms of QWeakPointer, we need to add some overloads which are not deprecated. Change-Id: If0333e4800c9fd277629cc69185c9ca3e4e7e81d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add clear() to QPointer for QWeakPointer compatibility.Stephen Kelly2012-06-011-0/+5
| | | | | Change-Id: I9efc162bf56775c7ebcff4e3b79a997edc4ceaeb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QPointer: some optimisationsMarc Mutz2012-03-221-18/+40
| | | | | | | | | | | | | | | | | | Implement QPointer in terms of QPointerBase, a non-template roughly the same as QPointer<QObject>, to reduce the amount of template code being generated. Also mark QPointer as movable, fake an isNull() for qdoc, and remove qpointer.h's content from QT_NO_QOBJECT builds (some indirect include hits the missing QWeakPointer(QObject*) constructor when bootstrapping; worked before b/c QPointer is a template; QPointerBase isn't, though). Change-Id: I657826601f570f954d80b84bb0334dd3a7452859 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Un-deprecate QPointer per mailing list discussion.Robin Burchell2012-03-151-5/+1
| | | | | | | | | | Now that QPointer is implemented in an efficient manner, there is really no need to avoid it, deprecating it just adds a large amount of churn. Change-Id: I32116faf14c3b07631d59ba9585f9ce422531646 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.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>
* Remove use of QT_MODULE from libraryGunnar Sletta2012-01-251-1/+0
| | | | | | | | | | These defines were there to aid in the commercial licensing scheme we used long ago, and are no longer needed. Keep a QT_MODULE(x) define so other modules continue compiling. Change-Id: I8fd76cd5270df8f14aee746b6cf32ebf7c23fec7 Reviewed-by: Lars Knoll <lars.knoll@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>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove QMetaObject guards and deprecate QPointer.Bradley T. Hughes2011-12-101-17/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QWeakPointer is superior and preferred. Remove QMetaObject::addGuard(), QMetaObject::changeGuard(), QMetaObject::removeGuard(), and QObjectPrivate::clearGuards(). Implement QPointer using QWeakPointer<T> instead. This changes the behavior of QPointer in 2 ways: - During destruction of a QWidget. Previously, the destructor of QWidget would reset all QPointers so that they would return zero when destroying children. Update tst_QPointer to account for this change. - When constructing a QSharedPointer to take ownership of an object after a QPointer is already tracking the object. Previously, the shared pointer construction would not be affected by the QPointer, but now that QPointer is implemented using QWeakPoiner, constructing the QSharedPointer will cause an abort(). Fix tst_QSharedPointer by removing the use of QPointer in the objectCast() test. These behavior changes are documented in the QPointer class documentation and in the changes file. Change-Id: I92d0276219c076ece7bcb60f6e1b9120ce4f5747 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.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/+168
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