[osg-submissions] QT issue

Tomas Hnilica tomas.hnilica at webstep.net
Thu Mar 20 23:57:29 PDT 2008


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




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


More information about the osg-submissions mailing list