0

I have a mainwindow and a button on this mainWindow that opens a popup. Now I want to force the focus on that popup.

Right now i am doing

mainwindow.setEnabled(False)
popup.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)

when the popup is opened and

mainwindow.setEnabled(True)

when the popup is closed, but that does not affect the focus.

Is there another way, than to catch the signal that the mainwindow got the focus and force it back to the popup?

Jonas
  • 1,838
  • 4
  • 19
  • 35

1 Answers1

0

Thanks to a comment I was able to solve it myself (and it was quite easy):

popup.setWindowModality(QtCore.Qt.ApplicationModal)

link

Jonas
  • 1,838
  • 4
  • 19
  • 35