本文整理汇总了C++中QSplashScreen::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ QSplashScreen::clear方法的具体用法?C++ QSplashScreen::clear怎么用?C++ QSplashScreen::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSplashScreen
的用法示例。
在下文中一共展示了QSplashScreen::clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main( int argc, char ** argv )
{
QApplication a( argc, argv );
// dSelectDB dselectdb;
dLogin dlogin;
// application = &a;
int rc = 1;
bool ok;
QPixmap pixmap;
BrInitError error;
QTextCodec::setCodecForCStrings( QTextCodec::codecForName("UTF8") );
aLog::init("",aLog::MT_DEBUG);
#ifndef _Windows
if (br_init_lib(&error) == 0 && error != BR_INIT_ERROR_DISABLED) {
aLog::print(aLog::MT_INFO, QObject::tr("Warning: BinReloc failed to initialize (error code %1)\n").arg(error));
aLog::print(aLog::MT_INFO, QObject::tr("Will fallback to hardcoded default path.\n"));
}
aLog::print(aLog::MT_DEBUG, QObject::tr("main - BinReloc path to data dir is %1.\n").arg( br_find_data_dir("/usr/share") ));
aLog::print(aLog::MT_DEBUG, QObject::tr("main - BinReloc path to lib dir is %1.\n").arg( br_find_data_dir("/usr/lib") ));
#endif
if ( parseCommandLine( qApp->argc(), qApp->argv() ) ) return 1;
qApp->installTranslator( &tr_app );
qApp->installTranslator( &tr_lib );
qApp->installTranslator( &tr_plugins );
pixmap = QPixmap::fromMimeSource( "engine-splash-"+lang+".png" );
if ( pixmap.isNull() )
#ifdef _Windows
pixmap = QPixmap::fromMimeSource( qApp->applicationDirPath()+"/engine-splash-"+lang+".png" );
qApp->addLibraryPath( qApp->applicationDirPath() );
#else
pixmap = QPixmap::fromMimeSource( QString(br_find_data_dir("/usr/share") ) + "/ananas/designer/locale/engine-splash-"+lang+".png");
qApp->addLibraryPath( QString( br_find_lib_dir("/usr/lib")) + "/ananas/qt3plugins" );
QStringList list = a.libraryPaths();
QString libPath = "";
QStringList::Iterator it = list.begin();
while( it != list.end() ) {
libPath += *it+":";
++it;
}
aLog::print(aLog::MT_DEBUG, QString("main - qt library path is '%1'\n").arg( libPath));
#endif
printf("extensions: \n%s\n",( const char *) AExtensionFactory::keys().join("\n") );
// Test create extension
// AExtension *e = AExtensionFactory::create("AExtTest");
// if (e) printf("EXT OK\n"); else printf("NO EXT OK\n");
if ( pixmap.isNull() )
pixmap = QPixmap::fromMimeSource( "engine-splash-en.png" );
QSplashScreen *splash = new QSplashScreen( pixmap );
if ( ananas_login( rcfile, username, userpassword ) ){
// if ( rcfile.isEmpty() ) {
// if (dselectdb.exec()==QDialog::Accepted) rcfile = dselectdb.rcfile;
// }
// if ( !rcfile.isEmpty() ) {
// if (dlogin.exec()==QDialog::Accepted) {
// username = dlogin.username;
// userpassword = dlogin.password;
// }
// if (dselectdb.rcfile.isEmpty()) return 0;
splash->show();
splash->message( QObject::tr("Init application"), Qt::AlignBottom, Qt::white );
MainForm *w = new MainForm( 0, "MainForm");
mainform = w;
mainformws = mainform->ws;
mainformwl = mainform->wl;
qApp->setMainWidget( w );
w->rcfile = rcfile;
// printf( "rcfile = %s\n", rcfile.ascii() );
w->show();
ok = w->init();
splash->clear();
splash->finish( w );
delete splash;
if ( ok ) {
qApp->connect( qApp, SIGNAL( lastWindowClosed() ), qApp, SLOT( quit() ) );
rc = qApp->exec();
if( w ) delete w;
w=0;
} else {
QMessageBox::critical(0, QObject::tr("Error"), QObject::tr("Ananas runtime init error. See message window and log file for details."));
}
aLog::close();
return rc;
}
else
{
aLog::close();
return 0;
}
}