Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
5.2.0, 5.2.1
-
None
-
Qt Creator 3.0.1, Qt 5.2.0
Description
Following is the test code:
- In essence, it is a TextEdit within a Rectangle and the rectangle isin a ColumnLayout.
- When clicked, the cursor is positioned outside the TextEdit.
- Enter a character, and then the cursor moves to the expected position, based on vertical alignment.
- Middle and Bottom alignment suffer; Top alignment appears to function correctly.
- If TextEdit is set to fill its parent, the issue does not occur.
import QtQuick 2.1 import QtQuick.Layouts 1.0 ColumnLayout { height: 200 width: 500 Rectangle { Layout.preferredHeight: 100 Layout.fillWidth: true color: "yellow" TextEdit { id: iTextEdit height: parent.height width: parent.width // anchors.fill: parent verticalAlignment: Text.AlignBottom function printPositionInfo() { console.log( "TextEdit x:" + iTextEdit.x + " y: " + iTextEdit.y + " width: " + iTextEdit.width + " height: " + iTextEdit.height ) var cursorRect = iTextEdit.cursorRectangle; console.log( "TextEdit Cursor Rectangle: x:" + cursorRect.x + " y: " + cursorRect.y + " width: " + cursorRect.width + " height: " + cursorRect.height ); console.log( "\n" ); } onCursorRectangleChanged: printPositionInfo() Component.onCompleted: printPositionInfo() } } }