Display problem
-
wrote on 4 Jul 2011, 17:57 last edited by
Hello,
I'm developping a game with Qt + Sfml, and I encountered a problem conerning the display, the screen flashes when these attributs are not setted:
@
canvas->setAttribute(Qt::WA_PaintOnScreen);
canvas->setAttribute(Qt::WA_OpaquePaintEvent);@But when I set them, there'se no problem conerning the blink.
When I display a window in the middle of the sfml widget, there's no problem, but when I hide it and show an other, I see the new window opened with the old window in background, it's like these attributes dont clear the background when a window is hidden.
I don't know how to solve this problem, could you help me ?
Thanks for my english.
-
wrote on 4 Jul 2011, 19:06 last edited by
Only top-level Qt widgets have an associated native window. Child widgets don't draw a background because they assume their top-level parent widget will do so. For those widgets to be shown over a sfml widget, try forcing them to have a native window using:
@
setAttribute(Qt::WA_NativeWindow);
@ -
wrote on 4 Jul 2011, 20:54 last edited by
A variable menuGame contain the canvas (sfml screen) and others widgets that are displaying above the canvas, I set this attribute to the global widget menuGame and the child widget both before and after but it doesnt change nothing.
By the way thanks for your fast answer.
-
wrote on 5 Jul 2011, 20:12 last edited by
Does anyone has an idea about this subject ? Maybe why Bradley's solution doesnt work or have an other one ?
-
wrote on 11 Jul 2011, 16:32 last edited by
nobody knows ?
-
wrote on 22 Jul 2011, 16:11 last edited by
I doesn't know if anyone already had the same problem, or if the major part of you didn't get the point, or if it's because nobody had this problem and can't solve it.
I feel quiet alone here x).