Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Connecting with QSignalMapper
Qt 6.11 is out! See what's new in the release blog

Connecting with QSignalMapper

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 2 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mulfycrowh
    wrote on last edited by
    #1

    Hi,

    Why does the following expression not compile ?

    connect(ui.Generate, &QPushButton::clicked, signalMapper, &QSignalMapper::map);
    

    The error is about map. I didn't find any example with the new syntax.
    Is it overloaded ?
    Thank you for help

    1 Reply Last reply
    0
    • kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by
      #2

      It is indeed overloaded.

      Read and abide by the Qt Code of Conduct

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mulfycrowh
        wrote on last edited by
        #3

        So how should I write it ?

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mulfycrowh
          wrote on last edited by
          #4
          	connect(ui.Generate, &QPushButton::clicked, signalMapper, static_cast<void(QSignalMapper::*)()>(&QSignalMapper::map));
          

          Is it OK ?

          kshegunovK 1 Reply Last reply
          0
          • M mulfycrowh
            	connect(ui.Generate, &QPushButton::clicked, signalMapper, static_cast<void(QSignalMapper::*)()>(&QSignalMapper::map));
            

            Is it OK ?

            kshegunovK Offline
            kshegunovK Offline
            kshegunov
            Moderators
            wrote on last edited by
            #5

            @mulfycrowh
            Yes, looks correct.

            Read and abide by the Qt Code of Conduct

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mulfycrowh
              wrote on last edited by
              #6

              Thank you

              kshegunovK 1 Reply Last reply
              0
              • M mulfycrowh

                Thank you

                kshegunovK Offline
                kshegunovK Offline
                kshegunov
                Moderators
                wrote on last edited by
                #7

                @mulfycrowh
                You're welcome.

                Read and abide by the Qt Code of Conduct

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved