Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Check if QWidget is currently in visible display area

Check if QWidget is currently in visible display area

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 2 Posters 898 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.
  • P Offline
    P Offline
    peter-70
    wrote on last edited by
    #1
    This post is deleted!
    1 Reply Last reply
    1
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You can use visualRect for that task.

      Out of curiosity, why do you need that ?

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

      P 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        You can use visualRect for that task.

        Out of curiosity, why do you need that ?

        P Offline
        P Offline
        peter-70
        wrote on last edited by
        #3

        @SGaist

        When I'm loading the items into my list, I have first the following behavior:
        0_1551427641943_IMG_FC3A3195E04F-1.jpeg

        The items are inside the displaying area at the loading items time, are correct drawn. But the items are not in the displaying area at the loading items time, are not drawn, as you can see. They are white, with thin gray top-border only.

        When I "open" one of the items in a new QMainWindow, and then I close it again, so I see the list again, ALL the items are drawn correct.

        I have a paint method for each item

        void PositionGroupbox::paintEvent(QPaintEvent*)
        {
            QStyleOption opt;
            opt.init(this);
            QPainter p(this);
            style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
        }
        

        Maybe this ist the reason, for the defective draw-behavior. Therefor I want to watch, when the Item comes into the visible display-area, I could tray to draw it again.

        It is a little complicated, sorry for that

        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