dbzhang800 |
2016-09-18 10:53 |
你用的什么平台,Windows7下,Qt4.8.5、Qt5.5.1、Qt5.6.1、Qt5.7.0 下,如下代码没发现你描述的问题
- #include <QApplication>
#include <QDialog> #include <QMainWindow>
class MainWindow : public QMainWindow { public: MainWindow() { resize(800, 600); setWindowTitle("MainWindow for show event test!"); }
protected: void showEvent(QShowEvent *evt) { QDialog dlg; dlg.resize(400, 300); dlg.exec(); } };
int main(int argc, char *argv[]) { QApplication a(argc, argv);
MainWindow mw; mw.show();
return a.exec(); }
|
|