Answer the question
In order to leave comments, you need to log in
How to collapse a PyQt5 program?
There is a program with a property on top of all windows and located by a script in a certain place on the screen. With a certain action, you need to collapse it, and then, when you click on the global hotkey (it already exists), expand it. MyWin.showMinimized(self) works in a strange way, it collapses it so that it can't even be expanded manually. How can this be done?'
upd. Empirically, it turned out that without a function on top of all windows, minimized works as it should. On top of all the windows I have in the body of the class: MyWin.setWindowFlag(self,Qt.WindowStaysOnTopHint)
. Accordingly, it is necessary to somehow cut it down when folding is called.
upd2. I brought the statetop into a function, initially it is true, after minimizing it falls, after the inverse maximized it is true again. Everything seems to work, prints are displayed when needed, but there is no result. It remains in a collapsed mode, from which it cannot be deployed in any way.
def StayTop(self):
if self.top is True:
MyWin.setWindowFlag(self,Qt.WindowStaysOnTopHint)
print('StayTop')
else:
MyWin.setWindowFlag(self,Qt.WindowStaysOnBottomHint)
print('StayBottom')
self.top = True
self.StayTop()
print('123')
MyWin.showMaximized(self)
print('showM')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question