0
GUI에 대한 QGLWidget을 홍보하는 동안 Qt에 문제가 발생했습니다. 내 QGLWidget의 생성자 그래서 객체가이UI에서 위젯 생성자 변경
QGLFormat glFormat;
glFormat.setVersion(3, 3);
glFormat.setProfile(QGLFormat::CoreProfile);
glFormat.setSampleBuffers(true);
GLWidget w(glFormat, parent);
처럼 인스턴스화해야
GLWidget::GLWidget(const QGLFormat& format, QWidget* parent)
: QGLWidget(format, parent),
m_vertexBuffer(QGLBuffer::VertexBuffer) {}
하지만 ui_mainwindow.h이
widget = new GLWidget(centralWidget);
으로이 작업을 자동으로 수행하기 때문에 하는 수 없습니다 ui_mainwindow.h가 UI가 다시 컴파일 될 때마다 새로 작성된다는 사실 때문에 수정 될 수 있습니다. 그래서 아마도 maindwindow.cpp에서 GLWidget이 표준 생성자와는 다른 인스턴스로 만들어 지지만 QFormat을 사용한다고 말할 것입니다. 이것이 어떻게 이루어 졌는지 모든 생각?
나중에 간단히'widget-> setFormat (format)'을 호출 할 수 없습니까? – vahancho
[void setFormat (const QGLFormat & format)] (http://qt-project.org/doc/qt-4.8/qglwidget-obsolete.html)은 더 이상 사용되지 않으므로 더 이상 사용하지 않아야합니다. – TheMindWithin