Maya - Custom Error/Query Windows

Hi Guys
I am trying todo a custom errorhandling module for maya (python), the reason is that I want to use the same module for all my tools.

What I plan is a qt interface for my windows however what I am lacking is a way of “forcing the focus” on the new popup until the user clicked whatever button.

Basically I wan to lock all user actions in maya until the button is pressed or window is closed.

Does anyone have any idea how to do this?

Windows which don’t allow the user to interact with anything else until they are dealt with are usually referred to as ‘modal’ or modal dialogues.

You can use the QWidget.setWindowModality method and set that to Qt.ApplicationModal to stop the user interacting with anything but your window. You can also set that in Qt Designer if you’re authoring stuff that way.