大家好,请教个问题。
我做了个QSplashScreen,在程序启动的时候,先显示这个QSplashScreen,然后做一些比较繁重的初始化工作,完了秀出新界面。类似于:
QApplication app(argc, argv);
QSpalshScreen* splash = new QSpalshScreen(pixmap);
splash->show();
// Do the heavy initialization job
app.setActiveWindow(MainScreen::GetInstance());
MainScreen::GetInstance()->Init();
MainScreen::GetInstance()->show();
splash->finish(MainScreen::GetInstance());
delete splash;
return app.exec();
其中,MainScreen是我的主窗口,在绣出来之前会做一些初始化工作。
但是,现在的问题是,在SplashScreen秀出来之后,MainScreen绣出来之前,我在SplashScreen上乱点,结果点击的事件都被记住了。当我的MainScreen绣出来之后,所有的点击事件都被MainScreen上的按钮给接收处理了。。。
怎么会这样呢?在app.exec执行之前,我又没办法对这些点击事件进行预处理,app.exec执行时,它又把我不想要的事件都分派下去了。。SplashScreen就像是透明的一样。。
谢谢了!!