Signal and Slot

Heads up! You've already completed this tutorial.

Scoodood | 2020-08-06 18:18:52 UTC | #1

Dear Martin,

I am just done watching the Signal, Slots & Events video and done reading the Signals and Slots chapter on your PySide2 ebook. The sample code below is from your video

python
self.windowTitleChanged.connect(self.onWindowTitleChange)

def onWindowTitleChange(self, s):   # <--- "s" ??
   print(s)

How do you know that the signal is also passing along a string variable s in this case? There are so many type of signals in Qt (pressed, released, drag, move....etc), how do we know each signal is passing along what-else when it is triggered? How do we find out?

Thanks


Impiastro_1 | 2020-08-07 15:59:20 UTC | #2

[quote="Scoodood, post:1, topic:394"] How do you know that the signal is also passing along a string variable s in this case? There are so many type of signals in Qt (pressed, released, drag, move…etc), how do we know each signal is passing along what-else when it is triggered? How do we find out? [/quote]

Create GUI Applications with Python & Qt6 by Martin Fitzpatrick — (PySide6 Edition) The hands-on guide to making apps with Python — Over 10,000 copies sold!

More info Get the book

You can find your answers here: https://doc.qt.io/qtforpython/PySide2/QtGui/QWindow.html?highlight=windowtitlechanged#PySide2.QtGui.PySide2.QtGui.QWindow.windowTitleChanged

I think that in this case the signal emits only one unicode parameter.

Over 10,000 developers have bought Create GUI Applications with Python & Qt!
Create GUI Applications with Python & Qt6
Take a look

Downloadable ebook (PDF, ePub) & Complete Source code

Also available from Leanpub and Amazon Paperback

[[ discount.discount_pc ]]% OFF for the next [[ discount.duration ]] [[discount.description ]] with the code [[ discount.coupon_code ]]

Purchasing Power Parity

Developers in [[ country ]] get [[ discount.discount_pc ]]% OFF on all books & courses with code [[ discount.coupon_code ]]

ROb


PyQt/PySide 1:1 Coaching with Martin Fitzpatrick — Get one on one help with your Python GUI projects. Working together with you I'll identify issues and suggest fixes, from bugs and usability to architecture and maintainability.

Book Now 60 mins ($195)

Well done, you've finished this tutorial! Mark As Complete
[[ user.completed.length ]] completed [[ user.streak+1 ]] day streak
Martin Fitzpatrick

Signal and Slot was written by Martin Fitzpatrick .

Martin Fitzpatrick has been developing Python/Qt apps for 8 years. Building desktop applications to make data-analysis tools more user-friendly, Python was the obvious choice. Starting with Tk, later moving to wxWidgets and finally adopting PyQt. Martin founded PythonGUIs to provide easy to follow GUI programming tutorials to the Python community. He has written a number of popular Python books on the subject.