Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to handle click event on node of Treeview
Indrajeet last edited by
I want to call a slot on the click event of a treeview node i tried something like this
@QObject::connect(view, SIGNAL(clicked(const QModelIndex &)),view, SLOT(expandtest(const QModelIndex &)));@
My slot loks like this
@void MainWindow::expandtest(const QModelIndex &index)
QMessageBox::information(this, "Popup", "Item clicked");
but the slot is not getting called.
Can anybody help me out.
vsorokin last edited by
Third parameter of connect must be pointer to object which contain slot,
so for you it must be pointer for MainWindow object,
if you doing connect in MainWindow object you can use this.