diff options
Diffstat (limited to 'demos/textedit')
-rw-r--r-- | demos/textedit/textedit.cpp | 6 | ||||
-rw-r--r-- | demos/textedit/textedit.pro | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/demos/textedit/textedit.cpp b/demos/textedit/textedit.cpp index d1e12bb..be740be 100644 --- a/demos/textedit/textedit.cpp +++ b/demos/textedit/textedit.cpp @@ -128,7 +128,9 @@ TextEdit::TextEdit(QWidget *parent) connect(textEdit, SIGNAL(copyAvailable(bool)), actionCut, SLOT(setEnabled(bool))); connect(textEdit, SIGNAL(copyAvailable(bool)), actionCopy, SLOT(setEnabled(bool))); +#ifndef QT_NO_CLIPBOARD connect(QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(clipboardDataChanged())); +#endif QString initialFile = ":/example.html"; const QStringList args = QCoreApplication::arguments(); @@ -248,7 +250,9 @@ void TextEdit::setupEditActions() a->setShortcut(QKeySequence::Paste); tb->addAction(a); menu->addAction(a); +#ifndef QT_NO_CLIPBOARD actionPaste->setEnabled(!QApplication::clipboard()->text().isEmpty()); +#endif } void TextEdit::setupTextActions() @@ -661,7 +665,9 @@ void TextEdit::cursorPositionChanged() void TextEdit::clipboardDataChanged() { +#ifndef QT_NO_CLIPBOARD actionPaste->setEnabled(!QApplication::clipboard()->text().isEmpty()); +#endif } void TextEdit::about() diff --git a/demos/textedit/textedit.pro b/demos/textedit/textedit.pro index 1ef4256..8b29a45 100644 --- a/demos/textedit/textedit.pro +++ b/demos/textedit/textedit.pro @@ -19,3 +19,4 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.html *.doc images sources.path = $$[QT_INSTALL_DEMOS]/textedit INSTALLS += target sources +include($$QT_SOURCE_TREE/demos/demobase.pri) |