Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Don't clear QWidget on paintEvent.
Forum Updated to NodeBB v4.3 + New Features

Don't clear QWidget on paintEvent.

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 5.1k Views 1 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.
  • G Offline
    G Offline
    goocreations
    wrote on last edited by
    #1

    I want paintEvent of a QWidget to paint some QPixmaps onto the widget. I then update() the widget from a seperate thread. However each time I do this, the old drawn picture is automatically removed. In the API documentation I found the following under the QWidget update() slot:

    bq. Qt normally erases the widget's area before the paintEvent() call.

    It seems weird that it is only "normally" updates.

    Anyway, is there anyway I can block the QWidget to clear before the paintEvent? I want to draw a couple of pictures next to each other.

    Thanks

    1 Reply Last reply
    0
    • P Offline
      P Offline
      p-himik
      wrote on last edited by
      #2

      Did you read about "Qt::WA_OpaquePaintEvent":http://developer.qt.nokia.com/doc/qt-4.8/qt.html#WidgetAttribute-enum ?

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goocreations
        wrote on last edited by
        #3

        Thanks, that worked

        1 Reply Last reply
        0

        • Login

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