[PyQt] Additional decorators - not working correctly anymore

Necoro lists at necoro.eu
Thu May 31 21:26:21 BST 2007


Hi,

me again ;) (just don't want to mangle the two topics.).

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?

Thanks,
Nec


More information about the PyQt mailing list