treeView = new QTreeView();
treeView->header()->hide();
treeView->setModel(treeCtrl);
QItemSelectionModel* _select;
_select = new QItemSelectionModel(treeCtrl);
treeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
treeView->setContextMenuPolicy(Qt::CustomContextMenu);
connect(treeView, &QWidget::customContextMenuRequested, this, &MainForm::treeContextMenu);
connect(_select, &QItemSelectionModel::selectionChanged,
this, &MainForm::treeSelectionChanged);
и мой слот:
void MainForm::treeSelectionChanged(const QItemSelection & selected, const QItemSelection & deselected)
{
qDebug() << "selectionChanged";
QModelIndex index = selected.indexes().at(0);
propCtrl = new StatPropCtrl(&index);
}
Не заходит в слот, там стоит точка останова, но увы.