Forums

OverviewV-Play 2 Support (Qt 5) › Examples project files

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

    Sam

    Hi

    I was wondering why the following is in every pro file in the examples:

    # NOTE: for PUBLISHING, perform the following steps:
    # 1. comment the DEPLOYMENTFOLDERS += qmlFolder line above, to avoid shipping your qml files with the application (instead they get compiled to the app binary)
    # 2. uncomment the resources.qrc file inclusion and add any qml subfolders to the .qrc file; this compiles your qml files and js files to the app binary and protects your source code
    # 3. change the setMainQmlFile() call in main.cpp to the one starting with "qrc:/" - this loads the qml files from the resources
    # for more details see the "Deployment Guides" in the V-Play Documentation

    It’s a bit hacky and won’t include the qrc in the tree fi. Something like:

    CONFIG(debug, debug|release) {
        DEPLOYMENTFOLDERS += qmlFolder
    }
    
    CONFIG(release, debug|release) {
        RESOURCES += resources.qrc
    }

    would be better I reckon as I think that’s the main point of having a debug and release build.

    In the main.cpp file something like the following could work:

    #ifdef QT_DEBUG
        vplay.setMainQmlFileName(QStringLiteral("qml/Main.qml"));
    #else
        vplay.setMainQmlFileName(QStringLiteral("qrc:/qml/Main.qml"));
    #endif

     

    #9724

    Christian
    V-Play Team

    Hi Sam,

    the qrc approach is the last step when publishing a game and not the ideal workflow during development. The main advantage you get by using the qrc approach, is that you can protect your QML source code.

    So you might test performance in release builds and still not use the qrc approach. Or not use qrc in release builds because especially when not using shadow builds the workflow is much faster (because you can just perform a re-run of the appliation without compiling it).

    The third reason why we decided against the autamitc switching as you suggested is this: When you add a new folder in your project tree, you manually need to add this folder to the resources file. As your app would not start if you forget this step, this is a manual process you usually do when your app is ready for publishing and thus the better user experience is to use the DEPLOYMENTFOLDERS approach during development.

    Cheers, Chris

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