summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2011-01-17 04:07:33 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2011-01-17 04:07:33 (GMT)
commit8b6674e55118896dfecbcdc1960418dc2064f632 (patch)
tree243889d8c43b7a0bd294866e904b079e0a0b90c0 /tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
parent62087b2ec0afad240d61a61c7a2972d021e01695 (diff)
downloadQt-8b6674e55118896dfecbcdc1960418dc2064f632.zip
Qt-8b6674e55118896dfecbcdc1960418dc2064f632.tar.gz
Qt-8b6674e55118896dfecbcdc1960418dc2064f632.tar.bz2
Add canPaste property to TextInput and TextEdit
Task-number: QTBUG-16190 Reviewed-by: Martin Jones
Diffstat (limited to 'tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp')
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
index 964125f..d7e6a60 100644
--- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
+++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
@@ -952,10 +952,18 @@ void tst_qdeclarativetextinput::copyAndPaste() {
QCOMPARE(textInput->selectedText(), QString("Hello world!"));
QCOMPARE(textInput->selectedText().length(), 12);
textInput->setCursorPosition(0);
+ QVERIFY(textInput->canPaste());
textInput->paste();
QCOMPARE(textInput->text(), QString("Hello world!Hello world!"));
QCOMPARE(textInput->text().length(), 24);
+ // can paste
+ QVERIFY(textInput->canPaste());
+ textInput->setReadOnly(true);
+ QVERIFY(!textInput->canPaste());
+ textInput->setReadOnly(false);
+ QVERIFY(textInput->canPaste());
+
// select word
textInput->setCursorPosition(0);
textInput->selectWord();
@@ -973,6 +981,7 @@ void tst_qdeclarativetextinput::copyAndPaste() {
QClipboard *clipboard = QApplication::clipboard();
QVERIFY(clipboard);
clipboard->clear();
+ QVERIFY(!textInput->canPaste());
// test that copy functionality is disabled
// when echo mode is set to hide text/password mode