Issue
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?
Solution
Thanks to a comment I was able to solve it myself (and it was quite easy):
popup.setWindowModality(QtCore.Qt.ApplicationModal)
Answered By - Jonas
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.