diff options
author | Andreas Holzammer <andreas.holzammer.qnx@kdab.com> | 2012-04-20 10:06:45 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-20 10:40:10 +0200 |
commit | fc081c31741e1011d659fd758bbd7ab3a90ee123 (patch) | |
tree | ed60e3238dd1c2352f47df617b0ee721fa3540da /src/assistant/assistant/helpviewer_qtb.cpp | |
parent | 0b526b2baed013c23cf856da8816e38e89f34dbf (diff) |
Fix assistant build with QT_NO_CLIPBOARD
Change-Id: I2c31525cba5b613ad13368fe11869789e003cbd1
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src/assistant/assistant/helpviewer_qtb.cpp')
-rw-r--r-- | src/assistant/assistant/helpviewer_qtb.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/assistant/assistant/helpviewer_qtb.cpp b/src/assistant/assistant/helpviewer_qtb.cpp index a42f4781b..620debed1 100644 --- a/src/assistant/assistant/helpviewer_qtb.cpp +++ b/src/assistant/assistant/helpviewer_qtb.cpp @@ -51,7 +51,9 @@ #include <QtGui/QContextMenuEvent> #include <QtWidgets/QMenu> +#ifndef QT_NO_CLIPBOARD #include <QtGui/QClipboard> +#endif #include <QtWidgets/QApplication> QT_BEGIN_NAMESPACE @@ -248,11 +250,13 @@ bool HelpViewer::findText(const QString &text, FindFlags flags, bool incremental // -- public slots +#ifndef QT_NO_CLIPBOARD void HelpViewer::copy() { TRACE_OBJ QTextBrowser::copy(); } +#endif void HelpViewer::forward() { @@ -356,13 +360,17 @@ void HelpViewer::contextMenuEvent(QContextMenuEvent *event) if (!link.isEmpty() && link.isValid()) copyAnchorAction = menu.addAction(tr("Copy &Link Location")); } else if (!selectedText().isEmpty()) { +#ifndef QT_NO_CLIPBOARD menu.addAction(tr("Copy"), this, SLOT(copy())); +#endif } else { menu.addAction(tr("Reload"), this, SLOT(reload())); } +#ifndef QT_NO_CLIPBOARD if (copyAnchorAction == menu.exec(event->globalPos())) QApplication::clipboard()->setText(link.toString()); +#endif } QVariant HelpViewer::loadResource(int type, const QUrl &name) |