You are not logged in.

daydreamer

Beginner

  • "daydreamer" started this thread

Posts: 28

Location: Scotland

  • Send private message

1

Tuesday, January 11th 2005, 1:04am

Multiple inheritance with QGLWidget...

Hello,
I am currently porting an OpenGL application from Windows to Qt. However, I am stuck with a problem with multiple inheritance and the QGLWidget.

My application requires the use of an OpenGL extension manager ... This is simply a class
inherited by the OpenGL window class, the purpose of which is to check for the presence of
each OpenGL extensions and set up the function adddreses.

However, simply by inheriting this class (and not doing any initialisation or configuration),
is causing the application to crash with a segmentation fault. I cannot even debug it, since 'gdb' gives the error:

Starting program: .../glshaders
warning: Child process unexpectedly missing: No child processes

Program terminated with signal ?, Unknown signal.
The program no longer exists.
You can't do that without a process to debug.

---------------

If I insert printf statements within my application, the error is seen to happen at:
CMainWindowLayout->addWidget( glWidget,0,0) ...

CMainWindow::CMainWindow( QWidget* parent, const char* name, WFlags fl )
: QMainWindow( parent, name, fl )
{
(void)statusBar();
if ( !name )
setName( "CMainWindow" );
setCentralWidget( new QWidget( this, "qt_central_widget" ) );
CMainWindowLayout = new QGridLayout( centralWidget(), 1, 1, 11, 6, "CMainWindowLayout");

glWidget = new GLWidget( centralWidget(), "glWidget" );

CMainWindowLayout->addWidget( glWidget, 0, 0 );

---------------

The bizarre thing is that the application works perfectly if a single GLWidget object is created, without any layouts.

Can anyone help?

  • "Petr Svetr Killometr" is male

Posts: 55

Location: Czech Republic

  • Send private message

2

Tuesday, January 11th 2005, 6:44am

RE: Multiple inheritance with QGLWidget...

There is no mistake in code you sent. But I think there may be some mistake in implementation of your GLWidget class.