#include #include class MyWidget : public QWidget { public: MyWidget(){} virtual ~MyWidget() {} }; int main (int argc, char **argv) { QApplication app (argc, argv); app.setQuitOnLastWindowClosed (true); MyWidget widget; widget.resize (100, 100); widget.show(); QMessageBox *mb = new QMessageBox (QMessageBox::Warning, "Title", "text", QMessageBox::NoButton, NULL, //&widget, Qt::Dialog); mb->show(); return app.exec(); }