How to handle click event on node of Treeview
-
wrote on 22 May 2012, 13:46 last edited by
Hi
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. -
wrote on 22 May 2012, 13:59 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.
1/2