Thanks Lukas, changes now look OK, and are merged and submitted to svn/trunk.

On Mon, Oct 27, 2008 at 8:55 PM, Lukas Diduch <[EMAIL PROTECTED]> wrote:
> Hi Robert,
>
> still no clue what causes the bad window but most probably this is due
> to the sequence of windowing toolkit initialization between qt,osg and
> x11, so looking at GraphicsWindowX11 might be a good idea.
>
> Please ignore the header definition message from my last email, i've
> mistook different file versions. The file was actually ok.
>
> I have updated QOSGWindow due to your recommendations. Playing around
> with it i've found some bugs so changed the widget which contains the
> timer doing calls to CompositeViewer::frame () too.
>
> Unfortunately the mod does not behave as stable as my personal
> applications in terms of number of independent widgets and resizing. The
> reason for this is the workaround due to the timer, which is best
> implemented standalone if using osg's CompositeViewer (no subclassing
> with QWidget) like in the mod. I had bad performance using subclassing
> in this case since we need to use qt's window inheritance. Maybe someone
> can find a better solution to this...
>
> I could see however you guys did quite a job working around to avoid
> usage of the moc (because of cmake ?, usually qmake would call it for
> you).
>
> Please note that if any subclasses of QObject want to implement custom
> slots, which are not built using the moc, the user will get a runtime
> error that slots are not present..  something like this:
>
> Object::connect: No such slot QWidget::update()
>
> In order to use these, the Q_OBJECT macro must be used at the beginning
> of the class declaration.  Doing this, but compiling without moc
> however, will lead to another error message looking something like this:
>
> QOSGWidget.cpp:(.text+0x2028): undefined reference to `vtable for
> QViewerTimer'
>
> I just wanted to mention this because i know (my private apps work quite
> fine) that there is way more performance and stability potential in
> using osg with qt. Unfortunately this cannot be implemented in the
> current example. Maybe you guys can fix this issue by finding a way to
> call the moc from within cmake and implement signals and slots the
> recommended 'QT way'.
>
> I've attached the new version.
>
> Best regards,
> Lukas
>
> On Mon, Oct 27, 2008 at 11:30:24AM +0000, Robert Osfield wrote:
>> Hi Lukas,
>>
>> I have do a test applying your patch and get the errors X11 your
>> mention, I haven't dug into the example QT implementation or
>> osgViewer::GraphicsWIndowX11 yet, but it does sound like we might need
>> to refactor either the example or GraphicsWindowX11 to avoid the
>> issue.  I would like to see these fixed as end users wouldn't be able
>> to deploy an app that produces these warnings.
>>
>> In your follow up post you write:
>>
>> "Sorry, forgot to mention that i've remove the header definitions for mac
>> and windows. Please add the original header definitions from the
>> example."
>>
>> I couldn't spot any code related this this.  Could be specific about
>> what you mean here.
>>
>> On a final note, the placement of the:
>>
>> #if USE_QT4
>>     if (arugments.read("--MTCompositeViewer"))
>>    {
>> ..
>>    }
>> ...
>>
>> Makes the CompositeViewer code a bit more awkward, with the code
>> indendent when it needn't be and there is an extra #if def's around
>> the close } bracket that is at first look confusing.
>>
>> A better structuring of your MTCompositeViewer code would be to put it
>> after the --CompositeViewer block, then you could just put the #if
>> USE_QT4 around one single block, and indentation could remain more
>> consistent between the blocks.
>>
>> As there a couple of issues outstanding that need resolving I'm going
>> to hold off from merging right now.  Could you restructure the code as
>> per the suggestion above and explain/resolve the header definitions.
>>
>> Cheers,
>> Robert.
>>
>>
>> On Wed, Oct 15, 2008 at 9:07 PM, Lukas Diduch <[EMAIL PROTECTED]> wrote:
>> >
>> > This mod to QOSGWidget enables multithreaded rendering using QOSGWidget 
>> > using
>> > CompositeViewer. It demonstrates as well the embedding of QOSGWidget into 
>> > other
>> > QTWidgets. Performance is very good (70 fps) on AMD 3Ghz, FedoraCore8 using
>> > NVidia 8600GTS.
>> >
>> >
>> > usage:
>> > ~~~~~~
>> >
>> >    osgviewerQT --QOSGWidget --MTCompositeViewer cow.osg
>> >
>> >
>> > There are some issues with this mod:
>> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> >
>> > 1. Other multithreading modes fail.
>> >
>> > 2. Correct Widget inheritance is crucial to functionality.
>> >
>> > 3. Written for QT4 only
>> >
>> > 4. Using 'ClickToFocus'. Select the widget first before manipulating.
>> >
>> > 5. though working fine we get a BadWindow error message see thread
>> >
>> >   [osg-users] Multiple Contexts in QT Applications
>> >
>> > 6. Although the problem (point 5) is related to deranged traits values
>> >   which are set by failing a call to XGetWindowAttributes in
>> >   GraphicsWindowX11::setWindow the following fix (to set traits only if
>> >   XGetWindowAttributes returns with no error) does not solve the problem
>> >   properly:
>> >
>> >    @ line 750, GraphicsWindowX11.cpp
>> >
>> >    Status s = XGetWindowAttributes( _display, _window, &watt );
>> >        if (s = True)
>> >        {
>> >            _traits->x = watt.x;
>> >            _traits->y = watt.y;
>> >            _traits->width = watt.width;
>> >            _traits->height = watt.height;
>> >        }
>> >
>> >        The context can be embedded and displayed but somehow the
>> >        perspective is distored in this case. That's why we set the traits
>> >        in QOSGWidget::createContext after initializing the graphicsContext.
>> >
>> >
>> > Regards,
>> > Lukas
>> >
>> > _______________________________________________
>> > osg-submissions mailing list
>> > [email protected]
>> > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>> >
>> >
>> _______________________________________________
>> osg-submissions mailing list
>> [email protected]
>> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
> --
> Lukas L. Diduch
> Smartspace Laboratory
> Information Access Division (IAD)
> National Institute of Standards and Technology (NIST)
>
> web    : http://www.nist.gov/smartspace
> email  : [EMAIL PROTECTED]
> office : +1 (301) 975 6399
> fax    : +1 (301) 975 5287
> mobile : +1 (240) 899 6536
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to