• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ Q_INIT_RESOURCE函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中Q_INIT_RESOURCE函数的典型用法代码示例。如果您正苦于以下问题:C++ Q_INIT_RESOURCE函数的具体用法?C++ Q_INIT_RESOURCE怎么用?C++ Q_INIT_RESOURCE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了Q_INIT_RESOURCE函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: main

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();
}
开发者ID:conny-h,项目名称:Qt-SESAM,代码行数:19,代码来源:main.cpp


示例2: main

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();
}
开发者ID:Nacto1,项目名称:qt-everywhere-opensource-src-4.6.2,代码行数:19,代码来源:main.cpp


示例3: main

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();
}
开发者ID:hxpe,项目名称:qt-kso-484,代码行数:19,代码来源:main.cpp


示例4: main

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;
}
开发者ID:Natalya-Akinina,项目名称:stend,代码行数:43,代码来源:main.cpp


示例5: main

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();
}
开发者ID:thehumanweb,项目名称:qml-runtime,代码行数:19,代码来源:main.cpp


示例6: main

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);
    }
开发者ID:Nacto1,项目名称:qt-everywhere-opensource-src-4.6.2,代码行数:19,代码来源:main.cpp


示例7: main

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();
}
开发者ID:bailsoftware,项目名称:qt-embedded,代码行数:42,代码来源:main.cpp


示例8: main

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();
}
开发者ID:daemons2000,项目名称:qt-box-editor,代码行数:42,代码来源:main.cpp


示例9: mousePressEvent

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;
    }

}
开发者ID:mengcz13,项目名称:FlowFree,代码行数:42,代码来源:gamebody.cpp


示例10: main

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();
}
开发者ID:ironsteel,项目名称:QtOME,代码行数:20,代码来源:main.cpp


示例11: Q_INIT_RESOURCE

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 );
}
开发者ID:bawaaaaah,项目名称:Phoenix,代码行数:20,代码来源:sdlevents.cpp


示例12: main

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();
}
开发者ID:F1ash,项目名称:qt-virt-manager,代码行数:20,代码来源:main.cpp


示例13: main

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();
}
开发者ID:AmesianX,项目名称:ParticleEditor,代码行数:20,代码来源:main.cpp


示例14: main

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();
}
开发者ID:12019,项目名称:shrew,代码行数:20,代码来源:main.cpp


示例15: main

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);
    }
开发者ID:maxxant,项目名称:qt,代码行数:20,代码来源:main.cpp


示例16: main

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;
}
开发者ID:bartp5,项目名称:filebrowser-scripting-primitive,代码行数:20,代码来源:main.cpp


示例17: emscriptenQtSDLMain

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();
}
开发者ID:RobertoMalatesta,项目名称:emscripten-qt,代码行数:20,代码来源:main.cpp


示例18: main

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();
}
开发者ID:bkchr,项目名称:Rockete,代码行数:20,代码来源:main.cpp


示例19: CoaToolWindow

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();
}
开发者ID:BackupTheBerlios,项目名称:openaqua-svn,代码行数:20,代码来源:coaaboutbox.cpp


示例20: QDialog

/*
 *  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);
}
开发者ID:0TheFox0,项目名称:MayaOpenRPT,代码行数:27,代码来源:login.cpp



注:本文中的Q_INIT_RESOURCE函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ Q_INT64_C函数代码示例发布时间:2022-05-30
下一篇:
C++ Q_HANDLED函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap