diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-07-07 04:09:49 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-07-07 04:09:49 (GMT) |
commit | 628159323c60c434a202b036ecbaf5e433c703e8 (patch) | |
tree | 008ade0cdb2bf5d44e6995c9f1240f336a13ce63 /tests | |
parent | be19c343000ffc7099474663c66a13226fa5253c (diff) | |
download | Qt-628159323c60c434a202b036ecbaf5e433c703e8.zip Qt-628159323c60c434a202b036ecbaf5e433c703e8.tar.gz Qt-628159323c60c434a202b036ecbaf5e433c703e8.tar.bz2 |
Make Text, TextInput, and TextEdit all have the same size for the same text.
This may mean that the cursor is to the right of the width, so components should
cater for that with a margin if they are boxed / clipped.
TextInput used to try to account for right bearing (and left bearing incorrectly since
it added it on the right). This is removed. Potentially this means that for some fonts
the text repaints incorrectly on the left or right, but if that is the case Text and TextEdit
already had such a problem (undetected), and all will need fixing.
Task-number: QTBUG-11983
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp | 6 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp index 6e4aa22..5a81881 100644 --- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp +++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp @@ -226,7 +226,7 @@ void tst_qdeclarativetextedit::width() QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->width(), 1.);//+1 for cursor + QCOMPARE(textEditObject->width(), 0.0); } for (int i = 0; i < standard.size(); i++) @@ -242,7 +242,7 @@ void tst_qdeclarativetextedit::width() QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->width(), qreal(metricWidth + 1 + 3));//+3 is the current way of accounting for space between cursor and last character. + QCOMPARE(textEditObject->width(), qreal(metricWidth)); } for (int i = 0; i < richText.size(); i++) @@ -259,7 +259,7 @@ void tst_qdeclarativetextedit::width() QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->width(), qreal(documentWidth + 1 + 3)); + QCOMPARE(textEditObject->width(), qreal(documentWidth)); } } diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp index 16d9ac7..9ae7c99 100644 --- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp +++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp @@ -175,7 +175,7 @@ void tst_qdeclarativetextinput::width() QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); - QCOMPARE(textinputObject->width(), 1.); // 1 for the cursor + QCOMPARE(textinputObject->width(), 0.0); delete textinputObject; } |