[Development] QtCS - QObject discussion

Olivier Goffart olivier at woboq.com
Fri Jul 26 23:48:47 CEST 2013

This is a summary of what's written there:

- As it was decided in the QtCore discussion, new features may require C++11

- We want to add an overload of QObject::connect that takes both a pointer to 
a "receiver" and a simple functor (as opposed to a pointer to member function)
Use case is to have automatic disconnection of connections to lambda 
functions, and also be able to use thread affinity and QueuedConnection.
Dario Freddi said he will have a look.

- We discussed ways to extent the QTimer::singleShot or such function that 
take a slot as a char*.   One could either implement a QSlot<> class:
  void QTimer::singleShot(int timeout, QSlot<void()> slot);
Or, alternatively, we add two templates overload, with some helper code in the 
QtPrivate  namespace  to make the implementation easy.

- We talked about QMetaObject::invokeMethod.   t would be nice to add:
   void QMetaObject::queuedInvoke(QObject, Ret(T::*)(Args…), Args…)
   Ret QMetaObject::blockingQueuedInvoke(QObject, Ret(T::*)(Args…), Args…)

- Support in moc for templated QObject: We need to investigate what are the 
use cases to see what kind of features we want to support or not. (Not to open 
too many cans of worms)


Woboq - Qt services and support - http://woboq.com - http://code.woboq.org

More information about the Development mailing list