qt-interest@trolltech.com
[Top] [All Lists]

Which mouse button caused QTreeWidget::itemClicked signal?

Subject: Which mouse button caused QTreeWidget::itemClicked signal?
From: Mark Thompson
Date: Mon, 04 Jun 2007 11:23:07 -0700

I have a slot to handle the QTreeWidget::itemClicked signal.
I also want to find out which mouse button caused the signal to be emitted.

Using QApplication:mouseButtons() in my sample below always gives a value of '0' for buttons. The problem with using QApplication::mouseButtons() is that the itemClicked signal is not emitted until the mouse button is released.

Any ideas on how to achieve this would be most appreciated.

void MyClass::handleItemClicked(QTreeWidgetItem *item, int column)
{
   Qt::KeyboardModifiers modifiers = QApplication::keyboardModifiers();
   Qt::MouseButtons buttons = QApplication::mouseButtons();
   ....
}

Thanks,
Mark

--

************************************
Mark Thompson
Seattle, WA
http://www.arguslab.com
mark@xxxxxxxxxxxx
************************************


--
To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with 
"unsubscribe" in the subject or the body.
List archive and information: http://lists.trolltech.com/qt-interest/

<Prev in Thread] Current Thread [Next in Thread>