On Friday October 12 2012, Olivier Goffart wrote: > On Friday 12 October 2012 10:26:04 Olivier Goffart wrote: > > On Thursday 11 October 2012 23:06:18 Thiago Macieira wrote: > > > On sexta-feira, 12 de outubro de 2012 07.27.51, Marc Mutz wrote: > > > > Hi, > > > > > > > > I was wondering whether we should stop using the pattern of declaring > > > > _q_privateSlots() in favour of connecting to functors or functions > > > > directly. > > > > > > Makes sense, except that it's of inconvenient use: > > > - lambdas: can't use in Qt code > > > - functors: inconvenient (need to be out of the class) > > > - static member or free functions: will not have access to the target > > > > > > object - private member functions: disallowed by Qt coding guidelines > > > > That is indeed a problem: it is not possible to connect to member > > function of a QObjectPrivate, only QObject. > > > > One could add an overload (or even a QObjectPrivate::connect) that > > connect to a QObjectPrivate function. > > > > From the implementation point of view it is just a matter of adding a > > QPrivateSlotObject inhartiting from QSlotBase. > > Implemented here: > https://codereview.qt-project.org/37012
I've run some different implementations against each other, and posted the results there. I've also pushed a cleaned-up version of the patch I posted here: https://codereview.qt-project.org/37057 if the code's already there, let's use it. By storing the control and not the d-pointer in the functor, I could even reduce the text size. Thanks, Marc -- Marc Mutz <[email protected]> | Senior Software Engineer KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company www.kdab.com || Germany +49-30-521325470 || Sweden (HQ) +46-563-540090 KDAB - Qt Experts - Platform-Independent Software Solutions _______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
