Important: Please read the Qt Code of Conduct -

State of QSignalMapper

  • Hi all,

    while investigating the possibility to enhance QSignalMapper with support for QVariant mapping, I came across this ticket:

    Unfortunately, I cannot quite concur with the conclusion that QSignalMapper has become useless with the introduction of lambdas. There are still scenarios - for example when working with plugins - where one doesn't have access to the class method address --and thus needs to rely on the const char* notation derived from the SIGNAL() macro, rendering the connect() signature using a lambda unavailable.
    Additionally, although I'm a big fan of lambdas myself, I expect that some teams doing cross-platform development may be reluctant to adopt to C++11 usage for some time.
    Having said that, I'd be willing to create a patch and pull request for QSignalMapper to support QVariant, but that wouldn't make sense if you decide to deprecate it, in which case I'd do the mapping locally.

    All the best

  • Lifetime Qt Champion


    I think you have a valid point. If you have a solution for that feature request, you should go ahead and make the patch (start by Qt 5 then cherry-pick for Qt 4).

    Nobody said QSignalMapper will be deprecated

    Happy coding !

Log in to reply