Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.2.0 Beta4
-
None
-
3
Description
This came up in the hackathon: the green "blackboard" at the front of the space station is declared like this:
Frame { id: frame objectName: "frame with green blackboard" x: -90 y: 190 z: 100 w: 160 h: 90 eulerRotation.y: 90 TextEdit { objectName: "blackboard text" property int iviId: 1337 parent: frame.contentItem anchors.fill: parent text: "<- lasciate ogne speranza, voi ch'intrate\n\nTry editing the text here" selectByMouse: true wrapMode: TextEdit.Wrap } }
while Frame is declared like this:
Node { id: rOOT property real w: 150 property real h: 75 property alias contentItem: contentRect PrincipledMaterial { ... } Node { scale: "100,100,100" Model { ... } Model { ... } ... } Node { id: contentNode x: w/200 y: -h/200 scale: "0.5, 0.5, 0.5" Rectangle { id: contentRect width: w*2 height: h*2 color: "lightgreen" } } }
So Frame creates a 2D subscene because it has contentRect declared inside a Node, without a #Rectangle Model to give it a bounding region. That's OK, it can be corrected if we want to avoid having Item2D's at all (because of the infinite planes that they create). But clearly the idea is to reparent the TextEdit into that same 2D subscene. Instead though, we get another 2D subscene just for the TextEdit, which will then end up being empty after the reparenting! Its plane will interfere with event delivery even though it's empty. It is created in QQuick3DObjectPrivate::data_append(). Perhaps that should be put off until componentComplete or so.
The attached example shows that even if you try to avoid creating an Item2D, if you do this reparenting trick you will end up creating an Item2D accidentally, and you will not be able to mouse the WasdController which is behind the scene (that's QTBUG-96457).
[ 1.267 D] qt.quick3d.pick QQuick3DViewport::internalPick - pick result: QQuick3DItem2D(0x555599b71de0) @ QVector3D(45.1119, -88.8839, 367.912) UV QVector2D(46.7033, 88.8839) dist 252.587 scene QPointF(46.7033,88.8839) QQuickItem(0x555599b7a820, name="parent of pressure-sensitive green/lightblue rect", parent=0x0, geometry=0,0 0x0)
Attachments
Issue Links
- relates to
-
QTBUG-96457 "infinite plane" Item2D prevents event propagation to 2D content behind it
-
- Closed
-
Gerrit Reviews
For Gerrit Dashboard: QTBUG-96514 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
371155,3 | Postpone creating Item2D instance until componentComplete | dev | qt/qtquick3d | Status: NEW | -1 | 0 |