Results 1 to 6 of 6

Thread: problem painting

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2009
    Posts
    81
    Platforms
    MacOS X Windows

    Default problem painting

    within an MDI I have subwindows as QScrollArea with a QWidget scrollAreaWidgetContents inside


    Qt Code:
    1. childScrollArea::childScrollArea(QWidget *parent) :
    2. QScrollArea(parent),
    3. m_ui(new Ui::childScrollArea)
    4. {
    5.  
    6. scrollAreaWidgetContents = new QWidget();
    7. childScrollArea->setWidget(scrollAreaWidgetContents);
    8.  
    9. scrollAreaWidgetContents->show();
    10.  
    11. }
    12.  
    13.  
    14. void childScrollArea::paintEvent(QPaintEvent * /* event */)
    15. {
    16. QPainter painter(this);
    17.  
    18. painter.fillRect(QRect(0, 0, 300, 300), Qt::blue );
    19. }
    To copy to clipboard, switch view to plain text mode 


    unfortunately the paint event in this case does not do any painting in the window!

    what do i do wrong?

    Thanks for any hint
    Last edited by wysota; 12th August 2009 at 19:58. Reason: missing [code] tags

Similar Threads

  1. Painting problem
    By ScoOteR in forum Qt Programming
    Replies: 5
    Last Post: 11th March 2007, 11:03
  2. Painting Problem on Mac
    By shyam prasad in forum Qt Programming
    Replies: 1
    Last Post: 2nd February 2007, 08:58
  3. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  4. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.