From d203e7d078cc2bb43ccb32282f40cedbffee4095 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Mon, 4 Oct 2010 14:12:10 +0200 Subject: 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 --- demos/textedit/textedit.cpp | 4 ++-- 1 file 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 } -- cgit v0.12