Re: [PySide] What if a slot is not decorated with @Slot()?

2022-11-19 Thread Christian Tismer-Sperling
On 18.11.22 20:27, ic...@gmx.net wrote: Hello Chris and others, thanks for the insights. To be honest, I don't completely understand the issues I might be facing when not using @Slot decorators. Furthermore, I fear that there are a lot of code lines in my project which do not use the

Re: [PySide] What if a slot is not decorated with @Slot()?

2022-11-18 Thread Zhao Lee
Thanks Chris! The question originated from the issue : In my project, self.sender() in the downloadFinished slot sometimes returns None instead of QNetworkReply, if comment the @Slot() ahead it seems to always return QNetworkReply - works well. The same issue also happened to the slot connected

Re: [PySide] What if a slot is not decorated with @Slot()?

2022-11-18 Thread Tim Roberts
On 11/18/22 11:27 AM, ic...@gmx.net wrote: If this statement is actually true, I'm starting to wonder why using non-decorated python functions is at all possible in signal/slot connections? History.  Qt on Python predates decorators in Python. -- Tim Roberts, t...@probo.com Providenza &

Re: [PySide] What if a slot is not decorated with @Slot()?

2022-11-18 Thread icfwm
Hello Chris and others, thanks for the insights. To be honest, I don't completely understand the issues I might be facing when not using @Slot decorators. Furthermore, I fear that there are a lot of code lines in my project which do not use the decorator... (and it seems to work without any

Re: [PySide] What if a slot is not decorated with @Slot()?

2022-11-18 Thread Christian Tismer-Sperling
Hi Zhao, there is a configuration problem between Qt and PySide signals and slots. The Qt signals and slots are assigned once at compile time. On PySide, initialization is different since some things happen earlier or later. There *can* be situations constructed which go wrong, although doing

Re: [PySide] What if a slot is not decorated with @Slot()?

2022-11-16 Thread Zhao Lee
I initially expect that the aim of the decorator @Slot() is to make things easier like this https://uwsgi-docs.readthedocs.io/en/latest/PythonDecorators.html#notes and without the decorator , you'd expect write a little more code like

Re: [PySide] What if a slot is not decorated with @Slot()?

2022-11-16 Thread Cristián Maureira-Fredes via PySide
Hello, The answer can be found in https://code.qt.io/cgit/pyside/pyside-setup.git/tree/sources/pyside6/libpyside/dynamicqmetaobject.cpp#n557 The main idea is to register Slots (and signals) at parsing time, before the connection is done. An old issue can be find here:

[PySide] What if a slot is not decorated with @Slot()?

2022-11-15 Thread Zhao Lee
The doc says: It is really important to decorate each method declaration with a @Slot(), in that way PySide6 knows internally how to register them into Qt. But the method used as the slot works well even without the @Slot() decorator , I wonder if there is a risk in doing