Code: Alles auswählen
QObject::connect(ui.uiTree->selectionModel(), SIGNAL(currentChanged(const QModelIndex&, const QModelIndex&)), nodeEditor, SLOT(setSelection(const QModelIndex&, const QModelIndex&)));
Code: Alles auswählen
void NodeEditor::setSelection(QModelIndex current, QModelIndex prev)
{
qDebug() << "event fired"; //passiert nie :/
QModelIndex parent = current.parent();
dataMapper->setRootIndex(current.parent());
dataMapper->setCurrentModelIndex(current);
}
Also NodeEditor ist ein Q_OBJECT, erbt von QWidget und ansonsten müsste eigentlich auch alles passen, weil error oder warnings gibts auch keine. Hat jemand eine Idee warums nicht geht?
Grüße