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

Forums

OverviewFelgo 3 Support (Qt 5) › pro addon load from resource detection

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

    Bas

    hi,

    I have a little add on for the pro file:

    this code can be added after :

    RESOURCES += #resources.qrc # uncomment for publishing

    
    
    contains( RESOURCES, "resources.qrc" ) {
     DEFINES += "VPLAY_BUILD_RELEASE"
    }

     

    then in main.cpp

    #ifndef VPLAY_BUILD_RELEASE
        qDebug() << "LOAD qml from external qml dir";
            vplay.setMainQmlFileName(QStringLiteral("qml/Main.qml"));
    #endif
        // use this instead of the above call to avoid deployment of the qml files and compile them into the binary with qt's resource system qrc
        // this is the preferred deployment option for publishing games to the app stores, because then your qml files and js files are protected
        // to avoid deployment of your qml files and images, also comment the DEPLOYMENTFOLDERS command in the .pro file
        // also see the .pro file for more details
    #if VPLAY_BUILD_RELEASE
            qDebug() << "LOAD qml from RESOURCE.RC";
        vplay.setMainQmlFileName(QStringLiteral("qrc:/qml/Main.qml"));
    #endif
    
    

    so the process is automated when loading  qml files from resource or from qml files.

    maybe it can be automated even further, but i thought this could be handy

    gr,

    Bas

     

    #17838

    Günther
    Felgo Team

    Hi Bas!

    Yes, that’s definitely something you can do.

    We do not have this automated in our demo projects, as we think it’s best that users manually decide when to use QRC or DEPLOYMENTFOLDERS at first, and thus also learn what the difference is.

    Best,
    Günther

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