From 40dfab12053f2f8b8ccbf10bf257ce984eac5ba7 Mon Sep 17 00:00:00 2001 From: Furkan Uzumcu Date: Mon, 18 Apr 2022 14:18:25 -0400 Subject: [PATCH] Use correct terms when talking about ids --- README.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index b057701..1828768 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ contribution matters. - [CS-2: Property Initialization Order](#cs-2-property-initialization-order) - [CS-3: Function Ordering](#cs-3-function-ordering) - [CS-4: Animations](#cs-4-animations) - - [CS-5: Giving Components `id`s](#cs-5-giving-components-ids) + - [CS-5: Specifying IDs for Objects](#cs-5-specifying-ids-for-objects) - [CS-6: Property Assignments](#cs-6-property-assignments) - [CS-7: Import Statements](#cs-7-import-statements) - [Full Example](#full-example) @@ -284,16 +284,15 @@ SequentialAnimation { } ``` -### CS-5: Giving Components `id`s +### CS-5: Specifying IDs for Objects -If a component does not need to be accessed for a functionality, avoid setting -the `id` property. This way you don't clutter the namespace with unused `id`s and -you'll be less likely to run into duplicate `id` problem. Also, having an id for -a type puts additional cognitive stress because it now means that there's -additional relationships that we need to care for. +If an object does not need to be accessed for a functionality, avoid setting the `id` property. +This way you'll be less likely to run into duplicate `id` problem. Also, having an id for an object +puts additional cognitive stress because it now means that there's additional relationships that we +need to care for. If you want to mark the type with a descriptor but you don't intend to reference -the type, you can use `objectName` instead old just plain old comments. +the type, you can use `objectName` instead or just plain old comments. Make sure that the top most component in the file always has `root` as its `id`. Qt will make unqualified name look up deprecated in QML 3, so it's better to