I have a class drived from QMessageBox, and the size of the dialog is set by default, I want it to be wider and have a better look (less word wrap). Of course, setMinimumWidth() or setFixedSize() don't work, the size is automatically computed by QMessageBox. I searched the web, someone said that overwrite showEvent() or resizeEvent() could do, I've tried but it had no effect, my QT version is 4.7, maybe that method only works with older Qt. I also found an ugly way to set the minimum size, that is, adding many spaces to window title, at last I find it's not a workaround, since there is always three dot "..." at the end of the title bar, not user friendly. Our project had used a lot of such derived message box, it's not a good idea to write a new one, I want to know is there any other way to change the size?