I am making a GUI system with PySide2.
When a certain QDockWidget (Widget1) closes, I want to realize the operation of showing the QDockWidget (Widget2) that was hidden in advance, but I'm stumbling.
The processing flow currently being tried is as follows.
- Initially Widget2 is open, then hide itself after opening Widget1 in the middle
- Signal fire when Widget1 closes itself
- Widget2 shows itself
However, I get the following error.
'PySide2.QtCore.Signal' object has no attribute'connect'
Below is the source code.
class Widget1 (QDockWidget): Open after # Widget2 hides. closeSignal = Signal () def __init __ (self, file_name): super (Widget1, self) .__ init __ () (Omitted: Button installation to execute close_Widget1) def close_Widget1 (self): self.closeSignal.emit () self.close () class Widget2 (QDockWidget): # First opened. def __init __ (self, file_name): super (Widget2, self) .__ init__ () (Omitted: Open widget1 and hide yourself.) Widget1.closeSignal.connect (self.widget1_show) @Slot () def widget1_show (self): self.show ()
I can't figure out the cause even if I look it up.
Can anyone give me some advice?
In addition, we are not particular about processing using signals and slots, so
If the other process seems to be better, I'll try it.
Answer # 1
Depending on the code omitted,
Widget1Is a class, so
You need to connect to the instance's signal.
How to send a signal when the window is closed
closeEventSee also event handlers.
- python - i get an error when connecting to a voice channel with discordpy
- python - the py file cannot be executed in the task scheduler 0x2 error
- python - in raspberry pi, the error occurs only in the case of the automatic start program using systemd
- python - categorical_crossentoropy error does not resolve
- readcsv error in python
- python - i want to display an image with pysimplegui, but an error occurs
- python - error when scraping with selenium and firefox
- [python] graphviz output format error
- python 3x - best estimator: i get an error with no syntax, so please tell me what to do
- [python] i don't know how to solve the error
- python - an error has occurred in yolo v3
- python - idle cannot resolve the "rootgeometry" error
- python - tuple error does not resolve
- python max () arg is an empty sequence and an error occurs and it cannot be processed well
- python 3x - error after changing to csv file
- python error code how to deal with
- python - error in image binarization using cv2adaptivethreshold function
- python - sklearn, svm error
- python - an error occurs in the if statement program that compares the size of numbers
- python : Removing the focus with LineEdit in Pyqt
- python : Signal transmission between classes
- python : How to track changes in the PyQT5 cell?
- python : How to perform any action when you click on Label?
- python : How does Qpainter work?
- python : Calling Update Functions To update Paintevent
- python : Why does Qtdesigner squeeze the window?
- python : How to send QPushButton Enterevent?
- python : Unintentional closure of the program window when calling a function in PyQT5
- python : Create a class well and determine the contents in it.