Details
Description
Seg fault in this code:
#include "MainWindow.h"
#include <QApplication>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QMessageBox>
#include <QGLWidget>
#include <QLayout>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QGraphicsScene *scene = new QGraphicsScene();
QGraphicsView *view = new QGraphicsView();
view->setScene(scene);
view->setMinimumSize(500, 500);
view->setViewport(new QGLWidget());
QMessageBox testWindow;
testWindow.setWindowTitle(" Opengl standart test.");
testWindow.addButton(QMessageBox::Cancel);
testWindow.addButton(QMessageBox::Ok);
testWindow.layout()->addWidget(view);
testWindow.setText("All correct?");
testWindow.show();
return a.exec();
}
if comments view->setViewport(new QGLWidget()); then all Ok.