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. Meaning of eventFilter return value

Meaning of eventFilter return value

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 1.4k 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.
  • I Offline
    I Offline
    IknowQT
    wrote on last edited by
    #1

    43c474c2-924c-4caa-86b5-bae4cefe4871-image.png

    If the return value of eventFilter is set to true, the scroll bar turns black.
    If you set it to false, it comes out normally.
    What is the difference between the return values?

    jsulmJ 1 Reply Last reply
    0
    • I IknowQT

      43c474c2-924c-4caa-86b5-bae4cefe4871-image.png

      If the return value of eventFilter is set to true, the scroll bar turns black.
      If you set it to false, it comes out normally.
      What is the difference between the return values?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @IknowQT It's explained in the documentation: https://doc.qt.io/qt-5/qobject.html#installEventFilter
      "The eventFilter() function must return true if the event should be filtered, (i.e. stopped); otherwise it must return false."
      So, if you return true it means the event is droped and the object (on which you set the event filter) will not handle it.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      3

      • Login

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