Updating the text layout cannot be omitted with NoWrap because line width
needs to be updated even with empty content.
Change-Id: Ia9b168d6cfe7680cc1c9e7fa641ce7528d2b6d5e
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
{
Q_D(QQuickTextInput);
if (!d->inLayout) {
- if (newGeometry.width() != oldGeometry.width() && d->wrapMode != NoWrap)
+ if (newGeometry.width() != oldGeometry.width())
d->updateLayout();
updateCursorRectangle();
}
TextInput {
id: text
objectName: "text"
- anchors.fill: parent
+ anchors.left: parent.left
+ anchors.top: parent.top
+ width: 180
text: top.text
focus: true
QCOMPARE(textInput->effectiveHAlign(), QQuickTextInput::AlignLeft);
platformInputContext.setInputDirection(Qt::RightToLeft);
QCOMPARE(textInput->effectiveHAlign(), QQuickTextInput::AlignRight);
+
+ // changing width keeps right aligned cursor on proper position
+ textInput->setText("");
+ textInput->setWidth(500);
+ QVERIFY(textInput->positionToRectangle(0).x() > textInput->width() / 2);
}
void tst_qquicktextinput::verticalAlignment()