[Qt-interest] Mouse double click.

Shabd Swarup V shabd at cadence.com
Thu Feb 19 08:23:56 CET 2009


QMouseEvent event(QEvent::MouseButtonDblClick,
treeView->pos(),Qt::LeftButton,0, 0);
QCoreApplication::sendEvent(treeView, &event);

This is what I am trying to do, but the problem is that I have to send
the event on an index inside the treeView while treeView->pos() returns
the position of the treeView widget as a whole. I am unable to find the
screen coordinates of the index.

Am I missing something very obvious? Please suggest.

Thanks,
Shabd


-----Original Message-----
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of Malyushytsky,
Alex
Sent: Thursday, February 19, 2009 11:05 AM
To: qt-interest at trolltech.com
Subject: Re: [Qt-interest] Mouse double click.

Make sure this item is visible and compute its screen coordinate, then
construct QMouseEvent?
Not sure why don't call appropriate slot right away instead.

Regards,
   Alex Malyushytsky



________________________________________
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of Shabd Swarup V
Sent: Wednesday, February 18, 2009 8:41 PM
To: qt-interest at trolltech.com
Subject: [Qt-interest] Mouse double click.

Hi,

I need to fire a mouse double click on a particular index(QModelIndex)
in a QTreeView and a QListWidget.
I can fire the event on the widget as a whole, but how do I do it on a
particular index?

Please let me know.

Regards,
Shabd



------------------------------------------------------------------------
---------------------------
Weidlinger Associates, Inc. made the following annotations.

"This message and any attachments are solely for the intended recipient
and may contain confidential or privileged information. If you are not
the intended recipient, any disclosure, copying, use, or distribution of
the information included in this message and any attachments is
prohibited. If you have received this communication in error, please
notify us by reply e-mail and immediately and permanently delete this
message and any attachments. Thank you."

"Please consider our environment before printing this email."

_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list