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 450 - Signal emitting behaviour changed when an unrelated signal is connected
: Signal emitting behaviour changed when an unrelated signal is connected
Status: CLOSED INVALID
Product: PySide
Classification: Unclassified
Component: QtDeclarative
: HEAD
: All All
: P3 normal
Assigned To: renato filho
:
:
:
  Show dependency treegraph
 
Reported: 2010-11-01 12:16 EET by Matti Airas
Modified: 2010-11-25 17:53 EET (History)
0 users

See Also:


Attachments
Example application (1.14 KB, application/x-gzip)
2010-11-01 12:16 EET, Matti Airas
Details
cpp example (9.46 KB, application/x-gzip)
2010-11-02 13:30 EET, renato filho
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matti Airas 2010-11-01 12:16:57 EET
Created attachment 133 [details]
Example application

When I run the attached code, the signals connected to printer.output work
fine:

123
foobar

However, when I connect the printer.output signal to textRotationChanged by
removing the comment in qmlsigs.py:34, I get:

123.0
nan

o_O
Comment 1 renato filho 2010-11-02 11:25:26 EET
Reading your example I check you connect a string slot to a double signal. In
my point of view this is not correct, but I do not know if this is valid in a
QML program.

I changed you example creating a new slot with float signature and connect this
signal 'textRotationChanged' to this new slot and everything works fine.

Now I need to now if is valid connect a string slot with a double signal, if
this is valid then we have a bug on PySide.
Comment 2 renato filho 2010-11-02 13:30:08 EET
I created a similar test on cpp, and this behavior is the same as python, 

After some investigation I discovered the problem. QML was emitting a wrong
singal when calling the 'output' method with QString signature. 

For some reason QML aways call the double signature.

This only happen when you have 2 slots with the same name but different
signatures in the same object.


Then we can conclude with this examples, this is a QML bug.

Check my example, if you agree with me, please close the bug, and fell free to
report this on Qt bugzilla.
Comment 3 renato filho 2010-11-02 13:30:34 EET
Created attachment 135 [details]
cpp example
Comment 4 Matti Airas 2010-11-03 06:19:20 EET
Thanks for the C++ sample. An interesting thing there is that if I switch the
order in which the slots are declared (in the header file), the C++ example
works.

However, the behaviour is slightly different in Python. If I leave
textRotationChanged disconnected and then add the following slot decoration:

    @QtCore.Slot(str)
    @QtCore.Slot(float)
    def output(self,s):
    print s

the example still works as before (I believe the slots are declared in inverse
order of the decorators because of their "recursive" behaviour). However, if I
switch the order of the decorators:

    @QtCore.Slot(float)
    @QtCore.Slot(str)
    def output(self,s):
    print s

then I get:

123.0
nan

I guess this is fine and consistent with the C++ example. However, even if I
have added the explicit float decorator and then connect textRotationChanged,
the thing still breaks! Is this a separate issue?
Comment 5 Matti Airas 2010-11-03 10:12:29 EET
As discussed on the IRC: when connecting textRotationChanged in Python, an
implicit slot with 'double' signature is added. If the explicit signature is
made 'double', everything works again.

Another part of the issue is that QML always picks the first overloaded slot in
Qt meta object. This is a bug in QML and will be fixed in Qt 4.7.2:

http://bugreports.qt.nokia.com/browse/QTBUG-11604?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel

Since there doesn't appear to be any PySide issue behind this, I'm resolving
the bug as invalid.
Comment 6 Hugo Parente Lima 2010-11-25 17:53:43 EET
Released on version 1.0.0~beta1