we ask there and we got no responed,
is no one here that use OSG and QT togther?
we just need to do a simple application that have buttan and scene,
in some layout, that will look fine.
someone please can help us?
thanks
NB
On 11/27/06, Robert Osfield <[EMAIL PROTECTED]> wrote:
Hi Benny,
These are really QT questions, you'll need to look a QT docs and
examples for answers to this.
Robert.
On 11/27/06, benny porat <[EMAIL PROTECTED]> wrote:
> I understand how to do it, that the butten will sown up in the scene(it
> looks like it is a part of the scene, no grid)
>
> but I want to do it like a regular program, just have butten and menu in
the
> first row, and the scene under it,(like mozila)
>
> how can I do it?
> in the constractor of the simpleViewerQT the "this" is the scene how can
I
> put him in a QGridLayout?
>
>
> thanks
> NB
>
>
> On 11/27/06, Robert Osfield <[EMAIL PROTECTED]> wrote:
> > Hi Benny,
> >
> > What is probably missing is the setting of parent of the
> > SimpleViewerQT widget. To make this custom widget a bit more Qt
> > friendly its probably best to simply add the standard Qt constructor
> > parameters to the SimpleViewerQT widget, and then constructor it in
> > your own custom widget along the same lines you use the QButton.
> >
> > Try the below version of SimpleViewerQT.
> >
> > class SimpleViewerQT : public osgViewer::SimpleViewer, public
> GraphicsWindowQT
> > {
> > public:
> >
> > SimpleViewerQT(QWidget * parent = 0, const char * name = 0,
> > const QGLWidget * shareWidget = 0, WFlags f = 0):
> > GraphicsWindowQT( parent, name, shareWidget, f )
> > {}
> >
> > virtual void initializeGL()
> > {
> > QGLWidget::initializeGL();
> > }
> >
> > virtual void paintGL()
> > {
> > frame();
> > }
> >
> > };
> >
> >
> > Robert.
> >
> > On 11/27/06, benny porat <[EMAIL PROTECTED]> wrote:
> > >
> > >
> > > Hi all,
> > > We are trying to do two diffrent frames. one for OSG and another for
> menue.
> > > Ofcourse the menue have to handle the scene.
> > >
> > > We tryed to create new class MyWidget that inheret from QWidget and
in
> the
> > > constractor we load the scene into SimpleViewerQT, and add a buttun
and
> put
> > > them both in a grid, and it shows us just the butten.
> > > what we did wrong?
> > > here is our code,
> > > (its append into the osgsimpleviewerQT3.cpp file(witout the main)
> > >
> > >
> > > class MyWidget: public QWidget
> > >
> > > {
> > >
> > > public:
> > >
> > > MyWidget( QWidget *parent=0, const char *name=0 );
> > >
> > > };
> > >
> > >
> > >
> > > MyWidget::MyWidget( QWidget *parent, const char *name )
> > >
> > > : QWidget( parent, name )
> > >
> > > {
> > >
> > > QPushButton *quit = new QPushButton( "Quit", this, "quit" );
> > >
> > > quit->setFont( QFont( "Times", 18, QFont::Bold ) );
> > >
> > > connect( quit, SIGNAL(clicked()), qApp, SLOT(quit()) );
> > >
> > > osg::ref_ptr<osg::Node> loadedModel =
> > >
> osgDB::readNodeFile("/home/natalie/project/T72-tank/t72-tank_des.flt");
> > >
> > > if(loadedModel==NULL)
> > >
> > > {
> > >
> > > std::cout<<"error, problem with load"<<endl;
> > >
> > > }
> > >
> > > SimpleViewerQT* viewerWindow = new SimpleViewerQT;
> > >
> > > viewerWindow->setSceneData(loadedModel.get());
> > >
> > > viewerWindow->setCameraManipulator(new
> > > osgGA::TrackballManipulator);
> > >
> > > QGridLayout *grid = new QGridLayout( this, 2, 2, 10 );
> > >
> > > //2x2, 10 pixel border
> > >
> > > grid->addWidget( quit, 0, 0 );
> > >
> > > grid->addWidget( viewerWindow, 1, 1 );
> > >
> > > grid->setColStretch( 1, 10 );
> > >
> > > }
> > >
> > >
> > >
> > > int main( int argc, char **argv )
> > >
> > > {
> > >
> > > QApplication a( argc, argv );
> > >
> > >
> > >
> > > MyWidget w;
> > >
> > > w.setGeometry( 100, 100, 640, 400 );
> > >
> > > a.setMainWidget( &w );
> > >
> > > w.show();
> > >
> > > return a.exec();
> > >
> > > }
> > >
> > > _______________________________________________
> > > osg-users mailing list
> > > [email protected]
> > > http://openscenegraph.net/mailman/listinfo/osg-users
> > > http://www.openscenegraph.org/
> > >
> > >
> > _______________________________________________
> > osg-users mailing list
> > [email protected]
> > http://openscenegraph.net/mailman/listinfo/osg-users
> > http://www.openscenegraph.org/
> >
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/