qmlbook / qt6book

The Qt 6 Book - A book about QML
https://www.qt.io/product/qt6/qml-book
Other
347 stars 113 forks source link

Intro refers to QML "type" but should say "object." #209

Open Stokestack opened 1 year ago

Stokestack commented 1 year ago

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!

Stokestack commented 1 year ago

I can't find any way to link this issue to the PR: https://github.com/qmlbook/qt6book/pull/210

The instructions here say there should be a "gear" icon in the sidebar under "Development," but there isn't.