I get the same error when I use OSGQGLManagedWidget. I'm currently using QT
vesion 3.1.1Educational.
My main for this is:
// initialize OSG
OSG::osgInit(argc,argv);
// initialize QT
QApplication qapp( argc, argv );
// initialize GL
QGLFormat::setDefaultFormat(QGLFormat(QGL::DirectRendering |
QGL::DoubleBuffer | QGL::DepthBuffer | QGL::Rgba));
// initialize widget
OSG::OSGQGLManagedWidget widget;
qapp.connect(&qapp, SIGNAL(lastWindowClosed()), &qapp, SLOT
(quit()));
// initialize scene
Scene* scene = new Scene("data/world.xml");
// set scene
widget.getManager().setRoot(scene->getRoot());
// show scene
widget.getManager().showAll();
widget.show();
int retCode = qapp.exec();
OSG::osgExit();
return retCode;
thanks a lot,
Peter
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:opensg-users-
> [EMAIL PROTECTED] On Behalf Of Peter Billen
> Sent: donderdag 11 maart 2004 15:38
> To: [email protected]
> Subject: RE: [Opensg-users] OpenSG and QT/QThread/QTimer
>
> Ah oops, totally forgot that.
>
> I managed to compile and link with QT now, but when I run my app, I get
> the
> following error:
>
> "QPaintDevice: Must construct a QApplication before a QPaintDevice".
>
> Do you have an idea what might be wrong? I understand the error, but I am
> creating my QApplication-object before anything else!
>
> My main looks like this:
>
> // initialize OSG
> OSG::osgInit(argc, argv);
>
> // initialize QT
> QApplication::setColorSpec(QApplication::CustomColor);
> QApplication a(argc, argv);
>
> // create windows
> QGLFormat::setDefaultFormat(QGLFormat(QGL::DirectRendering |
> QGL::DoubleBuffer | QGL::DepthBuffer | QGL::Rgba));
>
> // initialize scene
> Scene* scene = new Scene("data/world.xml");
>
> // initialize window
> SceneWindow* sceneWindow = new SceneWindow();
>
> OSG::QTWindowPtr win = OSG::QTWindow::create();
> win->setGlWidget(sceneWindow);
>
> sceneWindow->m_simpleSceneManager.setWindow(win);
> sceneWindow->m_simpleSceneManager.setRoot(scene->getRoot());
> sceneWindow->m_simpleSceneManager.showAll();
>
> // process events
> a.processEvents();
>
> // show scene
> sceneWindow->show();
>
> a.setMainWidget(sceneWindow);
>
> return (a.exec());
>
> Thanks a lot Andreas,
>
> Peter
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:opensg-users-
> > [EMAIL PROTECTED] On Behalf Of Andreas Zieringer
> > Sent: donderdag 11 maart 2004 14:44
> > To: [email protected]
> > Subject: Re: [Opensg-users] OpenSG and QT/QThread/QTimer
> >
> > Hi Peter,
> >
> > QTimer needs a running qt event loop, something like this ...
> >
> > QApplication a( argc, argv );
> > a.exec();
> >
> > this conflicts with the glut event loop.
> >
> > Andreas
> >
> >
> > > I'm only using QTimer.h, so it's not possible to combine that with
> > > GLUT-functions?
> > >
> > > I'll check that example out, thanks
> > >
> > > Peter
> > >
> > >
> > >>-----Original Message-----
> > >>From: [EMAIL PROTECTED] [mailto:opensg-users-
> > >>[EMAIL PROTECTED] On Behalf Of Andreas Zieringer
> > >>Sent: donderdag 11 maart 2004 13:44
> > >>To: [email protected]
> > >>Subject: Re: [Opensg-users] OpenSG and QT/QThread/QTimer
> > >>
> > >>Hi Peter,
> > >>
> > >>what do you mean with "glutIdleFunc(glutIdleCallback)" are you using
> > >>glut in a qt application? That's not a good idea you can use a qt
> widget
> > >>for rendering just look into
> > >>OpenSG/Source/WindowSystem/QT/testPassiveQT.cpp
> > >>
> > >>Andreas
> > >>
> > >>
> > >>>Hi all,
> > >>>
> > >>>Any idea why QTimer and QThread of QT (www.trolltech.com) aren't
> > working
> > >>>anymore when using OpenSG?
> > >>>
> > >>>I think it has somethinig to do with
> "glutIdleFunc(glutIdleCallback)",
> > >>
> > >>so
> > >>
> > >>>the QThread/QTimer-object isn't given time to do their jobs.
> > >>>
> > >>>On request I can provide my framework, maybe it has something to do
> > with
> > >>
> > >>a
> > >>
> > >>>project setting. (MSVC6)
> > >>>
> > >>>Thanks a lot,
> > >>>
> > >>>--
> > >>>Peter
> > >>>
> > >>>
> > >>>
> > >>>-------------------------------------------------------
> > >>>This SF.Net email is sponsored by: IBM Linux Tutorials
> > >>>Free Linux tutorial presented by Daniel Robbins, President and CEO of
> > >>>GenToo technologies. Learn everything from fundamentals to system
> > >>>administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> > >>>_______________________________________________
> > >>>Opensg-users mailing list
> > >>>[email protected]
> > >>>https://lists.sourceforge.net/lists/listinfo/opensg-users
> > >>>
> > >>>
> > >>
> > >>
> > >>
> > >>
> > >>-------------------------------------------------------
> > >>This SF.Net email is sponsored by: IBM Linux Tutorials
> > >>Free Linux tutorial presented by Daniel Robbins, President and CEO of
> > >>GenToo technologies. Learn everything from fundamentals to system
> > >>administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> > >>_______________________________________________
> > >>Opensg-users mailing list
> > >>[email protected]
> > >>https://lists.sourceforge.net/lists/listinfo/opensg-users
> > >
> > >
> > >
> > >
> > > -------------------------------------------------------
> > > This SF.Net email is sponsored by: IBM Linux Tutorials
> > > Free Linux tutorial presented by Daniel Robbins, President and CEO of
> > > GenToo technologies. Learn everything from fundamentals to system
> > > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> > > _______________________________________________
> > > Opensg-users mailing list
> > > [email protected]
> > > https://lists.sourceforge.net/lists/listinfo/opensg-users
> > >
> > >
> >
> >
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by: IBM Linux Tutorials
> > Free Linux tutorial presented by Daniel Robbins, President and CEO of
> > GenToo technologies. Learn everything from fundamentals to system
> > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> > _______________________________________________
> > Opensg-users mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/opensg-users
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> Opensg-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensg-users
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users