AsemanApplication::AsemanApplication(int &argc, char **argv, ApplicationType appType) : QObject() { if(!aseman_app_singleton) aseman_app_singleton = this; p = new AsemanApplicationPrivate; p->appType = appType; p->app_owner = true; switch(p->appType) { #ifdef QT_CORE_LIB case CoreApplication: p->app = new QCoreApplication(argc, argv); connect(p->app, SIGNAL(organizationNameChanged()) , SIGNAL(organizationNameChanged())); connect(p->app, SIGNAL(organizationDomainChanged()), SIGNAL(organizationDomainChanged())); connect(p->app, SIGNAL(applicationNameChanged()) , SIGNAL(applicationNameChanged())); connect(p->app, SIGNAL(applicationVersionChanged()), SIGNAL(applicationVersionChanged())); break; #endif #ifdef QT_GUI_LIB case GuiApplication: p->app = new QGuiApplication(argc, argv); connect(p->app, SIGNAL(lastWindowClosed()), SIGNAL(lastWindowClosed())); p->globalFont = static_cast<QGuiApplication*>(p->app)->font(); break; #endif #ifdef QT_WIDGETS_LIB case WidgetApplication: p->app = new QtSingleApplication(argc, argv); connect(p->app, SIGNAL(messageReceived(QString)), SIGNAL(messageReceived(QString))); p->globalFont = static_cast<QtSingleApplication*>(p->app)->font(); break; #endif default: p->app = 0; break; } }
int main(int argc, char * argv[]) { QApplication a(argc, argv); MainWindow w(argc, argv); w.show(); a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); return a.exec(); }
int main(int argc, char ** argv) { QApplication app( argc, argv ); MainWindowImpl win; QObject::connect(&win, SIGNAL( quit() ), &app, SLOT( quit() ) ); //win.init(); app.connect( &app, SIGNAL( lastWindowClosed() ), &app, SLOT( quit() ) ); return app.exec(); }
int main(int argc, char ** argv) { QApplication * app = new QApplication(argc, argv); int cx = -1; int cy = -1; int w = QApplication::desktop()->width(); int h = QApplication::desktop()->height(); QSettings settings(QSettings::IniFormat, QSettings::UserScope, "DoUML", "settings"); settings.setIniCodec(QTextCodec::codecForName("UTF-8")); int uid = settings.value("Main/id", -1).toInt(); int l, t, r, b; l = settings.value("Desktop/left", -1).toInt(); r = settings.value("Desktop/right", -1).toInt(); t = settings.value("Desktop/top", -1).toInt(); b = settings.value("Desktop/bottom", -1).toInt(); if(l != -1 && r != -1 && t != -1 && b != -1) { if (!((r == 0) && (t == 0) && (r == 0) && (b == 0)) && !((r < 0) || (t < 0) || (r < 0) || (b < 0)) && !((r <= l) || (b <= t))) { cx = (r + l) / 2; cy = (t + b) / 2; w = r - l; h = b - t; } } if (uid == -1) QMessageBox::critical(0, "Control project", "Own identifier not defined"); else if ((uid < 2) || (uid > 127)) QMessageBox::critical(0, "Control project", "invalid Identifier"); else { set_user_id(uid, QDir::homePath()); app->connect(app, SIGNAL(lastWindowClosed()), SLOT(quit())); init_pixmaps(); QDir homeDir = QDir::home(); ControlWindow * ww = new ControlWindow(homeDir); ww->resize((w * 3) / 5, (h * 3) / 5); if (cx != -1) ww->move(ww->x() + cx - (ww->x() + ww->width() / 2), ww->y() + cy - (ww->y() + ww->height() / 2)); ww->show(); app->exec(); } return 0; }
int main( int argc, char *argv[] ) { Application app( argc, argv ); app.setWindowIcon( QIcon( QString::fromUtf8( ":/icon2.png" ) ) ); QObject::connect( &app, SIGNAL( lastWindowClosed() ), &app, SLOT( quit() ) ); MainWindow mainWin; app.setMainWindow(&mainWin); // TODO: Enable GUI control via command line. mainWin.setObjectName("MainWindow"); mainWin.showMaximized(); return app.exec(); }
int main( int argc, char ** argv ) { QApplication a( argc, argv ); mainWindow w; qApp->setMainWidget(&w); w.show(); a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) ); w.run(); return 0; }
int main(int argc, char **argv) { QApplication maestro(argc, argv); Fenetre MainWin; maestro.setMainWidget(&MainWin); MainWin.connect(&maestro, SIGNAL(lastWindowClosed()), &maestro, SLOT(quit())); MainWin.show(); return maestro.exec(); }
int main(int argc, char **argv) { QApplication app(argc, argv); MyClass cl; cl.show(); QObject::connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit())); int ret = app.exec(); return ret; }
int main(int argc, char **argv) { QApplication a( argc, argv ); ArchiveDialog ad; ad.show(); QObject::connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) ); return a.exec(); }
int main(int argc, char** argv) { ros::init(argc, argv, "find_object_2d"); QApplication app(argc, argv); ros::NodeHandle nh("~"); nh.param("gui", gui, gui); nh.param("objects_path", objectsPath, objectsPath); ROS_INFO("gui=%d", (int)gui); ROS_INFO("objects_path=%s", objectsPath.c_str()); CameraROS * cam = new CameraROS(); MainWindow mainWindow(cam); // take ownership ObjectsDetectedCallback objDetectedCallback; QObject::connect(&mainWindow, SIGNAL(objectsFound(const QMap<int, QPair<QRect, QTransform> > &)), &objDetectedCallback, SLOT(publish(const QMap<int, QPair<QRect, QTransform> > &))); if(gui) { // Disable camera settings... mainWindow.parametersToolBox()->getParameterWidget(Settings::kCamera_1deviceId())->setEnabled(false); mainWindow.parametersToolBox()->getParameterWidget(Settings::kCamera_3imageHeight())->setEnabled(false); mainWindow.parametersToolBox()->getParameterWidget(Settings::kCamera_2imageWidth())->setEnabled(false); mainWindow.setSourceImageText(mainWindow.tr( "<qt>Camera subscribed to <b>%1</b> topic.<br/>" "You can remap the topic when starting the node: <br/>\"rosrun find_object_2d find_object_2d image:=your/image/topic\".<br/>" "</qt>").arg(QString::fromStdString(cam->subscribedTopic()))); mainWindow.show(); app.connect( &app, SIGNAL( lastWindowClosed() ), &app, SLOT( quit() ) ); } if(!objectsPath.empty()) { QString path = objectsPath.c_str(); if(path.contains('~')) { path.replace('~', QDir::homePath()); } if(!mainWindow.loadObjects(path)) { ROS_ERROR("No objects loaded from path \"%s\"", path.toStdString().c_str()); } } mainWindow.startProcessing(); // Catch ctrl-c to close the gui struct sigaction sigIntHandler; sigIntHandler.sa_handler = my_handler; sigemptyset(&sigIntHandler.sa_mask); sigIntHandler.sa_flags = 0; sigaction(SIGINT, &sigIntHandler, NULL); return app.exec(); }
MyWidget::MyWidget(){ playing = false; frameIndex = 1; //setup the initial gui b_play = new QPushButton(tr("Play"), this); b_save = new QPushButton(tr("Save Output"), this); b_open = new QPushButton(tr("Open File"), this); l_skin = new QLabel(tr("Skin Threshold"),this); s_skin = new QSlider(Horizontal,this); s_skin->setMinValue(1); s_skin->setMaxValue(7); s_skin->setTickInterval(1); s_skin->setValue((int)(SKINTHRES*10)); skin_t = SKINTHRES; l_thres = new QLabel(tr("Edge Threshold"),this); s_thres = new QSlider(Horizontal,this); s_thres->setMinValue(3); s_thres->setMaxValue(7); s_thres->setTickInterval(1); s_thres->setValue((int)(THRES*10)); edge_t = THRES; s_frame = new QSlider(Horizontal,this); status = new QLabel(tr("Status"),this); l_algo = new QComboBox(this); l_algo->insertItem("Linear Equation"); l_algo->insertItem("Motion Vector"); l_algo->insertItem("Hybrid"); //creates some objects and threads list = new QVector<ptrFrame>(); tracker = new Tracker(list); stats = new Stats(list); stats->start(); connect(qApp, SIGNAL(lastWindowClosed()), qApp, SLOT(quit())); connect(b_play, SIGNAL(clicked()), SLOT(play())); connect(b_save, SIGNAL(clicked()), SLOT(save())); connect(b_open, SIGNAL(clicked()), SLOT(open_file())); connect(s_thres, SIGNAL(valueChanged(int)), SLOT(thresChanged())); connect(s_skin, SIGNAL(valueChanged(int)), SLOT(skinthresChanged())); connect(l_algo, SIGNAL(highlighted(int)), SLOT(algorithmChange())); }
int main(int argc, char ** argv) { QApplication app( argc, argv ); QCoreApplication::setApplicationVersion(VERSION); MainWindowImpl win; win.show(); app.connect( &app, SIGNAL( lastWindowClosed() ), &app, SLOT( quit() ) ); return app.exec(); }
int main( int argc, char *argv[] ) { // load qt traduction files QTranslator qtTranslator; qtTranslator.load( "qt_" + QLocale::system().name() ); // load our application traduction file QTranslator myappTranslator; myappTranslator.load( "Quinect_" + QLocale::system().name() ); // create application and set translations QApplication app( argc, argv ); Q_INIT_RESOURCE(resources); QPixmap splashImage( ":/images/splash" ); QSplashScreen splash( splashImage ); splash.setMask( QRegion( splashImage.mask() ) ); // transparency splash.show(); #if 0 QPalette p (app.palette()); p.setColor (QPalette::Background, QColor (48, 48, 48/*39, 39, 39*/)); // general background p.setColor (QPalette::WindowText, QColor (203, 203, 203)); // general foreground p.setColor (QPalette::Base, QColor (60, 60, 60)); // text entry widget p.setColor (QPalette::AlternateBase, QColor (238, 112, 0)); // Text used on 'Base' p.setColor (QPalette::Text, QColor (145, 145, 145)); // Text used on 'Base' p.setColor (QPalette::Button, QColor (48, 48, 48)); // general bg button color p.setColor (QPalette::ButtonText, QColor (203, 203, 203)); // general foreground button color p.setColor (QPalette::BrightText, QColor (238, 112, 0)); // to ensure contrast p.setColor (QPalette::Highlight, QColor (238, 112, 0)); // marked element p.setColor (QPalette::HighlightedText, QColor (31, 13, 0)); // marked element text app.setPalette(p); #endif /*QFile file( "data/BRGMViewer.qss" ); file.open( QFile::ReadOnly ); QString styleSheet = QLatin1String( file.readAll() ); app.setStyleSheet( styleSheet );*/ //app.setWindowIcon( QIcon( QPixmap( ":/icons/brgm-128" ) ) ); app.connect( &app, SIGNAL( lastWindowClosed() ), &app, SLOT( quit() ) ); app.installTranslator( &qtTranslator ); app.installTranslator( &myappTranslator ); // create and launch window MainWindow window; window.show(); splash.finish(&window); // let the show begin... return app.exec(); }
int main( int argc, char **argv ) { QApplication a( argc, argv ); CMainWindowDialog w; a.setStyle( QString( "Plastik" ) ); w.show(); a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) ); return a.exec(); }
int main(int argc, char **argv) { QApplication app(argc, argv); QLabel *l1 = new QLabel("Fenster1", 0); QLabel *l2 = new QLabel("Fenster2", 0); l1->show(); l2->show(); QObject::connect(qApp, SIGNAL(lastWindowClosed()), qApp, SLOT(quit())); return app.exec(); }
int main(int argc, char *argv[]) { QApplication a(argc, argv); QNativeWidgetTest widget; widget.setLabel("Foobar"); widget.show(); a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); return a.exec(); }
int main(int argc, char **argv) { /********************* ** Qt **********************/ QApplication app(argc, argv); qt_filter_tester::MainWindow w(argc,argv); w.show(); app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit())); int result = app.exec(); return result; }
int main(int argc, char *argv[]) { #if !GLIB_CHECK_VERSION (2, 31, 0) if (!g_thread_supported ()) g_thread_init (NULL); #endif gst_init (&argc, &argv); QApplication app(argc, argv); app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit ())); /* prepare the pipeline */ GstElement *pipeline = gst_pipeline_new ("xvoverlay"); GstElement *src = gst_element_factory_make ("videotestsrc", NULL); GstElement *sink = find_video_sink (); if (sink == NULL) g_error ("Couldn't find a working video sink."); gst_bin_add_many (GST_BIN (pipeline), src, sink, NULL); gst_element_link (src, sink); /* prepare the ui */ QWidget window; window.resize(320, 240); window.setWindowTitle("GstXOverlay Qt demo"); window.show(); WId xwinid = window.winId(); gst_x_overlay_set_window_handle (GST_X_OVERLAY (sink), xwinid); /* run the pipeline */ GstStateChangeReturn sret = gst_element_set_state (pipeline, GST_STATE_PLAYING); if (sret == GST_STATE_CHANGE_FAILURE) { gst_element_set_state (pipeline, GST_STATE_NULL); gst_object_unref (pipeline); /* Exit application */ QTimer::singleShot(0, QApplication::activeWindow(), SLOT(quit())); } int ret = app.exec(); window.hide(); gst_element_set_state (pipeline, GST_STATE_NULL); gst_object_unref (pipeline); return ret; }
int main(int argc, char ** argv) { QApplication app( argc, argv ); //MainWindowImpl win; QMainWindow *win = new QMainWindow(0, Qt::Window); PageTemplate tmplt;// = new PageTemplate; book b;// = new book(); tmplt.setBook(&b); QMenu fileMenu("File"); QAction *openBookAction = new QAction(("Open book"), win); QAction *openLibraryAction = new QAction(("Library"), win); fileMenu.addAction(openBookAction); fileMenu.addAction(openLibraryAction); // fileMenu.addAction("Open book", ) fileMenu.addSeparator(); fileMenu.addAction("Quit"); win->connect(openBookAction, SIGNAL(triggered()), &tmplt, SLOT(openBookSlot())); win->connect(openLibraryAction, SIGNAL(triggered()), &tmplt, SLOT(openLibrarySlot())); QMenu prefMenu("Settings"); // prefMenu.addAction("Fonts +"); // prefMenu.addAction("Fonts -"); // prefMenu.addAction("Linespacing +"); // prefMenu.addAction("Linespacing -"); // prefMenu.addSeparator(); // prefMenu.addAction("Settings"); QAction *openSettingsAction = new QAction(("Settings"), win); prefMenu.addAction(openSettingsAction); win->connect(openSettingsAction, SIGNAL(triggered()), &tmplt, SLOT(openSettingsWindow())); QMenu contentsMenu("Contents"); win->menuBar()->addMenu(&fileMenu); win->menuBar()->addMenu(&prefMenu); win->menuBar()->addMenu(&contentsMenu); // win->menuBar()-> addMenu("File")->addSeparator(); // win->menuBar()->addMenu("Settings")->addAction("Preferences"); win->setCentralWidget(&tmplt); tmplt.menuBar = win->menuBar(); tmplt.contentsMenu = &contentsMenu; win->resize(640, 480); //b->loadFB2(); win->show(); app.connect( &app, SIGNAL( lastWindowClosed() ), &app, SLOT( quit() ) ); return app.exec(); }
int main(int argc, char** argv) { #ifdef XQ_WS_WIN WSADATA wsaData; if(WSAStartup(MAKEWORD(1, 1), &wsaData)) { qDebug("Failed to initialize Window Sockets library."); } #endif QApplication app(argc, argv); QSplashScreen * splash = new QSplashScreen(QPixmap(":/images/openrpt.png")); splash->show(); _databaseURL = ""; if (argc > 1) { for (int intCounter = 1; intCounter < argc; intCounter++) { QString argument(argv[intCounter]); if (argument.contains("-databaseURL=")) { _databaseURL = argument.right(argument.length() - 13); } } } if (_databaseURL == "") { QSettings settings; settings.setPath("OpenMFG.com", "OpenRPT", QSettings::UserScope); _databaseURL = settings.readEntry("/OpenRPT/_databaseURL", "pgsql://127.0.0.1/mfg:5432"); } app.addLibraryPath("."); ReportWriterWindow * rwf = new ReportWriterWindow(); app.setMainWidget( rwf ); rwf->show(); app.connect( &app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()) ); qApp->processEvents(); splash->finish(rwf); delete splash; int ret = app.exec(); #ifdef XQ_WS_WIN WSACleanup(); #endif return ret; }
int main(int argc,char ** argv) { QApplication app(argc, argv); int width; int height; osg::ref_ptr<PoLAR::Image<unsigned char> > myImage; // Create the viewer, here the widget used to display the read image is a custom one implemented by the user MyViewer2D viewer; // Read the image given in parameter if (argc >1) { if(PoLAR::Util::fileExists(argv[1])) myImage = new PoLAR::Image<unsigned char>(argv[1], true); else { std::cerr << argv[1] << ": file not found" << std::endl; exit(0); } width = myImage->getWidth(); height = myImage->getHeight(); // Resize the widget function of the size of the image read viewer.resize(width,height); // Assign the read image as background viewer.setBgImage(myImage); // Show it viewer.bgImageOn(); // Have the image interaction active viewer.startEditImageSlot(); // load grx if (argc > 2) viewer.readGrx(argv[2]); // Show the widget viewer.center(); viewer.show(); } else { std::cerr << "Syntax: " << argv[0] << " <image> [<file.grx>]" <<std::endl; exit(0); } app.connect( &app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()) ); return app.exec(); }
int main(int argc, char **argv) { /********************* ** Qt **********************/ QApplication app(argc, argv); robotis_manipulator_h_gui::MainWindow w(argc,argv); w.show(); app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit())); int result = app.exec(); return result; }
int main( int argc, char** argv ) { KApplication::disableAutoDcopRegistration(); KCmdLineArgs::init(argc, argv, "storedroptest", 0, 0, 0, 0); KApplication app; StoreDropTest* window = new StoreDropTest( 0 ); window->resize( 500, 500 ); window->show(); QObject::connect( qApp, SIGNAL( lastWindowClosed() ), qApp, SLOT( quit() ) ); return app.exec(); }
void tst_QSystemTrayIcon::lastWindowClosed() { QSignalSpy spy(qApp, SIGNAL(lastWindowClosed())); QWidget window; QSystemTrayIcon icon; icon.setIcon(QIcon("whatever.png")); icon.show(); window.show(); QTimer::singleShot(2500, &window, SLOT(close())); QTimer::singleShot(20000, qApp, SLOT(quit())); // in case the test fails qApp->exec(); QVERIFY(spy.count() == 1); }
int main( int argc, char ** argv ) { QApplication a( argc, argv ); a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) ); QSettings set(QSettings::IniFormat, QSettings::UserScope, "RVM", "findsubtitles"); FindSubtitlesWindow w; w.setSettings(&set); w.show(); return a.exec(); }
int main(int argc, char *argv[]) { ProfileLogger app(argc, argv); app.loadTranslation(); QObject::connect(QApplication::instance(), SIGNAL(lastWindowClosed()), QApplication::instance(), SLOT(quit())); MainWindow* w = new MainWindow(); w->show(); app.setMainWindow(w); return app.exec(); }
int main(int argc, char *argv[]) { QApplication app(argc, argv); QCoreApplication::setOrganizationName("SocialRobot"); QCoreApplication::setApplicationName("Social Robot"); Gui w(argc, argv); w.show(); app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit())); return app.exec(); }
int main( int argc, char ** argv ) { sysinfo.machinenum = 0; sysinfo.nchannels[0] = 1; sysinfo.channelinfo[0][1].number = 1; sysinfo.channelinfo[0][1].electchan = 0; QApplication a( argc, argv ); DIOInterface* mw = new DIOInterface(); mw->setCaption( "Qt Example - Application" ); mw->show(); a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) ); return a.exec(); }
int main(int argc,char *argv[]) { int retval = 0; /* Initialize rtdk */ #ifdef _RTUTILS_H rt_print_auto_init(1); #endif /* Try to Exit Cleanly on Signals */ parentThread = getpid(); signal(SIGINT,signal_handler); signal(SIGABRT,signal_handler); signal(SIGSEGV,signal_handler); /* Handle Command-Line Options */ cli_options_t cli_options; if (!parse_cli_options(argc,argv,&cli_options)) return -EINVAL; /* Find Configuration File */ std::string config_file; if (cli_options.config_file.length()) config_file = cli_options.config_file; else if (getenv("RTXI_CONF")) config_file = getenv("RTXI_CONF"); else config_file = "/etc/rtxi.conf"; /************************************************************ * Create Main System Components * * * * These need to be created early because they should have * * Settings::IDs of 0 and 1. * ************************************************************/ /* Create GUI Objects */ QApplication *app = new QApplication(argc,argv); app->connect(app,SIGNAL(lastWindowClosed()),app,SLOT(quit())); MainWindow::getInstance()->showMaximized(); CmdLine::getInstance(); RT::System::getInstance(); IO::Connector::getInstance(); /* Bootstrap the System */ Settings::Manager::getInstance()->load(config_file); retval = app->exec(); Plugin::Manager::getInstance()->unloadAll(); return retval; }
int main( int argc, char** argv ) { // check qt version QT_REQUIRE_VERSION( argc, argv, "4.7.0" ); // create application QApplication a( argc, argv ); a.setApplicationName( PACKAGE_NAME ); a.setOrganizationName( PACKAGE_NAME ); a.setOrganizationDomain( PACKAGE_DOMAIN ); QObject::connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) ); // init pSettings pSettings::setIniInformations( PACKAGE_NAME, PACKAGE_VERSION_STR ); // parse command line arguments CommandLineManager clm; clm.parse(); /*Properties p; p.writeToFile( "properties.xml" );*/ const QStringList arguments = clm.arguments().keys(); if ( arguments.contains( "-v" ) || arguments.contains( "--version" ) ) { clm.showVersion(); } if ( arguments.contains( "-h" ) || arguments.contains( "--help" ) ) { clm.showHelp(); } if ( arguments.contains( "-v" ) || arguments.contains( "--version" ) || arguments.contains( "-h" ) || arguments.contains( "--help" ) ) { return 0; } // init monkey studio core MonkeyCore::init(); // handle command line arguments clm.process(); // execute application const int result = a.exec(); // some cleanup MonkeyCore::pluginsManager()->clearPlugins(); delete MonkeyCore::settings(); // exit code return result; }