Search code examples
qtqtreewidget

how to call myslot using item click signal in QTreeWidget


Want to trigger "itemClicked" event for a QTreeWidget Item using the following code.

connect(aTreeWidget,SIGNAL(itemClicked(QTreeWidgetItem*,int)),this,SLOT(CallM(QTreeWidgetItem* item, int)));

but the CallM slot is not called,don't no what is the problem here !? there is no syntax or build error, I am using Qt 4.7.1/Win 7.


Solution

  • I missed to add Q_OBJECT In my class, after adding it works fine