July 4, 2011

x4rkz x4rkz
Lab Rat
5 posts

Display problem

 

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:

  1. canvas->setAttribute(Qt::WA_PaintOnScreen);
  2. 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.

5 replies

July 4, 2011

Bradley Bradley
Lab Rat
314 posts

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:

  1. setAttribute(Qt::WA_NativeWindow);

 Signature 

Nokia Certified Qt Specialist.

July 4, 2011

x4rkz x4rkz
Lab Rat
5 posts

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.

July 5, 2011

x4rkz x4rkz
Lab Rat
5 posts

Does anyone has an idea about this subject ? Maybe why Bradley’s solution doesnt work or have an other one ?

July 11, 2011

x4rkz x4rkz
Lab Rat
5 posts

nobody knows ?

July 22, 2011

x4rkz x4rkz
Lab Rat
5 posts

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).

 
  ‹‹ Falling Objects help      [SOLVED]text output ››

You must log in to post a reply. Not a member yet? Register here!