PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 820 - Slots cannot receive signal when another decorator is present
: Slots cannot receive signal when another decorator is present
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: PySide
: 1.0.1
: N900 Maemo5/Fremantle
: P3 normal
Assigned To: renato filho
:
:
:
  Show dependency treegraph
 
Reported: 2011-04-09 23:36 EEST by Ed Page
Modified: 2011-05-26 17:04 EEST (History)
8 users (show)

See Also:


Attachments
Script that be configured to run with/without PySide and with/without decorators (2.80 KB, text/x-python)
2011-04-09 23:36 EEST, Ed Page
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Page 2011-04-09 23:36:02 EEST
Created attachment 308 [details]
Script that be configured to run with/without PySide and with/without
decorators

I use a decorator on all of my callbacks to record to a log file any exceptions
to help in debugging user issues.

When porting from PyQt to PySide, I found that if I am using a cross-thread
signal/slot and the slot decorator decorates a function that has my logging
decorator applied, it will not receive any of the signals.

Example:
    @Slot()
    @log_exception()
    def process(self):

Workarounds:
* Use PyQt
* Do not use decorator
* Move all slot logic to another function that is decorated, leaving the slot
to call it.  For example:
    @qt_compat.Slot(object)
    def _on_task_added(self, task):
        self.__on_task_added(task)

    @misc.log_exception(_moduleLogger)
    def __on_task_added(self, task):
This is a bit messy though and would be nice to have this fixed.

Attached code will autodetect the available bindings and try to run some
producer/consumer code.  When DECORATE is True and it is using PySide, the
script will never terminate on its own.  If DECORATE is False or PyQt is used,
it will print the results of the producer/consumer and exit.
Comment 1 Ed Page 2011-04-20 05:37:55 EEST
I'm not too sure what is different from a lot of my other code but I just now
hit this again but without crossing threads.

https://github.com/epage/DialCentral/blob/master/src/dialogs.py#L419

I'd be curious the number of times I am just not noticing the slots not
receiving their signal.
Comment 2 renato filho 2011-05-05 17:42:20 EEST
fixed on pyside commit:

commit a31fb14a1f37d9a10283e1e257389da9c1a74105
Author: Renato Filho <renato.filho@openbossa.org>
Date:   Wed May 4 17:23:37 2011 -0300
Comment 3 renato filho 2011-05-26 17:04:05 EEST
PySide release 1.0.3