[Qt-interest] Fwd: Works in 4.53, but not 4.6.

Freak . mentalcodes at gmail.com
Thu Dec 31 03:35:28 CET 2009


On Tue, Dec 29, 2009 at 2:40 AM, Trond Kjernaasen <trond at trolltech.com>wrote:

> Hi Scott,
>
> Hi Trond,
>
>
> There are two things you need to do/take care of, in order to get your D3D
>> drawing to work:
>>
>
> 2) You *have* to reimplement QWidget::paintEngine() in your iD3D9 class
> (note that it's a const function) and have it return 0. Otherwise the
> WA_PaintOnScreen attribute won't have any effect. This is actually
> documented in the Widget Attributes section.
>

Thanks, I had read that however i didn't seem make any difference 4.53 so
removed it again, (doh) i guess in 4.53 the -direct3d switch did this for
me.  But thankyou very much as this has solved the issue.

I added the following to my previous DX9 code above, for any other people
who may need to come across this post in the future.

//"iD3D9.h"

QPaintEngine* paintEngine() const;

And also added this to

//"iD3D9.cpp

QPaintEngine* iD3D9::paintEngine() const
{
    return 0;
}

I will note that i also had to add
"setAttribute(Qt::WA_PaintOnScreen,true);" to stop the double buffering as
well, and i now get my green screen as opposed to grey screen yet again.
Thankyou.

>
> In addition, be aware that when Qt reparents native widgets, their winId()
> changes. That means, if you move a widget from one parent into another, your
> D3D drawing will most likely stop working unless you set it up again with
> the new window id.
>
> Regards,
> --
> Trond K.
>

Thanks i will keep this in mind for the future, thank you again and much
appreciate the reply, On to my next issue of sorting an unsortable "side by
side configuration error" with Qt/MSVC.

Regards,
Scott.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091231/4426d7e6/attachment.html 


More information about the Qt-interest-old mailing list