Early in the book, there are a few places where the text uses the word "type" but almost certainly means "object." Under "Digesting a user interface," the book states:
a QML document needs to have one and only one root type
I suspect that this should say root object. Likewise, where it goes on to say
As QML doesn’t restrict the choice of type for the root type
Again the last word should be object.
The text also doesn't specify how Qt knows which object is the root; the example sets the object's ID to "root," which may mislead readers into thinking that this is a required and distinguishing specifier. We might add a note to the contrary (there is one that comes later), and point out that all other objects in the QML document will be nested within the root object's markup.
A couple more places where "type" is used where "object" should be used:
The id is a special and optional property that contains an identifier that can be used to reference its associated type elsewhere in the document.
That statement is actually incorrect; the ID is not an alias for a type. It's used to refer to the associated object.
It goes on to say:
Using root as the id for the root-type is a convention used in this book to make referencing the top-most type predictable in larger QML documents.
But should say,
"Using "root" as the ID for the root object is a convention used in this book to make referencing the topmost object predictable in larger QML documents.
I found quite a few other places where "type" is confused with "object," so I made changes and will submit a PR. Thanks!
Early in the book, there are a few places where the text uses the word "type" but almost certainly means "object." Under "Digesting a user interface," the book states:
I suspect that this should say root object. Likewise, where it goes on to say
Again the last word should be object.
The text also doesn't specify how Qt knows which object is the root; the example sets the object's ID to "root," which may mislead readers into thinking that this is a required and distinguishing specifier. We might add a note to the contrary (there is one that comes later), and point out that all other objects in the QML document will be nested within the root object's markup.
A couple more places where "type" is used where "object" should be used:
That statement is actually incorrect; the ID is not an alias for a type. It's used to refer to the associated object.
It goes on to say:
But should say, "Using "root" as the ID for the root object is a convention used in this book to make referencing the topmost object predictable in larger QML documents.
I found quite a few other places where "type" is confused with "object," so I made changes and will submit a PR. Thanks!