[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: [PyKDE] qwidget.eventFilter()
From: "Aljosa Mohorovic" <aljosa () revolucija ! hr>
Date: 2006-06-05 17:59:44
Message-ID: 87d364ab0606051059o4fe01dcjad69e86fe4220c39 () mail ! gmail ! com
[Download RAW message or body]
1. i have images.qrc > images.py imported 'import images' but
QIcon(':/images/rotate_left_over.png') and
QIcon(':/images/rotate_left.png') have no effect - code below.
QIcon(':/images/rotate_left.png') should work because
/images/rotate_left.png is used in designer from images.qrc resource
and is shown in application if i don't use eventFilter.
my guess is that i should change
QIcon(':/images/rotate_left_over.png') into something similar but i
don't know what.
2. i'm actually trying to capture mouse over/out events so i can
change qpushbutton icon on mouseOver and change some text elsewhere in
application.
# PyQt4-gpl-4.0beta1-Py2.4-Qt4.1.2.exe
# this method is part of object instance "a"
def eventFilter(self, obj, event):
if obj == ui.rotate_left:
if ui.rotate_left.underMouse():
ui.rotate_left.setIcon(QIcon(':/images/rotate_left_over.png'))
else:
ui.rotate_left.setIcon(QIcon(':/images/rotate_left.png'))
return False
ui.rotate_left.installEventFilter(a)
this (under 2.) works but i'm not sure this is the right way to do it,
probably not.
Aljosa Mohorovic
_______________________________________________
PyKDE mailing list PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic