MdispQtApp::MdispQtApp( int& argc, char** argv ) : QApplication( argc, argv ) , m_isCurrentlyHookedOnErrors(false) , m_ErrorEventSemaphore(1) , m_CreatorThread( QThread::currentThreadId() ) { // Set semaphore to initial state (no error event available). m_ErrorEventSemaphore.acquire(); // Allocate an application and system [CALL TO MIL] MappAllocDefault(M_DEFAULT, &m_MilApplication, &m_MilSystem, M_NULL, M_NULL, M_NULL); // Hook MIL error on function DisplayError() [CALL TO MIL] MappHookFunction(M_ERROR_CURRENT,DisplayErrorExt,M_NULL); m_isCurrentlyHookedOnErrors = true; // Disable MIL error message to be displayed as the usual way [CALL TO MIL] MappControl(M_ERROR,M_PRINT_DISABLE); // Inquire number of digitizers available on the system [CALL TO MIL] MsysInquire(m_MilSystem,M_DIGITIZER_NUM,&m_numberOfDigitizer); // Digitizer is available if (m_numberOfDigitizer) { // Allocate a digitizer [CALL TO MIL] MdigAlloc(m_MilSystem,M_DEFAULT,M_CAMERA_SETUP,M_DEFAULT,&m_MilDigitizer); // Stop live grab when window is disable [CALL TO MIL] //TBM MIL 8.0 MsysControl(MilSystem,M_STOP_LIVE_GRAB_WHEN_DISABLED,M_ENABLE); // Inquire digitizer informations [CALL TO MIL] MdigInquire(m_MilDigitizer,M_SIZE_X,&m_digitizerSizeX); MdigInquire(m_MilDigitizer,M_SIZE_Y,&m_digitizerSizeY); MdigInquire(m_MilDigitizer,M_SIZE_BAND,&m_digitizerNbBands); if (m_digitizerSizeX > M_DEF_IMAGE_SIZE_X_MAX) m_digitizerSizeX = M_DEF_IMAGE_SIZE_X_MAX; if (m_digitizerSizeY > M_DEF_IMAGE_SIZE_Y_MAX) m_digitizerSizeY = M_DEF_IMAGE_SIZE_Y_MAX; } // Digitizer is not available else { m_MilDigitizer = 0; m_digitizerNbBands = M_DEF_IMAGE_NUMBANDS_MIN; } // Initialize the state of the grab m_isGrabStarted = FALSE; // Initialize GUI MainFrame* mf = new MainFrame(); //setMainWidget(mf); mf->show(); }
int main(int argc, char *argv[]) { QApplication a(argc, argv); MainFrame w; w.show(); return a.exec(); }
int main(int argc, char **argv) { QApplication app(argc, argv); MainFrame frame; frame.show(); return app.exec(); }
int main(int argc, char *argv[]) { QApplication app( argc , argv); MainFrame fenetre; //HelloModule hello; fenetre.show(); //QObject::connect(fenetre.sendButton, SIGNAL(clicked()),hello,SLOT(SendHelloBCast())); return app.exec(); }
int main(int argc, char *argv[]) { QApplication a(argc, argv); QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8")); MainFrame w; a.setApplicationName("FireDetection"); a.setApplicationVersion("V201509"); w.show(); w.setGeometry(qApp->desktop()->availableGeometry());//全屏运行 return a.exec(); }
int main( int argc, char ** argv ) { QApplication a( argc, argv ); MainFrame w; w.show(); a.setMainWidget( &w ); // a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) ); try { return a.exec(); } catch ( ... ) { std::cerr << "Some unspecified exception occurred" << std::endl; } }
int main(int argc, char *argv[]) { QApplication a(argc, argv); //TODO remove before release test(); MainFrame w; w.show(); Options::registerForKeys(); new GameManager; return a.exec(); }
int main(int argv, char *args[]) { DApplication app(argv, args); app.setQuitOnLastWindowClosed(false); app.setOrganizationName("deepin"); app.setApplicationName("dde-launcher"); app.setApplicationVersion("3.0"); #ifdef QT_DEBUG DLogManager::registerConsoleAppender(); #else DLogManager::registerFileAppender(); #endif const bool quit = !app.setSingleInstance(QString("dde-launcher_%1").arg(getuid())); QCommandLineOption showOption(QStringList() << "s" << "show", "show launcher(hide for default.)"); QCommandLineOption toggleOption(QStringList() << "t" << "toggle", "toggle launcher visible."); QCommandLineParser cmdParser; cmdParser.setApplicationDescription("DDE Launcher"); cmdParser.addHelpOption(); cmdParser.addVersionOption(); cmdParser.addOption(showOption); cmdParser.addOption(toggleOption); // cmdParser.addPositionalArgument("mode", "show and toogle to <mode>"); cmdParser.process(app); // QStringList positionArgs = cmdParser.positionalArguments(); if (quit) { DBusLauncherFrame launcherFrame; do { if (!launcherFrame.isValid()) break; if (cmdParser.isSet(toggleOption)) launcherFrame.Toggle(); else if (cmdParser.isSet(showOption)) launcherFrame.Show(); } while (false); return 0; } // INFO: what's this? setlocale(LC_ALL, ""); QTranslator translator; translator.load("/usr/share/dde-launcher/translations/dde-launcher_" + QLocale::system().name() + ".qm"); app.installTranslator(&translator); MainFrame launcher; DBusLauncherService service(&launcher); Q_UNUSED(service); QDBusConnection connection = QDBusConnection::sessionBus(); if (!connection.registerService("com.deepin.dde.Launcher") || !connection.registerObject("/com/deepin/dde/Launcher", &launcher)) qWarning() << "register dbus service failed"; #ifndef QT_DEBUG if (/*!positionArgs.isEmpty() && */cmdParser.isSet(showOption)) #endif launcher.show(); // monitor gtk icon theme changed GtkSettings *gs = gtk_settings_get_default(); g_signal_connect(gs, "notify::" PROP_GTK_ICON_THEME_NAME, G_CALLBACK(iconThemeChanged), NULL); return app.exec(); }