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. How to set a Slot receiving every Widget action
QtWS25 Last Chance

How to set a Slot receiving every Widget action

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 4 Posters 2.1k Views
  • 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.
  • alsaA Offline
    alsaA Offline
    alsa
    wrote on last edited by
    #1

    I'm trying to arrange a slot able to "capture" every event happened related to pressed pushbuttons and Qmouse events on my widgets.
    For QMouse events I solved, since all MousePressEvent are captured from the same function; what I'm looking for is how to "capture" every buttons whatever it is.
    It seems to be QCoreApplication::notify a good way to make it, but I don't know how to set it.
    Any suggestion?

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

      Hi,

      What about keyPressEvent ?

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

      alsaA 1 Reply Last reply
      0
      • sneubertS Offline
        sneubertS Offline
        sneubert
        wrote on last edited by
        #3

        This won´t answer your question but what about subclass QWidgetand reimplement virtual bool event(QEvent * event)

        1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          What about keyPressEvent ?

          alsaA Offline
          alsaA Offline
          alsa
          wrote on last edited by
          #4

          @SGaist
          KeyPressEvent is for keyboard only OR for QPushButtons too?

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

            keyPressEvent reacts to keyboard related events. QPushButton doesn't generate any key event (it receives them though)

            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
            • alsaA Offline
              alsaA Offline
              alsa
              wrote on last edited by
              #6

              Is there an common event generated from QPushbuttons, QDials, QSliders,etc...?

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

                What kind of event are you interested in ?

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

                alsaA 1 Reply Last reply
                0
                • SGaistS SGaist

                  What kind of event are you interested in ?

                  alsaA Offline
                  alsaA Offline
                  alsa
                  wrote on last edited by
                  #8

                  @SGaist
                  I've to detect every pressed Pushbuttons, Qdial actions, QSliders and Qmouseevent (this last already done), in order to do "something" when one of the cited elements act. My app is intended for the use in an embedded system connected to a touchscreen LCD display. When the user touches LCD OR press any Button, I've to activate a slot. My problem is I don't know what kind of signal common to all my widgets (if exists) , can be used.

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

                    There's no common signal/event to every widget. You have to implement that tracking yourself.

                    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
                    • Hamed.MasafiH Offline
                      Hamed.MasafiH Offline
                      Hamed.Masafi
                      wrote on last edited by
                      #10
                      target->installEventFilter(this);
                      

                      Remote object sharing (OO RPC)
                      http://forum.qt.io/topic/60680/remote-object-sharing-oo-rpc-solved

                      Advanced, Powerful and easy to use ORM for Qt5
                      https://forum.qt.io/topic/67417/advanced-powerful-and-easy-to-use-orm-for-qt5

                      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