Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.0.0
-
None
Description
The y coordinate reported by TextInput.positionToRectangle seems to be zero always even though the vertical aligment was set to AlignVCenter or AlignBottom. Try changing the cursor position (by clicking) with the following example:
(There seems to be another bug that the initial value for "rect" is (0, 0, 0, 0))
import QtQuick 2.0 Item { width: 200; height: 300 Rectangle { anchors.fill: textInput border.width: 1 border.color: "black" } TextEdit { id: textInput width: 100; height: 80 anchors.centerIn: parent horizontalAlignment: TextInput.AlignHCenter verticalAlignment: TextInput.AlignBottom text: "Testing" focus: true Rectangle { property var rect: textInput.positionToRectangle(textInput.cursorPosition) x: rect.x y: rect.y width: rect.width height: rect.height color: "red" } } }
Attachments
For Gerrit Dashboard: QTBUG-23934 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
15099,2 | Fix vertical offset of TextInput.positionToRectangle. | master | qt/qtdeclarative | Status: MERGED | +2 | 0 |