[Qt-interest] Qt, DirectX and MultiThreading

Clinton Stimpson clinton at elemtech.com
Fri Apr 16 16:34:50 CEST 2010


On 04/16/2010 08:27 AM, Ender EREL wrote:
> Clinton Stimpson wrote:
>    
>> You should fix the flickering by doing this:
>> setAttribute(Qt::WA_NoBackground);
>> instead of working around it.
>>
>> Clint
>>      
> Qt::WA_NoBackground is obsolete, docs recommend to use
> Qt::WA_OpaquePaintEvent. When i set this flag, the flickering color
> changes from gray(system background) to black.
>
> Currently the flags i am setting are:
> Qt::WA_DontCreateNativeAncestors
> Qt::WA_NativeWindow
> Qt::WA_OpaquePaintEvent
> Qt::WA_PaintOnScreen	// Has no effect on windows, but still...
> Qt::WA_NoSystemBackground
>
> I also tried many combinations of these flags but flickering never goes
> away.
>    

Oh, forgot one more thing, try overloading QWidget::paintEngine() to 
return NULL.
Then Qt will leave the QWidget alone and not do its own double buffering 
on it (which is where the flicker comes from).
Then, if you ever need to use a QPainter on that QWidget, you can use a 
paint engine that works with direct x.

Clint




More information about the Qt-interest-old mailing list