summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2011-03-07 05:58:17 (GMT)
committerYann Bodson <yann.bodson@nokia.com>2011-03-07 06:16:33 (GMT)
commit88c4bd4d5fc25a58d3b71c540acd6f2484c3a9a3 (patch)
tree36790c7f5f7c474345f7c694b2ee49b809a8d135 /src
parent5ead7e7ddd5430b6a0b5597754f13583b653d67b (diff)
downloadQt-88c4bd4d5fc25a58d3b71c540acd6f2484c3a9a3.zip
Qt-88c4bd4d5fc25a58d3b71c540acd6f2484c3a9a3.tar.gz
Qt-88c4bd4d5fc25a58d3b71c540acd6f2484c3a9a3.tar.bz2
Set correct initial value for TextEdit and TextInput canPaste property
Change-Id: Ied5b257305fa68db64fcf270ad2a42f691fbdca2 Task-number: QTBUG-17765 Reviewed-by: Martin Jones
Diffstat (limited to 'src')
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp1
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index c28d7f4..d3c5b82 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -1469,6 +1469,7 @@ void QDeclarativeTextEditPrivate::init()
#ifndef QT_NO_CLIPBOARD
QObject::connect(q, SIGNAL(readOnlyChanged(bool)), q, SLOT(q_canPasteChanged()));
QObject::connect(QApplication::clipboard(), SIGNAL(dataChanged()), q, SLOT(q_canPasteChanged()));
+ canPaste = control->canPaste();
#endif
document = control->document();
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index 8b21008..29b1f6b 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -1766,6 +1766,7 @@ void QDeclarativeTextInputPrivate::init()
q, SLOT(q_canPasteChanged()));
q->connect(QApplication::clipboard(), SIGNAL(dataChanged()),
q, SLOT(q_canPasteChanged()));
+ canPaste = !control->isReadOnly() && QApplication::clipboard()->text().length() != 0;
#endif // QT_NO_CLIPBOARD
q->connect(control, SIGNAL(updateMicroFocus()),
q, SLOT(updateMicroFocus()));