PDA

View Full Version : resize of QMessageBox not working?



Sheng
12th November 2008, 15:52
I want to change the size of QMessageBox and use resize(int w, int h) function, but it does not make any difference of appearance, any ideas?
Thanks,

spirit
12th November 2008, 16:09
QMessageBox has the next flag Qt::MSWindowsFixedSizeDialogHint. so, initially the message box can be resized. but you can try to remove this flag in this case you need to conctruct a dialog by yourself and then call exec() method.

Sheng
13th November 2008, 14:25
QMessageBox has the next flag Qt::MSWindowsFixedSizeDialogHint. so, initially the message box can be resized. but you can try to remove this flag in this case you need to conctruct a dialog by yourself and then call exec() method.

still the same, any more suggestion? I can just go ahead to use a dialog, obviously, but feel better if I know why it does not work, thanks.
Here is what I have done:

QMessageBox myMessageBox;
myMessageBox.setText(versionString);
myMessageBox.setStandardButtons(QMessageBox::Close );
myMessageBox.resize(400,200);
myMessageBox.exec();