Singleton instance of QSplashScreen
-
@SplashScreen* SplashScreen::m_pInstance = NULL;
SplashScreen* SplashScreen::getInstance() {
if(NULL == m_pInstance ) {
m_pInstance = new SplashScreen();
}
return m_pInstance;
}void SplashScreen::destroyInstance() {
delete m_pInstance;
m_pInstance = NULL;
}void SplashScreen::SetMessage(const std::wstring& message ) {
progressText = message.c_str();
char pC = (char)(LPCTSTR)progressText ;
splashMessage->append(QString::fromAscii(pC));
hostSplash_->showMessage(*splashMessage);}
void SplashScreen::SetSplashScreen() {
hostSplash_ = new QSplashScreen(QPixmap(":Resource Files/splash.jpg"));
}@ -
Why do you use CString and std::wstring for setting/storing text? Why not QString? Also using CString and LPCTSTR type will break cross-platform compatibility.
-
2moderators of this section: please move this thread to more correspondent category (Desktop I think)