[Qt-interest] QListWidget itemOnRelease

Malyushytsky, Alex alex at wai.com
Thu Aug 6 21:55:35 CEST 2009


Do you really think you would get more help, if you send your e-mail every few minutes?

As for your question,
you certainly can get all information about QMouseEvent by (for example) overriding
void QWidget::mouseReleaseEvent ( QMouseEvent * event ). I would not consider using mouse events with QListWidget though for such purpose.

As an alternative QListWidget emits
void QListWidget::itemSelectionChanged ()   [signal]
when selection is changed, so you can connect this signal to the slot where you iterate through selected items.

Keep in mind, that if you are dealing with time consuming operation it might be better to require user to perform a certain action (click a button?) in order to initiate "query" on the selected items.
In this case all you need is be able to find which items are selected (for example with QList<QListWidgetItem *> QListWidget::selectedItems () const).

Regards,
   Alex



-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Hatem Nassrat
Sent: Wednesday, August 05, 2009 9:06 PM
To: qt-interest at trolltech.com
Subject: Re: [Qt-interest] QListWidget itemOnRelease

Hi,

I have a bunch of items in a QListWidget, and based on what the user
clicks on I want to go query a service. Now I found that the user may
also press on an item and drag the mouse to select other items without
clicking. Now what I am looking for is the event where he releases
his/her mouse, basically onMouseRelease but directly releated to items
in a QListWidget, any one know of any tricks to do this?

--
Hatem Nassrat

A: Yes.
>Q: Are you sure?
>> A: Because it reverses the logical flow of conversation.
>>> Q: Why is top posting annoying in email?
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest


---------------------------------------------------------------------------------------------------
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."




More information about the Qt-interest-old mailing list