summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-05-02 12:12:57 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-05-02 12:12:57 (GMT)
commitcc26af5ad405a76b59fc21a34862ce83744a0374 (patch)
tree0fed84e25adc04b98f4b3996a538556d542aac58 /tests
parentd58cbb0ae009d7ff295d44b8e48352ff802b2e35 (diff)
parentf33b31dcc1b8fd35501ab5b441a4529e2f8570f3 (diff)
downloadQt-cc26af5ad405a76b59fc21a34862ce83744a0374.zip
Qt-cc26af5ad405a76b59fc21a34862ce83744a0374.tar.gz
Qt-cc26af5ad405a76b59fc21a34862ce83744a0374.tar.bz2
Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qt-qml-team
* 'master' of git://scm.dev.nokia.troll.no/qt/qt-qml-team: QmlViewer: Translate UI Fix insert and scroll to bottom case
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qplaintextedit/tst_qplaintextedit.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/qplaintextedit/tst_qplaintextedit.cpp b/tests/auto/qplaintextedit/tst_qplaintextedit.cpp
index d3e4fd0..8da5ba5 100644
--- a/tests/auto/qplaintextedit/tst_qplaintextedit.cpp
+++ b/tests/auto/qplaintextedit/tst_qplaintextedit.cpp
@@ -150,6 +150,7 @@ private slots:
void lineWrapProperty();
void selectionChanged();
void blockCountChanged();
+ void insertAndScrollToBottom();
private:
void createSelection();
@@ -1504,5 +1505,22 @@ void tst_QPlainTextEdit::blockCountChanged()
}
+void tst_QPlainTextEdit::insertAndScrollToBottom()
+{
+ ed->setPlainText("First Line");
+ ed->show();
+ QString text;
+ for(int i = 0; i < 2000; ++i) {
+ text += QLatin1String("this is another line of text to be appended. It is quite long and will probably wrap around, meaning the number of lines is larger than the number of blocks in the text.\n");
+ }
+ QTextCursor cursor = ed->textCursor();
+ cursor.beginEditBlock();
+ cursor.insertText(text);
+ cursor.endEditBlock();
+ ed->verticalScrollBar()->setValue(ed->verticalScrollBar()->maximum());
+ QCOMPARE(ed->verticalScrollBar()->value(), ed->verticalScrollBar()->maximum());
+}
+
+
QTEST_MAIN(tst_QPlainTextEdit)
#include "tst_qplaintextedit.moc"