[Qt-interest] Idea: QSignalMapper with std::function (esp. for C++0x lambdas)

Thiago Macieira thiago at kde.org
Fri Feb 19 12:59:39 CET 2010


Em Sexta-feira 19 Fevereiro 2010, às 08:59:57, Ville M. Vainio escreveu:
> Anyone done a version of QSignalMapper that supports std::function
> mapping, instead of the more pedestrian int, string, QWidget mapping?

Yes. I've implemented a solution for that, but it requires C++0x. I will not 
provide a C++98/03 equivalent because it's just too much code.

However, this is not yet in Qt (not even 4.7). It's only my research stuff.

> While waiting for C++0x to set things right, you can use boost::lambda.

As long as we can use it without using boost.

> Not having closures is one of the things still bothering me greatly
> about C++, since this problem is gradually disappearing Qt stands to
> benefit from it. Obviously, in the meantime people who have the luxury
> to use modern C++ compilers can copy the QSignalMapper implementation
> and create a new class with this feature, unless there is a logical
> flaw I'm not seeing...

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100219/6224b5ed/attachment.bin 


More information about the Qt-interest-old mailing list