summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-10-04 12:12:10 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-10-04 12:24:18 (GMT)
commitd203e7d078cc2bb43ccb32282f40cedbffee4095 (patch)
tree0970af6a403ee16444c424c08674edbe9c29a752 /demos
parent0b905d602ffb24b8cad4f09d84a5f762cc6a6603 (diff)
downloadQt-d203e7d078cc2bb43ccb32282f40cedbffee4095.zip
Qt-d203e7d078cc2bb43ccb32282f40cedbffee4095.tar.gz
Qt-d203e7d078cc2bb43ccb32282f40cedbffee4095.tar.bz2
Small improvement in the textedit demo
We don't need to retrieve the content of the clipboard just to check if it is empty or not - that is quite a heavy operation if the clipboard contains large piece of data. Related to QTBUG-11085 Reviewed-by: Bradley T. Hughes
Diffstat (limited to 'demos')
-rw-r--r--demos/textedit/textedit.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/demos/textedit/textedit.cpp b/demos/textedit/textedit.cpp
index e1f24a1..165c97c 100644
--- a/demos/textedit/textedit.cpp
+++ b/demos/textedit/textedit.cpp
@@ -262,7 +262,7 @@ void TextEdit::setupEditActions()
tb->addAction(a);
menu->addAction(a);
#ifndef QT_NO_CLIPBOARD
- actionPaste->setEnabled(!QApplication::clipboard()->text().isEmpty());
+ actionPaste->setEnabled(QApplication::clipboard()->mimeData()->hasText());
#endif
}
@@ -681,7 +681,7 @@ void TextEdit::cursorPositionChanged()
void TextEdit::clipboardDataChanged()
{
#ifndef QT_NO_CLIPBOARD
- actionPaste->setEnabled(!QApplication::clipboard()->text().isEmpty());
+ actionPaste->setEnabled(QApplication::clipboard()->mimeData()->hasText());
#endif
}