Results 1 to 12 of 12

Thread: How do I find out which widgets/canvas items are visible?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How do I find out which widgets/canvas items are visible?

    Quote Originally Posted by Tommytrojan
    I call QCanvasItem.update(). Well, it is a subclass where I implement the drawing of the item. Whenever a data even occurs in my system I have to go through a lengthy formatting procedure and prepare the output, then I call update() to get the data rendered.
    QCanvasItem::update() only marks canvas chunks as modified. IMO it shouldn't trigger any repainting (the docs say something different, so I might have missed something when I was reading the sources).

    BTW. You can try tuning the QCanvas chunk size. Also make sure that your item reports proper bounding rectangle.

  2. #2
    Join Date
    Jan 2006
    Location
    Bend, Oregon
    Posts
    27
    Qt products
    Qt3
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How do I find out which widgets/canvas items are visible?

    Quote Originally Posted by jacek
    QCanvasItem::update() only marks canvas chunks as modified. IMO it shouldn't trigger any repainting (the docs say something different, so I might have missed something when I was reading the sources).

    BTW. You can try tuning the QCanvas chunk size. Also make sure that your item reports proper bounding rectangle.
    Well, the item gets updated properly, so I assume that the bounding rectangle and everything else is okay. The problem is that it does get updated every time! I would like it to invoke my draw() function only when it actually is visible. However, I calls my draw() function even when it is obscured...

    T

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How do I find out which widgets/canvas items are visible?

    Quote Originally Posted by Tommytrojan
    Well, the item gets updated properly, so I assume that the bounding rectangle and everything else is okay.
    Yes, but the bigger bounding rectangle is, the more likely update is to occur.

    Quote Originally Posted by Tommytrojan
    The problem is that it does get updated every time! [...]However, I calls my draw() function even when it is obscured...
    It looks like Qt doesn't know that a part of a window is hidden under another one.

    In case somebody wants to research this subject further, I've attached a little program I wrote to test few ideas.
    Attached Files Attached Files

Similar Threads

  1. problems installing Qt opensource with msvc2008 support
    By odin1985 in forum Installation and Deployment
    Replies: 6
    Last Post: 24th May 2008, 09:06
  2. Get Visible Items from the QListWidget
    By srj in forum Qt Programming
    Replies: 4
    Last Post: 22nd November 2006, 20:13
  3. Replies: 3
    Last Post: 10th April 2006, 19:04

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.