I'm porting one example in Mark Summerfield's book: Advanced Qt Programming to QT5. I'm using QT 5.3.1&vs2013. I made some change in .pro and the source code so that the project can be build.

but when the exe runs, it shows another window(textitem dialog of the project), not the main window(an graphical editor) of the program.

the main.cpp is as following:

int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MainWindow window;
window.show();


app.setApplicationName(app.translate("main", "Page Designer"));
app.setOrganizationName("Qtrac Ltd.");
app.setOrganizationDomain("qtrac.eu");
app.setWindowIcon(QIcon(":/icon.png"));
#ifdef Q_WS_MAC
app.setCursorFlashTime(0);
#endif

qsrand(static_cast<uint>(time(0)));

return app.exec();
}

due the upload limit, I can't attach the source(The source should be build with QT greater than 5.0). but I can send it by mail .

I think this problem doesn't belong to QT5 only.

does anyone knows why? thank you in andvance.

improper window.png
mainwindow-should-be.jpg