Qiao
Qiao

Reputation: 17049

PyQt emulate minimize button "_"

How can I minimize window in PyQt the same way as when _ is pressed?

I use

self.showMinimized()

It really minimizes window.
But there is no refocus to the previous window. As if focus is still on minimized window.

How can I minimize and refocus to the previous window as if minimize button _ is pressed?

Upvotes: 5

Views: 9307

Answers (2)

Cuanms
Cuanms

Reputation: 41

Just Connect it this way

Minimized.clicked.connect(self.showMinimized)

Upvotes: 4

tzot
tzot

Reputation: 95911

(Copying Qiao's comment as an answer:)

I solved my problem with showNormal() and then showMinimized() once again.

Upvotes: 2

Related Questions