当前位置: 首页>>代码示例>>C++>>正文


C++ QQuickView::connect方法代码示例

本文整理汇总了C++中QQuickView::connect方法的典型用法代码示例。如果您正苦于以下问题:C++ QQuickView::connect方法的具体用法?C++ QQuickView::connect怎么用?C++ QQuickView::connect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QQuickView的用法示例。


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

示例1: main

int main(int argc, char* argv[])
{
   QGuiApplication app(argc,argv);
   qmlRegisterType<Connector>("Connector", 1, 0, "Connector");
   app.setOrganizationName("QtProject");\
   app.setOrganizationDomain("qt-project.org");\
   app.setApplicationName(QFileInfo(app.applicationFilePath()).baseName());\
   QQuickView view;\
   if (qgetenv("QT_QUICK_CORE_PROFILE").toInt()) {\
       QSurfaceFormat f = view.format();\
       f.setProfile(QSurfaceFormat::CoreProfile);\
       f.setVersion(4, 4);\
       view.setFormat(f);\
   }\
   view.connect(view.engine(), SIGNAL(quit()), &app, SLOT(quit()));\
   new QQmlFileSelector(view.engine(), &view);\
   view.setSource(QUrl("qrc:///demos/tweetsearch/tweetsearch.qml")); \
   view.setResizeMode(QQuickView::SizeRootObjectToView);\
   if (QGuiApplication::platformName() == QLatin1String("qnx") || \
         QGuiApplication::platformName() == QLatin1String("eglfs")) {\
       view.showFullScreen();\
   } else {\
       view.show();\
   }\
   return app.exec();\
}
开发者ID:ernesto341,项目名称:FFA_App,代码行数:26,代码来源:main.cpp

示例2: main

int main(int argc, char* argv[])
{
    QGuiApplication app(argc, argv);
    QQuickView view;
    FileIO fileIO;

    view.rootContext()->setContextProperty("fileio", &fileIO);
    view.connect(view.engine(), SIGNAL(quit()), &app, SLOT(quit()));
    view.setSource(QUrl("qrc:////qml/main.qml"));
    view.setResizeMode(QQuickView::SizeRootObjectToView);
    view.show();

    return app.exec();
}
开发者ID:jknick,项目名称:buttonAlert,代码行数:14,代码来源:main.cpp

示例3: main

int main(int argc, char *argv[]) {
    QApplication app(argc, argv);
    QQuickView view;


    XHR* xhr = XHR::instance();
    view.rootContext()->setContextProperty("xhr", xhr);
    FILESYSTEM* filesystem = FILESYSTEM::instance();
    view.rootContext()->setContextProperty("filesystem", filesystem);
    view.setSource(QUrl("qrc:/qml/friendiqa.qml"));
    view.show();
    view.connect(view.rootContext()->engine(), SIGNAL(quit()), &app, SLOT(quit()));
    return app.exec();

}
开发者ID:LubuWest,项目名称:Friendiqa,代码行数:15,代码来源:friendiqa.cpp

示例4: main

int main(int argc, char* argv[])
{
    pthread_t trade_thread, md_thread;
    QGuiApplication app(argc,argv);
    qmlRegisterType<Graph>("Graph", 1, 0, "Graph");
    app.setOrganizationName("QtProject");
    app.setOrganizationDomain("qt-project.org");
    app.setApplicationName(QFileInfo(app.applicationFilePath()).baseName());
    QQmlEngine engine;
    QQmlComponent component(&engine, QUrl("qrc:///demos/stocqt/content/Tradepanel.qml"));
 //   if( component.status != component.Ready )
 //   {
 //       if( component.status == component.Error )
 //           console.debug("Error:"+ component.errorString() );
 //       return; // or maybe throw
 //   }

    object = component.create();

    QQuickView view;
    tradepanel.object=object;
    PublicFuncs tradeFun(object);
    view.rootContext()->setContextProperty("myObject", &tradepanel);
    view.rootContext()->setContextProperty("myObject_t", &tradeFun);
    if (qgetenv("QT_QUICK_CORE_PROFILE").toInt()) {
        QSurfaceFormat f = view.format();
        f.setProfile(QSurfaceFormat::CoreProfile);
        f.setVersion(4, 4);
        view.setFormat(f);
    }

    view.connect(view.engine(), SIGNAL(quit()), &app, SLOT(quit()));
    new QQmlFileSelector(view.engine(), &view);
    view.setSource(QUrl("qrc:///demos/stocqt/stocqt.qml"));
    view.setResizeMode(QQuickView::SizeRootObjectToView);
    if (QGuiApplication::platformName() == QLatin1String("qnx") ||
          QGuiApplication::platformName() == QLatin1String("eglfs")) {
        view.showFullScreen();
    } else {
        view.show();
    }

    pthread_create(&md_thread, NULL, Msclient, NULL);
    pthread_create(&trade_thread, NULL, trade_main, NULL);

    return app.exec();
}
开发者ID:wfay,项目名称:qtst,代码行数:47,代码来源:main.cpp

示例5: main

int main(int argc, char* argv[])
{
    QGuiApplication app(argc,argv);
    QQuickView view;

    GameData *game = new GameData();
    view.engine()->rootContext()->setContextObject(game);
    view.engine()->rootContext()->setContextProperty("gameData", game);

    view.connect(view.engine(), SIGNAL(quit()), &app, SLOT(quit()));
    view.setSource(QUrl::fromLocalFile(QString("rsc/main.qml")));
    if (QGuiApplication::platformName() == QLatin1String("qnx") ||
          QGuiApplication::platformName() == QLatin1String("eglfs")) {
        view.setResizeMode(QQuickView::SizeRootObjectToView);
        view.showFullScreen();
    } else {
        view.show();
    }
    return app.exec();
}
开发者ID:jga9000,项目名称:Dipple,代码行数:20,代码来源:main.cpp

