void TreeModel::selectIndex(QModelIndex ix) { if (!ix.isValid()) return; qDebug() << "name1" << ix.data(); tree->selectionModel()->clear(); tree->setExpanded(ix.parent(), true); tree->selectionModel()->setCurrentIndex(ix, QItemSelectionModel::SelectCurrent); tree->scrollTo(ix);}
name1 QVariant(QString, "Highlight elements") The program has unexpectedly finished.C:\Home\develop\qt\arm\designer\Designer exited with code -1073741819
tree->selectionModel()->setCurrentIndex(ix, QItemSelectionModel::SelectCurrent);
void MainWindow::showEvent(QShowEvent *event) { QMainWindow::showEvent(event); QTimer::singleShot(0, this, SLOT(selectLastNode()));}