Results 1 to 3 of 3

Thread: Problem with QListWidget and paintEvent()

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2009
    Posts
    1
    Thanked 3 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem with QListWidget and paintEvent()

    You should give viewport to QPainter.

    Qt Code:
    1. QPainter painter(this->viewport());
    To copy to clipboard, switch view to plain text mode 

    See Qt docs:

    void QAbstractScrollArea:: paintEvent ( QPaintEvent * event ) [virtual protected]

    This event handler can be reimplemented in a subclass to receive paint events (passed in event), for the viewport() widget.

    Note: If you open a painter, make sure to open it on the viewport().

  2. The following 3 users say thank you to birchbay for this useful post:

    canislupax (14th November 2010), joksi (29th May 2009), San_Cou (6th February 2013)

  3. #2
    Join Date
    May 2009
    Location
    Tampere Finland
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Thumbs up Re: Problem with QListWidget and paintEvent()

    Thanks birchbay, this solved my problem!

Tags for this Thread

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.