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 325 - Emitting new-style signals with str/unicode parameters fails with Qt.QueuedConnection
: Emitting new-style signals with str/unicode parameters fails with Qt.QueuedCo...
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: PySide
: 0.4.0
: PC Linux
: P5 normal
Assigned To: renato filho
:
:
:
  Show dependency treegraph
 
Reported: 2010-08-30 19:56 EEST by msonnemann
Modified: 2010-09-10 19:21 EEST (History)
8 users (show)

See Also:


Attachments
new-style-signal broken, str parameter (576 bytes, text/x-python)
2010-08-30 19:56 EEST, msonnemann
Details
old-style-signals work (920 bytes, text/x-python)
2010-08-30 19:57 EEST, msonnemann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description msonnemann 2010-08-30 19:56:12 EEST
Created attachment 71 [details]
new-style-signal broken, str parameter

Using Ubuntu 10.04, libqt 4.7.0, pyside 0.4.0:

Trying to emit a new-style signal with string or unicode parameters using the
connection-type Qt.QueuedConnection results in the following error message:

QObject::connect: Cannot queue arguments of type 'str'
(Make sure 'str' is registered using qRegisterMetaType().)

and

QObject::connect: Cannot queue arguments of type 'unicode'
(Make sure 'unicode' is registered using qRegisterMetaType().)

Usage of Qt.AutoConnection fails, too, if emitting occurs inside a thread.

Emitting old-style-signals like self.emit( SIGNAL("done(QString)"), "abc" )
still works.

A minimal bug example is attached.
Comment 1 msonnemann 2010-08-30 19:57:48 EEST
Created attachment 72 [details]
old-style-signals work

Workaround using old-style-signals (doesn't look as nice, though) and
explicitly demanding a QString
Comment 2 msonnemann 2010-08-30 23:44:18 EEST
I found a solution, and it's embarrassingly simple, too:
Instead of declaring the signal as

done = Signal(str)

, declare it as

done = Signal("QString")

and it works for me. Still pretty confusing and looks ugly.
Comment 3 renato filho 2010-08-31 11:50:05 EEST
fixed on Pyside commit:
commit 653261e047871ae64d4e3bb97b7b24d05df06db3
Author: Renato Filho <renato.filho@openbossa.org>
Date:   Thu Aug 26 15:24:05 2010 -0300


unittest created on: 
commit 28000755c2913851a3c7c339a8eabe6ece450c30
Author: Renato Filho <renato.filho@openbossa.org>
Date:   Tue Aug 31 11:35:43 2010 -0300