int main(int argc, char *argv[]) { QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); QApplication a(argc, argv); RMMSMain w; QSplashScreen *splash = new QSplashScreen; splash->setStyleSheet("font-size: 16px"); splash->setPixmap(QPixmap(":/splash/1.png"));//设置图片 splash->show();//显示图片 Qt::Alignment topRight = Qt::AlignCenter | Qt::AlignBottom; splash->showMessage(QObject::tr("Setting up the main window..."), topRight, Qt::white);//显示信息 QDateTime curtime = QDateTime::currentDateTime(); QDateTime nowtime; do{ nowtime = QDateTime::currentDateTime(); } while(curtime.secsTo(nowtime) <= 3); w.setWindowTitle(SystemName); w.show(); splash->finish(&w);//图片一直显示到mainWin加载完成 delete splash; return a.exec(); }
/** * Start point of the program which executes the main window * @param argc Slots of command line parameter * @param argv Values of command line parameter * @return The executing main window */ int main(int argc, char *argv[]) { QApplication a(argc, argv); #ifdef LOGFILE QString fileName = QCoreApplication::applicationFilePath() + ".log"; QFile *log = new QFile(fileName); if (log->open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text)) { out = new QTextStream(log); qInstallMessageHandler(messageOutput); } else { qDebug() << "Error opening log file '" << fileName << "'. All debug output redirected to console."; } #endif // Check language QTranslator translator; QString current = QLocale::system().name(); if ( current.contains("de_DE") ) { translator.load("scribo_de", ":/translations"); a.installTranslator(&translator); } // Load splash screen QSplashScreen *splash = new QSplashScreen; splash->setPixmap( QPixmap(":/img/splash.jpg") ); splash->show(); Qt::Alignment topRight = Qt::AlignRight | Qt::AlignTop; splash->setStyleSheet("font-size: 10px;"); splash->showMessage(QObject::tr("Loading modules..."), topRight, Qt::white); QCoreApplication::setApplicationName("Scribo"); QCoreApplication::setApplicationVersion("0.1"); // Create directories QString scriboDir = QDir::home().absolutePath() + QDir::separator() + "scribo"; if ( !QDir(scriboDir).exists() ) QDir().mkdir(scriboDir); splash->showMessage(QObject::tr("Establishing connections..."), topRight, Qt::white); // Create database connection Database db; if ( !db.open() ) { qDebug() << "Failed to open the database.\n" "Please check the database settings"; } else { qDebug() << "Connected to the database"; } splash->showMessage(QObject::tr("Loading..."), topRight, Qt::white); MainWindow w; QTimer::singleShot(3000, splash, SLOT(close())); QTimer::singleShot(3000, &w, SLOT(show())); //w.show(); qDebug() << "Application started..."; return a.exec(); }
int main(int argc, char *argv[]) { int dummy = errno; QApplication a(argc, argv); Debug::init(0); #ifdef WIN32 QFont font; font.setPointSize(10); font.setFamily(("΢ÈíÑźÚ")); font.setBold(false); a.setFont(font); #else QFont font; font.setPointSize(10); font.setFamily(("WenQuanYi Zen Hei")); font.setBold(false); a.setFont(font); #endif QPixmap pixmap(":/logo/resources/splash.png"); QSplashScreen *splash = new QSplashScreen(pixmap); splash->setStyleSheet(QStringLiteral("color : white;")); splash->show(); gFactory = new Factory; if (gFactory->Init() == FALSE) { #ifdef WIN32 astring strPath = "C:\\";//TODO get the hdd from hdd VSCHddDevice hdd; hdd.show(); hdd.exec(); s32 size = hdd.GetDiskSize(); hdd.GetDiskPath(strPath); #else astring strPath = "ve/";//TODO get the hdd from hdd s32 size = 2; #endif gFactory->SetSystemPath(strPath); //splash->showMessage(QObject::tr("Create Video Database ...")); gFactory->Init(); } VSCLangType m_lang; gFactory->GetLang(m_lang); if (m_lang == VSC_LANG_AUTO) { if (QLocale::system().name() == "zh_CN") { LoadLangZH(a); } } else if (m_lang == VSC_LANG_ZH) { LoadLangZH(a); }//else if add more language to here splash->showMessage(QObject::tr("Starting ...")); VEvent::Init(*gFactory); VEMap::Init(*gFactory); VServiceMgr *pServiceMgr = VServiceMgr::CreateObject(*gFactory); VSCMainWindows w; //w.showMaximized(); w.hide(); //w.showFullScreen(); splash->finish(&w); /* Auto */ if (gFactory->GetAutoLogin() == FALSE) { w.ShowLogin(); }else { w.showMaximized(); } delete splash; /* Every thread is ready, start the factory thread */ gFactory->start(); /* Init Mining framework */ gMFramework = new MFramework(*gFactory); gMFramework->Init(); gMFramework->start(); /* Start the OpenCVR api server */ gOAPIServer = new OAPIServer(*gFactory); gOAPIServer->start(); return a.exec(); }
int main(int argc, char *argv[]) { int dummy = errno; ClientFactory *pFactory = NULL; QApplication a(argc, argv); a.setStyle(new VStyle); astring strVSCDefaultPath = VSC_DEFAULT_SYSPATH; #ifdef WIN32 #ifndef _WIN64 astring strLoggerPath = strVSCDefaultPath + "\\vidstor\\logs\\"; #else astring strLoggerPath = strVSCDefaultPath + "\\vidstor64\\logs\\"; #endif #else astring strLoggerPath = strVSCDefaultPath + "/vidstor/logs/"; #endif Poco::File file1(strLoggerPath); file1.createDirectories(); astring strLoggerFile = strLoggerPath + "opencvrclient"; Debug::init(9200, strLoggerFile); Debug::logger().info("opencvrclient started"); //Debug::logger().info("opencvrclient started {} {}", __LINE__, __FUNCTION__); //Debug::logger().info("opencvrclient started {} {}", __LINE__, __FUNCTION__); #ifdef WIN32 QFont font; font.setPointSize(10); font.setFamily(("΢ÈíÑźÚ")); font.setBold(false); a.setFont(font); #else QFont font; font.setPointSize(10); font.setFamily(("WenQuanYi Zen Hei")); font.setBold(false); a.setFont(font); #endif QPixmap pixmap(":/logo/resources/splash.png"); QSplashScreen *splash = new QSplashScreen(pixmap); splash->setStyleSheet(QStringLiteral("color : white;")); splash->show(); pFactory = new ClientFactory; if (pFactory->Init() == FALSE) { astring strPath = VSC_DEFAULT_SYSPATH; pFactory->SetSystemPath(strPath); pFactory->Init(); } VidLanguage m_lang; pFactory->GetLang(m_lang); if (m_lang == VID_LANG_AUTO) { if (QLocale::system().name() == "zh_CN") { LoadLangZH(a); } } else if (m_lang == VID_ZH_CN) { LoadLangZH(a); }//else if add more language to here splash->showMessage(QObject::tr("Starting ...")); VTaskMgr *pVTaskMgr = new VTaskMgr(); VSCMainWindows w(*pFactory); //w.showMaximized(); w.hide(); //w.showFullScreen(); splash->finish(&w); /* Auto */ if (pFactory->GetAutoLogin() == false) { w.ShowLogin(); }else { w.showMaximized(); } delete splash; return a.exec(); }
int main(int argc, char *argv[]) { int dummy = errno; QApplication a(argc, argv); Debug::init(0); //mediaPipeline::init(argc, argv); // Set the Application Language #if 0 //if (QLocale::system().name() == "zh_CN") { QTranslator *translator = new QTranslator(&a); bool ok = translator->load("vscloudnode_zh.qm", QCoreApplication::applicationDirPath() + "/translations"); if (ok) { qDebug("Translation Files loaded."); a.installTranslator(translator); } } #endif QPixmap pixmap(":/logo/resources/splash.png"); QSplashScreen *splash = new QSplashScreen(pixmap); QFont splashFont; //splashFont.setFamily("Arial"); splashFont.setBold(true); splash->setStyleSheet(QStringLiteral("color : red;")); splash->setFont(splashFont); splash->show(); //QApplication::setStyle(QStyleFactory::create("Fusion")); //QApplication::setStyle(QStyleFactory::create("Plastique")); //QApplication::setStyle("WindowsVista"); #if 0 QFile f(":qdarkstyle/style.qss"); if (!f.exists()) { printf("Unable to set stylesheet, file not found\n"); } else { f.open(QFile::ReadOnly | QFile::Text); QTextStream ts(&f); a.setStyleSheet(ts.readAll()); } #endif gFactory = new Factory; splash->showMessage("Starting ..."); if (gFactory->Init() == FALSE) { #ifdef WIN32 astring strPath = "C:\\";//TODO get the hdd from hdd VSCHddDevice hdd; hdd.show(); hdd.exec(); s32 size = hdd.GetDiskSize(); hdd.GetDiskPath(strPath); #else astring strPath = "ve/";//TODO get the hdd from hdd s32 size = 2; #endif gFactory->SetSystemPath(strPath); splash->showMessage("Create Video Database ..."); gFactory->Init(); #ifndef WIN32 //gFactory->AddHDD(strPath, size); #endif } VEvent::Init(*gFactory); VServiceMgr *pServiceMgr = VServiceMgr::CreateObject(*gFactory); VSCMainWindows w; //w.setWindowIcon(QIcon(":/logo/resources/vscsmall.jpg")); //w.show(); //Sleep(1000); //w.setWindowFlags(Qt::FramelessWindowHint ); //w.setWindowFlags(Qt::Window | Qt::FramelessWindowHint | Qt::CustomizeWindowHint ); w.showMaximized(); //w.showFullScreen(); splash->finish(&w); //stacked s; //s.show(); delete splash; /* Every thread is ready, start the factory thread */ gFactory->start(); return a.exec(); }