[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] qlistview
From: Baz Walter <bazwal () ftml ! net>
Date: 2008-10-30 22:42:12
Message-ID: 490A3844.8070406 () ftml ! net
[Download RAW message or body]
kachim kachim wrote:
> hi,
> I'm quite newbie in pyqt, so maybe my question is silly but I couldn't
> find answer with google helps. I want to know when the user clicks on
> my listview. Now I'm using void clicked (const QModelIndex&) signal
> but it isn't what I want, signal is emitted only when then index is
> valid. It is also interesting for me when index is invalid. How can I
> do this?
class ListView(QListView):
def __init__(self, parent):
QListView.__init__(self, parent)
def mousePressEvent(self, event):
if not self.indexAt(event.pos()).isValid():
print 'invalid index'
QListView.mousePressEvent(self, event)
Regards
Baz Walter
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic