[osg-submissions] QT issue

Tomas Hnilica tomas.hnilica at webstep.net
Fri Mar 21 07:35:52 PDT 2008


Hello Robert,

the problem of keypress events was solved by QT community, attached is 
repaired AdapterWidget.cpp file.
In the AdapterWidget class constructor following line was added:  
setFocusPolicy(Qt::ClickFocus);
Scene disappearing by resizing to minimum still needs to be fixed...

Cheers,
Tomas


Tomas Hnilica napsal(a):
> Robert,
>
> sorry for problematic post.
> Attached is modified source of AdapterWidget.cpp file from osgviewerQT 
> example. Original was token today from SVN - trunk. (2.3.6).
> --mdi option needs to be set to run MDI version.
>
> Few notes:
> - tested on Windows box (Win XP)
> - using QT4
> - I was not able to execute the example with QOSGWidget  - had same
> error like described in [osg-users] "fate error using QOSGWidget in 
> develop release
> 2.3.0" thread from Shuxing Xiao, 2008-01-08.
> - problems are described in source
>
> Cheers,
> Tomas
>
>
>
>>>    
>>>> HI Tomas,
>>>>       
>>>  >
>>>  > I can't think of what might be amiss without trying it out.
>>>  >
>>>  > Could modify the osgviewerQT example so that it has another optional
>>>  > code path in creating a viewer based on your code.  This will allow
>>>  > others to try out your usage model and see first hand what is wrong.
>>>  > I can also merge these changes so we can use it as a unit test in
>>>  > future - and getting it working too obviously :-)
>>>  >
>>>  > Robert.
>>>  >
>>>  > On Thu, Mar 20, 2008 at 11:07 AM, Tomas Hnilica
>>>  > <tomas.hnilica at webstep.net> wrote:
>>>  >
>>>  >> Hello all OSG users,
>>>  >>
>>>  >>  I found few issues by intergration OSG(2.2.0) with QT (4.3.3) :
>>>  >>  The ViewerQT class from OSG-2.2.0 works well in the 
>>> osqviewerQT.cpp
>>>  >>  example.
>>>  >>  But when I add it to existing QT window, I have these problems:
>>>  >>  - no keyboard actions are emitted to OSG, mouse works ok
>>>  >>  - when resizing the MDI window to minimum (like with minimize 
>>> button,
>>>  >>  but done as resizing) the scene disappears by resizing back.
>>>  >>
>>>  >>  I changed the osgviewerQT example by replacin the 
>>> viewerWindow->show();
>>>  >>  with these code:
>>>  >>  -------------------------------------------
>>>  >>        ViewerQT* viewerWindow = new ViewerQT;
>>>  >>        viewerWindow->setCameraManipulator(new 
>>> osgGA::TrackballManipulator);
>>>  >>        viewerWindow->setSceneData(loadedModel.get());
>>>  >>
>>>  >>        QMainWindow* mw = new QMainWindow();
>>>  >>        QMdiArea* mdiArea = new QMdiArea(mw);
>>>  >>        mw->setCentralWidget(mdiArea);
>>>  >>
>>>  >>        QMdiSubWindow *subWindow = 
>>> mdiArea->addSubWindow(viewerWindow);
>>>  >>        subWindow->resize(200,100);
>>>  >>        subWindow->showNormal();
>>>  >>        subWindow->setWindowTitle("New Window");
>>>  >>        mw->show();
>>>  >>  -------------------------------------------
>>>  >>
>>>  >>
>>>  >>  I hope these problems are more OSG than QT related...
>>>  >>
>>>  >>  Many thanks,
>>>  >>  Tomas
>>>  >>  
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> osg-submissions mailing list
> osg-submissions at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>   


-- 
S pozdravem
    Mgr. Tomas Hnilica

=================================
e-mail: tomas.hnilica at webstep.net
jabber: tomas.hnilica at webstep.net
skype:  tomashnilica
icq:    339070
tel.:   +420 604 214 284
web:	http://tomas.webstep.net
================================= 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: AdapterWidget.zip
Type: application/x-zip-compressed
Size: 2565 bytes
Desc: not available
Url : http://lists.openscenegraph.org/pipermail/osg-submissions-openscenegraph.org/attachments/20080321/21de0f0f/attachment.bin 


More information about the osg-submissions mailing list