Search code examples
qmlstandard-library

Which standard can we consider when writing QML?


For writing PHP code, programmers usually use PSR. For programming in QML, which standard should we consider that unites the code written by QML programmers.


Solution

  • It's not a standard as such, but the best way that I know of to achieve what you're after is to use Qt Creator. The rules that it uses can likely only be found in its source code, but if you pay attention to the warnings that it produces, and use the Tools > QML/JS > Reformat File feature, you shouldn't have any problems.

    The built-in coding style comes from Tools > Options > Qt Quick > Code Style.