本文整理汇总了C++中QSplashScreen::raise方法的典型用法代码示例。如果您正苦于以下问题:C++ QSplashScreen::raise方法的具体用法?C++ QSplashScreen::raise怎么用?C++ QSplashScreen::raise使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSplashScreen
的用法示例。
在下文中一共展示了QSplashScreen::raise方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
return EXIT_FAILURE;
}
//splash screen
splashStartTime.start();
QPixmap pixmap(QString::fromUtf8(":/CC/images/imLogoV2Qt.png"));
splash = new QSplashScreen(pixmap, Qt::WindowStaysOnTopHint);
splash->show();
QApplication::processEvents();
}
//global structures initialization
ccTimer::Init();
FileIOFilter::InitInternalFilters(); //load all known I/O filters (plugins will come later!)
ccNormalVectors::GetUniqueInstance(); //force pre-computed normals array initialization
ccColorScalesManager::GetUniqueInstance(); //force pre-computed color tables initialization
int result = 0;
if (commandLine)
{
//command line processing (no GUI)
result = ccCommandLineParser::Parse(argc, argv);
}
else
{
//main window init.
MainWindow* mainWindow = MainWindow::TheInstance();
if (!mainWindow)
{
QMessageBox::critical(0, "Error", "Failed to initialize the main application window?!");
return EXIT_FAILURE;
}
mainWindow->show();
QApplication::processEvents();
//show current Global Shift parameters in Console
{
ccLog::Print(QString("[Global Shift] Max abs. coord = %1 / max abs. diag = %2")
.arg(ccGlobalShiftManager::MaxCoordinateAbsValue(), 0, 'e', 0)
.arg(ccGlobalShiftManager::MaxBoundgBoxDiagonal(), 0, 'e', 0));
}
if (argc > lastArgumentIndex)
{
if (splash)
splash->close();
//any additional argument is assumed to be a filename --> we try to load it/them
QStringList filenames;
for (int i = lastArgumentIndex; i<argc; ++i)
filenames << QString(argv[i]);
mainWindow->addToDB(filenames);
}
if (splash)
{
//we want the splash screen to be visible a minimum amount of time (1000 ms.)
while (splashStartTime.elapsed() < 1000)
{
splash->raise();
QApplication::processEvents(); //to let the system breath!
}
splash->close();
QApplication::processEvents();
delete splash;
splash = 0;
}
//let's rock!
try
{
result = app.exec();
}
catch(...)
{
QMessageBox::warning(0, "CC crashed!","Hum, it seems that CC has crashed... Sorry about that :)");
}
}
//release global structures
MainWindow::DestroyInstance();
FileIOFilter::UnregisterAll();
#ifdef CC_TRACK_ALIVE_SHARED_OBJECTS
//for debug purposes
unsigned alive = CCShareable::GetAliveCount();
if (alive > 1)
{
printf("Error: some shared objects (%u) have not been released on program end!",alive);
system("PAUSE");
}
#endif
return result;
}
示例2: main
//.........这里部分代码省略.........
lang = RS_SETTINGS->readEntry("/Language", "");
if (lang.isEmpty())
{
lang=QC_PREDEFINED_LOCALE;
RS_SETTINGS->writeEntry("/Language", lang);
}
langCmd = RS_SETTINGS->readEntry("/LanguageCmd", "");
if (langCmd.isEmpty())
{
langCmd=QC_PREDEFINED_LOCALE;
RS_SETTINGS->writeEntry("/LanguageCmd", langCmd);
}
#else
lang = RS_SETTINGS->readEntry("/Language", "en");
langCmd = RS_SETTINGS->readEntry("/LanguageCmd", "en");
#endif
RS_SETTINGS->endGroup();
RS_SYSTEM->loadTranslation(lang, langCmd);
RS_DEBUG->print("main: loading translation: OK");
RS_DEBUG->print("main: creating main window..");
QC_ApplicationWindow appWin;
RS_DEBUG->print("main: setting caption");
appWin.setWindowTitle(XSTR(QC_APPNAME));
RS_DEBUG->print("main: show main window");
RS_SETTINGS->beginGroup("/Geometry");
int windowWidth = RS_SETTINGS->readNumEntry("/WindowWidth", 0);
int windowHeight = RS_SETTINGS->readNumEntry("/WindowHeight", 0);
int windowX = RS_SETTINGS->readNumEntry("/WindowX", 30);
int windowY = RS_SETTINGS->readNumEntry("/WindowY", 30);
RS_SETTINGS->endGroup();
if (windowWidth != 0)
appWin.resize(windowWidth, windowHeight);
appWin.move(windowX, windowY);
RS_SETTINGS->beginGroup("Defaults");
bool maximize = RS_SETTINGS->readNumEntry("/Maximize", 0);
RS_SETTINGS->endGroup();
if (maximize || windowWidth == 0)
appWin.showMaximized();
else
appWin.show();
RS_DEBUG->print("main: set focus");
appWin.setFocus();
RS_DEBUG->print("main: creating main window: OK");
if (show_splash)
{
RS_DEBUG->print("main: updating splash");
splash->raise();
splash->showMessage(QObject::tr("Loading..."),
Qt::AlignRight|Qt::AlignBottom, QC_SPLASH_TXTCOL);
RS_DEBUG->print("main: processing events");
qApp->processEvents();
RS_DEBUG->print("main: updating splash: OK");
}
// Set LC_NUMERIC so that entering numeric values uses . as the decimal seperator
setlocale(LC_NUMERIC, "C");
RS_DEBUG->print("main: loading files..");
bool files_loaded = false;
for (QStringList::Iterator it = fileList.begin(); it != fileList.end(); ++it )
{
if (show_splash)
{
splash->showMessage(QObject::tr("Loading File %1..")
.arg(QDir::toNativeSeparators(*it)),
Qt::AlignRight|Qt::AlignBottom, QC_SPLASH_TXTCOL);
qApp->processEvents();
}
appWin.slotFileOpen(*it, RS2::FormatUnknown);
files_loaded = true;
}
RS_DEBUG->print("main: loading files: OK");
RS_DEBUG->print("main: app.exec()");
if (!files_loaded)
{
appWin.slotFileNewNew();
}
if (show_splash)
splash->finish(&appWin);
else
delete splash;
int return_code = app.exec();
RS_DEBUG->print("main: exited Qt event loop");
return return_code;
}
示例3: main
int main(int argc, char **argv)
{
//QT initialiation
qccApplication app(argc, argv);
//Force 'english' local so as to get a consistent behavior everywhere
QLocale::setDefault(QLocale::English);
#ifdef Q_OS_LINUX
// we reset the numeric locale. As suggested in documetation
// see http://qt-project.org/doc/qt-5/qcoreapplication.html#locale-settings
// Basically - from doc: - "On Unix/Linux Qt is configured to use the system locale settings by default.
// This can cause a conflict when using POSIX functions, for instance,
// when converting between data types such as floats and strings"
setlocale(LC_NUMERIC,"C");
#endif
#ifdef USE_VLD
VLDEnable();
#endif
//splash screen
QSplashScreen* splash = 0;
QTime splashStartTime;
//Command line mode?
bool commandLine = (argc > 1 && argv[1][0] == '-');
if (!commandLine)
{
//OpenGL?
if (!QGLFormat::hasOpenGL())
{
QMessageBox::critical(0, "Error", "This application needs OpenGL to run!");
return EXIT_FAILURE;
}
//splash screen
splashStartTime.start();
QPixmap pixmap(QString::fromUtf8(":/CC/images/imLogoV2Qt.png"));
splash = new QSplashScreen(pixmap,Qt::WindowStaysOnTopHint);
splash->show();
QApplication::processEvents();
}
//global structures initialization
ccTimer::Init();
FileIOFilter::InitInternalFilters(); //load all known I/O filters (plugins will come later!)
ccNormalVectors::GetUniqueInstance(); //force pre-computed normals array initialization
ccColorScalesManager::GetUniqueInstance(); //force pre-computed color tables initialization
int result = 0;
if (commandLine)
{
//command line processing (no GUI)
result = ccCommandLineParser::Parse(argc,argv);
}
else
{
//main window init.
MainWindow* mainWindow = MainWindow::TheInstance();
if (!mainWindow)
{
QMessageBox::critical(0, "Error", "Failed to initialize the main application window?!");
return EXIT_FAILURE;
}
mainWindow->show();
QApplication::processEvents();
if (argc > 1)
{
if (splash)
splash->close();
//any additional argument is assumed to be a filename --> we try to load it/them
QStringList filenames;
for (int i=1; i<argc; ++i)
filenames << QString(argv[i]);
mainWindow->addToDB(filenames);
}
if (splash)
{
//we want the splash screen to be visible a minimum amount of time (1000 ms.)
while (splashStartTime.elapsed() < 1000)
{
splash->raise();
QApplication::processEvents(); //to let the system breath!
}
splash->close();
QApplication::processEvents();
delete splash;
splash = 0;
}
//let's rock!
try
//.........这里部分代码省略.........
示例4: main
Q_DECL_EXPORT int main(int argc, char *argv[])
{
#ifdef Q_OS_SYMBIAN
QApplication::setAttribute((Qt::ApplicationAttribute)11); //Qt::AA_CaptureMultimediaKeys
#endif
QApplication app(argc, argv);
app.setApplicationName("QVideo");
app.setOrganizationName("QShen");
app.setApplicationVersion(VER);
QString locale = QLocale::system().name();
QTranslator translator;
if(!translator.load(QString("QVideo_") + locale,":/i18n")){
qDebug()<<"translator load erro";
}
app.installTranslator(&translator);
Utility utility;
Settings settings;
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
QmlApplicationViewer viewer;
//viewer.setAttribute(Qt::WA_OpaquePaintEvent);
//viewer.setAttribute(Qt::WA_NoSystemBackground);
//viewer.viewport()->setAttribute(Qt::WA_OpaquePaintEvent);
//viewer.viewport()->setAttribute(Qt::WA_NoSystemBackground);
viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait);
viewer.rootContext()->setContextProperty("utility", &utility);
viewer.rootContext()->setContextProperty("settings", &settings);
viewer.rootContext()->setContextProperty("appVersion", app.applicationVersion());
#ifdef Q_OS_SYMBIAN
QSplashScreen *splash = new QSplashScreen(QPixmap(":/qml/pic/splash_symbian.png"));
splash->show();
splash->raise();
viewer.setSource(QUrl("qrc:/qml/Symbian/main.qml"));
#elif defined(Q_OS_HARMATTAN)
//QApplication::setGraphicsSystem("native");
viewer.setSource(QUrl("qrc:/qml/Meego/main.qml"));
#elif defined(Q_WS_SIMULATOR)
viewer.setSource(QUrl("qrc:/qml/Symbian/main.qml"));
#endif
viewer.showExpanded();
#else
QQmlApplicationEngine engine;
engine.rootContext()->setContextProperty("utility",&utility);
#ifdef Q_OS_WIN32
engine.load(QUrl(QStringLiteral("qrc:/qml/Win32/main.qml")));
#endif
#endif
#ifdef Q_OS_SYMBIAN
splash->finish(&viewer);
splash->deleteLater();
#endif
return app.exec();
}
示例5: main
//.........这里部分代码省略.........
{
if (splash)
splash->close();
//any additional argument is assumed to be a filename --> we try to load it/them
QStringList filenames;
for (int i = lastArgumentIndex; i < argc; ++i)
{
QString arg(argv[i]);
//special command: auto start a plugin
if (arg.startsWith(":start-plugin:"))
{
QString pluginName = arg.mid(14);
QString pluginNameUpper = pluginName.toUpper();
//look for this plugin
bool found = false;
for (const tPluginInfo &plugin : plugins)
{
if (plugin.object->getName().replace(' ', '_').toUpper() == pluginNameUpper)
{
found = true;
bool success = plugin.object->start();
if (!success)
{
ccLog::Error(QString("Failed to start the plugin '%1'").arg(plugin.object->getName()));
}
break;
}
}
if (!found)
{
ccLog::Error(QString("Couldn't find the plugin '%1'").arg(pluginName.replace('_', ' ')));
}
}
else
{
filenames << arg;
}
}
mainWindow->addToDB(filenames);
}
if (splash)
{
//we want the splash screen to be visible a minimum amount of time (1000 ms.)
while (splashStartTime.elapsed() < 1000)
{
splash->raise();
QApplication::processEvents(); //to let the system breath!
}
splash->close();
QApplication::processEvents();
delete splash;
splash = 0;
}
//let's rock!
try
{
result = app.exec();
}
catch (...)
{
QMessageBox::warning(0, "CC crashed!", "Hum, it seems that CC has crashed... Sorry about that :)");
}
//release the plugins
for (tPluginInfo &plugin : plugins)
{
plugin.object->stop(); //just in case
if (!plugin.qObject->parent())
{
delete plugin.object;
plugin.object = 0;
plugin.qObject = 0;
}
}
}
//release global structures
MainWindow::DestroyInstance();
FileIOFilter::UnregisterAll();
#ifdef CC_TRACK_ALIVE_SHARED_OBJECTS
//for debug purposes
unsigned alive = CCShareable::GetAliveCount();
if (alive > 1)
{
printf("Error: some shared objects (%u) have not been released on program end!",alive);
system("PAUSE");
}
#endif
return result;
}
示例6: main
Q_DECL_EXPORT int main(int argc, char *argv[])
{
QScopedPointer<QApplication> app(createApplication(argc, argv));
//qDebug()<<QString::fromUtf8("主线程地址是:")<<QThread::currentThread();
#if defined(Q_OS_SYMBIAN)||defined(Q_WS_SIMULATOR)
QPixmap pixmap(":/Image/Symbian.png");
QSplashScreen *splash = new QSplashScreen(pixmap);
splash->show();
splash->raise();
#endif
#ifndef QT_NO_DEBUG
QNetworkProxy proxy;
proxy.setType(QNetworkProxy::HttpProxy);
proxy.setHostName("localhost");
proxy.setPort(8888);
QNetworkProxy::setApplicationProxy(proxy);
#endif
//int width=QApplication::desktop()->width();
//int height=QApplication::desktop()->height();
app->setApplicationName (QString::fromUtf8("IT之家"));
app->setOrganizationName ("Stars");
app->setApplicationVersion ("1.2.2");
Settings *setting=new Settings;
Utility *unility=new Utility;
Cache *cacheContent=new Cache(setting);
//qmlRegisterType<MyXmlListModel>("myXmlListModel",1,0,"MyXmlListModel");
//qmlRegisterType<MyXmlRole>("myXmlListModel", 1, 0, "MyXmlRole");
QmlApplicationViewer viewer;
MyNetworkAccessManagerFactory *network = new MyNetworkAccessManagerFactory();
viewer.engine()->setNetworkAccessManagerFactory(network);
viewer.rootContext ()->setContextProperty ("cacheContent",cacheContent);
viewer.rootContext()->setContextProperty("settings",setting);
viewer.rootContext()->setContextProperty("utility",unility);
QWebSettings::globalSettings ()->setAttribute (QWebSettings::LocalContentCanAccessRemoteUrls,true);
QWebSettings::globalSettings ()->setAttribute (QWebSettings::SpatialNavigationEnabled,true);
QWebSettings::globalSettings ()->setAttribute (QWebSettings::SpatialNavigationEnabled, true);
#if defined(Q_OS_SYMBIAN)||defined(Q_WS_SIMULATOR)
#if defined(Q_OS_S60V5)//判断qt的版本
qWarning("build symbian s60v5");
viewer.setMainQmlFile(QLatin1String("qml/symbian-v5/main.qml"));
if(setting->getValue("night_mode",false).toBool())
unility->setCss("./qml/symbian-v5/theme_black.css",viewer.width()-20);//设置默认的css
else
unility->setCss("./qml/symbian-v5/theme_white.css",viewer.width()-20);
#elif defined(Q_OS_S60V3)
qWarning("build symbian s60v3");
viewer.setMainQmlFile(QLatin1String("qml/symbian-v3/main.qml"));
if(setting->getValue("night_mode",false).toBool())
unility->setCss("./qml/symbian-v3/theme_black.css",viewer.width()-20);//设置默认的css
else
unility->setCss("./qml/symbian-v3/theme_white.css",viewer.width()-20);
#else
qWarning("build symbian anna or simulator");
viewer.setMainQmlFile(QLatin1String("qml/symbian-anna/main.qml"));
if(setting->getValue("night_mode",false).toBool())
unility->setCss("./qml/symbian-anna/theme_black.css",viewer.width()-20);//设置默认的css
else
unility->setCss("./qml/symbian-anna/theme_white.css",viewer.width()-20);
#endif
viewer.showExpanded();
splash->finish(&viewer);
splash->deleteLater();
#elif defined(Q_OS_HARMATTAN)
qWarning("build meego");
viewer.setMainQmlFile(QLatin1String("qml/meego/main.qml"));
if(setting->getValue("night_mode",false).toBool())
unility->setCss("/opt/ithome/qml/meego/theme_black.css",460);//设置默认的css
else
unility->setCss("/opt/ithome/qml/meego/theme_white.css",460);
viewer.showExpanded();
#endif
return app->exec();
}