[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] Additional decorators - not working correctly anymore
From: Phil Thompson <phil () riverbankcomputing ! co ! uk>
Date: 2007-05-31 22:06:35
Message-ID: 200705312306.35609.phil () riverbankcomputing ! co ! uk
[Download RAW message or body]
On Thursday 31 May 2007 9:26 pm, Necoro wrote:
> Hi,
>
> me again ;) (just don't want to mangle the two topics.).
I think I agree with your other report - I need to do some testing.
> Switched from PyQt-4.1.1 to PyQt-4.2. and now the following does not
> work anymore:
>
> @Qt.pyqtSignature("")
> @Window.watch_cursor
> def on_searchBtn_clicked(self):
> print "i have been clicked"
>
>
> Window.watch_cursor is defined as follows:
>
> @staticmethod
> def watch_cursor (func):
> """This is a decorator for functions being so time consuming, that
> it is appropriate to show the watch-cursor."""
> def wrapper (*args, **kwargs):
> ret = None
>
> Qt.QApplication.setOverrideCursor(Qt.Qt.WaitCursor)
> try:
> ret = func(*args, **kwargs)
> finally:
> Qt.QApplication.restoreOverrideCursor()
>
> return ret
>
> return wrapper
>
>
>
> If I remove the "watch_cursor" decorator, "on_searchBtn_clicked" is
> executed - but not if I use the decorator :(.
> Can anybody give me a hint or tell me, why this is not working?
Can you produce a small example that demonstrates the problem?
Phil
_______________________________________________
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