From: Manuel Nickschas Date: Tue, 27 Sep 2016 21:03:30 +0000 (+0200) Subject: Use override in a few more places to avoid compiler warnings X-Git-Tag: 0.12.5~46 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=ec6b5babe3967c23ce55bb5d391e49286dad09c3 Use override in a few more places to avoid compiler warnings Clang complains about inconsistent use of virtual and override, and for some reason the only offender when building against Qt 5 was multilineedit.h. This commit fixes the ungodly amount of warnings that that one header produced. When building against Qt 4 we still get warnings from the various application classes; however fixing them triggers a million new warnings related to Q_OBJECT which is beyond our control, so we'll just have to wait until we can finally deprecate support for Qt 4 for good... (cherry picked from commit 4e53ef2a62b2b6b4f103b016bf2f4260a9c02ad4) --- diff --git a/src/uisupport/multilineedit.h b/src/uisupport/multilineedit.h index 642e84f7..d1f613e0 100644 --- a/src/uisupport/multilineedit.h +++ b/src/uisupport/multilineedit.h @@ -61,8 +61,8 @@ public: inline bool isSingleLine() const { return _singleLine; } inline bool pasteProtectionEnabled() const { return _pasteProtectionEnabled; } - virtual QSize sizeHint() const; - virtual QSize minimumSizeHint() const; + QSize sizeHint() const override; + QSize minimumSizeHint() const override; inline QString mircColorFromRGB(QString rgbColor) const { return _mircColorMap.key(rgbColor); } inline QString rgbColorFromMirc(QString mircColor) const { return _mircColorMap[mircColor]; } @@ -75,7 +75,7 @@ public: void addCompletionSpace(); #if defined HAVE_KF5 || defined HAVE_KDE4 - virtual void createHighlighter() override; + void createHighlighter() override; #endif public slots: @@ -97,9 +97,9 @@ signals: void noTextEntered(); protected: - virtual bool event(QEvent *e); - virtual void keyPressEvent(QKeyEvent *event); - virtual void resizeEvent(QResizeEvent *event); + bool event(QEvent *e) override; + void keyPressEvent(QKeyEvent *event) override; + void resizeEvent(QResizeEvent *event) override; private slots: void on_returnPressed();