Forums

OverviewFelgo 2 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.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support