Details
-
Bug
-
Resolution: Done
-
P2: Important
-
6.2.0 Beta3
-
b262090c0226589282c377fe531cd3a1e713c729 (qt/qtdeclarative/dev) 7bf995971b6804e55da2fd04c987798f5402ff54 (qt/qtdeclarative/6.2)
Description
https://doc-snapshots.qt.io/qt6-6.2/qtquick-bestpractices.html mentions
- "Bundle Application Resources": This should be "Create QML modules" instead. Bundling resources is not enough. You need to tell the build system that your files constitute a QML module so that they are properly analyzed and compiled. Also, the whole section focuses on qmake. Instead, CMake should be the primary build system. Building QML modules with qmake can be covered in a separate section further down, if necessary at all.
- "Separate UI from Logic": While this generally heads into the right direction, we should not promote the use of ListModel and ListElement because ListElement relies on custom parsers. Instead we should either restrict it to simple models (integer or JS array) or go the whole way and use a QAbstractItemModel.
https://doc-snapshots.qt.io/qt6-6.2/qml-codingconventions.html should mention that JS functions need to be type-annotated.
Attachments
For Gerrit Dashboard: QTBUG-96150 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
367929,3 | qmlapp/codingconventions: Recommend using type annotations | dev | qt/qtdoc | Status: MERGED | +2 | 0 |
367960,2 | qmlapp/codingconventions: Recommend using type annotations | 6.2 | qt/qtdoc | Status: MERGED | +2 | 0 |
368372,7 | docs/qtquick-bestpractices: Update documentation | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
368496,2 | docs/qtquick-bestpractices: Update documentation | 6.2 | qt/qtdeclarative | Status: MERGED | +2 | 0 |