I'm going through a tutorial on QML and they've started using Item as the base for every component they create, after using Rectangle
for the first portion of the tutorial.
The thing is, color
doesn't seem to be a valid property on Item. I don't understand why.
Then, I looked at a bunch of example component definitions on-line from a variety of places, and they seem to all use Item
as the top-level class and then immediately after, Rectangle
. What's the point of wrapping a Rectangle
in Item
? Why not just use Rectangle
as the top-level class?