0

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.

secretgenes
  • 1,291
  • 1
  • 19
  • 39
Prady
  • 663
  • 3
  • 11
  • 28

2 Answers2

3

From the QObject::connect(....) docs

the signal and slots parameters must not contain any variable names, only the type.

Remove the 'item' word from the slot arguments.

cmannett85
  • 21,725
  • 8
  • 76
  • 119
0

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

Prady
  • 663
  • 3
  • 11
  • 28