Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.0.0
-
None
Description
TextEdit always draws the text top aligned even though the verticalAlignment property was set to TextEdit.AlignVCenter or TextEdit.AlignBottom. The cursor on the other hand seems to be aligned correctly. Also the value returned by TextEdit.positionToRectangle does not take verticalAlignment into account but always return top-aligned coordinates.
import QtQuick 2.0 Item { width: 200; height: 300 Rectangle { anchors.fill: textEdit border.width: 1 border.color: "black" } TextEdit { id: textEdit width: 100; height: 80 anchors.centerIn: parent horizontalAlignment: TextEdit.AlignHCenter verticalAlignment: TextEdit.AlignVCenter text: "Testing" focus: true Rectangle { property var rect: textEdit.positionToRectangle(textEdit.cursorPosition) x: rect.x y: rect.y width: rect.width height: rect.height color: "red" } } }