qt signals and slots example: Sử dụng __slots__ trong Python. Problem understanding Signals/Slots. What's New in Python 2.2.
Có lẽ là serverThread và QtWidgets.QApplication ở 2 thread khác nhau nên sinh ra lỗi này. Bạn thử dùng event signals &
slots của qt để setText.
Signals
and slots are used for communication between objects. The signals and slots mechanism is a central feature of Qt and probably the part that differs most from the features provided by other frameworks.
When working with
Qt slots and signals in PySide6 you will discover the @
Slot decorator. This decorator is used to mark a Python function or method as
a slot to which a Qt signal can be connected.