int main(int argc, char *argv[]) { Q_INIT_RESOURCE(ctSESAM); QApplication a(argc, argv); QTranslator translator; bool ok = translator.load(":/translations/i18n_" + QLocale::system().name()); #ifndef QT_NO_DEBUG if (!ok) qWarning() << "Could not load translations for" << QLocale::system().name() << "locale"; #endif if (ok) a.installTranslator(&translator); MainWindow w; w.activateWindow(); return a.exec(); }
int main(int argc, char *argv[]) { Q_INIT_RESOURCE(fridgemagnets); bool smallScreen = false; for (int i=0; i<argc; i++) if (QString(argv[i]) == "-small-screen") smallScreen = true; QApplication app(argc, argv); #ifdef QT_KEYPAD_NAVIGATION QApplication::setNavigationMode(Qt::NavigationModeCursorAuto); #endif DragWidget window; if (smallScreen) window.showFullScreen(); else window.show(); return app.exec(); }
int main(int argc, char **argv) { Q_INIT_RESOURCE(portedasteroids); QApplication app(argc, argv); qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); KAstTopLevel topLevel; topLevel.setWindowTitle("Ported Asteroids Game"); #if defined(Q_OS_SYMBIAN) topLevel.showFullScreen(); #else topLevel.show(); #endif app.setQuitOnLastWindowClosed(true); return app.exec(); }
int main(int argc, char * argv[]) { int ret = 0; try { qInstallMessageHandler(message_handler); Q_INIT_RESOURCE(scripts); throw_if(argc != 4, "Недостаточное количество аргументов"); const QString script_fname = argv[1]; const QString src_video_fname = argv[2]; const QString dst_video_fname = argv[3]; // ############################################################################ CDisplay::init(); CMatrix::init(); CImage::init(); CLua lua; CMainLoop main_loop(lua); lua.load_module("/home/natalya/Science/super_stend/src/stend_modules/build/demo_image/libdemo_image.so"); lua.load_script(script_fname); main_loop.start(src_video_fname, dst_video_fname); main_loop.stats["sec_per_frame"]->display(); main_loop.stats["sec_per_frame"]->save("/home/amv/trash/sec_per_frame"); } catch(...) { ret = -1; } CDisplay::destroy(); CMatrix::destroy(); CImage::destroy(); return ret; }
int main(int argc, char *argv[]) { Q_INIT_RESOURCE(preload); QGuiApplication app (argc, argv); if (app.arguments().count() != 2) { return 10; } QmlModule::registerTypes(); QString source = app.arguments().at(1); QmlRuntime::Ptr runtime (QmlRuntimeFactory::create()); bool preloaded = runtime->preload(QUrl(QLatin1String("qrc:/preload.qml"))); Q_ASSERT(preloaded); Q_UNUSED(preloaded); runtime->execute(QUrl(source)); return app.exec(); }
int main(int argc, char **argv) { Q_INIT_RESOURCE(pathstroke); QApplication app(argc, argv); bool smallScreen = false; for (int i=0; i<argc; i++) if (QString(argv[i]) == "-small-screen") smallScreen = true; PathStrokeWidget pathStrokeWidget(smallScreen); QStyle *arthurStyle = new ArthurStyle(); pathStrokeWidget.setStyle(arthurStyle); QList<QWidget *> widgets = qFindChildren<QWidget *>(&pathStrokeWidget); foreach (QWidget *w, widgets) { w->setStyle(arthurStyle); w->setAttribute(Qt::WA_AcceptTouchEvents); }
int main(int argc, char** argv) { Q_INIT_RESOURCE(portedcanvas); QApplication app(argc,argv); if ( argc > 1 ) butterfly_fn = argv[1]; else butterfly_fn = ":/trolltech/examples/graphicsview/portedcanvas/butterfly.png"; if ( argc > 2 ) logo_fn = argv[2]; else logo_fn = ":/trolltech/examples/graphicsview/portedcanvas/qtlogo.png"; QGraphicsScene canvas; canvas.setSceneRect(0, 0, 800, 600); Main m(canvas); m.resize(m.sizeHint()); m.setWindowTitle("Ported Canvas Example"); #if defined(Q_OS_SYMBIAN) m.showMaximized(); #elif defined(Q_WS_MAEMO_5) m.show(); #else if ( QApplication::desktop()->width() > m.width() + 10 && QApplication::desktop()->height() > m.height() +30 ) m.show(); else m.showMaximized(); #endif QTimer timer; QObject::connect(&timer, SIGNAL(timeout()), &canvas, SLOT(advance())); timer.start(30); QObject::connect( qApp, SIGNAL(lastWindowClosed()), qApp, SLOT(quit()) ); return app.exec(); }
int main(int argc, char* argv[]) { Q_INIT_RESOURCE(application); QApplication app(argc, argv); app.setOrganizationName(SETTING_ORGANIZATION); app.setApplicationName(SETTING_APPLICATION); QSettings settings(QSettings::IniFormat, QSettings::UserScope, SETTING_ORGANIZATION, SETTING_APPLICATION); //Set the style saved inside the configuration if any QString style = settings.value("GUI/Style").toString(); if (style.isEmpty()) { app.setStyle(QStyleFactory::create("Plastique")); } else { app.setStyle(QStyleFactory::create(style)); } //Set the icon theme saved inside the configuration if any QString iconTheme = settings.value("GUI/IconTheme").toString(); if (!iconTheme.isEmpty()) { QIcon::setThemeName(iconTheme); } static const char * GENERIC_ICON_TO_CHECK = "fileopen"; static const char * FALLBACK_ICON_THEME = "QBE-Faenza"; if (!QIcon::hasThemeIcon(GENERIC_ICON_TO_CHECK)) { //If there is no default working icon theme then we should //use an icon theme that we provide via a .qrc file //This case happens under Windows and Mac OS X //This does not happen under GNOME or KDE QIcon::setThemeName(FALLBACK_ICON_THEME); } QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8")); MainWindow mainWin; mainWin.show(); for (int i = 1; i < argc; ++i) { mainWin.addChild(argv[i]); } return app.exec(); }
void GameBody :: mousePressEvent(QMouseEvent *event){ Q_INIT_RESOURCE(flowfree_resources); int inteval = (this->frameSize().height())/(gamesection->size); qDebug()<<this->frameSize(); if (event->button() == Qt::LeftButton){ cursor = event->pos(); if (last_active_unit!=0) show_cursor = true; else show_cursor = false; update(); int cursor_j = (event->pos().x())/inteval; int cursor_i = (event->pos().y())/inteval; if (cursor_j>=gamesection->size) cursor_j = gamesection->size - 1; if (cursor_i>=gamesection->size) cursor_i = gamesection->size - 1; if (gamesection->playarea[cursor_i][cursor_j].color == (-1)){ last_active_unit = 0; } else{ if (gamesection->if_color_connected(gamesection->playarea[cursor_i][cursor_j].color)){ qDebug()<<"Broken!"; QSound::play(":/sound/sound/broken.wav"); } last_active_unit = &(gamesection->playarea[cursor_i][cursor_j]); if (last_active_unit->if_fixed){ gamesection->fixed_point_series[last_active_unit->color][0]->clear_succ(); gamesection->fixed_point_series[last_active_unit->color][1]->clear_succ(); } else{ int tempcolor = last_active_unit->color; last_active_unit->clear_succ(); last_active_unit->color = tempcolor; } } } else{ last_active_unit = 0; } }
int main(int argc, char *argv[]) { QApplication a(argc, argv); Q_INIT_RESOURCE(QtOME); MainWindow w; QSplashScreen *splash = new QSplashScreen; splash->setPixmap(QPixmap(":/splash")); Qt::Alignment topRight = Qt::AlignRight | Qt::AlignTop; splash->show();splash->showMessage(QObject::tr("Setting up the main window..."), topRight, Qt::black); w.setSplash(splash); //QObject::connect(w.action_Quit, SIGNAL(triggered()), MainWindow, SLOT(close())); w.showMaximized(); return a.exec(); }
SDLEvents::SDLEvents() { // Initialize the GameController database with the most recent file // from https://github.com/gabomdq/SDL_GameControllerDB // TODO: Instead of storing the file as a ressource, have it in some // directory so the user can modify it if needed.. Q_INIT_RESOURCE( assets ); // needed to access resources before app.exec() QFile f( ":/assets/gamecontrollerdb.txt" ); f.open( QIODevice::ReadOnly ); SDL_SetHint( SDL_HINT_GAMECONTROLLERCONFIG, f.readAll().constData() ); event_list = new SDL_Event[10](); this->moveToThread( &thread ); polltimer.moveToThread( &thread ); connect( &thread, SIGNAL( started() ), SLOT( threadStarted() ) ); connect( &thread, SIGNAL( finished() ), SLOT( threadFinished() ) ); thread.setObjectName( "phoenix-SDLEvents" ); thread.start( QThread::HighPriority ); }
int main(int argc, char *argv[]) { Q_INIT_RESOURCE(qt_virt_manager); QApplication a(argc, argv); QString name("qt-virt-manager"); a.setOrganizationName(name); a.setApplicationName(name); QSettings::setDefaultFormat(QSettings::IniFormat); QTranslator tr; QLocale lc = QLocale(); if ( lc.language() == QLocale::Russian ) { tr.load("qt_virt_manager_ru"); } else if ( lc.language() == QLocale::Italian ) { tr.load("qt_virt_manager_it"); }; a.installTranslator(&tr); MainWindow w; w.show(); return a.exec(); }
int main(int argc, char *argv[]) { VPlayApplication vplayApplication(argc, argv); // the default mainQmlFileName is qml/main.qml - if you want to change the entry qml file, change it here before startApplication() is called vplayApplication.setMainQmlFileName("qml/ParticleEditorMain.qml"); // this can be used if you want to hide the qml files and compile them into the binary with qt's resource system qrc //vplayApplication.setMainQmlFileName(":/qml/ParticleEditorMain.qml"); // V-Play has 2 renderers: // * the performance optimized CocosRenderer: this is the default renderer on all platforms and has a better performance than QmlRenderer; its only limitation is that not all QML items are fully supported, and no debug shapes of physics objects are available // * the QmlRenderer is primarily needed for debugging of physics games on desktops // vplayApplication.setCocosRendererEnabled(false); vplayApplication.setQmlRendererEnabled(false); // this must be called in each game before startApplication() is called, so the import VPlay 1.0 can be resolved Q_INIT_RESOURCE(resources_vplay); return vplayApplication.startApplication(); }
int main(int argc, char *argv[]) { Q_INIT_RESOURCE(gui_media); QApplication a(argc, argv); #ifdef TESTS PruebaPantalla *pp = new PruebaPantalla(); pp->show(); #else NewMainWindow mw; mw.show(); #endif return a.exec(); }
int main(int argc, char *argv[]) { Q_INIT_RESOURCE(qtdemo); QApplication app(argc, argv); Colors::parseArgs(argc, argv); MainWindow mainWindow; MenuManager::instance()->init(&mainWindow); mainWindow.setFocus(); if (Colors::fullscreen) mainWindow.showFullScreen(); else { mainWindow.enableMask(true); mainWindow.show(); } artisticSleep(500); mainWindow.start(); return app.exec(); }
int main( int argc, char ** argv ) { Q_INIT_RESOURCE(qikea); QApplication a( argc, argv ); // iniitialize our root window qikeaRoot r; r.show(); // initialize our ikea config // and populate our site list qikea.init( &r ); a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) ); return a.exec(); }
int main(int argc, char **argv) { Q_INIT_RESOURCE(pathstroke); QApplication app(argc, argv); #ifdef Q_OS_SYMBIAN bool smallScreen = true; #else bool smallScreen = QApplication::arguments().contains("-small-screen"); #endif PathStrokeWidget pathStrokeWidget(smallScreen); QStyle *arthurStyle = new ArthurStyle(); pathStrokeWidget.setStyle(arthurStyle); QList<QWidget *> widgets = pathStrokeWidget.findChildren<QWidget *>(); foreach (QWidget *w, widgets) { w->setStyle(arthurStyle); w->setAttribute(Qt::WA_AcceptTouchEvents); }
int main(int argc, char *argv[]) { QApplication app(argc, argv); app.setApplicationName("filebrowser"); QFile currentFile; Q_INIT_RESOURCE(onyx_ui_images); sys::SysStatus::instance().setSystemBusy(false); FileBrowser fileBrowser(0); /*onyx::screen::watcher().addWatcher(&fileBrowser);*/ QString path = fileBrowser.showLoadFile(currentFile.fileName()); if (path.isEmpty()) { return 1; } printf("%s\n",path.toUtf8().data()); return 0; }
int emscriptenQtSDLMain(int argc, char *argv[]) #endif { Q_INIT_RESOURCE(portedasteroids); QApplication *app = new QApplication(argc, argv); qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); KAstTopLevel *topLevel = new KAstTopLevel; topLevel->setWindowTitle("Ported Asteroids Game"); #if defined(Q_OS_SYMBIAN) topLevel->showFullScreen(); #else topLevel->show(); #endif app->setQuitOnLastWindowClosed(true); return app->exec(); }
int main(int argc, char *argv[]) { Q_INIT_RESOURCE(texture); QApplication a(argc, argv); QTextCodec *codec = QTextCodec::codecForName("UTF-8"); QTextCodec::setCodecForCStrings(codec); QTextCodec::setCodecForLocale(codec); QTextCodec::setCodecForTr(codec); QCoreApplication::setOrganizationName("milytia"); //QCoreApplication::setOrganizationDomain(""); QCoreApplication::setApplicationName("texture_atlas_maker"); MainWindow w; w.show(); //w.move(800,200); //w.showMaximized(); return a.exec(); }
CoaAboutBox::CoaAboutBox() : CoaToolWindow("CoaAboutBox", 0) { BEGIN; //Create the central form Q_INIT_RESOURCE(about); CoaFormFactory factory(this); factory.formBuild(":/about/coaaboutbox.ui"); setWindowTitle(QString(tr("About: %1")).arg("Applicationname")); CoaLabel *labelIcon = qFindChild<CoaLabel*>(this, "labelIcon"); labelIcon->setPixmap(QPixmap(":/about/about_coa.png")); initLicencePage(); initApplicationPage(); readSettings(); }
/* * Constructs a login as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. */ login::login(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) : QDialog(parent, fl) { setModal(modal); setObjectName(name); Q_INIT_RESOURCE(OpenRPTCommon); setupUi(this); // signals and slots connections connect(_login, SIGNAL(clicked()), this, SLOT(sLogin())); connect(_options, SIGNAL(clicked()), this, SLOT(sOptions())); _splash = 0; _captive = false; _password->setEchoMode(QLineEdit::Password); }
int main(int argc, char** argv) { // std::cout<<"Size of dart: "<<sizeof(LCC::Dart)<<std::endl; CGAL::set_error_behaviour(CGAL::ABORT); QApplication application(argc,argv); application.setOrganizationDomain("cgal.org"); application.setOrganizationName("CNRS and LIRIS' Establishments"); application.setApplicationName("3D Linear Cell Complex"); // Import resources from libCGALQt4. // See http://doc.trolltech.com/4.4/qdir.html#Q_INIT_RESOURCE CGAL_Qt4_init_resources(); // that function is in a DLL Q_INIT_RESOURCE(Linear_cell_complex_3); MainWindow mw; mw.show(); return application.exec(); }
WiresharkApplication::WiresharkApplication(int &argc, char **argv) : QApplication(argc, argv), initialized_(false), is_reloading_lua_(false) { wsApp = this; setApplicationName("Wireshark"); Q_INIT_RESOURCE(about); Q_INIT_RESOURCE(display_filter); Q_INIT_RESOURCE(i18n); Q_INIT_RESOURCE(layout); Q_INIT_RESOURCE(status); Q_INIT_RESOURCE(toolbar); Q_INIT_RESOURCE(wsicon); Q_INIT_RESOURCE(languages); #ifdef Q_OS_WIN /* RichEd20.DLL is needed for native file dialog filter entries. */ if (QLibrary::isLibrary("riched20.dll")) { QLibrary riched20("riched20.dll"); riched20.load(); if (!riched20.isLoaded()) { qDebug() << riched20.errorString(); } } #endif // Q_OS_WIN #if (QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)) setAttribute(Qt::AA_UseHighDpiPixmaps); #endif QList<int> icon_sizes = QList<int>() << 16 << 24 << 32 << 48 << 64 << 128 << 256 << 512 << 1024; foreach (int icon_size, icon_sizes) { QString icon_path = QString(":/wsicon/wsicon%1.png").arg(icon_size); normal_icon_.addFile(icon_path); icon_path = QString(":/wsicon/wsiconcap%1.png").arg(icon_size); capture_icon_.addFile(icon_path); }
/* TODO: rename _nonxTupleDB to _isxTupleDB internally and set it based on db contents, not command line parameter input */ login2::login2(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : QDialog(parent, modal ? (fl | Qt::Dialog) : fl) { setObjectName(name); Q_INIT_RESOURCE(xTupleCommon); setupUi(this); _company->hide(); _companyLit->hide(); _options = _buttonBox->addButton(tr("Options..."), QDialogButtonBox::ActionRole); _recent = _buttonBox->addButton(tr("Recent"), QDialogButtonBox::ActionRole); _buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Login")); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sLogin())); connect(_options, SIGNAL(clicked()), this, SLOT(sOptions())); connect(_cloudLink, SIGNAL(linkActivated(QString)), this, SLOT(cloudLink(QString))); connect(_otherOption, SIGNAL(toggled(bool)), _options, SLOT(setEnabled(bool))); connect(_otherOption, SIGNAL(toggled(bool)), _recent, SLOT(setEnabled(bool))); _splash = 0; _captive = false; _nonxTupleDB = false; _multipleConnections = false; _evalDatabaseURL = "pgsql://demo.xtuple.com:5434/%1"; _cloudDatabaseURL= "pgsql://cloud.xtuple.com:5432/%1"; _password->setEchoMode(QLineEdit::Password); updateRecentOptionsActions(); _databaseURL = xtsettingsValue("/xTuple/_databaseURL", "pgsql://:5432/").toString(); _enhancedAuth = xtsettingsValue("/xTuple/_enhancedAuthentication", false).toBool(); _requireSSL = xtsettingsValue("/xTuple/_requireSSL", false).toBool(); if(xtsettingsValue("/xTuple/_demoOption", false).toBool()) _demoOption->setChecked(true); else if(xtsettingsValue("/xTuple/_cloudOption", false).toBool()) _cloudOption->setChecked(true); _company->setText(xtsettingsValue("/xTuple/cloud_company", "").toString()); adjustSize(); }
int main( int argc, char** argv ) { Q_INIT_RESOURCE(grades); QApplication app( argc, argv ); QStandardItemModel *model=new QStandardItemModel(); QFile file(":/grades.txt"); QString line; QStringList list; if (file.open(QFile::ReadOnly)) { line = file.readLine(200); list= line.simplified().split(","); model->setHorizontalHeaderLabels(list); int row=0; QStandardItem *newItem=0; while(file.canReadLine()){ line = file.readLine(200); if(!line.startsWith("#") && line.contains(",")){ list= line.simplified().split(","); for(int col=0; col<list.length(); col++){ newItem = new QStandardItem(list.at(col)); model->setItem(row ,col, newItem); } row++; } } } file.close(); FreezeTableWidget *tableView = new FreezeTableWidget(model); tableView->setWindowTitle(QObject::tr("Frozen Column Example")); tableView->resize(560,680); tableView->show(); return app.exec(); }
int main(int argc, char **argv) { if (IS_DEBUG_BUILD) { // see http://doc.qt.io/qt-5/qtglobal.html#qSetMessagePattern // also allows environment variable QT_MESSAGE_PATTERN qSetMessagePattern( "[%{time} %{threadid}] %{type} in %{function} (at %{file}:%{line}): %{message}"); } QApplication app(argc, argv); Q_INIT_RESOURCE(mmapper2); tryInitDrMingw(); tryUseHighDpi(app); auto tryLoadingWinSock = std::make_unique<WinSock>(); const auto &config = getConfig(); if (config.canvas.softwareOpenGL) { app.setAttribute(Qt::AA_UseSoftwareOpenGL); if (CURRENT_PLATFORM == Platform::Linux) { qputenv("LIBGL_ALWAYS_SOFTWARE", "1"); } } else { // Windows Intel drivers cause black screens if we don't specify OpenGL app.setAttribute(Qt::AA_UseDesktopOpenGL); } std::unique_ptr<ISplash> splash = !config.general.noSplash ? static_upcast<ISplash>(std::make_unique<Splash>()) : static_upcast<ISplash>(std::make_unique<FakeSplash>()); auto mw = std::make_unique<MainWindow>(); tryAutoLoad(*mw); mw->show(); splash->finish(mw.get()); splash.reset(); mw->startServices(); const int ret = app.exec(); mw.reset(); config.write(); return ret; }
int maoni_main(int argc, char* argv[], RenderAlgorithm* algorithm_stack) { boost::mpi::environment env(argc, argv); QApplication app(argc, argv); Q_INIT_RESOURCE( Resources); QPixmap pixmap(":/Maoni/Splashscreen.jpg"); QSplashScreen splash(pixmap, Qt::WindowStaysOnTopHint); FrameDataIceT framedata(algorithm_stack); RenderWidgetIceT* icet_widget = new RenderWidgetIceT(framedata); QWidget* main_window; if (framedata.master()) { MainWindow* mw = new MainWindow(framedata, icet_widget); TilesWidget* tiles_widget = new TilesWidget(framedata); mw->connect(mw, SIGNAL(data_updated()), tiles_widget, SLOT( update_browser())); mw->add_dock("Tile Config", Qt::LeftDockWidgetArea, // tiles_widget); main_window = mw; splash.show(); } else { main_window = icet_widget; } QString window_title("Maoni using IceT Parallel Rendering; Rank %1"); main_window->setWindowTitle(window_title.arg(framedata.myrank())); QTimer::singleShot(1000, main_window, SLOT(show())); QTimer::singleShot(1337, &splash, SLOT(close())); env.abort(app.exec()); return 0; }
int main(int argc, char *argv[]) { Q_INIT_RESOURCE(draggableicons); QApplication app(argc, argv); QWidget mainWidget; QHBoxLayout *horizontalLayout = new QHBoxLayout; horizontalLayout->addWidget(new DragWidget); horizontalLayout->addWidget(new DragWidget); mainWidget.setLayout(horizontalLayout); mainWidget.setWindowTitle(QObject::tr("Draggable Icons")); #ifdef Q_OS_SYMBIAN mainWidget.showMaximized(); #else mainWidget.show(); #endif return app.exec(); }
int main(int argc, char *argv[]) { QApplication app(argc, argv); QCoreApplication::setOrganizationName("GNU Telephony"); QCoreApplication::setOrganizationDomain("gnutelephony.org"); QCoreApplication::setApplicationName("coastal-search"); Q_INIT_RESOURCE(search); Coastal::bind(app, "search"); if(app.styleSheet().isEmpty()) Coastal::applyStyle(":/qss/search.css"); if(argv[1] && argv[2]) types = argv[2]; Main w(argv[1]); w.show(); return app.exec(); }