summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qobject.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Let QMetaObject::connectSlotsByName(o) also check for signals of oAxel Waggershauser2013-03-071-1/+7
| | | | | | | | | | | | | | | | | | | QMetaObject::connectSlotsByName(QObject* o) creates a list of all children to look for signals that match slots of o. This changeset simply adds the object o itself to that list. The motivation is to finally fix the long standing QtCreator bug QTCREATORBUG-6494. Where executing 'Go to slot...' and choosing 'accepted()' for a simple QDialog named 'MyDialog' will add a on_MyDialog_accepted() slot to MyDialog. That slot never gets connected. More details may be found in the linked QTBUG-7595. Task-number: QTBUG-7595 Task-number: QTCREATORBUG-6494 Change-Id: I35f52761791af697eabb569adb5faee6fae50638 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-03-061-2/+2
|\ | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/qnx/qqnxscreen.cpp src/plugins/platforms/windows/qwindowsdialoghelpers.cpp Change-Id: Ib64f21c077b54f2291d19187590bfe869b98477a
| * Fix spellingOlivier Goffart2013-03-041-2/+2
| | | | | | | | | | Change-Id: If3d5e09b2553d95caacd3e61a1bb108f1172111f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-02-141-1/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/concurrent/doc/qtconcurrent.qdocconf src/corelib/doc/qtcore.qdocconf src/corelib/global/qglobal.h src/dbus/doc/qtdbus.qdocconf src/dbus/qdbusmessage.h src/gui/doc/qtgui.qdocconf src/gui/image/qimagereader.cpp src/network/doc/qtnetwork.qdocconf src/opengl/doc/qtopengl.qdocconf src/opengl/qgl.h src/plugins/platforms/windows/qwindowswindow.cpp src/printsupport/doc/qtprintsupport.qdocconf src/sql/doc/qtsql.qdocconf src/testlib/doc/qttestlib.qdocconf src/tools/qdoc/doc/config/qt-cpp-ignore.qdocconf src/widgets/doc/qtwidgets.qdocconf src/xml/doc/qtxml.qdocconf Change-Id: Ie9a1fa2cc44bec22a0b942e817a1095ca3414629
| * QThread documentation: do not discourage the reimplementation of QThreadOlivier Goffart2013-02-041-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new QThread documentation now really discourage to reimplement QThread. But in fact, there are many cases where it is perfectly fine. And the example given is even a case where using worker object is wrong. The examle even contains a leak since the thread will never stop and will even leak. This changes put back some sentences from before commit d4ad9dbbf96884c0899e8f8116a8a056facd52d5. The sample code has been re-writen. Notice how reimpementing run takes less lines of code, less runtime overhead, no leaks, and also is more complete than the previous example. Change-Id: I6cb80826e917dd5ce442ccad2572ec692ccb25ab Reviewed-by: Andre Somers <andre@familiesomers.nl> Reviewed-by: Geir Vattekar <geir.vattekar@digia.com> Reviewed-by: Debao Zhang <hello@debao.me> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-221-1/+1
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qsavefile_p.h src/corelib/tools/qregularexpression.cpp src/gui/util/qvalidator.cpp src/gui/util/qvalidator.h Change-Id: I58fdf0358bd86e2fad5d9ad0556f3d3f1f535825
| * Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | | | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Rename QRegularExpression-related feature defs to QT_NO_REGULAREXPRESSIONGiuseppe D'Angelo2013-01-071-2/+2
|/ | | | | | | | | | | | QRegExp and QRegularExpression are totally independent, therefore using two different defines is the right thing to do. Also, document the new define in qfeatures.{txt,h}. Change-Id: Ice4826ea543f4b22f1cc27bf31ed6e043d0c43b0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Delete the QSlotObject when disconnect()ingGiuseppe D'Angelo2012-12-171-0/+6
| | | | | | | | | | | | | | | When disconnect()ing through a QMetaObject::Connection, if the QObjectPrivate::Connection contains a slot object, deref it, so that it will be destroyed before the next run of cleanConnectionList. Previously, a copy of the functor passed to connect() was kept until QObjectPrivate::cleanConnectionLists was called (by adding a new signal, or the sender was destroyed), even after a successful call to disconnect(). That is, we were keeping that copy allocated without any good reason. Change-Id: Ie6074ea797df1611cb995dec07c5b5a742360833 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Reset the QMetaObject::Connection dptr when disconnect()ingGiuseppe D'Angelo2012-12-171-0/+4
| | | | | | | | | | | | The QObjectPrivate::Connection refcount was not decreased when disconnect()ing, therefore it was kept alive by the owning QMetaObject::Connection object. This removes a leak in case the QMetaObject::Connection survives the sender object, after a successful disconnect(). Change-Id: Ie2ea59b269a0e589ae23c1457df7533be77c0797 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Docs: Fix referencesChristian Stenger2012-12-131-3/+3
| | | | | Change-Id: I48173186afb874d307010f4f303d0e4f97ec0287 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Emit destroyed() signal before children get deletedLars Knoll2012-11-231-1/+1
| | | | | | | | | | | Make sure we always emit the destroyed() signal before we delete our children. This wasn't working correctly for QWidget based classes, as the QWidget destructor deletes all children itself. Task-number: QTBUG-24672 Change-Id: Iecdff3489196271177edfeba1c4a2c5800e255af Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Revise QObject::connect documentation.Mitch Curtis2012-11-231-4/+5
| | | | | | Change-Id: I07d593b6b2c3d5c8843212d5a888525ac29ca1b0 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Core/kernel: Make some signals private.Stephen Kelly2012-10-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | There are more opportunities in QtCore and the rest of Qt to make signals private instead of public. This is a test-dart to see if there is any reason not to do this. It would be nice to make QObject::destroyed private, but as it has a default argument it would be source incompatible to anyone connecting to the SIGNAL(destroyed()) instead of SIGNAL(destroyed(QObject*)). Currently the function-pointer-based connect syntax does not accept a functor (or lambda) with a different number of arguments than the signal. Olivier says a fix for that might come in 5.1, but for now the qfiledialog2 test is changed to not use that anymore. Also, the function pointer for a private signal can not be assigned to a local variable, so the qmetamethod test is changed to not do so anymore. Change-Id: Iaf776b822f9ba364f2c184df0c6b23811da56e44 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fixed instances of "to to" in qtbase.Samuel Rødal2012-09-241-1/+1
| | | | | | | Really it should just be "to". Change-Id: I7d0fff334bac3f0ac78adb8131e3bf3df1f1b242 Reviewed-by: Sean Harmer <sean.harmer@kdab.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: fix example linkFrederik Gladhorn2012-09-031-1/+1
| | | | | Change-Id: Ie0235281c3a4d5e5dadc6e5823bbf722b7ca411f Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* QSlotObjectBase: make 'impl' and 'ref' privateMarc Mutz2012-08-261-13/+11
| | | | | | | | | | | | This allows to fold the deref() and the destroy() operations into one, destroyIfLastRef(). The member variables were renamed since there's now a member function of the same name (ref()). Change-Id: Ib94416d9e658065bbf5d3711ecafaf0eb063af17 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* blockSignals should block QML signal emission.Michael Brasser2012-08-261-3/+3
| | | | | | Change-Id: Ief35f3ca326173a87240e3cb558e47f721bd04b7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Doc: Add \inmodule QtCore to all QtCore class doc bodiesThiago Macieira2012-08-231-0/+2
| | | | | Change-Id: I19100755c97cc155c76a859e19940e9f9222d34e Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Doc: Fix snippet and example referencing widget examplesAndy Nichols2012-08-231-1/+1
| | | | | | | | Widget examples were moved into a widgets subfolder, but qdoc references were not updated. Change-Id: Id2a4573e723745b9827c664c852807d6116f8f6d Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Fix more qdoc errorsLars Knoll2012-08-201-13/+21
| | | | | Change-Id: Ieed340068327f37ea0f549d24ea49235994118f4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSlotObjectBase: combat virtual function "bloat"Marc Mutz2012-08-151-18/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In C++, the compiler creates extra functions and data for classes with virtual functions. This can lead to "virtual function bloat": http://www.boost.org/doc/libs/1_47_0/doc/html/function/misc.html#id1382504 This is especially true when the number of instances is of the same order of magnitute as the number of derived classes, such as is common with type erasure techniques. One such case is the QSlotObjectBase hierarchy, which this patch tackles. The mechanics of this optimisation are simple: re-implement the virtual function call mechanism by hand, with function pointers. But we go one step further and collapse the vtable into a single pointer to a function that implements all three currently-defined operations, swtching on an 'int which' argument. This even allows us to extend this in a BC way, should that become necessary later, by adding a new Operation and using the void** argument to transport arguments, if any. This approach was inspired by: Ulrich Drepper: How To Write Shared Libraries, Section 2.4.4 http://www.akkadia.org/drepper/dsohowto.pdf Also move the QSlotObjectBase hierarchy out of QObject so as not to export all the derived classes. This was pointed out in review by Thiago. Results (Linux amd64, GCC 4.8-pre -O2 -std=c++11, stripped): size tst_qobject* text data bss dec hex filename 523275 21192 48 544515 84f03 tst_qobject (old) 507343 13984 48 521375 7f49f tst_qobject (new) relinfo.pl tst_qobject* (old) tst_qobject: 473 relocations, 0 relative (0%), 240 PLT entries, 240 for local syms (100%), 0 users (new) tst_qobject: 323 relocations, 0 relative (0%), 238 PLT entries, 238 for local syms (100%), 0 users Change-Id: I40ad4744dde8c5c29ef62ed2d82d4b1ede178510 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make the "\internal" qdoc command stand on its own lineLaszlo Papp2012-08-151-27/+54
| | | | | | | | | | The qdoc manual currently claims that the command must stand on its own line. The change follows the consistency with the rest and how the example looks like inside the qdoc manual for this command. Change-Id: I6b653dc95cf9d84e4adf32220dace5d313678419 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Fix warning about change of signThiago Macieira2012-08-141-1/+1
| | | | | | | | | | | method_relative_ is unsigned, so we can't store a -1 in it. qobject.cpp(434): warning #68: integer conversion resulted in a change of sign callFunction_(0), method_offset_(0), method_relative_(-1) ^ Change-Id: If8bf3835590ef2c26b9ca5010d638aa84675ff62 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QObject: add a macro for conveniently setting the object nameMarc Mutz2012-07-251-0/+13
| | | | | | | | | | | | | | | | | | This is a simplified port of KDTools' KDAB_SET_OBJECT_NAME. It simply assigns the variable name as the objectName of a QObject, uic-style. It uses a small helper function so that it works on references as well as pointer variables. QLabel label; QLabel *pLabel = new QLabel(); Q_SET_OBJECT_NAME(label); Q_SET_OBJECT_NAME(pLabel); Change-Id: I25fec0c90f33249a3ea5d2dd622ab708019fd101 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* fix "No such ..." for QObject::connect(...,functor) docJeremy Katz2012-07-191-2/+2
| | | | | Change-Id: Idd1d871b0fde899fdd21ce5aa365e08e2c7bcf45 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Call QObject::disconnectNotify() when receiver is destroyedKent Hansen2012-06-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | | Store the signal index in QObjectPrivate::Connection, thereby making it available in "implicit" disconnect contexts (i.e., receiver deletion). This change does not cause the size of QObjectPrivate::Connection to grow (still 40 bytes on 32-bit Linux, 72 bytes on 64-bit Mac). Valgrinding the new benchmark indicates that the percentage of the time spent in the QObject destructor increased from 7.8% to 8.4% on ia32, for that particular stress test; the increase is the combined cost of calling metaObject(), QMetaObjectPrivate::signal(), and disconnectNotify() for one connection. In practice, the measured wallclock time increased by about 3ms for a 500ms run (which repeatedly constructs, connects, and destroys an object). Task-number: QTBUG-4844 Change-Id: I1beb01c753f31542fc0acb62edb4c6d165fcc5b4 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* doc: use correct snippet id for QObject::isSignalConnectedKent Hansen2012-06-281-1/+1
| | | | | | | Copy-and-paste error; the doc was based on QObject::receivers. Change-Id: I4f6ce716d388328e0345e8457cbc99fff323ce41 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Add QAbstractDeclarativeData::isSignalConnected hookKent Hansen2012-06-261-6/+7
| | | | | | | | | | | | | | Similar to QAbstractDeclarative::receivers. This hook will allow QObject::isSignalConnected(QMetaMethod) to return true when there are QML-managed connections. It's important that the hook is called from QObjectPrivate::isSignalConnected(uint), since QML calls that function. Change-Id: I9c5e42f2b3e7f985af02905985a3a47101cdee05 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Fix docs mentioning Q_EXPORT_PLUGIN2Lars Knoll2012-06-251-1/+1
| | | | | | | | Fix all remaining places where Q_EXPORT_PLUGIN2 was being used in the documentation. Change-Id: I7be67b83c18545d0e74f250b4b26583444b01909 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Change internal QDeclarativeData hooks to use signal index rangeKent Hansen2012-06-121-8/+4
| | | | | | | | | | | This also changes the qtdeclarative-specific QMetaObject::activate() overload to not take a methodOffset argument, since it's no longer needed. Change-Id: I4f7ece9f43339f3327419598c032e48fb37b97f0 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Add QDeferredDeleteEventBradley T. Hughes2012-06-051-1/+1
| | | | | | | | | | | Use this to store the loop-level counter needed by QCoreApplication when determining when it is safe to delete an object. This removes the hack to hijack the QEvent::d pointer (even though the pointer is unused). Change-Id: I91c0b1aa00235ec6e13feb30bf928e56d2f80026 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Change testlib signal dumper hooks to use signal index rangeKent Hansen2012-06-041-5/+3
| | | | | | | | | | | | Another step towards getting rid of the class method offset computation in QMetaObject::activate(). Since QMetaObjectPrivate::signal() is private API, this also required adding a testlib dependency on core-private (and getting rid of the duplicated QSignalSpyCallbackSet struct). Change-Id: I0d830f35392a6b44fc321c5285877ec0bf437100 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Change QConnectionSenderSwitcher et al to use signal index rangeKent Hansen2012-06-031-6/+14
| | | | | | | | | | | | | First step towards getting rid of the signal_absolute_index variable from QMetaObject::activate() (which requires computation of the class's method offset). This also required changing the implementation of the public function senderSignalIndex() so it still returns an index in the full method range. Change-Id: I58571eb3c8099ea5b673682872c53875f5ea8c13 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Use QMetaObjectPrivate::signalOffset() where appropriateKent Hansen2012-06-031-19/+6
| | | | | | | | computeOffsets() was unnecessarily computing the method index, when only the signal index is needed. Change-Id: Id682d4447ba283a44cf0ea15cc47bd30edccb57b Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Simplify the QObject::dumpObjectInfo() implementationKent Hansen2012-06-011-14/+1
| | | | | | | Use the new signal index-based API. Change-Id: If44e02e71b718bca5c18c486ca9ab95f836cd0f1 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Simplify connectSlotsByName() implementationKent Hansen2012-06-011-8/+3
| | | | | | | Use the new signal index-based API. Change-Id: I89263f5366726ef8213e45e5ab6575ebd6eab04a Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Move implementation of QObject::senderSignalIndex() to QObjectPrivateKent Hansen2012-06-011-11/+19
| | | | | | | | In preparation of changing the implementation to return an index in the signals-only range, not all-methods range. Change-Id: Ib743a4bc9da27ad776ade262b215ebf988e7ab28 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Don't call metaObject() redundantlyKent Hansen2012-05-311-1/+1
| | | | | | | The desired meta-object is already stored in a local variable. Change-Id: I40c7840f07f5dbd67110e2f7d5bb618cbb269047 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move rarely used QObjectPrivate data to extraDataMartin Jones2012-05-211-27/+27
| | | | | | | | | | | Move runningTimers, eventFilters and objectName data members to ExtraData. Saves 12 bytes per QObject for 95% of use cases (QObjectPrivate goes from 76B -> 64B). Change-Id: I5648c89f65a7be3ea51bd703ee8a9dcff6222c3c Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QMetaObject::activate() overload that doesn't require a metaobjectAaron Kennedy2012-05-181-0/+7
| | | | | | | | | This allows QML to emit signals without having to built lazily created metaobjects. Change-Id: If8068fb3cb35d79dc8f3ef79253d9c2eb7c93205 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Encapsulate the dynamic meta object pointerAaron Kennedy2012-05-181-1/+7
| | | | | | | | | This change allows us to delay creating the actual meta object until it is actually required. Change-Id: I1c4a4226bd82fa606b206dd60322f49b49c32463 Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove const char *-based connectNotify() APIKent Hansen2012-05-151-37/+0
| | | | | | | | | | | | | | | | This completes the transition from connectNotify(const char *) and disconnectNotify(const char *) to the new QMetaMethod-based functions. Removed the old connectNotify autotests and renamed the connectNotifyMethodXXX autotests to connectNotify, since there is no longer any ambiguity about which overload is being tested. Change-Id: Icf108a80177155f21bb73c165fb8ab5d4e997bc2 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove QAbstractDeclarativeData::objectNameChanged.Michael Brasser2012-05-101-3/+0
| | | | | | | | | | There is now an actual NOTIFY signal for this property, and the callback is no longer necessary. Change-Id: I664714e22e607c747f144250cfb78de8c1d28686 Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Fix typos in bcd477e0bc48bDavid Faure2012-05-061-1/+1
| | | | | Change-Id: Ia1981c86f799a749aa8fab5cdd8f6563b2ebe77f Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Change remaining uses of {to,from}Ascii to {to,from}Latin1 [QtCore]Thiago Macieira2012-05-041-1/+1
| | | | | | | | | | | This operation should be a no-op anyway, since at this point in time, the fromAscii and toAscii functions simply call their fromLatin1 and toLatin1 counterparts. Task-number: QTBUG-21872 Change-Id: I38f97ad379deafebef02c75d611343ca15640c8a Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Introduce QObject::isSignalConnected(QMetaMethod)Olivier Goffart2012-05-021-3/+56
| | | | | | | | | This is much more performant than calling QObject::receivers(const char*) Can be used instead of connectNotify in some cases. Change-Id: I19e0933f678f171f515d9a0f69f0ad4fb7d894b4 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Add QMetaMethod-based QObject::connect/disconnectNotify() APIKent Hansen2012-05-011-35/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This API will fully replace the const char *-based connectNotify() and disconnectNotify() in Qt5; the old functions will be REMOVED before Qt 5.0 final. The new implementation fixes the long-standing issue of connectNotify() not being called when using the (internal) index-based QMetaObject::connect() (e.g., from QML). As with the old API, there are still two "unintuitive" behaviors concerning disconnectNotify(): - disconnectNotify() is not called when the signal is disconnected using the QObject::disconnect(QMetaObject::Connection) overload. - disconnectNotify() is not called when a receiver is destroyed (i.e., when a connection is implicitly removed). The old versions of connectNotify() and disconnectNotify() are kept for now, and they are still called. They will be removed once known existing reimplementations (e.g., QtNetwork, QtDBus) have been ported to the new API. Change-Id: I8b4f007f3c6d89199c1ba04a3e23c8ca314e0896 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Don't use the QRegExp methods that modify the object [QtCore]Thiago Macieira2012-04-271-1/+2
| | | | | | | | | | | | | | QRegExp matching methods modify the object, which we don't want to. In particular, when we receive a QRegExp from the user or we store in a context that might require thread-safety, make sure we make a copy before using it. QRegularExpression has no such shortcoming. Task-number: QTBUG-25064 Change-Id: Icf22986cd5f6fd086518c78a7d56e6cadfe9f5f6 Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>