Skip to content
Advertisement

How to re Open my closed subwindow in PyQt5 QStackWidget?

Add My second File In QStackwidget.

After pressing the “close” Button from the second file, I can’t able to reopen it. How to reopen the second file? How to refresh the code?

How to close the second/Subwindow file properly and re-open the same from the first file. or If we close the second file, How to refresh the first file fully.

First File

JavaScript

SecondFile

JavaScript

Advertisement

Answer

If you have hidden it then you have to call show():

JavaScript

Note: It is advisable to avoid the abuse of lambda methods, if they are not strictly necessary then do not use them, in your case using a lambda to invoke the close method is unnecessary so you should use:

JavaScript

In addition, the concept of files only serves to order the project but it does not make sense in the execution of the program since the same logic applies if all the logic is in the same file.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement