本文整理汇总了C++中QSplashScreen::message方法的典型用法代码示例。如果您正苦于以下问题:C++ QSplashScreen::message方法的具体用法?C++ QSplashScreen::message怎么用?C++ QSplashScreen::message使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSplashScreen
的用法示例。
在下文中一共展示了QSplashScreen::message方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
}
示例2: runApp
//----------------------------------------------------------------------------
// Run app
//----------------------------------------------------------------------------
void CApp::runApp()
{
// We must always have an application
QApplication application( argc_, argv_ );
AmonSoft *main = new AmonSoft; // We create our dialog
dlgAmonSoft *gui = const_cast< dlgAmonSoft* >( g_gui );
gui = main;
// Shareware version !
QDate currentDate = QDate::currentDate();
QDate expireDate;
expireDate.setYMD( 2007, 12, 30 );
if( currentDate > expireDate )
{
QMessageBox::critical( main,
"Votre version a expiré",
"Veuillez contacter votre revendeur pour continuer à utiliser ce programme",
QMessageBox::Ok,
QMessageBox::NoButton );
exit( 0 );
}
// Splash screen
QImage imgSplash( "Forms/Img/Splash.PNG" );
QSplashScreen *splash =
new QSplashScreen( imgSplash );
splash->show();
Datas::usLastId = 0;
Datas::usLastIdEntses = 0;
splash->message(QObject::tr("Initialisation de Xerces..."),
Qt::AlignLeft | Qt::AlignTop, Qt::blue);
XMLPlatformUtils::Initialize();
//<-- Insert here modules to load during splash screen
splash->message(QObject::tr("Chargement de l'interface..."),
Qt::AlignLeft | Qt::AlignTop, Qt::blue);
//-->
application.setMainWidget( main ); // It is our main widget
CUpdater up( *main );
up.updateAvailable();
// Interface init
splash->message(QObject::tr("Chargement des données..."),
Qt::AlignLeft | Qt::AlignTop, Qt::blue);
makeBackup();
// Load searchs
Datas::g_Search = new Datas::CSearch();
Datas::g_Search->loadFileSearch( sSearchFile );
Datas::g_Search->loadInComboBox( main->comboBoxSearchFunction, true );
// Add empty enterprise and person to reset form
Datas::CPersonnes *pEmptyPerson = new Datas::CPersonnes( true );
Datas::CEntreprise *pEmptyEnterprise = new Datas::CEntreprise( true );
Datas::g_listPersonnes.push_back( pEmptyPerson );
Datas::g_listEntreprises.push_back( pEmptyEnterprise );
// Initialize & load preference system
g_Preferences = new Preferences::CPreferences();
// Initialize parser
g_Parser = new CParser( sPersonnesFile );
g_ParserEntses = new CParser( sEntreprisesFile );
g_ParserFamille = new CParser( sFamilleFile );
// Be carrefull, order is really important !
loadXercesData( *main );
loadXercesDataEntses( *main );
loadXercesDataFamille( *main ); // Always after Personnes load !!
// TODO: Put progress bar
// Show version information
QString strVersion = "Amonsoft (c) Sesam micro 2005-2006 Version ";
qDebug( strVersion + STR_APP_VERSION );
main->lister();
main->show(); // Show it...
delete splash;
application.exec(); // And run!
saveXercesData();
delete g_Preferences;
//.........这里部分代码省略.........
示例3: main
int main( int argc, char **argv )
{
QPCApplication app(argc, argv);
QApplication::setStyle("plastik");
qapital::QPLOGGER.salvarLog(SBLogger::QP_INFO, SBLogger::CLIENTE, QObject::tr("Iniciando QPCliente"));
QString splash = qapital::GUIDATADIR + QString("qapital-splash-2004-08-31.png");
QPixmap pixmap( splash );
QSplashScreen *pantalla = new QSplashScreen( pixmap );
pantalla->show();
pantalla->message(QObject::tr("Iniciando aplicacion..."));
QFile configFile( qapital::CONFIGRC + QString("QPCConfig.xml"));
QXmlInputSource sourceXML(configFile);
configFile.close();
QPCConfigHandler *handler = new QPCConfigHandler;
QXmlSimpleReader reader;
reader.setContentHandler( handler );
if ( ! reader.parse( sourceXML ) )
{
std::cout << QObject::tr("Error en la configuracion del cliente") << std::endl;
}
ClnRed cliente ( handler->obtenerQPSHost(), handler->obtenerQPSPuerto() );
pantalla->message(QObject::tr("creando interfaz..."));
//GCLMdiMainWindow *qpCliente;
QMainWindow *qpCliente = 0;
switch ( int opt = handler->obtenerTipoDeInterfaz() )
{
case SBGui::MenuBased:
{
std::cout << "Iniciando MenuBased" << std::endl;
qpCliente = new GCLPrincipal(&cliente);
}
break;
case SBGui::MDIBased:
{
std::cout << "Iniciando MDIBased" << std::endl;
qpCliente = new GCLMdiMainWindow();
}
break;
default:
{
std::cout << "Tipo de interfaz desconocido " << opt << std::endl;
qpCliente = new GCLMdiMainWindow();
}
break;
}
app.setMainWidget( qpCliente );
QObject::connect( qApp, SIGNAL( lastWindowClosed() ), &cliente, SLOT( clnCerrarConexion() ) );
pantalla->finish( qpCliente );
delete pantalla;
return app.exec();
}
示例4: aq_main
//.........这里部分代码省略.........
AbanQ->setLibraryPaths(paths);
int pointSize = 8;
#if defined (Q_OS_LINUX)
appFont.setFamily(FLSettings::readEntry("font/family", "Verdana"));
#endif
#if defined(Q_OS_WIN32)
appFont.setFamily(FLSettings::readEntry("font/family", "Tahoma"));
#endif
#if defined(Q_OS_MACX)
appFont.setFamily(FLSettings::readEntry("font/family", "Lucida Grande"));
pointSize = 12;
QString envPath(getenv("PATH"));
envPath = "/sw/sbin:/sw/bin:" + envPath + ":/usr/X11R6/bin";
setenv("PATH", envPath.local8Bit(), 1);
#endif
appFont.setPointSize(FLSettings::readNumEntry("font/pointSize", pointSize));
appFont.setBold(FLSettings::readBoolEntry("font/bold", false));
appFont.setItalic(FLSettings::readBoolEntry("font/italic", false));
appFont.setUnderline(FLSettings::readBoolEntry("font/underline", false));
appFont.setStrikeOut(FLSettings::readBoolEntry("font/strikeOut", false));
AbanQ->setFont(appFont);
AbanQ->setStyle(FLSettings::readEntry("style", "QtCurve"));
AbanQ->installTranslator(AbanQ->createSysTranslator(QString(QTextCodec::locale()).left(2), true));
AbanQ->installTranslator(AbanQ->createSysTranslator("multilang"));
AbanQ->setPalette(p, true);
FLConnectDBDialog *s = 0;
QSplashScreen *splash = 0;
if (silentConn.isEmpty()) {
bool autoLogin = FLSettings::readBoolEntry("application/autoLogin", autoLogin_);
s = new FLConnectDBDialog(autoLogin, 0, "FLConnectDBDialog", 0, strConn);
static_cast<QWidget *>(s->child("frMore"))->hide();
s->adjustSize();
s->setPalette(p);
int ret = -1;
bool connectAttempts = 0;
do {
if (!s->isShown()) {
s->show();
s->raise();
}
if (autoLogin && !connectAttempts) {
QTimer::singleShot(1000, s, SLOT(tryConnect()));
connectAttempts++;
} else
s->exec();
} while (s->error());
ret = s->result();
QTimer::singleShot(0, s, SLOT(deleteLater()));
if (ret != QDialog::Accepted) {
QTimer::singleShot(0, AbanQ, SLOT(quit()));
return;
}
splash = new QSplashScreen(QPixmap::fromMimeSource("splashabanq.png"));
splash->show();
splash->message(QT_TR_NOOP("Inicializando..."), Qt::AlignRight, QColor(0, 0, 0));
} else if (!silentConnect(silentConn)) {
QTimer::singleShot(0, AbanQ, SLOT(quit()));
return;
}
AbanQ->setNotExit(FLSettings::readBoolEntry("application/notExit", false));
AbanQ->setPrintProgram(FLSettings::readEntry("printing/printProgram", QString::null));
AbanQ->flushX();
AbanQ->syncX();
AbanQ->processEvents();
AbanQ->init(
FLSettings::readEntry("application/formAlone", formAlone),
FLSettings::readEntry("application/callFunction", callFunction),
FLSettings::readEntry("application/arguments", arguments),
FLSettings::readBoolEntry("application/quitAfterCall", quitAfterCall),
FLSettings::readBoolEntry("application/noMax", noMax)
);
if (AbanQ->mainWidget()) {
AbanQ->mainWidget()->show();
AbanQ->mainWidget()->raise();
if (splash) {
splash->finish(AbanQ->mainWidget());
delete splash;
}
} else {
if (splash) {
QTimer::singleShot(0, splash, SLOT(deleteLater()));
}
}
}