diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2017-03-11 17:54:40 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2017-03-11 16:59:11 +0000 |
commit | 451adafbc52c8f7a13854821c9d69efd37dfcc6a (patch) | |
tree | 2682d584ac8822f6c40281e05a1b5eb6621066af | |
parent | 23ef4f43fb25cf0461acb793a40332a0de50651e (diff) | |
download | qttools-451adafbc52c8f7a13854821c9d69efd37dfcc6a.tar.gz |
Fix build with QWebView as parent class for the help viewer
Using override with functions that are not virtual in the base causes
build errors such as
error: ‘void HelpViewer::setSource(const QUrl&)’ marked override, but does not override
Change-Id: Ibdff5cdf199bb31810bbebf97d8f5ab2e6c777bf
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r-- | src/assistant/assistant/helpviewer.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/assistant/assistant/helpviewer.h b/src/assistant/assistant/helpviewer.h index 3ea3c1dee..36404dcee 100644 --- a/src/assistant/assistant/helpviewer.h +++ b/src/assistant/assistant/helpviewer.h @@ -48,8 +48,10 @@ QT_BEGIN_NAMESPACE class HelpEngineWrapper; #if defined(BROWSER_QTWEBKIT) +#define TEXTBROWSER_OVERRIDE class HelpViewer : public QWebView #elif defined(BROWSER_QTEXTBROWSER) +#define TEXTBROWSER_OVERRIDE override class HelpViewer : public QTextBrowser #endif { @@ -80,7 +82,7 @@ public: void setTitle(const QString &title); QUrl source() const; - void setSource(const QUrl &url) override; + void setSource(const QUrl &url) TEXTBROWSER_OVERRIDE; QString selectedText() const; bool isForwardAvailable() const; @@ -102,10 +104,10 @@ public slots: #ifndef QT_NO_CLIPBOARD void copy(); #endif - void home() override; + void home() TEXTBROWSER_OVERRIDE; - void forward() override; - void backward() override; + void forward() TEXTBROWSER_OVERRIDE; + void backward() TEXTBROWSER_OVERRIDE; signals: void titleChanged(); @@ -137,7 +139,7 @@ private slots: private: bool eventFilter(QObject *obj, QEvent *event) override; void contextMenuEvent(QContextMenuEvent *event) override; - QVariant loadResource(int type, const QUrl &name) override; + QVariant loadResource(int type, const QUrl &name) TEXTBROWSER_OVERRIDE; bool handleForwardBackwardMouseButtons(QMouseEvent *e); private: |