Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
None
Description
Code
import QtQuick import QtQuick.Controls.Basic Window { id: root width: 800 height: 600 visible: true Page { header: Rectangle { width: root.width // OK } } ListView { header: Rectangle { width: root.width // Unqualified access } } Popup { Rectangle { width: root.width // OK } } Repeater { Rectangle { width: root.width // Unqualified access } } }
Issue
Unless someone already has in-depth knowledge of the Qt Quick API, it is not obvious from the code why the Page and Popup are OK while the ListView and Repeater are not. (Answer: The type of Page.header is Item while the type of ListView.header is Component, so the code above is not assigning an instance of a Rectangle to ListView.header. Similar for Popup vs. Repeater)
Suggestion
Let the syntax highlighter or code editor provide a way to visually distinguish the two cases above at a glance