Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
5.15.2, 6.5
-
ec25258 (dev), f751745 (6.6)
Description
I've discovered yet another bug with inline components.
In a regular component, you can define a property such like this:
property Component comp: null
And later you can override the property like this:
comp: Item { }
But not with inline components. The implicit conversion doesn't kick in, and the runtime crashes.
It does work as expected like this:
comp: Component { Item { } }
OK, here is a complete example that reproduces the problem:
import QtQuick 2.15 import QtQuick.Window 2.15 Window { width: 640 height: 480 visible: true component C1 : Item { property Component comp: null } component C2 : C1 { comp: Rectangle { width: 50; height: 50; color: "red" } // still null } component C3 : C1 { comp: Component { Rectangle { width: 50; height: 50; color: "red" } } // ok here } C2 { id: c2 } C3 { id: c3 } Component.onCompleted: console.log(c2.comp, c3.comp) }
Attachments
Issue Links
- is duplicated by
-
QTBUG-104798 Crash when using a listview inside an inline component
- Closed
-
QTBUG-106173 qml: Implicit Component wrapping fails in Inline components
- Closed
-
QTBUG-115128 Shorthand Component binding does not work inside inline components
- Closed
For Gerrit Dashboard: QTBUG-98859 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
497447,5 | QtQml: Create implicit components in inline components early | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
498129,2 | QtQml: Create implicit components in inline components early | 6.6 | qt/qtdeclarative | Status: MERGED | +2 | 0 |