qt5-cadaques icon indicating copy to clipboard operation
qt5-cadaques copied to clipboard

The word "element" is possibly confusing

Open chriadam opened this issue 11 years ago • 2 comments

back-link: ch04/index.html#quick-starter

You write, for example, "Elements are declared by using their element name" but later you refer to "Basic Elements" such as the "Rectangle Element". This seems to combine two separate ideas: types, and object instances. An object instance may be declared using the typename, and you could consider any given object instance to be an element in the document, perhaps. But with that interpretation applied, you certainly could not consider the Rectangle type to be an element.

It is true that a declaration of an object instance may simultaneously be an implicit type declaration (if it has dynamic properties, for example), but that is somewhat orthogonal to the discussion above.

chriadam avatar Dec 13 '13 04:12 chriadam

How does it work in HTML? Need to look up. I know they changed it on the Qt documentation to use objects and types. So I will better use elements and types. Object is just to generic for me and to technical. Thanks for pointing this out.

jryannel avatar Jan 08 '14 06:01 jryannel

I believe the terminology Qt uses is not "element" at all (that's HTML terminology), but "item". The term is derived from Qt Quick Item, the base type of all visual QML types - http://qt-project.org/doc/qt-5.0/qtquick/qml-qtquick2-item.html.

I've seen the term "item" used all over the Qt documentation interchangeably to refer to both a QML type and to an instance of a type. It's very similar to HTML/XML where one can use the term "element" to refer both to an element type (e.g. "h1") and to an actual usage of an element in a document - a piece of text surrounded by the corresponding start tag and end tag (e.g. <h1>chapter title</h1>).

I suggest to use term "QML type" when you want to stress that you are talking about a type and not a particular instance. But using "item" most of the time is fine with me.

martinky avatar Jan 24 '14 20:01 martinky