Qt World Summit: Register Today!

QML Code modularization (re-use)

  • Hi
    It looks like Qt is making some really nice strides under Digia. I thought I would start playing with QML. I'm wondering how to go about modularizing qml files. For instance, what if I have two screens that have very different functionality and I want to separate them into different QML files or I have some code that I want to re-use often? How do I pull it all together?



  • Moderators

    Put separate components into separate QML files. It's all written in the documentation. As long as the file name follows the convention (starts with upper case), QML will allow you to import that file and use it in your code straigt away.

    There are also more advanced options available, like creating custom component sets.

Log in to reply