PDA

View Full Version : how to track mouse button inside treeItemClickAction?



sudhansu
24th November 2009, 06:35
Hi Everybody.
Need you peoples help to solve a problem.

My code is like below.


connect(ui->treeWidget, SIGNAL(itemClicked(QTreeWidgetItem*, int)),
this, SLOT(treeItemClickAction(QTreeWidgetItem*, int)));

If i click the mouse in treewidget Item treeItemClickAction(QTreeWidgetItem*, int) is getting called. But i need to call this methode if i click only left mouse button in the treewidget. and if i pressed the right button in a treewidget Item a new action need to be opened. Or inside treeItemClickAction, can I track which mouse button is pressed.?

Thank u all.

wysota
24th November 2009, 08:55
Signals are a high level mechanism. If you want to go to a lower level, use events. You will be able to detect which button triggered it.

sudhansu
24th November 2009, 11:07
Signals are a high level mechanism. If you want to go to a lower level, use events. You will be able to detect which button triggered it.

Thank you very much.:)