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 determine whether a Widget is really visible? (in a scroll area)
Forum Updated to NodeBB v4.3 + New Features

How to determine whether a Widget is really visible? (in a scroll area)

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 4.4k 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.
  • V Offline
    V Offline
    viktor.benei
    wrote on last edited by
    #1

    I need to be able to determine whether a given QWidget is really visible or not - required for some lazy loading in a QScrollArea.

    The Show and Polish(Request) events are called even if the widget is not visible.

    To be more specific: I would like to test whether the widget will be paint-ed or not. Is this information available somehow? The paintEvent() of the widget is not called, so I guess Qt knows it internally that the widget won't be visible.

    1 Reply Last reply
    1
    • V Offline
      V Offline
      viktor.benei
      wrote on last edited by
      #2

      Additional information:
      calling the widget's visibleRegion() gives correct information - but where should I test it? I don't want to test with a timer, I would like to get an event about it or test it when a related event occurs.

      Is there any related event (occurs when the widget is moved into / moved out from the visible area)?

      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