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

Forums

OverviewFelgo 3 Support (Qt 5) › Felgo Live dont resolve sources in Qt Resource System

Tagged: 

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #19568

    Clovis

    Hi

    I’m using Felgo live to solve some problems in a developed APP, but I see developers used image sources as:

    source: "qrc:///Themes/" + Themes.selected.imagesTheme + "/Images/Logos/small.png";

    That way works for compiled app in Android phisical device, or Android Emulator, but dont works in Felgo Live, searching on forum I see a reply that explain to use Qt.resolvedUrl like that:

    source: Qt.resolvedUrl("../../../../Themes/" + Themes.selected.imagesTheme + "/Images/Logos/small.png");

    This way works well, both in compiled app or Felgo live, then I like to ask you, isnt possible to use Qt Resource System?  How about if I use some resources with prefix and alias to reduce that path, like prefix images and alias smallLogo.png, the path for QRC becomes :/images/smallLogo.png, that can work? Or I must configure something else in project for Felgo Live know how to deal with this?

    Best regards

     

    Clóvis

     

     

    #19571

    Alex
    Felgo Team

    Hi Clovis,

    with the resource system, the assets are compiled to be available with the app in binary format. Felgo Live does not use a compile step, it transfers the QML and asset files as-is and loads them at runtime. This enables the fast reloading and instand display of code changes. You can however turn your own app, with all it’s C++ and resources into a Live Client yourself with 3 lines of code, using the Live Client Module. Then you can also use the resource system while developing with Felgo Live.

    Cheers,
    Alex

    #19609

    Clovis

    Hi,

    Tried, but got application killed with follow message:

     

    W Felgo Live Client: (null):0 ((null)): ERROR: Invalid license key set for plugin: "VPlay" "2.0"

     

    and cant find a way to set license key on the client, exists a way to set that?

     

    regards

    Clóvis

     

    #19610

    Alex
    Felgo Team

    Hi Clovis,

    can you try to add the live client module to an empty Felgo project, to see if the crash is related to the module or your project?

    Just to be sure, those are the steps to add the module:

    Add this to your *.pro file:

    CONFIG += v-play-live

    Add this to your main.cpp file:

    #include <VPLiveClient>

    Comment (remove) those lines in the main.cpp file:

    // vplay.setMainQmlFileName(QStringLiteral("qml/Main.qml"));
    // vplay.setMainQmlFileName(QStringLiteral("qrc:/qml/Main.qml"));
    // engine.load(QUrl(vplay.mainQmlFileName()));

    And add this file just before the return statement in the main.cpp file:

    VPlayLiveClient liveClient(&engine);

    Then it’s recommended to make a clean build, thus run clean, run qmake and then run the project.

    Cheers,
    Alex

     

    #20135

    Bart

    Hi Alex,

    I just did exactly as you describe here. Still get this error:

    ERROR: Invalid license key set for plugin: "VPlay" "2.0"

    Do you know what can be wrong?

    Best regards, Bart

    #20137

    Clovis

    Hi

    Just a follow up and sorry for delay I forget about this post, the crash was in my APP on custom C++ API I forget to initialize a private field with nullptr then strange this happens.

    and to improve the use of VPlay Live in our code, I used the preprocessor to avoid commenting on CPP in .pro like this:

     

    CONFIG(debugx) {
      CONFIG += v-play-live
      DEFINES += QT_DEBUGX
    }

     

    then on main.cpp:

    #ifdef QT_DEBUGX
    #include <VPLiveClient>
    #endif

     

    and in start code:

        #ifdef QT_DEBUGX
            VPlayLiveClient liveClient(&engine);
        #else
        vplay.setMainQmlFileName(QStringLiteral("qrc:/QML/Main.qml"));
        engine.load(QUrl(vplay.mainQmlFileName()));
        if (engine.rootObjects().isEmpty())
            return -1;
        #endif

     

    Then you add a new build configuration clonning Debug, name as DebuX and on qmake build step on field Additional arguments set:

    CONFIG+=debugx

     

    Best regards.

     

    Clóvis

    #20192

    Günther
    Felgo Team

    Hi Bart!

    Thanks for letting us know about the error when building a Live Client with custom Cpp:

    ERROR: Invalid license key set for plugin: "VPlay" "2.0"
    

    However, this message does not seem to break the Live Client functionality. You can consider it a warning for now.
    After the client starts, you should be able to press “Connect”. The Live Server will show the request, which you can then accept to connect server + client.

    Your client should then show your app as intended.

    Best,
    Günther

     

    #20194

    Bart

    Hi Günther,

    Thanks for the reply, it works now. The trick is indeed to use the “Run” button in QtCreator, not the “Live” one, then connect to the “Live Client” whereas the “Desktop client” was used before.

    Best regards, Bart

     

     

     

Viewing 8 posts - 1 through 8 (of 8 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