Use override in a few more places to avoid compiler warnings
authorManuel Nickschas <sputnick@quassel-irc.org>
Tue, 27 Sep 2016 21:03:30 +0000 (23:03 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Tue, 27 Sep 2016 21:03:30 +0000 (23:03 +0200)
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...

src/uisupport/multilineedit.h

index e6b58e1..70e5580 100644 (file)
@@ -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();