summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qobjectdefs_impl.h
Commit message (Collapse)AuthorAgeFilesLines
* QObject: allow connecting to functors with a receiver objectDario Freddi2013-09-161-26/+26
| | | | | | | | | | | | | | | | | | | | | | | Up to now, it was only possible to connect to functors in a direct way, without being capable of using Qt::ConnectionType. This patch allows for specifying a receiver for Functors and function pointers, hence making it possible to specify effectively the connection type. To do this properly, it was needed to add an enum in FunctionPointer representing whether the considered function is a member function or not, to reduce ambiguity upon overloaded calls. Moreover, now senders are checked for the existence of a slot obj as well. This way, should the context be freed, the slot obj and the functor contained in it will be freed as well. On a side note, connecting to a static slot (like QCoreApplication::quit) specifying the receiver object is now compiling. Change-Id: I46474099413b1dc6ca4db9934191d469baeef070 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Rename template parameter: "I" -> "II"Sze Howe Koh2013-08-181-9/+9
| | | | | | | | | | C99 defines the "I" macro in complex.h. qobjectdefs_impl.h can be indirectly included in user code, which raises the possibility of a name clash if the user's compiler supports C99 and the user includes complex.h Change-Id: Ie79ec7baf2d49a34b66a01556c7e57324303dc04 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Support connection to functor with multiple operator()Olivier Goffart2013-03-191-1/+35
| | | | | | | | | | | | | When variadic templates and decltype are supported, detect the best overload of operator() to call. Currently, the code takes the type of the operator(), which requires that the functor only has one, and that it has no template parameter. This feature is required if we want to connect to c++1y generic lambda (N3418) Change-Id: Ifa957da6955ea39ab804b58f320da9f98ff47d63 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Mark QtPrivate::ApplyReturnType constructor as explicit.Olivier Goffart2013-03-191-1/+1
| | | | | | | | | Else, the operator,(T, ApplyReturnType<void>) is sometimes chosen if a pointer is passed, and that is breaking some decltype expressions. (such as the one in ComputeFunctorArgumentCount in the next patch) Change-Id: Ic203bbb1a8f5abbebb3b11786454807aa20be5fd Reviewed-by: Thiago Macieira <thiago.macieira@intel.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>
* | Mark all qtbase headers that aren't cleanThiago Macieira2013-03-031-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QtCore has a few headers that, though public, aren't meant to be included directly. Those are the atomic headers, the three _impl.h headers and qt_windows.h. QtGui includes two OpenGL headers that don't compile on their own. Other libraries should not have headers like that (but they do, something we need to fix eventually). Change-Id: I55e4eb057748f47df927ee618f9409acbc189cc1 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.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>
* Fix connecting to a functor with 3 argumentsOlivier Goffart2012-11-301-1/+1
| | | | | | | Task-number: QTBUG-28285 Change-Id: I07bd870c093482035728aa783d0ecbc8aa8670d2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix connection to const slots (or from const signals)Olivier Goffart2012-11-061-0/+121
| | | | | | | | Pointer to const member function have a different signature, and hence need their own traits code. Change-Id: Ie4b2434a412f412444fb07ef1388a37cab105ecd Reviewed-by: Stephen Kelly <stephen.kelly@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>
* Split qobject_impl.h into qobjectdefs_impl.hKent Hansen2012-04-251-0/+485
This is done to make QtPrivate::FunctionPointer available to the QMetaMethod declaration in qmetaobject.h (which already included qobjectdefs.h, since that's where QMetaObject is declared), so that the new template-based QMetaMethod::fromSignal() function may be implemented. The logic for statically generating the array of qMetaTypeId (used by the template-based QObject::connect()) remains in qobject_impl.h, since it's not needed for QMetaMethod::fromSignal(). Moreover, moving that code would introduce a circular dependency, since qmetatype.h as of commit 194674044693d6b101c3dc2f4784718540d343a4 now includes qobjectdefs.h. Change-Id: I36c35041e0c6661c3cf523684177a0b6c19e2d35 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>