Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.8.0
-
None
-
Linux 4.4 (64 bits) - Nvidia 780 (proprietary driver )
Description
setDefaultFormat value (at least the multi-sampling part) is forgotten after re-parenting an QOpenGLWidget.
My main function is like this:
int main(int argc, char *argv[]){ QSurfaceFormat sf = QSurfaceFormat(); sf.setRenderableType(QSurfaceFormat::OpenGL); sf.setProfile(QSurfaceFormat::CoreProfile); sf.setVersion(4, 3); sf.setSamples(8); QSurfaceFormat::setDefaultFormat(sf); QApplication a(argc, argv); MainWindow w; w.show(); return a.exec(); }
I re-parent a QOpenGLWidget which is initially attached to the main window like this:
if (glVieweverMaximized){ ui->openGLWidget->setParent(ui->frame); ui->horizontalLayout_8->addWidget(ui->openGLWidget); ui->openGLWidget->show(); }else{ ui->openGLWidget->setParent(nullptr); ui->openGLWidget->show(); } glVieweverMaximized=!glVieweverMaximized;
After the re-parenting the multisampling value of x8 is lost. See attached pictures.