Ok, here are some code snippets from the application. . .

In MDI MainWindow:
Qt Code:
  1. void MainWindow::createMdiPrevQSOs()
  2. {
  3. // show the window
  4. mdiPrev = new mdiPrevQSOs;
  5. mdiArea->addSubWindow(mdiPrev);
  6. mdiPrev->show();
  7. }
To copy to clipboard, switch view to plain text mode 
long after creation:
Qt Code:
  1. void MainWindow::slotUpdatePrev()
  2. {
  3. QList<QMdiSubWindow *> windows = mdiArea->subWindowList();
  4. foreach (QMdiSubWindow *window, mdiArea->subWindowList())
  5. {
  6. if (window->windowTitle().startsWith(tr("Previous"),Qt::CaseInsensitive))
  7. {
  8. mdiPrevQSOs *child = qobject_cast<mdiPrevQSOs *>(window);
  9. if (child->findPrev()) // (debug shows seg fault previous step is here)
  10. {
  11. . . .
  12. }
  13. }
  14. }
  15. . . .
  16. }
To copy to clipboard, switch view to plain text mode 
the MDISubWindow has a list Widget that is filled by the called function.

mdiPrevQSOs constructor:
Qt Code:
  1. mdiPrevQSOs::mdiPrevQSOs(QWidget *parent) : QDialog(parent)
  2. {
  3. setAttribute(Qt::WA_DeleteOnClose);
  4. . . .
  5. widget = new QWidget(this);
  6. widget->setObjectName(QString::fromUtf8("widget"));
  7. . . .
  8. listView = new QTreeView(widget);
  9. listView->setObjectName(QString::fromUtf8("listView"));
  10. }
To copy to clipboard, switch view to plain text mode 
the public function called:
Qt Code:
  1. bool mdiPrevQSOs::findPrev()
  2. {
  3. . . .
  4. // create a query . . .
  5. // create a QStandardItemModel for the tree view. . .
  6. // fill the model with data from the query . . .
  7. . . .
  8. // (this line crashes with a seg fault)
  9. listView->setModel(s_model); // the tree view created in the constructor
  10. . . .
  11. }
To copy to clipboard, switch view to plain text mode