[Qt-interest] QListWidget clicked() signal

Martin Fiala fialkam at gmail.com
Sun Mar 8 17:34:00 CET 2009


Ok, thank you both for your answers, I'll try to make it so..

Martin

On Sun, Mar 8, 2009 at 3:07 PM, Andreas Pakulat <apaku at gmx.de> wrote:
> On 08.03.09 13:55:37, Martin Fiala wrote:
>> Hello,
>> first, I'm new to this list, so hello everyone.
>> I've found many answers here before, but not to this one:
>>
>> I'm using two QListWidget items in my form and want to add a signal to
>> each, that calls some function when the Widget is clicked. Sounds
>> pretty easy, but unfortunately, isn't. So far I was able to manage
>> with itemClicked signal, but the problem is, I need the signal to be
>> emitted even if the list is empty.
>
> Then you probably need to subclass QListWidget and override the
> mouseReleaseEvent() method. That one will be called when a mouse button was
> released.  Make sure to accept the event you get when you've done your
> custom mouse-click handling and also that you call the superclass
> implementation when you don't want to do custom mouse-click handling (for
> example if the widget does have items).
>
> Andreas
>
> --
> Stay away from flying saucers today.
> _______________________________________________
> 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