Nominate our 2022 Qt Champions!

Subclassing QMessageBox [Solved]

  • I need to customize QMessageBox. I need to remove the Window Manager's title bar, and have one of my own. I am using "this ": to create my own title bar, but how do I insert it into the message box's layout? I also need to replace the standard buttons and probably redo the background color of the box.

    Is it possible to subclass QMessageBox and achieve the above? is there any example anywhere for this?

    Or, should I just subclass Dialog and create my own message box?

  • If you want to do that, take care of the side effects:

    If you remove the window managers title bar on windows, you loose all things like automatic full screen on double click of title bar, display in the task bar etc.

    And I do not think that deriving from QMessageBox and insert something in the layout at the top will work properly. I would create my own dialog or use OS things to achieve this (at least on windows :-) ).

  • Thank you. I implemented my own messagebox by subclassing QDialog

  • Be sure and edit your original post and add [Solved] to the title of the thread. Thanks!

Log in to reply