-
Notifications
You must be signed in to change notification settings - Fork 3
QML Naming conventions and file structure
mobile-bungalow edited this page Aug 28, 2019
·
2 revisions
There are three rules to follow when adding Elements or new files to the QML codebase.
- Group Subelements into directories with the same name as their parent.
for example SideBar has ConfigBar, ContactView, and SearchBar elements. the hierarchy should look like
├── /
├── Main.qml
├── SideBar.qml
├── SideBar/
│ ├── SearchBar.qml
│ ├── ConfigBar.qml
│ └── ChatView.qml
-
Keep qml as declarative as possible. JS written by us should be kept to an absolute minimum.
Try to move complex sub-elements into their own file, and make them work as independently as possible from their parent.
-
Element ID convention is Component Type Element
You can omit the element if component and type make the purpose self explanatory or shorter