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. [SOLVED] QSignalMapper - How to identify many signals from same widget

[SOLVED] QSignalMapper - How to identify many signals from same widget

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 989 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.
  • P Offline
    P Offline
    perez.sgo
    wrote on last edited by
    #1

    Hi,

    I'm using QSignalMapper to connect many signals from different widgets to one unique widget, as posted "here":http://qt-project.org/forums/viewthread/40408/.

    Now I'm trying to handle differents signals from the same Custom Widget, but cannot identify which of them has been activated, cause I always get the same int identifier. The only near approach I have tried, is to manage the signals direct from the sub widgets into the Custom Widget, but that implies to make them Public, and I don't think is appropriate (maybe it is?).

    So, is QSignalMapper the right approach in this situation?. Have not found info about it in the posts or docs, have I missed something?.

    Regards,

    Santiago

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Not it's not really the right approach, the idea behing QSignalMapper is to map the same signal for different (but generally of the same type) widgets on a given slot.

      You should rather use a separate mapper (and thus a different slot) for each signal you want to map

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • P Offline
        P Offline
        perez.sgo
        wrote on last edited by
        #3

        Thanks SGaist. Have tried this approach, works fine and looks better.

        Regards!

        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