Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 3 Support (Qt 5) › Cannot run example "c++ integration demo app" in real device.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #24388

    Duong

    hi, I try run example “c++ integration demo app” with a real device? I try to follow the documentation of felgo and qt but it isn’t run. I’m using android. run on client desktop ok but run on live device error. please hellp me!! Thanks
    log:
    file:cpp-qml-integration/qml/Main.qml:6: module “com.yourcompany.xyz” is not installed.

     

    This is code in file .pro

    # allows to add DEPLOYMENTFOLDERS and links to the Felgo library and QtCreator auto-completion
    CONFIG += felgo
    QT += qml
    CONFIG += qmltypes
    QML_IMPORT_NAME = com.yourcompany.xyz
    QML_IMPORT_MAJOR_VERSION = 1
    
     CONFIG += felgo-live
    
    PRODUCT_IDENTIFIER = com.yourcompany.wizardEVP.FelgoCppQML
    PRODUCT_VERSION_NAME = 1.0
    PRODUCT_VERSION_CODE = 1
    
    PRODUCT_LICENSE_KEY = ""
    
    qmlFolder.source = qml
    DEPLOYMENTFOLDERS += qmlFolder # comment for publishing
    
    assetsFolder.source = assets
    DEPLOYMENTFOLDERS += assetsFolder
    
    RESOURCES += #    
    SOURCES += main.cpp \
        src/myglobalobject.cpp \
        src/myqmltype.cpp
    
    HEADERS += \
        src/myglobalobject.h \
        src/myqmltype.h
    
    INCLUDEPATH += com/mycompany/xyz
    
    android {
        ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
        OTHER_FILES += android/AndroidManifest.xml       android/build.gradle
    }
    
    ios {
        QMAKE_INFO_PLIST = ios/Project-Info.plist
        OTHER_FILES += $$QMAKE_INFO_PLIST
    }
    
    win32 {
        RC_FILE += win/app_icon.rc
    }
    macx {
        ICON = macx/app_icon.icns
    }

    this code main.pp

    #include <QApplication>
    #include <FelgoApplication>
    #include <QQmlApplicationEngine>
    #include <QQmlContext>
    #include "src/myglobalobject.h"
    #include "src/myqmltype.h"
    #include <FelgoLiveClient>
    
    int main(int argc, char *argv[])
    {
    
      QApplication app(argc, argv);
    
      FelgoApplication felgo;
      felgo.setPreservePlatformFonts(true);
    
      QQmlApplicationEngine engine;
      felgo.initialize(&engine);
      felgo.setLicenseKey(PRODUCT_LICENSE_KEY);
      MyGlobalObject* myGlobal = new MyGlobalObject();
      myGlobal->doSomething("TEXT FROM C++");
      engine.rootContext()->setContextProperty("myGlobalObject", myGlobal); // the object will be available in QML with name "myGlobalObject"
    
      qmlRegisterType<MyQMLType>("com.yourcompany.xyz", 1, 0, "MyQMLType"); // MyQMLType will be usable with: import com.yourcompany.xyz 1.0
      FelgoLiveClient client (&engine);
    
      return app.exec();
    }

     

    #24401

    Alex
    Felgo Team

    Hi,

    Are you using the Felgo Live Client (Dev App) or deploy locally to your device?

    Best,
    Alex from Felgo

Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded