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] global eventfilter?! is it possible?

[Solved] global eventfilter?! is it possible?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 5.0k 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.
  • G Offline
    G Offline
    gandiii
    wrote on last edited by
    #1

    Hello,

    I have some pages (QWidgets) and a user system.
    I want to reset the userlevel after a timespan without any mouse events.
    But how can I do that? Do I have to make an eventfilter in every widget
    or is there a better way?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      You could install an event filter on the QApplication object instead. Note that this will only catch events for your application. If the user is working with another application in the meantime, this method will not catch that.

      1 Reply Last reply
      0
      • G Offline
        G Offline
        gandiii
        wrote on last edited by
        #3

        thank you for your help, it's working now.
        But could this be a performance leak? i catch every
        event and only if it's a mousepressevent, I do something,
        otherwise I send it back with return QObject::eventFilter(object,event);

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          Without seeing your code, I cannot say for sure if you're leaking memory, but I don't think so. Note that you should probably not really handle any event you receive. You only want to know about the events, but you don't want to process them.

          1 Reply Last reply
          0
          • G Offline
            G Offline
            gandiii
            wrote on last edited by
            #5

            thx

            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