#include <QtGui/QContextMenuEvent>
#include <QtWidgets/QMenu>
+#ifndef QT_NO_CLIPBOARD
#include <QtGui/QClipboard>
+#endif
#include <QtWidgets/QApplication>
QT_BEGIN_NAMESPACE
// -- public slots
+#ifndef QT_NO_CLIPBOARD
void HelpViewer::copy()
{
TRACE_OBJ
QTextBrowser::copy();
}
+#endif
void HelpViewer::forward()
{
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)
}
// -- public slots
-
+#ifndef QT_NO_CLIPBOARD
void HelpViewer::copy()
{
TRACE_OBJ
triggerPageAction(QWebPage::Copy);
}
+#endif
void HelpViewer::forward()
{
{
TRACE_OBJ
// TODO: remove this once we support multiple keysequences per command
+#ifndef QT_NO_CLIPBOARD
if (e->key() == Qt::Key_Insert && e->modifiers() == Qt::CTRL) {
if (!selectedText().isEmpty())
copy();
}
+#endif
QWebView::keyPressEvent(e);
}
#include <QtWidgets/QMenu>
#include <QtWidgets/QLayout>
#include <QtGui/QKeyEvent>
+#ifndef QT_NO_CLIPBOARD
#include <QtGui/QClipboard>
+#endif
#include <QtWidgets/QApplication>
#include <QtWidgets/QTextBrowser>
QUrl link = browser->anchorAt(point);
- QKeySequence keySeq(QKeySequence::Copy);
+ QKeySequence keySeq;
+#ifndef QT_NO_CLIPBOARD
+ keySeq = QKeySequence::Copy;
QAction *copyAction = menu.addAction(tr("&Copy") + QLatin1String("\t") +
keySeq.toString(QKeySequence::NativeText));
copyAction->setEnabled(QTextCursor(browser->textCursor()).hasSelection());
+#endif
QAction *copyAnchorAction = menu.addAction(tr("Copy &Link Location"));
copyAnchorAction->setEnabled(!link.isEmpty() && link.isValid());
QLatin1String("\t") + keySeq.toString(QKeySequence::NativeText));
QAction *usedAction = menu.exec(mapToGlobal(contextMenuEvent->pos()));
+#ifndef QT_NO_CLIPBOARD
if (usedAction == copyAction) {
QTextCursor cursor = browser->textCursor();
if (!cursor.isNull() && cursor.hasSelection()) {
else if (usedAction == copyAnchorAction) {
QApplication::clipboard()->setText(link.toString());
}
- else if (usedAction == newTabAction) {
+ else
+#endif
+ if (usedAction == newTabAction) {
emit requestShowLinkInNewTab(link);
}
else if (usedAction == selectAllAction) {