Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
6.7.2
-
None
Description
When running an application with the following code and the environment variable QT_LOGGING_RULES set to "qt.pyside.libpyside.warning=true":
from PySide6.QtWidgets import QApplication, QWidget, QPushButton from PySide6.QtCore import Slot class Window(QWidget): def __init__(self): super().__init__() self.button = QPushButton() self.button.clicked.connect(self.click_func) def click_func(self): pass app = QApplication() window = Window() window.show() app.exec()
The console correctly outputs the following message:
qt.pyside.libpyside: Warning: Registering dynamic slot "click_func()" on "Window". Consider annotating with @Slot()
However, when you nest the click_func() function into another function, like the following code, it does not print any such message:
from PySide6.QtWidgets import QApplication, QWidget, QPushButton from PySide6.QtCore import Slot class Window(QWidget): def __init__(self): def click_func(): pass super().__init__() self.button = QPushButton() self.button.clicked.connect(click_func) app = QApplication() window = Window() window.show() app.exec()