Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.8.1
-
None
-
171076792 (dev), 8a8fb882b (6.9), 38efd99ac (6.8)
Description
Example:
import QtQuick import QtQuick.Controls.Basic Window { width: 640 height: 480 visible: true title: qsTr("Hello World") Repeater { model: ['one', 'two'] MyButton { text: modelData } } component FirstComponent : Item { required property var control } component SecondComponent : FirstComponent {} component MyButton : Button { id: btn contentItem: SecondComponent { id: myContentItem control: btn } } }
Description:
MyButton has no required properties. I expect that this sample will work and that modelData will contain 'one' or 'two'. However, when I run it (I use Qt 6.6.1 and Qt 6.8.1), I get the following error: "ReferenceError: modelData is not defined."
But if I replace SecondComponent with FirstComponent in MyButton.contentItem, or remove the id from contentItem, it works as I expect. And I don't understand why
Attachments
Issue Links
- split to
-
QTBUG-133129 DelegateModel can create delegates with unset required properties in sub-objects
-
- Reported
-