diff --git a/src/common/SignalVectorModel.hpp b/src/common/SignalVectorModel.hpp index c44a167af..6f0928e04 100644 --- a/src/common/SignalVectorModel.hpp +++ b/src/common/SignalVectorModel.hpp @@ -101,7 +101,7 @@ public: return this; } - virtual ~SignalVectorModel() + ~SignalVectorModel() override { for (Row &row : this->rows_) { diff --git a/src/controllers/accounts/AccountController.hpp b/src/controllers/accounts/AccountController.hpp index a19af9692..ce63ba1ee 100644 --- a/src/controllers/accounts/AccountController.hpp +++ b/src/controllers/accounts/AccountController.hpp @@ -21,7 +21,7 @@ public: AccountModel *createModel(QObject *parent); - virtual void initialize(Settings &settings, Paths &paths) override; + void initialize(Settings &settings, Paths &paths) override; TwitchAccountManager twitch; diff --git a/src/controllers/accounts/AccountModel.hpp b/src/controllers/accounts/AccountModel.hpp index 2552a00b7..bcc4dbf5d 100644 --- a/src/controllers/accounts/AccountModel.hpp +++ b/src/controllers/accounts/AccountModel.hpp @@ -17,21 +17,20 @@ public: protected: // turn a vector item into a model row - virtual std::shared_ptr getItemFromRow( + std::shared_ptr getItemFromRow( std::vector &row, const std::shared_ptr &original) override; // turns a row in the model into a vector item - virtual void getRowFromItem(const std::shared_ptr &item, - std::vector &row) override; + void getRowFromItem(const std::shared_ptr &item, + std::vector &row) override; - virtual int beforeInsert(const std::shared_ptr &item, - std::vector &row, - int proposedIndex) override; + int beforeInsert(const std::shared_ptr &item, + std::vector &row, + int proposedIndex) override; - virtual void afterRemoved(const std::shared_ptr &item, - std::vector &row, - int index) override; + void afterRemoved(const std::shared_ptr &item, + std::vector &row, int index) override; friend class AccountController; diff --git a/src/controllers/commands/CommandController.hpp b/src/controllers/commands/CommandController.hpp index b7135279c..f5ba40b24 100644 --- a/src/controllers/commands/CommandController.hpp +++ b/src/controllers/commands/CommandController.hpp @@ -33,8 +33,8 @@ public: bool dryRun); QStringList getDefaultChatterinoCommandList(); - virtual void initialize(Settings &, Paths &paths) override; - virtual void save() override; + void initialize(Settings &, Paths &paths) override; + void save() override; CommandModel *createModel(QObject *parent); diff --git a/src/controllers/commands/CommandModel.hpp b/src/controllers/commands/CommandModel.hpp index 628a60859..7dc458b85 100644 --- a/src/controllers/commands/CommandModel.hpp +++ b/src/controllers/commands/CommandModel.hpp @@ -22,12 +22,12 @@ class CommandModel : public SignalVectorModel protected: // turn a vector item into a model row - virtual Command getItemFromRow(std::vector &row, - const Command &command) override; + Command getItemFromRow(std::vector &row, + const Command &command) override; // turns a row in the model into a vector item - virtual void getRowFromItem(const Command &item, - std::vector &row) override; + void getRowFromItem(const Command &item, + std::vector &row) override; friend class CommandController; }; diff --git a/src/controllers/filters/FilterModel.hpp b/src/controllers/filters/FilterModel.hpp index 14c0fd66b..3b44c7acb 100644 --- a/src/controllers/filters/FilterModel.hpp +++ b/src/controllers/filters/FilterModel.hpp @@ -16,13 +16,12 @@ public: protected: // turn a vector item into a model row - virtual FilterRecordPtr getItemFromRow( - std::vector &row, - const FilterRecordPtr &original) override; + FilterRecordPtr getItemFromRow(std::vector &row, + const FilterRecordPtr &original) override; // turns a row in the model into a vector item - virtual void getRowFromItem(const FilterRecordPtr &item, - std::vector &row) override; + void getRowFromItem(const FilterRecordPtr &item, + std::vector &row) override; }; } // namespace chatterino diff --git a/src/controllers/highlights/BadgeHighlightModel.hpp b/src/controllers/highlights/BadgeHighlightModel.hpp index cf3b8501c..20600bb67 100644 --- a/src/controllers/highlights/BadgeHighlightModel.hpp +++ b/src/controllers/highlights/BadgeHighlightModel.hpp @@ -25,12 +25,11 @@ public: protected: // vector into model row - virtual HighlightBadge getItemFromRow( - std::vector &row, - const HighlightBadge &original) override; + HighlightBadge getItemFromRow(std::vector &row, + const HighlightBadge &original) override; - virtual void getRowFromItem(const HighlightBadge &item, - std::vector &row) override; + void getRowFromItem(const HighlightBadge &item, + std::vector &row) override; }; } // namespace chatterino diff --git a/src/controllers/highlights/HighlightBlacklistModel.hpp b/src/controllers/highlights/HighlightBlacklistModel.hpp index 414af461a..8de3b07ea 100644 --- a/src/controllers/highlights/HighlightBlacklistModel.hpp +++ b/src/controllers/highlights/HighlightBlacklistModel.hpp @@ -21,13 +21,13 @@ public: protected: // turn a vector item into a model row - virtual HighlightBlacklistUser getItemFromRow( + HighlightBlacklistUser getItemFromRow( std::vector &row, const HighlightBlacklistUser &original) override; // turns a row in the model into a vector item - virtual void getRowFromItem(const HighlightBlacklistUser &item, - std::vector &row) override; + void getRowFromItem(const HighlightBlacklistUser &item, + std::vector &row) override; }; } // namespace chatterino diff --git a/src/controllers/highlights/HighlightModel.hpp b/src/controllers/highlights/HighlightModel.hpp index 4966950a1..0ee5192cf 100644 --- a/src/controllers/highlights/HighlightModel.hpp +++ b/src/controllers/highlights/HighlightModel.hpp @@ -42,19 +42,18 @@ public: protected: // turn a vector item into a model row - virtual HighlightPhrase getItemFromRow( - std::vector &row, - const HighlightPhrase &original) override; + HighlightPhrase getItemFromRow(std::vector &row, + const HighlightPhrase &original) override; // turns a row in the model into a vector item - virtual void getRowFromItem(const HighlightPhrase &item, - std::vector &row) override; + void getRowFromItem(const HighlightPhrase &item, + std::vector &row) override; - virtual void afterInit() override; + void afterInit() override; - virtual void customRowSetData(const std::vector &row, - int column, const QVariant &value, int role, - int rowIndex) override; + void customRowSetData(const std::vector &row, int column, + const QVariant &value, int role, + int rowIndex) override; }; } // namespace chatterino diff --git a/src/controllers/highlights/UserHighlightModel.hpp b/src/controllers/highlights/UserHighlightModel.hpp index 928d4931d..a9185b6c3 100644 --- a/src/controllers/highlights/UserHighlightModel.hpp +++ b/src/controllers/highlights/UserHighlightModel.hpp @@ -16,18 +16,17 @@ public: protected: // vector into model row - virtual HighlightPhrase getItemFromRow( - std::vector &row, - const HighlightPhrase &original) override; + HighlightPhrase getItemFromRow(std::vector &row, + const HighlightPhrase &original) override; - virtual void getRowFromItem(const HighlightPhrase &item, - std::vector &row) override; + void getRowFromItem(const HighlightPhrase &item, + std::vector &row) override; - virtual void afterInit() override; + void afterInit() override; - virtual void customRowSetData(const std::vector &row, - int column, const QVariant &value, int role, - int rowIndex) override; + void customRowSetData(const std::vector &row, int column, + const QVariant &value, int role, + int rowIndex) override; }; } // namespace chatterino diff --git a/src/controllers/hotkeys/HotkeyModel.hpp b/src/controllers/hotkeys/HotkeyModel.hpp index 98c59ca5e..8ec659593 100644 --- a/src/controllers/hotkeys/HotkeyModel.hpp +++ b/src/controllers/hotkeys/HotkeyModel.hpp @@ -17,21 +17,20 @@ public: protected: // turn a vector item into a model row - virtual std::shared_ptr getItemFromRow( + std::shared_ptr getItemFromRow( std::vector &row, const std::shared_ptr &original) override; // turns a row in the model into a vector item - virtual void getRowFromItem(const std::shared_ptr &item, - std::vector &row) override; + void getRowFromItem(const std::shared_ptr &item, + std::vector &row) override; - virtual int beforeInsert(const std::shared_ptr &item, - std::vector &row, - int proposedIndex) override; + int beforeInsert(const std::shared_ptr &item, + std::vector &row, + int proposedIndex) override; - virtual void afterRemoved(const std::shared_ptr &item, - std::vector &row, - int index) override; + void afterRemoved(const std::shared_ptr &item, + std::vector &row, int index) override; friend class HotkeyController; diff --git a/src/controllers/ignores/IgnoreModel.hpp b/src/controllers/ignores/IgnoreModel.hpp index 915a880bd..c604f8cd2 100644 --- a/src/controllers/ignores/IgnoreModel.hpp +++ b/src/controllers/ignores/IgnoreModel.hpp @@ -15,12 +15,12 @@ public: protected: // turn a vector item into a model row - virtual IgnorePhrase getItemFromRow(std::vector &row, - const IgnorePhrase &original) override; + IgnorePhrase getItemFromRow(std::vector &row, + const IgnorePhrase &original) override; // turns a row in the model into a vector item - virtual void getRowFromItem(const IgnorePhrase &item, - std::vector &row) override; + void getRowFromItem(const IgnorePhrase &item, + std::vector &row) override; }; } // namespace chatterino diff --git a/src/controllers/moderationactions/ModerationActionModel.hpp b/src/controllers/moderationactions/ModerationActionModel.hpp index 065e6f417..e8e51db03 100644 --- a/src/controllers/moderationactions/ModerationActionModel.hpp +++ b/src/controllers/moderationactions/ModerationActionModel.hpp @@ -15,13 +15,12 @@ public: protected: // turn a vector item into a model row - virtual ModerationAction getItemFromRow( - std::vector &row, - const ModerationAction &original) override; + ModerationAction getItemFromRow(std::vector &row, + const ModerationAction &original) override; // turns a row in the model into a vector item - virtual void getRowFromItem(const ModerationAction &item, - std::vector &row) override; + void getRowFromItem(const ModerationAction &item, + std::vector &row) override; friend class HighlightController; }; diff --git a/src/controllers/notifications/NotificationController.hpp b/src/controllers/notifications/NotificationController.hpp index f6cfce6b8..6d3dab7f9 100644 --- a/src/controllers/notifications/NotificationController.hpp +++ b/src/controllers/notifications/NotificationController.hpp @@ -20,7 +20,7 @@ enum class Platform : uint8_t { class NotificationController final : public Singleton, private QObject { public: - virtual void initialize(Settings &settings, Paths &paths) override; + void initialize(Settings &settings, Paths &paths) override; bool isChannelNotified(const QString &channelName, Platform p); void updateChannelNotification(const QString &channelName, Platform p); diff --git a/src/controllers/notifications/NotificationModel.hpp b/src/controllers/notifications/NotificationModel.hpp index 8ac0e39bd..dc53e953f 100644 --- a/src/controllers/notifications/NotificationModel.hpp +++ b/src/controllers/notifications/NotificationModel.hpp @@ -14,12 +14,12 @@ class NotificationModel : public SignalVectorModel protected: // turn a vector item into a model row - virtual QString getItemFromRow(std::vector &row, - const QString &original) override; + QString getItemFromRow(std::vector &row, + const QString &original) override; // turns a row in the model into a vector item - virtual void getRowFromItem(const QString &item, - std::vector &row) override; + void getRowFromItem(const QString &item, + std::vector &row) override; friend class NotificationController; }; diff --git a/src/controllers/pings/MutedChannelModel.hpp b/src/controllers/pings/MutedChannelModel.hpp index 1cc78c2c3..926285057 100644 --- a/src/controllers/pings/MutedChannelModel.hpp +++ b/src/controllers/pings/MutedChannelModel.hpp @@ -12,12 +12,12 @@ class MutedChannelModel : public SignalVectorModel protected: // turn a vector item into a model row - virtual QString getItemFromRow(std::vector &row, - const QString &original) override; + QString getItemFromRow(std::vector &row, + const QString &original) override; // turns a row in the model into a vector item - virtual void getRowFromItem(const QString &item, - std::vector &row) override; + void getRowFromItem(const QString &item, + std::vector &row) override; }; } // namespace chatterino diff --git a/src/providers/chatterino/ChatterinoBadges.hpp b/src/providers/chatterino/ChatterinoBadges.hpp index 0d6598e5c..6d36940c1 100644 --- a/src/providers/chatterino/ChatterinoBadges.hpp +++ b/src/providers/chatterino/ChatterinoBadges.hpp @@ -18,7 +18,7 @@ using EmotePtr = std::shared_ptr; class ChatterinoBadges : public Singleton { public: - virtual void initialize(Settings &settings, Paths &paths) override; + void initialize(Settings &settings, Paths &paths) override; ChatterinoBadges(); std::optional getBadge(const UserId &id); diff --git a/src/providers/ffz/FfzBadges.hpp b/src/providers/ffz/FfzBadges.hpp index 33852a5b9..1bf660200 100644 --- a/src/providers/ffz/FfzBadges.hpp +++ b/src/providers/ffz/FfzBadges.hpp @@ -21,7 +21,7 @@ using EmotePtr = std::shared_ptr; class FfzBadges : public Singleton { public: - virtual void initialize(Settings &settings, Paths &paths) override; + void initialize(Settings &settings, Paths &paths) override; FfzBadges() = default; struct Badge { diff --git a/src/providers/irc/AbstractIrcServer.hpp b/src/providers/irc/AbstractIrcServer.hpp index fd6a4612e..2b29ae43d 100644 --- a/src/providers/irc/AbstractIrcServer.hpp +++ b/src/providers/irc/AbstractIrcServer.hpp @@ -22,7 +22,7 @@ class AbstractIrcServer : public QObject public: enum ConnectionType { Read = 1, Write = 2, Both = 3 }; - virtual ~AbstractIrcServer() = default; + ~AbstractIrcServer() override = default; // initializeIrc must be called from the derived class // this allows us to initialize the abstract IRC server based on the derived class's parameters diff --git a/src/providers/irc/Irc2.cpp b/src/providers/irc/Irc2.cpp index 26bd82824..1116027ac 100644 --- a/src/providers/irc/Irc2.cpp +++ b/src/providers/irc/Irc2.cpp @@ -18,6 +18,7 @@ namespace chatterino { namespace { + QString configPath() { return combinePath(getPaths()->settingsDirectory, "irc.json"); @@ -33,7 +34,7 @@ namespace { // turn a vector item into a model row IrcServerData getItemFromRow(std::vector &row, - const IrcServerData &original) + const IrcServerData &original) override { return IrcServerData{ row[0]->data(Qt::EditRole).toString(), // host @@ -50,7 +51,7 @@ namespace { // turns a row in the model into a vector item void getRowFromItem(const IrcServerData &item, - std::vector &row) + std::vector &row) override { setStringItem(row[0], item.host, false); setStringItem(row[1], QString::number(item.port)); @@ -60,6 +61,7 @@ namespace { setStringItem(row[5], item.real); } }; + } // namespace inline QString escape(QString str) diff --git a/src/providers/irc/IrcChannel2.hpp b/src/providers/irc/IrcChannel2.hpp index 81b85ce18..3e26200dc 100644 --- a/src/providers/irc/IrcChannel2.hpp +++ b/src/providers/irc/IrcChannel2.hpp @@ -8,7 +8,7 @@ namespace chatterino { class Irc; class IrcServer; -class IrcChannel : public Channel, public ChannelChatters +class IrcChannel final : public Channel, public ChannelChatters { public: explicit IrcChannel(const QString &name, IrcServer *server); @@ -19,8 +19,8 @@ public: IrcServer *server(); // Channel methods - virtual bool canReconnect() const override; - virtual void reconnect() override; + bool canReconnect() const override; + void reconnect() override; private: void setServer(IrcServer *server); diff --git a/src/providers/twitch/TwitchAccount.hpp b/src/providers/twitch/TwitchAccount.hpp index 00e220ca8..e68624d0d 100644 --- a/src/providers/twitch/TwitchAccount.hpp +++ b/src/providers/twitch/TwitchAccount.hpp @@ -52,7 +52,7 @@ public: TwitchAccount(const QString &username, const QString &oauthToken_, const QString &oauthClient_, const QString &_userID); - virtual QString toString() const override; + QString toString() const override; const QString &getUserName() const; const QString &getOAuthToken() const; diff --git a/src/providers/twitch/TwitchChannel.hpp b/src/providers/twitch/TwitchChannel.hpp index c411c367d..0ca895192 100644 --- a/src/providers/twitch/TwitchChannel.hpp +++ b/src/providers/twitch/TwitchChannel.hpp @@ -67,7 +67,7 @@ struct HelixStream; class TwitchIrcServer; -class TwitchChannel : public Channel, public ChannelChatters +class TwitchChannel final : public Channel, public ChannelChatters { public: struct StreamStatus { @@ -109,17 +109,17 @@ public: void initialize(); // Channel methods - virtual bool isEmpty() const override; - virtual bool canSendMessage() const override; - virtual void sendMessage(const QString &message) override; - virtual void sendReply(const QString &message, const QString &replyId); - virtual bool isMod() const override; + bool isEmpty() const override; + bool canSendMessage() const override; + void sendMessage(const QString &message) override; + void sendReply(const QString &message, const QString &replyId); + bool isMod() const override; bool isVip() const; bool isStaff() const; - virtual bool isBroadcaster() const override; - virtual bool hasHighRateLimit() const override; - virtual bool canReconnect() const override; - virtual void reconnect() override; + bool isBroadcaster() const override; + bool hasHighRateLimit() const override; + bool canReconnect() const override; + void reconnect() override; void createClip(); // Data @@ -127,7 +127,7 @@ public: const QString &channelUrl(); const QString &popoutPlayerUrl(); int chatterCount(); - virtual bool isLive() const override; + bool isLive() const override; QString roomId() const; SharedAccessGuard accessRoomModes() const; SharedAccessGuard accessStreamStatus() const; @@ -140,9 +140,9 @@ public: std::shared_ptr ffzEmotes() const; std::shared_ptr seventvEmotes() const; - virtual void refreshBTTVChannelEmotes(bool manualRefresh); - virtual void refreshFFZChannelEmotes(bool manualRefresh); - virtual void refreshSevenTVChannelEmotes(bool manualRefresh); + void refreshBTTVChannelEmotes(bool manualRefresh); + void refreshFFZChannelEmotes(bool manualRefresh); + void refreshSevenTVChannelEmotes(bool manualRefresh); const QString &seventvUserID() const; const QString &seventvEmoteSetID() const; diff --git a/src/providers/twitch/TwitchIrcServer.hpp b/src/providers/twitch/TwitchIrcServer.hpp index 42d2c739a..c3ff2436f 100644 --- a/src/providers/twitch/TwitchIrcServer.hpp +++ b/src/providers/twitch/TwitchIrcServer.hpp @@ -42,9 +42,9 @@ class TwitchIrcServer final : public AbstractIrcServer, { public: TwitchIrcServer(); - virtual ~TwitchIrcServer() override = default; + ~TwitchIrcServer() override = default; - virtual void initialize(Settings &settings, Paths &paths) override; + void initialize(Settings &settings, Paths &paths) override; void forEachChannelAndSpecialChannels(std::function func); @@ -89,23 +89,19 @@ public: const IndirectChannel &getWatchingChannel() const override; protected: - virtual void initializeConnection(IrcConnection *connection, - ConnectionType type) override; - virtual std::shared_ptr createChannel( - const QString &channelName) override; + void initializeConnection(IrcConnection *connection, + ConnectionType type) override; + std::shared_ptr createChannel(const QString &channelName) override; - virtual void privateMessageReceived( - Communi::IrcPrivateMessage *message) override; - virtual void readConnectionMessageReceived( - Communi::IrcMessage *message) override; - virtual void writeConnectionMessageReceived( - Communi::IrcMessage *message) override; + void privateMessageReceived(Communi::IrcPrivateMessage *message) override; + void readConnectionMessageReceived(Communi::IrcMessage *message) override; + void writeConnectionMessageReceived(Communi::IrcMessage *message) override; - virtual std::shared_ptr getCustomChannel( + std::shared_ptr getCustomChannel( const QString &channelname) override; - virtual QString cleanChannelName(const QString &dirtyChannelName) override; - virtual bool hasSeparateWriteConnection() const override; + QString cleanChannelName(const QString &dirtyChannelName) override; + bool hasSeparateWriteConnection() const override; private: void onMessageSendRequested(TwitchChannel *channel, const QString &message, diff --git a/src/singletons/Emotes.hpp b/src/singletons/Emotes.hpp index 70c0261ff..26286f34d 100644 --- a/src/singletons/Emotes.hpp +++ b/src/singletons/Emotes.hpp @@ -25,7 +25,7 @@ class Emotes final : public IEmotes, public Singleton public: Emotes(); - virtual void initialize(Settings &settings, Paths &paths) override; + void initialize(Settings &settings, Paths &paths) override; bool isIgnoredEmote(const QString &emote); diff --git a/src/singletons/Fonts.hpp b/src/singletons/Fonts.hpp index 40932d20f..93529eb41 100644 --- a/src/singletons/Fonts.hpp +++ b/src/singletons/Fonts.hpp @@ -43,7 +43,7 @@ class Fonts final : public Singleton public: Fonts(); - virtual void initialize(Settings &settings, Paths &paths) override; + void initialize(Settings &settings, Paths &paths) override; // font data gets set in createFontData(...) diff --git a/src/singletons/Logging.hpp b/src/singletons/Logging.hpp index 19fd2bacd..16c3cd81a 100644 --- a/src/singletons/Logging.hpp +++ b/src/singletons/Logging.hpp @@ -24,7 +24,7 @@ class Logging : public Singleton public: Logging() = default; - virtual void initialize(Settings &settings, Paths &paths) override; + void initialize(Settings &settings, Paths &paths) override; void addMessage(const QString &channelName, MessagePtr message, const QString &platformName); diff --git a/src/singletons/WindowManager.hpp b/src/singletons/WindowManager.hpp index b9cc00f3a..78b7b9e53 100644 --- a/src/singletons/WindowManager.hpp +++ b/src/singletons/WindowManager.hpp @@ -93,8 +93,8 @@ public: QPoint emotePopupPos(); void setEmotePopupPos(QPoint pos); - virtual void initialize(Settings &settings, Paths &paths) override; - virtual void save() override; + void initialize(Settings &settings, Paths &paths) override; + void save() override; void closeAll(); int getGeneration() const; diff --git a/src/util/PostToThread.hpp b/src/util/PostToThread.hpp index 4f7f872d9..afeb34d06 100644 --- a/src/util/PostToThread.hpp +++ b/src/util/PostToThread.hpp @@ -17,11 +17,11 @@ class LambdaRunnable : public QRunnable { public: LambdaRunnable(std::function action) + : action_(std::move(action)) { - this->action_ = std::move(action); } - void run() + void run() override { this->action_(); } diff --git a/src/widgets/AttachedWindow.hpp b/src/widgets/AttachedWindow.hpp index 6763fb412..3f863cc32 100644 --- a/src/widgets/AttachedWindow.hpp +++ b/src/widgets/AttachedWindow.hpp @@ -28,7 +28,7 @@ public: bool fullscreen = false; }; - virtual ~AttachedWindow() override; + ~AttachedWindow() override; static AttachedWindow *get(void *target_, const GetArgs &args); #ifdef USEWINSDK @@ -39,7 +39,7 @@ public: void setChannel(ChannelPtr channel); protected: - virtual void showEvent(QShowEvent *) override; + void showEvent(QShowEvent *) override; // virtual void nativeEvent(const QByteArray &eventType, void *message, // long *result) override; diff --git a/src/widgets/BaseWidget.hpp b/src/widgets/BaseWidget.hpp index ed31283fd..2e9c04728 100644 --- a/src/widgets/BaseWidget.hpp +++ b/src/widgets/BaseWidget.hpp @@ -37,8 +37,8 @@ public: float qtFontScale() const; protected: - virtual void childEvent(QChildEvent *) override; - virtual void showEvent(QShowEvent *) override; + void childEvent(QChildEvent *) override; + void showEvent(QShowEvent *) override; virtual void scaleChangedEvent(float newScale); virtual void themeChangedEvent(); diff --git a/src/widgets/BaseWindow.hpp b/src/widgets/BaseWindow.hpp index cc6fbe713..197618657 100644 --- a/src/widgets/BaseWindow.hpp +++ b/src/widgets/BaseWindow.hpp @@ -72,20 +72,20 @@ protected: bool nativeEvent(const QByteArray &eventType, void *message, long *result) override; #endif - virtual void scaleChangedEvent(float) override; + void scaleChangedEvent(float) override; - virtual void paintEvent(QPaintEvent *) override; + void paintEvent(QPaintEvent *) override; - virtual void changeEvent(QEvent *) override; - virtual void leaveEvent(QEvent *) override; - virtual void resizeEvent(QResizeEvent *) override; - virtual void moveEvent(QMoveEvent *) override; - virtual void closeEvent(QCloseEvent *) override; - virtual void showEvent(QShowEvent *) override; + void changeEvent(QEvent *) override; + void leaveEvent(QEvent *) override; + void resizeEvent(QResizeEvent *) override; + void moveEvent(QMoveEvent *) override; + void closeEvent(QCloseEvent *) override; + void showEvent(QShowEvent *) override; - virtual void themeChangedEvent() override; - virtual bool event(QEvent *event) override; - virtual void wheelEvent(QWheelEvent *event) override; + void themeChangedEvent() override; + bool event(QEvent *event) override; + void wheelEvent(QWheelEvent *event) override; void mousePressEvent(QMouseEvent *event) override; void mouseReleaseEvent(QMouseEvent *event) override; diff --git a/src/widgets/Label.hpp b/src/widgets/Label.hpp index 0cf397a75..285980641 100644 --- a/src/widgets/Label.hpp +++ b/src/widgets/Label.hpp @@ -28,11 +28,11 @@ public: void setHasOffset(bool hasOffset); protected: - virtual void scaleChangedEvent(float scale_) override; - virtual void paintEvent(QPaintEvent *) override; + void scaleChangedEvent(float scale_) override; + void paintEvent(QPaintEvent *) override; - virtual QSize sizeHint() const override; - virtual QSize minimumSizeHint() const override; + QSize sizeHint() const override; + QSize minimumSizeHint() const override; private: void updateSize(); diff --git a/src/widgets/Notebook.hpp b/src/widgets/Notebook.hpp index c4382582d..3dcabf82d 100644 --- a/src/widgets/Notebook.hpp +++ b/src/widgets/Notebook.hpp @@ -124,10 +124,10 @@ public: void refresh(); protected: - virtual void scaleChangedEvent(float scale_) override; - virtual void resizeEvent(QResizeEvent *) override; - virtual void mousePressEvent(QMouseEvent *event) override; - virtual void paintEvent(QPaintEvent *) override; + void scaleChangedEvent(float scale_) override; + void resizeEvent(QResizeEvent *) override; + void mousePressEvent(QMouseEvent *event) override; + void paintEvent(QPaintEvent *) override; NotebookButton *getAddButton(); NotebookButton *addCustomButton(); diff --git a/src/widgets/dialogs/ColorPickerDialog.hpp b/src/widgets/dialogs/ColorPickerDialog.hpp index 2362a79ed..b932b26e8 100644 --- a/src/widgets/dialogs/ColorPickerDialog.hpp +++ b/src/widgets/dialogs/ColorPickerDialog.hpp @@ -37,7 +37,7 @@ public: */ ColorPickerDialog(const QColor &initial, QWidget *parent); - ~ColorPickerDialog(); + ~ColorPickerDialog() override; /** * @brief Return the final color selected by the user. diff --git a/src/widgets/dialogs/IrcConnectionEditor.hpp b/src/widgets/dialogs/IrcConnectionEditor.hpp index 1bad5c5ad..2786d04b3 100644 --- a/src/widgets/dialogs/IrcConnectionEditor.hpp +++ b/src/widgets/dialogs/IrcConnectionEditor.hpp @@ -22,7 +22,7 @@ class IrcConnectionEditor : public QDialog public: explicit IrcConnectionEditor(const IrcServerData &data, bool isAdd = false, QWidget *parent = nullptr); - ~IrcConnectionEditor(); + ~IrcConnectionEditor() override; IrcServerData data(); diff --git a/src/widgets/dialogs/SelectChannelDialog.hpp b/src/widgets/dialogs/SelectChannelDialog.hpp index 3a4f5a5c0..bff084d18 100644 --- a/src/widgets/dialogs/SelectChannelDialog.hpp +++ b/src/widgets/dialogs/SelectChannelDialog.hpp @@ -27,8 +27,8 @@ public: pajlada::Signals::NoArgSignal closed; protected: - virtual void closeEvent(QCloseEvent *) override; - virtual void themeChangedEvent() override; + void closeEvent(QCloseEvent *) override; + void themeChangedEvent() override; private: class EventFilter : public QObject @@ -37,7 +37,7 @@ private: SelectChannelDialog *dialog; protected: - virtual bool eventFilter(QObject *watched, QEvent *event) override; + bool eventFilter(QObject *watched, QEvent *event) override; }; struct { diff --git a/src/widgets/dialogs/SettingsDialog.hpp b/src/widgets/dialogs/SettingsDialog.hpp index 303842af2..38b113d26 100644 --- a/src/widgets/dialogs/SettingsDialog.hpp +++ b/src/widgets/dialogs/SettingsDialog.hpp @@ -42,9 +42,9 @@ public: SettingsDialogPreference::NoPreference); protected: - virtual void scaleChangedEvent(float newDpi) override; - virtual void themeChangedEvent() override; - virtual void showEvent(QShowEvent *) override; + void scaleChangedEvent(float newDpi) override; + void themeChangedEvent() override; + void showEvent(QShowEvent *) override; private: void refresh(); diff --git a/src/widgets/dialogs/UserInfoPopup.hpp b/src/widgets/dialogs/UserInfoPopup.hpp index 956668831..a233500e9 100644 --- a/src/widgets/dialogs/UserInfoPopup.hpp +++ b/src/widgets/dialogs/UserInfoPopup.hpp @@ -30,8 +30,8 @@ public: const ChannelPtr &openingChannel); protected: - virtual void themeChangedEvent() override; - virtual void scaleChangedEvent(float scale) override; + void themeChangedEvent() override; + void scaleChangedEvent(float scale) override; private: void installEvents(); diff --git a/src/widgets/dialogs/switcher/NewPopupItem.hpp b/src/widgets/dialogs/switcher/NewPopupItem.hpp index cc1ad8ce2..c4dafedd8 100644 --- a/src/widgets/dialogs/switcher/NewPopupItem.hpp +++ b/src/widgets/dialogs/switcher/NewPopupItem.hpp @@ -18,10 +18,10 @@ public: /** * @brief Open the channel passed in the constructor in a new popup. */ - virtual void action() override; + void action() override; - virtual void paint(QPainter *painter, const QRect &rect) const override; - virtual QSize sizeHint(const QRect &rect) const override; + void paint(QPainter *painter, const QRect &rect) const override; + QSize sizeHint(const QRect &rect) const override; private: static constexpr const char *TEXT_FORMAT = diff --git a/src/widgets/dialogs/switcher/NewTabItem.hpp b/src/widgets/dialogs/switcher/NewTabItem.hpp index 711a03fc1..7b9d109e4 100644 --- a/src/widgets/dialogs/switcher/NewTabItem.hpp +++ b/src/widgets/dialogs/switcher/NewTabItem.hpp @@ -20,10 +20,10 @@ public: /** * @brief Open the channel passed in the constructor in a new tab. */ - virtual void action() override; + void action() override; - virtual void paint(QPainter *painter, const QRect &rect) const override; - virtual QSize sizeHint(const QRect &rect) const override; + void paint(QPainter *painter, const QRect &rect) const override; + QSize sizeHint(const QRect &rect) const override; private: static constexpr const char *TEXT_FORMAT = "Open channel \"%1\" in new tab"; diff --git a/src/widgets/dialogs/switcher/SwitchSplitItem.hpp b/src/widgets/dialogs/switcher/SwitchSplitItem.hpp index 4343e42bf..7186f7dae 100644 --- a/src/widgets/dialogs/switcher/SwitchSplitItem.hpp +++ b/src/widgets/dialogs/switcher/SwitchSplitItem.hpp @@ -16,10 +16,10 @@ class SwitchSplitItem : public AbstractSwitcherItem public: SwitchSplitItem(SplitContainer *container, Split *split = nullptr); - virtual void action() override; + void action() override; - virtual void paint(QPainter *painter, const QRect &rect) const override; - virtual QSize sizeHint(const QRect &rect) const override; + void paint(QPainter *painter, const QRect &rect) const override; + QSize sizeHint(const QRect &rect) const override; private: SplitContainer *container_{}; diff --git a/src/widgets/helper/Button.hpp b/src/widgets/helper/Button.hpp index 069104999..da3ec4c72 100644 --- a/src/widgets/helper/Button.hpp +++ b/src/widgets/helper/Button.hpp @@ -69,10 +69,10 @@ protected: #else void enterEvent(QEvent * /*event*/) override; #endif - virtual void leaveEvent(QEvent *) override; - virtual void mousePressEvent(QMouseEvent *event) override; - virtual void mouseReleaseEvent(QMouseEvent *event) override; - virtual void mouseMoveEvent(QMouseEvent *event) override; + void leaveEvent(QEvent *) override; + void mousePressEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; + void mouseMoveEvent(QMouseEvent *event) override; void fancyPaint(QPainter &painter); diff --git a/src/widgets/helper/ComboBoxItemDelegate.hpp b/src/widgets/helper/ComboBoxItemDelegate.hpp index ea8c7d7e5..dc5818826 100644 --- a/src/widgets/helper/ComboBoxItemDelegate.hpp +++ b/src/widgets/helper/ComboBoxItemDelegate.hpp @@ -12,14 +12,14 @@ class ComboBoxItemDelegate : public QStyledItemDelegate public: ComboBoxItemDelegate(QObject *parent = nullptr); - ~ComboBoxItemDelegate(); + ~ComboBoxItemDelegate() override; - virtual QWidget *createEditor(QWidget *parent, - const QStyleOptionViewItem &option, - const QModelIndex &index) const; - virtual void setEditorData(QWidget *editor, const QModelIndex &index) const; - virtual void setModelData(QWidget *editor, QAbstractItemModel *model, - const QModelIndex &index) const; + QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, + const QModelIndex &index) const override; + void setEditorData(QWidget *editor, + const QModelIndex &index) const override; + void setModelData(QWidget *editor, QAbstractItemModel *model, + const QModelIndex &index) const override; }; } // namespace chatterino diff --git a/src/widgets/helper/Line.hpp b/src/widgets/helper/Line.hpp index 7da66562f..fbef52756 100644 --- a/src/widgets/helper/Line.hpp +++ b/src/widgets/helper/Line.hpp @@ -23,7 +23,7 @@ public: } } - virtual void paintEvent(QPaintEvent *) + void paintEvent(QPaintEvent *) override { QPainter painter(this); diff --git a/src/widgets/helper/NotebookButton.hpp b/src/widgets/helper/NotebookButton.hpp index 09ef8f478..95010f30b 100644 --- a/src/widgets/helper/NotebookButton.hpp +++ b/src/widgets/helper/NotebookButton.hpp @@ -21,15 +21,15 @@ public: Icon getIcon() const; protected: - virtual void themeChangedEvent() override; - virtual void paintEvent(QPaintEvent *) override; - virtual void mouseReleaseEvent(QMouseEvent *) override; - virtual void dragEnterEvent(QDragEnterEvent *) override; - virtual void dragLeaveEvent(QDragLeaveEvent *) override; - virtual void dropEvent(QDropEvent *) override; + void themeChangedEvent() override; + void paintEvent(QPaintEvent *) override; + void mouseReleaseEvent(QMouseEvent *) override; + void dragEnterEvent(QDragEnterEvent *) override; + void dragLeaveEvent(QDragLeaveEvent *) override; + void dropEvent(QDropEvent *) override; - virtual void hideEvent(QHideEvent *) override; - virtual void showEvent(QShowEvent *) override; + void hideEvent(QHideEvent *) override; + void showEvent(QShowEvent *) override; signals: void leftClicked(); diff --git a/src/widgets/helper/NotebookTab.hpp b/src/widgets/helper/NotebookTab.hpp index 2260d1eb6..6b8bf8f7b 100644 --- a/src/widgets/helper/NotebookTab.hpp +++ b/src/widgets/helper/NotebookTab.hpp @@ -65,24 +65,24 @@ public: int normalTabWidth(); protected: - virtual void themeChangedEvent() override; + void themeChangedEvent() override; - virtual void paintEvent(QPaintEvent *) override; + void paintEvent(QPaintEvent *) override; - virtual void mousePressEvent(QMouseEvent *event) override; - virtual void mouseReleaseEvent(QMouseEvent *event) override; - virtual void mouseDoubleClickEvent(QMouseEvent *event) override; + void mousePressEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; + void mouseDoubleClickEvent(QMouseEvent *event) override; #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) void enterEvent(QEnterEvent *event) override; #else void enterEvent(QEvent *event) override; #endif - virtual void leaveEvent(QEvent *) override; + void leaveEvent(QEvent *) override; - virtual void dragEnterEvent(QDragEnterEvent *event) override; + void dragEnterEvent(QDragEnterEvent *event) override; - virtual void mouseMoveEvent(QMouseEvent *event) override; - virtual void wheelEvent(QWheelEvent *event) override; + void mouseMoveEvent(QMouseEvent *event) override; + void wheelEvent(QWheelEvent *event) override; private: void showRenameDialog(); diff --git a/src/widgets/helper/QColorPicker.hpp b/src/widgets/helper/QColorPicker.hpp index b7d9f43d5..408fd344c 100644 --- a/src/widgets/helper/QColorPicker.hpp +++ b/src/widgets/helper/QColorPicker.hpp @@ -56,7 +56,7 @@ class QColorPicker : public QFrame Q_OBJECT public: QColorPicker(QWidget *parent); - ~QColorPicker(); + ~QColorPicker() override; void setCrossVisible(bool visible); public slots: @@ -91,7 +91,7 @@ class QColorLuminancePicker : public QWidget Q_OBJECT public: QColorLuminancePicker(QWidget *parent = 0); - ~QColorLuminancePicker(); + ~QColorLuminancePicker() override; public slots: void setCol(int h, int s, int v); diff --git a/src/widgets/helper/SettingsDialogTab.hpp b/src/widgets/helper/SettingsDialogTab.hpp index 921d157f7..97a1ad51d 100644 --- a/src/widgets/helper/SettingsDialogTab.hpp +++ b/src/widgets/helper/SettingsDialogTab.hpp @@ -40,8 +40,8 @@ signals: void selectedChanged(bool); private: - void paintEvent(QPaintEvent *); - void mousePressEvent(QMouseEvent *event); + void paintEvent(QPaintEvent *) override; + void mousePressEvent(QMouseEvent *event) override; struct { QString labelText; diff --git a/src/widgets/helper/SignalLabel.hpp b/src/widgets/helper/SignalLabel.hpp index 87ed2869b..d5ec3a4b4 100644 --- a/src/widgets/helper/SignalLabel.hpp +++ b/src/widgets/helper/SignalLabel.hpp @@ -13,7 +13,7 @@ class SignalLabel : public QLabel public: explicit SignalLabel(QWidget *parent = nullptr, Qt::WindowFlags f = {}); - virtual ~SignalLabel() override = default; + ~SignalLabel() override = default; signals: void mouseDoubleClick(QMouseEvent *ev); diff --git a/src/widgets/listview/GenericItemDelegate.hpp b/src/widgets/listview/GenericItemDelegate.hpp index a13578fc2..cd8cbaf5b 100644 --- a/src/widgets/listview/GenericItemDelegate.hpp +++ b/src/widgets/listview/GenericItemDelegate.hpp @@ -10,7 +10,7 @@ class SwitcherItemDelegate : public QStyledItemDelegate public: SwitcherItemDelegate(QObject *parent = nullptr); - ~SwitcherItemDelegate(); + ~SwitcherItemDelegate() override; void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; diff --git a/src/widgets/listview/GenericListView.hpp b/src/widgets/listview/GenericListView.hpp index 0ae0f08d2..0301fb285 100644 --- a/src/widgets/listview/GenericListView.hpp +++ b/src/widgets/listview/GenericListView.hpp @@ -16,7 +16,7 @@ class GenericListView : public QListView public: GenericListView(); - virtual void setModel(QAbstractItemModel *model) override; + void setModel(QAbstractItemModel *model) override; void setModel(GenericListModel *); void setInvokeActionOnTab(bool); bool eventFilter(QObject *watched, QEvent *event) override; diff --git a/src/widgets/settingspages/GeneralPage.hpp b/src/widgets/settingspages/GeneralPage.hpp index 53468d37f..5930bc141 100644 --- a/src/widgets/settingspages/GeneralPage.hpp +++ b/src/widgets/settingspages/GeneralPage.hpp @@ -19,7 +19,7 @@ class GeneralPage : public SettingsPage public: GeneralPage(); - bool filterElements(const QString &query); + bool filterElements(const QString &query) override; private: void initLayout(GeneralPageView &layout); diff --git a/src/widgets/splits/InputCompletionItem.hpp b/src/widgets/splits/InputCompletionItem.hpp index 51498123e..e0aa8f51d 100644 --- a/src/widgets/splits/InputCompletionItem.hpp +++ b/src/widgets/splits/InputCompletionItem.hpp @@ -19,10 +19,9 @@ public: ActionCallback action); // GenericListItem interface -public: - virtual void action() override; - virtual void paint(QPainter *painter, const QRect &rect) const override; - virtual QSize sizeHint(const QRect &rect) const override; + void action() override; + void paint(QPainter *painter, const QRect &rect) const override; + QSize sizeHint(const QRect &rect) const override; private: EmotePtr emote_;