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

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.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded