aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/help/helpviewer.h
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@digia.com>2012-09-25 13:59:37 +0200
committerhjk <qthjk@ovi.com>2012-09-25 15:38:48 +0200
commita6d50b6e12adc14beeb0408ccc2bf76f4847d596 (patch)
tree9b863887b5ef46d7e827c6010ee7820ad340a5c5 /src/plugins/help/helpviewer.h
parent61753f7e08bcd536a96d4b2e2a4299f1ec6daa7a (diff)
Help: Prevent moc from running on helpviewer_qwv.cpp.
If Webkit is disabled, moc will run on the file anyway, because there is a ".moc" included and moc does not know about #ifdefs. This results in an ugly warning ("no output generated") being emitted in the no-Webkit case. Solve the problem by moving the declaration of the QObject subclass into the header file. Change-Id: I2abaffd85a342fa2f3dbaa7bcf3ef63a2972c73e Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com> Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'src/plugins/help/helpviewer.h')
-rw-r--r--src/plugins/help/helpviewer.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/plugins/help/helpviewer.h b/src/plugins/help/helpviewer.h
index 6085084f91..f64e214b64 100644
--- a/src/plugins/help/helpviewer.h
+++ b/src/plugins/help/helpviewer.h
@@ -44,6 +44,7 @@
#if defined(QT_NO_WEBKIT)
#include <QTextBrowser>
#else
+#include <QWebPage>
#include <QWebView>
#endif
@@ -140,6 +141,33 @@ private:
HelpViewerPrivate *d;
};
+#ifndef QT_NO_WEBKIT
+class HelpPage : public QWebPage
+{
+ Q_OBJECT
+public:
+ HelpPage(QObject *parent);
+
+protected:
+ virtual QWebPage *createWindow(QWebPage::WebWindowType);
+ virtual void triggerAction(WebAction action, bool checked = false);
+
+ virtual bool acceptNavigationRequest(QWebFrame *frame,
+ const QNetworkRequest &request, NavigationType type);
+
+private slots:
+ void onHandleUnsupportedContent(QNetworkReply *reply);
+
+private:
+ QUrl m_loadingUrl;
+ bool closeNewTabIfNeeded;
+
+ friend class Help::Internal::HelpViewer;
+ Qt::MouseButtons m_pressedButtons;
+ Qt::KeyboardModifiers m_keyboardModifiers;
+};
+#endif // QT_NO_WEBKIT
+
} // namespace Internal
} // namespace Help