示例6: main

int main(int argc, char *argv[]) {
    QGuiApplication app(argc,argv);
    app.setOrganizationName("David A Roberts");
    app.setOrganizationDomain("davidar.io");
    app.setApplicationName("Tensor");
    QQuickView view;
    if(qgetenv("QT_QUICK_CORE_PROFILE").toInt()) {
        QSurfaceFormat f = view.format();
        f.setProfile(QSurfaceFormat::CoreProfile);
        f.setVersion(4, 4);
        view.setFormat(f);
    }
    view.connect(view.engine(), SIGNAL(quit()), &app, SLOT(quit()));
    new QQmlFileSelector(view.engine(), &view);
    view.setSource(QUrl("qrc:///src/Tensor.qml"));
    view.setResizeMode(QQuickView::SizeRootObjectToView);
    if(QGuiApplication::platformName() == QLatin1String("qnx") ||
       QGuiApplication::platformName() == QLatin1String("eglfs")) {
        view.showFullScreen();
    } else {
        view.show();
    }
    return app.exec();
}
开发者ID:jjpress,项目名称:tensor,代码行数:24,代码来源:main.cpp

示例7: main

int main(int argc, char* argv[])
{
    QGuiApplication app(argc,argv);

#ifdef QT_WEBVIEW_WEBENGINE_BACKEND
    QtWebEngine::initialize();
#endif // QT_WEBVIEW_WEBENGINE_BACKEND

    qreal screenH=0;
    qreal screenW=0;
    bool firstLaunch=false;

    FileService fileservice;   
    InternetServices internetservices;

    //Translation
    QTranslator translator;
    QDropbox dropbox(APP_KEY, APP_SECRET);
    DropBoxOperations dropboxOperations;
    dropboxOperations.setDropboxObject(&dropbox);


#ifdef IOS
    qmlRegisterType<PDFVisu>("PDFVisu", 1, 0, "PDFVisu");
#endif

#ifdef ANDROID
    qmlRegisterType<PdfCore>("ANDPDFVisu", 1, 0, "ANDPDFVisu");
#endif


    translator.load(":/playlistPlayer."+ QLocale::system().name());

    if(QGuiApplication::screens().length()>1){
        QScreen *scrn = QGuiApplication::primaryScreen();
        screenH=scrn->availableGeometry().size().height();
        screenW=scrn->availableGeometry().size().width();
    }

    app.setOrganizationName("Monasys");
    app.setOrganizationDomain("Monasys.fr");

    app.setApplicationName(QFileInfo(app.applicationFilePath()).baseName());

    //Translation

    app.installTranslator(&translator);

    QQuickView view;
    view.connect(view.engine(), SIGNAL(quit()), &app, SLOT(quit()));

    // Test if local Documents Dir exists, if not creates it

    if(!QDir(documents).exists()){        
        if(QDir(documents.left(documents.lastIndexOf("/"))).exists()){
            QDir(documents.left(documents.lastIndexOf("/"))).mkdir(QDir(documents).dirName());
        }
    }
    if(!QDir(documents + "/playlists").exists()){
        // First launch, install examples
        QDir(documents).mkdir("playlists");
        QDir(documents + "/playlists").mkdir("audio");
        QDir(documents + "/playlists").mkdir("chords");
        QDir(documents + "/playlists").mkdir("lyrics");
        QFile::copy(":/playlists/mysetlist.csv",documents + "/playlists/example.csv") ;
        QFile::copy(":/playlists/audio/onemore.mp3",documents + "/playlists/audio/onemore.mp3") ;        
        QFile::copy(":/playlists/lyrics/onemore.txt",documents + "/playlists/lyrics/onemore.txt") ;
        QFile::copy(":/playlists/lyrics/mysong.txt",documents + "/playlists/lyrics/mysong.txt") ;
        QFile::copy(":/playlists/chords/onemore.png", documents + "/playlists/chords/onemore.png") ;

        setFileAttribute(documents + "/playlists/example.csv");
        setFileAttribute(documents + "/playlists/audio/onemore.mp3");
        setFileAttribute(documents + "/playlists/lyrics/onemore.txt");
        setFileAttribute(documents + "/playlists/lyrics/mysong.txt");
        setFileAttribute(documents + "/playlists/chords/onemore.png");

#ifdef IOS
        // 20160124 Rend ces fichiers non sauvegardable sur iCloud
        backupAttrib bckAtt;
        bool statAttrib;

        setFileAttribute(documents + "/playlists/example.csv");
        setFileAttribute(documents + "/playlists/audio/onemore.mp3");
        setFileAttribute(documents + "/playlists/lyrics/onemore.txt");
        setFileAttribute(documents + "/playlists/lyrics/mysong.txt");
        setFileAttribute(documents + "/playlists/chords/onemore.png");

        statAttrib = bckAtt.setAttribExclude(documents + "/playlists/example.csv");
        statAttrib = bckAtt.setAttribExclude(documents + "/playlists/audio/onemore.mp3");
        statAttrib = bckAtt.setAttribExclude(documents + "/playlists/lyrics/onemore.txt");
        statAttrib = bckAtt.setAttribExclude(documents + "/playlists/lyrics/mysong.txt");
        statAttrib = bckAtt.setAttribExclude(documents + "/playlists/chords/onemore.png");
#endif

        firstLaunch=true;
    }


    //qDebug() << ">>>>>>>>>>>>> Kernel " << QSysInfo::productType() << QSysInfo::kernelVersion() << " Location " << documents;

//.........这里部分代码省略.........
开发者ID:monasysinfo,项目名称:GigSetListPlayer,代码行数:101,代码来源:main.cpp


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