[Qt-interest] Layout segmentation fault

Friedemann Kleint Friedemann.Kleint at nokia.com
Tue Mar 3 13:48:15 CET 2009


Hi Nicholas,

> void LeftWindow::SetupWindow()
> {
>     if (layout() != 0)
>         delete layout();
>     else
>         qDebug() << "No Layout to Destroy.";
>     QGridLayout* gridLayout = new QGridLayout(this);
> }
>
> this causes an immediate segmentation fault. Any ideas?

This code removes the special main window layout which QMainWindow uses to 
manage its dock widgets, status bars and such. For your case, you would have 
to set a central widget on the QMainWindow and apply the layout to it (see 
QMainWindow::setCentralWidget()).

I hope this helps,

Regards,
Friedemann




More information about the Qt-interest-old mailing list