Important: Please read the Qt Code of Conduct -

Best Practices for QML Code Size

  • I am looking for ideas of best practices for QML file code size. I am maintaining some existing code and some of the QML files sprawl over multiple pages. I am looking to compartmentalize the code to hopefully create more re-usable components/files. It should also make each file more maintainable as it will live in its own little world.

    So I am asking if people have any rules of thumb for:

    • qml file length in lines
    • obvious breakup points
    • any other ideas for compartmentalizing the code

    I have looked through some of the best practices pages, but am not really seeing this kind of information.

    As part of this effort I will be updating everything I can from QML 1.x libraries to QML 2.x libraries where appropriate.

Log in to reply