Say to Qt to never erase a specified widget background
-
wrote on 19 Oct 2011, 14:06 last edited by
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 -
wrote on 19 Oct 2011, 14:29 last edited by
You can set the "autoFillBackground":http://doc.qt.nokia.com/4.7/qwidget.html#autoFillBackground-prop property of QWidget to false.
-
wrote on 19 Oct 2011, 16:57 last edited by
It does the same.. :(
-
wrote on 19 Oct 2011, 17:00 last edited by
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 :'(
-
wrote on 19 Oct 2011, 19:03 last edited by
Have you combined it with attribute: opaquePaintEvent etc?
Perhaps you have to disable double buffering for the widget etc...
1/5