#include <QtGui>
#include <QDebug>
int main(int argc, char *argv[])
{
// msgBox1.setMinimumWidth(400); // seemingly ignored, always same width box
// msgBox1.setFixedSize(QSize(400, 200)); // also no effect
// msgBox1.setFixedSize(400, 200);
dw.setFixedSize(100, 100);
msgBox1.layout()->addWidget(&dw);
msgBox1.setWindowTitle("Width 400");
msgBox1.setText("<strong>Warning</strong>");
msgBox1.setInformativeText(
"You have not entered hours against this event<br /> "
"Do you wish to save the event anyway?");
msgBox1.show();
// msgBox2.setMinimumWidth(800); // seemingly ignored, always same width box
// msgBox2.setFixedSize(QSize(800, 200));
// msgBox1.setFixedSize(800, 200);
msgBox2.setWindowTitle("Width 800");
msgBox2.setText("<strong>Warning</strong>");
msgBox2.setInformativeText(
"You have not entered hours against this event<br /> "
"Do you wish to save the event anyway?");
msgBox2.exec();
return app.exec();
}
// vi: sw=4 ts=4 et
#include <QtGui>
#include <QDebug>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QMessageBox msgBox1;
// msgBox1.setMinimumWidth(400); // seemingly ignored, always same width box
// msgBox1.setFixedSize(QSize(400, 200)); // also no effect
// msgBox1.setFixedSize(400, 200);
QPushButton dw;
dw.setFixedSize(100, 100);
msgBox1.layout()->addWidget(&dw);
msgBox1.setWindowTitle("Width 400");
msgBox1.setText("<strong>Warning</strong>");
msgBox1.setInformativeText(
"You have not entered hours against this event<br /> "
"Do you wish to save the event anyway?");
msgBox1.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
msgBox1.setDefaultButton(QMessageBox::No);
msgBox1.setIcon(QMessageBox::Warning);
msgBox1.show();
QMessageBox msgBox2;
// msgBox2.setMinimumWidth(800); // seemingly ignored, always same width box
// msgBox2.setFixedSize(QSize(800, 200));
// msgBox1.setFixedSize(800, 200);
msgBox2.setWindowTitle("Width 800");
msgBox2.setText("<strong>Warning</strong>");
msgBox2.setInformativeText(
"You have not entered hours against this event<br /> "
"Do you wish to save the event anyway?");
msgBox2.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
msgBox2.setDefaultButton(QMessageBox::No);
msgBox2.setIcon(QMessageBox::Warning);
msgBox2.exec();
return app.exec();
}
// vi: sw=4 ts=4 et
To copy to clipboard, switch view to plain text mode
and result is attached. Not sure it proves anything though.
Bookmarks