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 install multiple event filter on qApp??
QtWS25 Last Chance

How to install multiple event filter on qApp??

Scheduled Pinned Locked Moved General and Desktop
eventeventfilterinstalleventfilremoveeventfilt
6 Posts 2 Posters 4.7k 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.
  • S Offline
    S Offline
    Sidii
    wrote on last edited by
    #1

    Hi All,
    Is there any possibility of installing multiple event filters on qApp? I want to read one file and based on the contents i have to make the keys disable, when new window is opened then another file is read and based on that new keys are added/removed in the list that needs to be blocked. When i dispose a window then i should delete/uninstall the specific event filter.

    Is it possible in QT? Or any other mechanism i have to follow? Kindly give me some pointers how to proceed.

    Cheers!!

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

      Hi,

      Shouldn't you rather crate a configurable filter object ?

      Should the filter only work for certain widget at certain time or globally ?

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

      S 2 Replies Last reply
      0
      • SGaistS SGaist

        Hi,

        Shouldn't you rather crate a configurable filter object ?

        Should the filter only work for certain widget at certain time or globally ?

        S Offline
        S Offline
        Sidii
        wrote on last edited by
        #3

        @SGaist Thanks for your reply. The filter should be a global filter. If at one time one filter is present and then another filter is applied then the overall it is viewed as a union of the both filters and again when the latest filter is removed then i have to revert back to old filter. Filter is nothing but just filtering of key and mouse events based on QRect.

        Can you please send me some links on configurable filter object. I was unable to find in QT help. How to install more than one event filter to qApp??

        Thanks :)

        1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          Shouldn't you rather crate a configurable filter object ?

          Should the filter only work for certain widget at certain time or globally ?

          S Offline
          S Offline
          Sidii
          wrote on last edited by
          #4

          @SGaist Is it possible to modify the event filter at run time? Or i need to remove the event filter and install it again?

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

            Your event filter is nothing more than a standard QObject where you reimplement the eventFilter method. From there it's up to you to make it configurable the way you want it to be

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

            S 1 Reply Last reply
            0
            • SGaistS SGaist

              Your event filter is nothing more than a standard QObject where you reimplement the eventFilter method. From there it's up to you to make it configurable the way you want it to be

              S Offline
              S Offline
              Sidii
              wrote on last edited by
              #6

              @SGaist I got it. Thanks for the reply. Cheers

              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