Segmentation fault in QGraphicsView::setScene()
-
Hello forum
I have a normal widget application which should show a finite automata in a graphic view widget. I add a QGgraphicsView to the main window, which has an instance of QGraphicsScene:
@
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
scene(new QGraphicsScene(this))
{
setupUi(this);
scene->addText("Hello");
ui->graphicsView->setScene(scene); // bumb!
}
@
Program crashes by a segmentation fault when it tries to set scene for graphicsView. -
@
ui->...
@
wild pointer? -
scene is just constructed in initialization list using new operator. So I trust the new operator won't screw it up.
@ui->graphicsView->setScene(scene); // bumb!@Looking at the above line - could be because of either 'ui' or 'graphicsView' - may be not a valid pointer?