Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
5.8, 6.7
-
None
-
e7d0395b4 (dev), d7453add3 (6.7), dd60632f8 (tqtc/lts-6.5)
Description
In the example below, the text's alignment should change to the right:
import QtQuick 2.5 import QtQuick.Window 2.2 Window { visible: true width: 640 height: 480 title: qsTr("Hello World") id: root TextEdit { id: textEdit property string t: qsTr("<b>Enter</b> some text...") text: t // placeholderText: t onImplicitWidthChanged: print("implicitWidth", implicitWidth) textFormat: TextEdit.AutoText // horizontalAlignment: TextEdit.AlignRight width: 200 height: 200 Rectangle { anchors.fill: parent color: "transparent" border.width: 1 opacity: 0.5 } } Timer { running: true interval: 800 onTriggered: { textEdit.horizontalAlignment = TextEdit.AlignRight } } }
If you click in the TextEdit, the mouse cursor will be aligned to the right, however. The text will become right-aligned when you start typing.
Works with 5.7, broken in 5.8.
Setting the alignment declaratively works as expected.
Attachments
For Gerrit Dashboard: QTBUG-56921 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
562978,3 | Call polish after setting HAlign in Qml TextEdit | tqtc/lts-6.2 | qt/tqtc-qtdeclarative | Status: NEW | -1 | 0 |
560871,5 | Call polish after setting HAlign in Qml TextEdit | dev | qt/qtdeclarative | Status: MERGED | +2 | +1 |
562832,2 | Call polish after setting HAlign in Qml TextEdit | 6.7 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
562957,2 | Call polish after setting HAlign in Qml TextEdit | tqtc/lts-6.5 | qt/tqtc-qtdeclarative | Status: MERGED | +2 | 0 |