From a6d50b6e12adc14beeb0408ccc2bf76f4847d596 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 25 Sep 2012 13:59:37 +0200 Subject: [PATCH] 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 Reviewed-by: hjk --- src/plugins/help/helpviewer.h | 28 ++++++++++++++++++++++++++++ src/plugins/help/helpviewer_qwv.cpp | 29 ----------------------------- 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/src/plugins/help/helpviewer.h b/src/plugins/help/helpviewer.h index 6085084f914..f64e214b644 100644 --- a/src/plugins/help/helpviewer.h +++ b/src/plugins/help/helpviewer.h @@ -44,6 +44,7 @@ #if defined(QT_NO_WEBKIT) #include #else +#include #include #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 diff --git a/src/plugins/help/helpviewer_qwv.cpp b/src/plugins/help/helpviewer_qwv.cpp index 76baa1ad496..3206c22b7ba 100644 --- a/src/plugins/help/helpviewer_qwv.cpp +++ b/src/plugins/help/helpviewer_qwv.cpp @@ -204,35 +204,6 @@ QNetworkReply *HelpNetworkAccessManager::createRequest(Operation op, ? QLatin1String("application/octet-stream") : mimeType); } -// -- HelpPage - -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; -}; -#include "helpviewer_qwv.moc" - - // - HelpPage HelpPage::HelpPage(QObject *parent)