summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qobject.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix a memory leak in template QMetaObject::Connection.Jędrzej Nowacki2012-03-191-1/+8
| | | | | | | | | QObject::QSlotObjectBase instance given as argument to QObject::connectImpl was not dereferenced in case of an unsuccessful connection. Change-Id: I206b14e986690c027aafc2593762d85dc619e0e6 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix a memory leak in QMetaObject::connectSlotsByName function.Jędrzej Nowacki2012-03-141-1/+1
| | | | | | | | QObjectPrivate::Connection time life should be controlled by QMetaObject::Connection handle. Change-Id: Ie7fcd950082a3e6cebc29ecc0622007470914edb Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Remove codecForTr().Robin Burchell2012-03-061-6/+1
| | | | | | | | | | Similarly to change id I2f429fa7ef93bd75bb93a7f64c56db15b7283388, the capability to arbitrarily alter the encoding of literals is very destructive, especially in a world with libraries and plugins. Change-Id: If0d4cd8dcf89792e39c1984cbde6b036cebfc02f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Merge remote-tracking branch 'origin/api_changes'Lars Knoll2012-03-041-0/+10
|\ | | | | | | | | | | | | | | | | | | Conflicts: dist/changes-5.0.0 mkspecs/features/qt_module_config.prf qmake/project.cpp qmake/property.cpp Change-Id: I6e4af40743a9aeff8ed18533a48036e332acc296
| * Make qobject_p.h not need qvariant.h.Stephen Kelly2012-02-291-0/+10
| | | | | | | | | | | | | | | | | | | | Move definition of ExtraData to the implementation file. As a side effect, we need to include qhash.h in some other places. Change-Id: I8bb4ec0940ae51c7d6961c9a51adb80fd444e1e3 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Remove the usage of deprecated qdoc macros.Casper van Donderen2012-03-021-14/+14
|/ | | | | | | | | | | QDoc now has support for Doxygen style commands for italics, bold and list items. This change applies that change in QDoc to the actual documentation. Task-number: QTBUG-24578 Change-Id: I519bf9c29b14092e3ab6067612f42bf749eeedf5 Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove use of Q_BROKEN_DEBUG_STREAM.Stephen Kelly2012-02-221-6/+0
| | | | | | | | No supported compiler defines it, and it was not used consistently so it didn't work anyway. Change-Id: Icc9e911e22daaedaee3d9316c15d19be26cd2e72 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Various documentation fixes ported from 4.8Teemu Katajisto2012-02-091-1/+1
| | | | | | | | | | | | | | | | | | | Selected documentation fixes for qtbase from 4.8 commit 40fb4750910e23d3e7128ca8e0f1c5920b05bd5a Task-number: QTBUG-8625 Task-number: QTBUG-19808 Task-number: QTBUG-1231 Task-number: QTBUG-21073 Task-number: QTBUG-8939 Task-number: QTBUG-20399 Task-number: QTBUG-20944 Task-number: QTBUG-22095 Task-number: QTBUG-11278 Task-number: QTBUG-15653 Change-Id: Ia4f59fce7c85f04b6da953a3988f705d9d9a658a Reviewed-by: Casper van Donderen <casper.vandonderen@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>
* Call connectNotify when connecting with function pointerOlivier Goffart2012-01-291-1/+13
| | | | | | | | Some objects expect connectNotify to be called in order the signal to be emitted. Change-Id: Id0460d9c2aef8f9c3618a2b62b2119a790e06f30 Reviewed-by: Thiago Macieira <thiago.macieira@intel.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>
* Remove all non-inline of qMalloc/qFree/qRealloc.Robin Burchell2012-01-061-4/+4
| | | | | | | | | | | | We're trying to deprecate these, so don't use them anymore. The inline uses of these have been left intact, for the moment. Inline code will need to create their own non-inline allocation methods (for future-proofing to allow alterations in how e.g. individual containers allocate) Change-Id: I1071a487c25e95b7bb81a3327b20c5481fb5ed22 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@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>
* Don't release timer ids in event dispatcher codeBradley T. Hughes2012-01-041-12/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 argument to QAbstractEventDispatcher::registerTimer()Bradley T. Hughes2012-01-021-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | ... and deprecate the old registerTimer() functions. The new pure- virtual registerTimer() breaks source-compatibility. Subclasses cannot be instantiated anymore, since the pure virtual function signature has changed. QAbstractEventDispatcher::TimerInfo is no longer a QPair. It is now a struct with timerId, interval, and timerType members. This is a source incompatibility that should only affect subclasses of QAbstractEventDispatcher, which will need to pass 3 arguments to the TimerInfo constructor instead of 2. If the subclass used QPair<int,int> instead of the TimerInfo typedef, the QPair<int,int> declarations will need to be replaced with TimerInfo. Call the new registerTimer() function with the type from QObject::startTimer(). Change all subclasses of QAbstractEventDispatcher to reimplement the new virtual function. The type argument is unused at the momemnt, except to ensure that registeredTimers() returns the type each timer was registered with. Implementations for the various dispatchers will be done in separate commits. Author: Thiago Macieira <thiago.macieira@nokia.com> Change-Id: Ia22697e0ab0847810c5d162ef473e0e5a17a904b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add Qt::TimerType and the QTimer::timerType propertyBradley T. Hughes2012-01-021-5/+7
| | | | | | | | | | | | | | | | | | | | 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>
* Revert "Revert "Add QObject::objectNameChanged(con... signal""Alan Alpert2011-12-201-5/+12
| | | | | | | | | This reverts commit 9b17557f3bbd5135651bcedf9f10e61d7e078ae2. Justification: Temporary commit, see JIRA task. Task-number: QTBUG-22985 Change-Id: I3df9eb5fdbdc133349dca5e192dcfcc9e758626c Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Do not call QueuedConnection slot on partialy destroyed objectOlivier Goffart2011-12-191-1/+1
| | | | | | | | | | | | This is a regression introduced in Qt 4.8 When QApplication::processEvents is called from a destructor, it is possible that pending events would still be called on the already destroyed subclass. Prevent that by using the same pattern as in QMetaObject::activate Change-Id: Ida50db07ae089264402dafcde7a41a066479d08b Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Remove QT_JAMBI_BUILD codeBradley T. Hughes2011-12-151-51/+0
| | | | | Change-Id: Ic9231b11293af4352f11cf075893175f0c9a471f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix typos in QObject::(dis)connect warningsGiuseppe D'Angelo2011-12-151-11/+11
| | | | | | | | For some strange reason "Object::method ..." was printed, without the leading Q. Change-Id: I10b99e8aa8730e4020d15b3e04a01004bade76c3 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Remove QMetaObject guards and deprecate QPointer.Bradley T. Hughes2011-12-101-114/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Don't overload the meaning of QObjectData::wasDeletedBradley T. Hughes2011-12-101-6/+7
| | | | | | | | | | | | | | | | | | The union in QObjectPrivate of declarativeData and currentChildBeingDeleted shouldn't use wasDeleted to determining the meaning of the unioned pointer. Instead, add QObjectData::isDeletingChildren, set that in QObjectPrivate::deleteChildren(), and only use the currentChildBeingDeleted member when the parent's isDeletingChildren is set. This solves aborts seen in autotests when widgets are deleting window children. The abort comes from QWeakPointer on the parent in the child's close event handler (the abort checks that wasDeleted is not set). Change-Id: I1a58449159d4a5312aad8ba12e559d05d6c43d93 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Remove QInternal callbacks and internal functionsBradley T. Hughes2011-12-021-39/+0
| | | | | | | | | | | | | | | | After commit 79f675a1e0f628bbc25345ebc1eb1f5809166c6b, the connect and disconnect callback API effectively becomes useless. Now that these callbacks cannot/do not, it makes little sense to keep the backdoors added for Qt Jambi support. Remove them for now. Should the Qt Jambi team want/need to port to Qt 5, we can re-add them, possibly designing a better API for doing so as well. Change-Id: I6209a1d647d683c979d5294b632b8c12c0f9f91c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Revert "Add QObject::objectNameChanged(const QString &objectName) signal"Martin Jones2011-12-021-12/+5
| | | | | | | | | | | This reverts commit ba635d7e74472f3a54c0c4686966af46d9035c6f. Breaks tests in declarative: tst_qdeclarativeecmascript::deleteLater tst_qquickvisualdatamodel::objectListModel Change-Id: I467b45109332e66fc62f3de00f376b1b88ab19ca Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Add QObject::objectNameChanged(const QString &objectName) signalBradley T. Hughes2011-12-011-5/+12
| | | | | | | | | | | | | | | | | | | This is sent when the object's name changes. tst_moc must be updated since the method count of QObject has changed. The test assumed that there were 4 invokable methods in QObject. The new signal is the 5th, which breaks the test's assumptions. Fix this as well. tst_QObject must be updated since the QObjectPrivate::isSignalConnected() method only supports the first 64 signals. With the addition of this new signal, sig61() in the test becomes the 65th signal, and will always appear connected now. Task-number: QTBUG-13999 (related) Change-Id: Ie87893c71a231fafa7ccf2f16102238a7be8327a Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Support Qt::UniqueConnection in the new connection syntaxOlivier Goffart2011-11-291-5/+49
| | | | | | | | | | This commit also improves the related documentation a bit. The test is copied from the test with the old syntax, but all the connection statement are changed to use the new syntax Change-Id: Ia5630ca4335b9f8ca6d724ae3c8750d6f0804d8e Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Reduce code dupplication in QObject::connectOlivier Goffart2011-11-291-29/+22
| | | | | | | | | Move from each implementation of QObject::connect to QObjectPrivate::addConnection the code that adds the QObjectPrivate::Connection* to the sender's list. Change-Id: I665af016d5e6673eb0e9c06965e5deed50454b28 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* QObject::disconnect with new syntaxOlivier Goffart2011-11-291-10/+99
| | | | | | | | | | | | | | | | | | | | | This add an overload to disconnect which is symetrical to the new syntax of connect. It is possible to diconnect connection like this: QObject::connect( sender, &Sender::valueChanged, receiver, &Receiver::updateValue ); QObject::disconnect( sender, &Sender::valueChanged, receiver, &Receiver::updateValue ); This overload only work with pointer to member function, and not static functions or functors. The test is copied from tst_QObject::disconnect(), just changed the syntax of the connection and disconnection Change-Id: Ia8f819100cb12098e32877522b97b732b1e676a8 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Remove obsolete QMetaObject::activate() overloads.Bradley T. Hughes2011-11-291-24/+1
| | | | | | | | | | | | | | | The overloads taking a range were previously used for cloned signals (ones that had default arguments). Commit 919b723088b8617b202b92d80b8d0983e4fd9500 changed how cloned signals are handled, making the from,to overloads obsolete. The 3 argument activate() overload that does not take a QMetaObject argument was marked obsolete by the same commit, but considering that it is used by our autotests, I've decided to keep it and not mark it as obsolete anymore. Change-Id: I631ce84dce156dec68cf26e10787cb35e3f50e18 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Add support for QueuedConnection when connecting using the new syntaxOlivier Goffart2011-11-251-13/+26
| | | | | | | QMetaCallEvent now can handle a pointer to QSlotObjectBase Change-Id: I94da1e68ce9bb1fd96a9ae013a389552eb625faa Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* New QObject connection syntaxOlivier Goffart2011-11-251-5/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In addition to the old connection syntax, you can now connect using function pointers. connect(sender, &Sender::valueChanged, receiver, &Receiver::updateValue ); You can connect also to functor or C++11 lambdas The connections are now type safe (no more problems with namespaces or typedefs). Implicit type conversion is also supported. The new syntax forces us to change the meaning of signal form protected to public, in order to be able to access the signal's address everywhere The way it works is by introducing new overload of QObject::connect that take function pointer as parametter. Those new overload are template function, that are implemented inline. The actual implementation is in QObject::connectImpl which take a QObject::QSlotObject* as parametter for the slot. That slot object contains a virtual function which call the slot which has to be implemented in the header as it depends on the template parametter. So the internals of QObjectPrivate::Connection will store this QObjectSlot* in order to be able to make the call. You can read a full description here: http://developer.qt.nokia.com/wiki/New_Signal_Slot_Syntax History of commits before it was imported on gerrit: https://qt.gitorious.org/~ogoffart/qt/ogoffarts-qtbase/commits/qobject_connect_ptr Thread on the mailing list: http://lists.qt.nokia.com/pipermail/qt5-feedback/2011-August/000796.html http://lists.qt.nokia.com/pipermail/qt5-feedback/2011-September/001248.html (The discussions on the mailing list were about trying to find a solution that do not need making signals public, but no user friendly solution was found) Note: support for QueuedConnection, and the symetric QObject::disconnect is added in another commit. Qt::UniqueConnection is not supported yet in the new overload. Change-Id: I67d08436b0720e7f2992be9f7e34770960fa58fa Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Change the return value of QObject::connectOlivier Goffart2011-11-251-52/+138
| | | | | | | | | | | | | | | | | | | | | | | | From a bool to a handle to to connection. Also added a new overload of disconnect that disconnect a handle This is required because with the new syntax taking lambda or functors, it is the only way to disconnect a connection (as it is impossible to compare functors) The new return value is QMetaObject::Connection, it is a wrapper around the internal QObjectPrivate::Connection. QObjectPrivate::Connection is now reference counted. tst_qglobal.cpp: This test set up an internal callback, and the callback do not set any proper connection handle (and tbh, it would be hard for it to do so). So the returned QMetaObject::Connection is invalid, and ok is false (Internal callbacks are only used for jambi and should probably be removed) Change-Id: I111626fb4f47efc4db5e2ea5bff9da15f08fea7b Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix most warnings about assignments of QAtomicInt.Friedemann Kleint2011-10-311-1/+1
| | | | | Change-Id: Ide409d72d2637b68ec2a85aaca4bc783a7e911e7 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Replace implicit QAtomic* casts with explicit load()/store()Bradley T. Hughes2011-10-271-6/+6
| | | | | Change-Id: Ia7ef1a8e01001f203e409c710c977d6f4686342e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use load() instead of implicit cast when using QueuedConnectionBradley T. Hughes2011-10-271-12/+15
| | | | | | | | | | | queued_activate() sets the argumentTypes atomic pointer on first use, which mixes a load, memory initialization, test-and-set-ordered, and another load. The explicit memory ordering is necessary to ensure that the memory stores happen in program order. Change-Id: Id1f8641f9cd081ce81aa8e830692f7af8261e84b Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* corelib: Remove Q_WS-macros.Friedemann Kleint2011-10-241-1/+1
| | | | | | | | | | | | | | | | | | | | Q_WS_QPA is the only active code path after merging refactor, other Q_WS-macros are no longer used. Enable compilation without -qpa. - Remove Q_OS_MSDOS, Q_OS_OS2 - Remove Q_WS_QWS - Remove/replace definitions/conditionals of Q_WS_XX - Remove qpa branches from profiles - Replace Q_WS_MAC by Q_OS_MAC - Replace Q_WS_MAC && !Q_WS_QPA by Q_OS_MAC && !QT_NO_CORESERVICES - Similarly in profiles: mac:contains(QT_CONFIG, coreservices) - Replace Q_FS_FAT by Q_OS_WIN Change-Id: Icce5a6c55b052c8f72b3b979ddf31a4f388ea9c9 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Rename QMetaType::construct() to create()Kent Hansen2011-10-111-1/+1
| | | | | | | | | | | | | | | | | | | | | create() is symmetric with destroy(). Also rename the internal methods and fields to be consistent (qDeleteHelper already had the "right" name, though!). This change will allow us to use construct() and destruct() for something else: Placement new-style allocation (QTBUG-12574). The old construct() is still kept for now, until the other repositories have been updated to use create(). Change-Id: Iceb184af6cffcb0a634359cfc3516c718ba0c2f5 Reviewed-on: http://codereview.qt-project.org/6342 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make all uses of QBasicAtomicInt and Pointer use load() and store()Thiago Macieira2011-10-031-2/+2
| | | | | | | | | | | | | | Most of these changes are search-and-replace of d->ref ==, d->ref != and d->ref =. The QBasicAtomicPointer in QObjectPrivate::Connection didn't need to be basic, so I made it QAtomicPointer. Change-Id: Ie3271abd1728af599f9ab17c6f4868e475f17bb6 Reviewed-on: http://codereview.qt-project.org/5030 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Use the right callback in QObject::disconnect()Olivier Goffart2011-09-231-1/+1
| | | | | | | Change-Id: Idf2f725dd859aa5c960e5889678cac0e139e44b0 Reviewed-on: http://codereview.qt-project.org/5475 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Merge remote branch 'gerrit/master' into refactorSamuel Rødal2011-08-301-0/+5
|\ | | | | | | | | | | | | Conflicts: src/src.pro Change-Id: Ic04fb170b82e86dc3cef6fe979f8fb709db10daf
| * Add a signal emitted callback to QAbstractDeclarativeDataAaron Kennedy2011-08-301-0/+5
| | | | | | | | | | | | | | | | | | | | | | For property notify signals, QtDeclarative can manage connections in a more special case - and more performant - way. This patch adds a callback hook so that QtDeclarative can intercept signals being emitted by declarative objects. Change-Id: I72554e80df0a4257da65d81cc1c5db88a11446a4 Reviewed-on: http://codereview.qt.nokia.com/3363 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* | Merge branch 'master' into refactorGunnar Sletta2011-08-251-15/+35
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qapplication_qpa.cpp src/gui/kernel/qcursor_qpa.cpp src/gui/kernel/qwindowsysteminterface_qpa.cpp src/gui/kernel/qwindowsysteminterface_qpa.h src/gui/kernel/qwindowsysteminterface_qpa_p.h src/gui/text/qtextcontrol.cpp src/plugins/platforms/wayland/wayland.pro src/widgets/accessible/qaccessible2.h src/widgets/widgets/qwidgetlinecontrol_p.h Change-Id: I5e6f4eb184159dccc67e8f13673edb884d179c74
| * Add flag for non-recursive lookup of child qobject(s)David Faure2011-08-151-15/+35
| | | | | | | | | | | | | | | | | | | | | | Merge-request: 40 Reviewed-by: olivier Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com> Change-Id: I1194ba0d8bba92ece3132171e230cece341ec127 Reviewed-on: http://codereview.qt.nokia.com/2957 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* | Merge remote branch 'gerrit/master' into refactorSamuel Rødal2011-08-031-23/+9
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qapplication_x11.cpp src/gui/widgets/qlinecontrol.cpp src/gui/widgets/qlinecontrol_p.h src/gui/widgets/qtabwidget.h Change-Id: I90ba893a5553b9ff5658ca0a3221ecf76be4c736
| * Simplify the mutexpool used in QObject.Olivier Goffart2011-07-291-19/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we now have QBasicMutex as a POD, we can simplify the mutexpool. This remove the call the the Q_GLOBAL_STATIC and some others tests that are taking CPU cycles when activating a signal. The QMutexPool class itself can't be simplified because its mutex are recursive mutexes, and the size is dynamic. also it is harder to get all the mutexes initialized to 0. Change-Id: Ie781655635907d2ad620eb189099cba14638414f Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-on: http://codereview.qt.nokia.com/2171 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
| * QMutex is now just a pointerOlivier Goffart2011-07-291-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And added a POD QBasicMutex. (QBasicMutex* can safely be static_cast'ed to QMutex*) The d pointer is not anymore always a QMutexPrivate. If d == 0x0: the mutex is unlocked If d == 0x1: the mutex is locked, uncontended On linux: if d == 0x3: the mutex is locked contended, waiting on a futex If d is a pointer, it is a recursive mutex. On non-linux platforms: When a thread tries to lock a mutex for which d == 0x1, it will try to assing it a QMutexPrivated (allocated from a freelist) in order to wait for it. Change-Id: Ie1431cd9402a576fdd9a693cfd747166eebf5622 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-on: http://codereview.qt.nokia.com/2116 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
* | Merge remote branch 'gerrit/master' into refactorSamuel Rødal2011-07-211-61/+0
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/opengl/cube/main.cpp examples/widgets/applicationicon/main.cpp examples/widgets/orientation/main.cpp src/gui/image/qicon.cpp src/gui/image/qimage.h src/gui/image/qpixmap.h src/gui/image/qpixmap_mac.cpp src/gui/kernel/qapplication.cpp src/gui/kernel/qpalette.cpp src/gui/kernel/qwidget.cpp src/gui/styles/qmacstyle_mac.mm src/gui/widgets/qmenubar.cpp src/gui/widgets/qslider.cpp src/opengl/qwindowsurface_gl.cpp tests/auto/qvariant/qvariant.pro tests/benchmarks/corelib/kernel/qobject/qobject.pro tests/benchmarks/gui/animation/qanimation/qanimation.pro tests/benchmarks/gui/graphicsview/qgraphicsanchorlayout/qgraphicsanchorlayout.pro tests/benchmarks/gui/graphicsview/qgraphicsitem/qgraphicsitem.pro tests/benchmarks/gui/graphicsview/qgraphicsscene/qgraphicsscene.pro tests/benchmarks/gui/graphicsview/qgraphicsview/qgraphicsview.pro tests/benchmarks/gui/graphicsview/qgraphicswidget/qgraphicswidget.pro tests/benchmarks/gui/image/qimagereader/qimagereader.pro tests/benchmarks/gui/itemviews/qtableview/qtableview.pro tests/benchmarks/gui/kernel/qapplication/qapplication.pro tests/benchmarks/gui/kernel/qwidget/qwidget.pro tests/benchmarks/gui/painting/qpainter/qpainter.pro tests/benchmarks/gui/painting/qtbench/qtbench.pro tests/benchmarks/gui/painting/qtracebench/qtracebench.pro tests/benchmarks/gui/text/qtext/qtext.pro Change-Id: I4b911c795ecb29d73b6a7fd18819711b49478a30
| * Doc: Removed documentation for deleted code.David Boddie2011-07-211-61/+0
| | | | | | | | | | | | | | Change-Id: Icdbc05decac3dfe3fc18ce073c494e1fce4ea347 Reviewed-on: http://codereview.qt.nokia.com/1824 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: David Boddie
* | Merge remote branch 'gerrit/master' into refactorSamuel Rødal2011-07-121-62/+68
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/image/qicon.cpp src/gui/image/qicon.h src/gui/image/qicon_p.h src/gui/text/qfontdatabase.cpp src/plugins/platforms/wayland/gl_integration/qwaylandglwindowsurface.cpp src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglwindow.cpp sync.profile Change-Id: Ie0a23a12177ff51bf562e15b2dd41f071afb19b4
| * Replace try/catch blocks in favour of destructors in the event loop.Thiago Macieira2011-07-111-62/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This has two direct benefits: 1) compiles regardless of -fno-exceptions: no need for #ifndef QT_NO_EXCEPTIONS or QT_TRY/QT_CATCH 2) no QT_RETHROW either, which means the backtrace of an application crashing due to an uncaught exception will include the actual throw point. Change-Id: I18e5500e121bfa81431ef16699df96d962794f0e Reviewed-on: http://codereview.qt.nokia.com/663 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>