Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!

Forums

OverviewFelgo 2 Support (Qt 5) › Global configuration

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

    Wojciech

    Hi

    I need in my program a simple object of configuration data (e.g. URL of webservices, etc). I can be static and set only during complilation, but it should by easily accessible through application modules. What do you advice to use in this case? Next step could be dynamic configuration kept in some datastorage, but it is not necessary at the moment.

    #16987

    Günther
    Felgo Team

    Hi!

    For simple configuration objects, we recommend to create a singleton type in QML. Singletons are directly usable from any QML file after importing the type.

    Our Slot Game tutorial includes a short section about adding a singleton: https://felgo.com/doc/how-to-make-a-slot-game-tutorial/#are-you-a-singleton

    You can also find singletons in many of our open-source demos, for example the Qt World Summit App (qml/common/DataModel.qml) or One Card (qml/common/Constants.qml)

    Hope this helps!

    Cheers,
    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.