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 588 - no way to connect a signal to another signal using, e.g. slider.valueChanged.connect() syntax
: no way to connect a signal to another signal using, e.g. slider.valueChanged....
Status: CLOSED INVALID
Product: PySide
Classification: Unclassified
Component: QtCore
: 1.0.0 beta2
: All Linux
: P3 normal
Assigned To: renato filho
:
:
:
  Show dependency treegraph
 
Reported: 2011-01-05 19:21 EET by forensic7278
Modified: 2011-01-08 16:23 EET (History)
9 users (show)

See Also:


Attachments
slightly edited example PyQT tutorial file that demonstrates the new-syntax failing to connect signal to signal (3.20 KB, text/x-python)
2011-01-05 19:21 EET, forensic7278
Details
signal -> singal connection example (348 bytes, text/x-python)
2011-01-06 10:23 EET, renato filho
Details
example using the signal to signal syntax and @QtCore.Signal syntax (3.40 KB, text/x-python)
2011-01-08 16:23 EET, forensic7278
Details

Note You need to log in before you can comment on or make changes to this bug.
Description forensic7278 2011-01-05 19:21:54 EET
Created attachment 211 [details]
slightly edited example PyQT tutorial file that demonstrates the new-syntax
failing to connect signal to signal

the long syntax that specifies SIGNAL and SLOT works, but using the new-syntax
to connect a SIGNAL with another SIGNAL doesn't seem to work.

example from PyQT tutorial attached - the top two lines should replace the
commented lines in the first (LCDRange) class.  It works for a SIGNAL-SLOT
connection, but not for the SIGNAL-SIGNAL connection.
Comment 1 renato filho 2011-01-06 10:22:42 EET
Thanks for your bug report, but after check your example, I found some mistakes
on it.

First:

this line:
self.slider.valueChanged.connect(self.valueChanged(int))

the correct way to use connect funcion is:
self.slider.valueChanged.connect(self.valueChanged)

but your current class class LCDRange(QtGui.QWidget) does not provide any
valueChand function, then you need create one:

def valueChanged(self, val):
     print "value changed:", val

this will make your example work.

if you want declare a signal on your class use the @Signal decorator.

@QtCore.Signal(int)
def valueChanged(self, val):
     print "value changed:", val
Comment 2 renato filho 2011-01-06 10:23:25 EET
Created attachment 212 [details]
signal -> singal connection example

This is a small example showing the signal -> signal connection working.
Comment 3 renato filho 2011-01-06 10:26:57 EET
marking as invalid
Comment 4 renato filho 2011-01-06 16:25:26 EET
released on beta3
Comment 5 forensic7278 2011-01-08 16:23:06 EET
Created attachment 215 [details]
example using the signal to signal syntax and @QtCore.Signal syntax

I tried following the changes you suggested, and I was able to get the
'self.slider.valueChanged.connect(self.valueChanged)' to work with a regular
valueChanged function definition as you described in the first part, but could
not get the @QtCore.Signal(int) decoration to work.  The console gives a
'TypeError: native Qt signal is not callable' traceback.