[Qt-interest] Problems with displaying two QGLWidget objects on a window.

Chen Dong 659536 at gmail.com
Tue May 12 23:59:54 CEST 2009


I need to have two opengl screens to display some 3D objects. My problem is
I can only update the first opengl screen ( or object ?),  and the second
doesn't change at all.

I  have a GLWidget class like this:

class GLWidget : public QGLWidget{ ... }


// Then I have two GLWidget objects. and add them to my winows
...
GLWidget *widget_S;
GLWidget *widget_O;

widget_O = new GLWidget(main_Window);
widget_O->setObjectName(QString::fromUtf8("widget_O"));

widget_O->setGeometry(QRect(6, 55, 490, 457));

widget_S = new GLWidget(main_Window);
widget_S->setObjectName(QString::fromUtf8("widget_S"));
widget_S->setGeometry(QRect(508, 55, 490, 457));

...

QObject::connect( this, SIGNAL( fileOpened(list<Point>) ), widget_O,
SLOT(  setList(list<Point> )) );
QObject::connect( this, SIGNAL( fileOpened(list<Point>) ), widget_S,
SLOT(  setList(list<Point> )) );
//QObject::connect( this, SIGNAL( simpFinisd(list<Point> ) ),
widget_O, SLOT( setList(list<Point> )) );

What I get is, when I load a 3D model, the "fileOpened" is emitted. Both of
them can received the new points. But only the widget_O can display the new
object.

So, can anyone tell me how to solve this problem?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090512/38c6c1f1/attachment.html 


More information about the Qt-interest-old mailing list