summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2010-09-09 12:58:38 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2010-09-09 13:01:41 (GMT)
commit7e9ac1bab3527de054552ff3f38ab70945f49512 (patch)
tree0334b37927a5ab21f8b62c5f00faaec8fbc7ee2d /tests/auto
parent01b1bb1ca1cd687b3bc276fc5374f8be8b3074b6 (diff)
downloadQt-7e9ac1bab3527de054552ff3f38ab70945f49512.zip
Qt-7e9ac1bab3527de054552ff3f38ab70945f49512.tar.gz
Qt-7e9ac1bab3527de054552ff3f38ab70945f49512.tar.bz2
Fixed the scrolling of text in QLineEdit with right alignment
The scrolling internal member was not changed in cas the text was bigger than the lineedit. Task-number: QTBUG-13520 Reviewed-by: gabi
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qlineedit/tst_qlineedit.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/qlineedit/tst_qlineedit.cpp b/tests/auto/qlineedit/tst_qlineedit.cpp
index 717b32d..bfa9406 100644
--- a/tests/auto/qlineedit/tst_qlineedit.cpp
+++ b/tests/auto/qlineedit/tst_qlineedit.cpp
@@ -275,6 +275,7 @@ private slots:
#endif
void taskQTBUG_7395_readOnlyShortcut();
void QTBUG697_paletteCurrentColorGroup();
+ void QTBUG13520_textNotVisible();
#ifdef QT3_SUPPORT
void validateAndSet_data();
@@ -3034,6 +3035,8 @@ public:
};
State state;
+
+ friend class tst_QLineEdit;
};
Q_DECLARE_METATYPE(LineEdit::State);
@@ -3741,5 +3744,21 @@ void tst_QLineEdit::QTBUG697_paletteCurrentColorGroup()
QCOMPARE(img.pixel(10, le.height()/2), QColor(Qt::red).rgb());
}
+void tst_QLineEdit::QTBUG13520_textNotVisible()
+{
+ LineEdit le;
+ le.setAlignment( Qt::AlignRight | Qt::AlignVCenter);
+ le.show();
+ QTest::qWaitForWindowShown(&le);
+ le.setText("01-ST16-01SIL-MPL001wfgsdfgsdgsdfgsdfgsdfgsdfgsdfg");
+ le.setCursorPosition(0);
+ QTest::qWait(100); //just make sure we get he lineedit correcly painted
+
+ QVERIFY(le.cursorRect().center().x() < le.width() / 2);
+
+
+}
+
+
QTEST_MAIN(tst_QLineEdit)
#include "tst_qlineedit.moc"