[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: [PyKDE] How can I prevent a QLable from eating MouseEvents?
From: Markus Gritsch <gritsch () iue ! tuwien ! ac ! at>
Date: 2001-05-25 19:17:12
[Download RAW message or body]
Hi!
How can I prevent a QLable from eating MouseEvents? If I click
outside the lable in the following example, mousePressEvent() is
called, if I click on the lable it is not. What can I do to receive
MouseEvents in any case?
import sys
from qt import *
class Form1(QDialog):
def __init__(self, parent=None, name='Form1', modal=0, fl = 0):
QDialog.__init__(self,parent,name,modal,fl)
self.resize(120,60)
self.setCaption(self.tr('Form1'))
self.TextLabel1 = QLabel(self, 'TextLabel1')
self.TextLabel1.setGeometry(QRect(30,20,61,15))
self.TextLabel1.setText('TextLabel1')
def mousePressEvent(self, mouseEvent):
print 'click'
if __name__ == '__main__':
a = QApplication(sys.argv)
QObject.connect(a,SIGNAL('lastWindowClosed()'),a,SLOT('quit()'))
w = Form1()
a.setMainWidget(w)
w.show()
a.exec_loop()
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic