PDA

View Full Version : About QGLWidget 's construct function



feiz
9th May 2015, 10:25
for the construct function


QGLWidget(QWidget * parent = 0, const QGLWidget * shareWidget = 0, Qt::WindowFlags f = 0)

when I use it likes this,(the class slicerCanvas and secCan all inherit QGLWidget)


slicerX_ = new slicerCanvas(centerWidget_);//which load data and gen texture object
slicerX_->setPlaneModel('y');
secWid_ = new secCan(centerWidget_,slicerX_);

the secWid_ can display correct. But if the code like this


secWid_ = new secCan(centerWidget_);
slicerX_ = new slicerCanvas(centerWidget_,secWid_);//which load data and gen texture object
slicerX_->setPlaneModel('y');

the secWid_ display correct(I use signal and slot to send and receive texture object,I don't konw whether this correct),I realy don't konw why.

feiz
10th May 2015, 10:33
I have solved this issue,I use QOpenGLWidget instead of QGLWidget