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. Say to Qt to never erase a specified widget background

Say to Qt to never erase a specified widget background

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 2.8k Views
  • 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.
  • K Offline
    K Offline
    kinju
    wrote on 19 Oct 2011, 14:06 last edited by
    #1

    Hi all,

    I have a desktop application which have a widget where the handle (p->winId()) is passed to a graphic library in order to draw the content.

    As this widget is the central widget of my main window, when I resize the window, the widget is also resized.

    My problem is that Qt erase the background of the widget.

    • When the widget is resized to a greater size, there is some flickering because Qt erase the background before I receive a WM_PAINT event
    • When the size is smaller, I receive the WM_PAINT event, I draw the content and then, I don't know why, Qt erase it :(

    Can you tel me what can I do ?
    King Regards,
    Kin

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on 19 Oct 2011, 14:29 last edited by
      #2

      You can set the "autoFillBackground":http://doc.qt.nokia.com/4.7/qwidget.html#autoFillBackground-prop property of QWidget to false.

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kinju
        wrote on 19 Oct 2011, 16:57 last edited by
        #3

        It does the same.. :(

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kinju
          wrote on 19 Oct 2011, 17:00 last edited by
          #4

          The only difference is that I only receive the 0X85 - WM_NCPAINT (only when the size is enlarged) but nothing when I reduce it, and the backgroung is still cleared at any resize :'(

          1 Reply Last reply
          0
          • G Offline
            G Offline
            giesbert
            wrote on 19 Oct 2011, 19:03 last edited by
            #5

            Have you combined it with attribute: opaquePaintEvent etc?
            Perhaps you have to disable double buffering for the widget etc...

            Nokia Certified Qt Specialist.
            Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

            1 Reply Last reply
            0

            5/5

            19 Oct 2011, 19:03

            • Login

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