Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-59152

setDefaultFormat value is forgotten

    XMLWordPrintable

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.

      Attachments

        1. FinalState.png
          FinalState.png
          189 kB
        2. InitialState.png
          InitialState.png
          198 kB
        3. WidgetParentChanged.png
          WidgetParentChanged.png
          195 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            sletta Gunnar Sletta
            davidmanz David Manzanares
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes