Results 1 to 4 of 4

Thread: repaint help pls

  1. #1
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default repaint help pls

    Hi,

    I have subclassed QScrollView and have reimplemented drawContents. The problem is when my window is not the focused one and when someone moves some other window on my window the repaint is not happening. Which method should I reimplement to solve this problem?

    Thanks a lot.

  2. #2
    Join Date
    Jan 2006
    Location
    Alingsås, Sweden
    Posts
    437
    Thanks
    3
    Thanked 39 Times in 39 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: repaint help pls

    What version of Qt are you using?
    Do you get paint events?
    If you're using Qt 4, do you draw somewhere outside drawContents?

    My recommendation is to create a widget that lays inside the scroll view - in that way you avoid one extra layer of complexity. See http://qt4.digitalfanatics.org/articles/zoomer.html for my example.

  3. #3
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: repaint help pls

    Quote Originally Posted by e8johan
    What version of Qt are you using?
    I am using Qt 3.3.6.

    Quote Originally Posted by e8johan
    Do you get paint events?
    yes I do. I have reimplemented the paintEvent in the following way.

    Qt Code:
    1. void Paper::paintEvent(QPaintEvent *e)
    2. {
    3. QScrollView::paintEvent(e);
    4. updateContents();
    5. }
    To copy to clipboard, switch view to plain text mode 

    Please Help
    Thanks a lot.

  4. #4
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: repaint help pls

    Can some one please help me on this ?

    Thanks a lot.

Similar Threads

  1. repaint a cell or row in QTableWidget
    By alphaqt in forum Newbie
    Replies: 6
    Last Post: 26th June 2012, 11:21
  2. QTreeView repaint
    By graeme in forum Qt Programming
    Replies: 17
    Last Post: 13th March 2012, 13:27
  3. force repaint
    By georgie in forum Qt Programming
    Replies: 3
    Last Post: 22nd May 2006, 13:16
  4. menu repaint
    By georgie in forum Qt Programming
    Replies: 2
    Last Post: 16th May 2006, 05:40
  5. Replies: 7
    Last Post: 20th March 2006, 20:03

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.