modernize: Use '= default' instead of empty ctor/dtor bodies
[quassel.git] / src / qtui / inputwidget.h
index dcf3b5a..47b876f 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef INPUTWIDGET_H
-#define INPUTWIDGET_H
+#pragma once
 
-#include "ui_inputwidget.h"
+#include <QHash>
+#include <QIcon>
+#include <QMap>
+#include <QTextCharFormat>
 
 #include "abstractitemview.h"
+#include "action.h"
 #include "buffermodel.h"
 #include "bufferinfo.h"
 #include "identity.h"
 #include "network.h"
-#include <action.h>
+
+#include "ui_inputwidget.h"
 
 class MultiLineEdit;
 
@@ -37,8 +41,7 @@ class InputWidget : public AbstractItemView
     Q_OBJECT
 
 public:
-    InputWidget(QWidget *parent = 0);
-    virtual ~InputWidget();
+    InputWidget(QWidget *parent = nullptr);
 
     const Network *currentNetwork() const;
 
@@ -88,17 +91,16 @@ public slots:
     void clearFormat();
 
 protected:
-    virtual bool eventFilter(QObject *watched, QEvent *event);
+    bool eventFilter(QObject *watched, QEvent *event) override;
 
 protected slots:
-    virtual void currentChanged(const QModelIndex &current, const QModelIndex &previous);
-    virtual void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end);
-    virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
+    void currentChanged(const QModelIndex &current, const QModelIndex &previous) override;
+    void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) override;
+    void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) override;
 
 private slots:
     void setCustomFont(const QVariant &font);
     void setUseCustomFont(const QVariant &);
-    void setEnableSpellCheck(const QVariant &);
     void setEnableEmacsMode(const QVariant &);
     void setShowNickSelector(const QVariant &);
     void setShowStyleButtons(const QVariant &);
@@ -180,9 +182,8 @@ private:
     struct HistoryState {
         QStringList history;
         QHash<int, QString> tempHistory;
-        qint32 idx;
+        qint32 idx{0};
         QString inputLine;
-        inline HistoryState() : idx(0) {};
     };
 
     QMap<BufferId, HistoryState> historyMap;
@@ -194,9 +195,6 @@ class MouseWheelFilter : public QObject
     Q_OBJECT
 
 public:
-    MouseWheelFilter(QObject *parent = 0);
-    virtual bool eventFilter(QObject *obj, QEvent *event);
+    MouseWheelFilter(QObject *parent = nullptr);
+    bool eventFilter(QObject *obj, QEvent *event) override;
 };
-
-
-#endif // INPUTWIDGET_H