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
Forum Updated to NodeBB v4.3 + New Features

Check if QWidget is currently in visible display area

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 2 Posters 903 Views 2 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.
  • P Offline
    P Offline
    peter-70
    wrote on 28 Feb 2019, 16:06 last edited by
    #1
    This post is deleted!
    1 Reply Last reply
    1
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 28 Feb 2019, 20:13 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 Mar 2019, 08:15
      1
      • S SGaist
        28 Feb 2019, 20:13

        Hi,

        You can use visualRect for that task.

        Out of curiosity, why do you need that ?

        P Offline
        P Offline
        peter-70
        wrote on 1 Mar 2019, 08:15 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

        1/3

        28 Feb 2019, 16:06

        • Login

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