add override specifier to tab subclasses (#5445)

This commit is contained in:
RickyRister 2025-01-11 18:28:02 -08:00 committed by GitHub
parent 2b296badea
commit 2851d0c7e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 43 additions and 43 deletions

View file

@ -31,7 +31,7 @@ private:
QList<QMenu *> tabMenus; QList<QMenu *> tabMenus;
public: public:
Tab(TabSupervisor *_tabSupervisor, QWidget *parent = nullptr); explicit Tab(TabSupervisor *_tabSupervisor, QWidget *parent = nullptr);
const QList<QMenu *> &getTabMenus() const const QList<QMenu *> &getTabMenus() const
{ {
return tabMenus; return tabMenus;

View file

@ -50,8 +50,8 @@ public:
AbstractClient *_client, AbstractClient *_client,
const ServerInfo_User &userInfo, const ServerInfo_User &userInfo,
QWidget *parent = nullptr); QWidget *parent = nullptr);
void retranslateUi(); void retranslateUi() override;
QString getTabText() const QString getTabText() const override
{ {
return tr("Account"); return tr("Account");
} }

View file

@ -22,7 +22,7 @@ private:
QSpinBox *minutesEdit; QSpinBox *minutesEdit;
public: public:
ShutdownDialog(QWidget *parent = nullptr); explicit ShutdownDialog(QWidget *parent = nullptr);
QString getReason() const; QString getReason() const;
int getMinutes() const; int getMinutes() const;
}; };
@ -55,8 +55,8 @@ private slots:
public: public:
TabAdmin(TabSupervisor *_tabSupervisor, AbstractClient *_client, bool _fullAdmin, QWidget *parent = nullptr); TabAdmin(TabSupervisor *_tabSupervisor, AbstractClient *_client, bool _fullAdmin, QWidget *parent = nullptr);
void retranslateUi(); void retranslateUi() override;
QString getTabText() const QString getTabText() const override
{ {
return tr("Administration"); return tr("Administration");
} }

View file

@ -64,8 +64,8 @@ private slots:
public: public:
TabDeckStorage(TabSupervisor *_tabSupervisor, AbstractClient *_client); TabDeckStorage(TabSupervisor *_tabSupervisor, AbstractClient *_client);
void retranslateUi(); void retranslateUi() override;
QString getTabText() const QString getTabText() const override
{ {
return tr("Deck storage"); return tr("Deck storage");
} }

View file

@ -72,7 +72,7 @@ signals:
void stateChanged(); void stateChanged();
public: public:
ToggleButton(QWidget *parent = nullptr); explicit ToggleButton(QWidget *parent = nullptr);
bool getState() const bool getState() const
{ {
return state; return state;
@ -80,7 +80,7 @@ public:
void setState(bool _state); void setState(bool _state);
protected: protected:
void paintEvent(QPaintEvent *event); void paintEvent(QPaintEvent *event) override;
}; };
class DeckViewContainer : public QWidget class DeckViewContainer : public QWidget

View file

@ -54,9 +54,9 @@ private slots:
public: public:
TabLog(TabSupervisor *_tabSupervisor, AbstractClient *_client, QWidget *parent = nullptr); TabLog(TabSupervisor *_tabSupervisor, AbstractClient *_client, QWidget *parent = nullptr);
~TabLog(); ~TabLog() override;
void retranslateUi(); void retranslateUi() override;
QString getTabText() const QString getTabText() const override
{ {
return tr("Logs"); return tr("Logs");
} }

View file

@ -39,12 +39,12 @@ public:
AbstractClient *_client, AbstractClient *_client,
const ServerInfo_User &_ownUserInfo, const ServerInfo_User &_ownUserInfo,
const ServerInfo_User &_otherUserInfo); const ServerInfo_User &_otherUserInfo);
~TabMessage(); ~TabMessage() override;
void retranslateUi(); void retranslateUi() override;
void closeRequest(); void closeRequest() override;
void tabActivated(); void tabActivated() override;
QString getUserName() const; QString getUserName() const;
QString getTabText() const; QString getTabText() const override;
void processUserMessageEvent(const Event_UserMessage &event); void processUserMessageEvent(const Event_UserMessage &event);

View file

@ -59,8 +59,8 @@ signals:
public: public:
TabReplays(TabSupervisor *_tabSupervisor, AbstractClient *_client); TabReplays(TabSupervisor *_tabSupervisor, AbstractClient *_client);
void retranslateUi(); void retranslateUi() override;
QString getTabText() const QString getTabText() const override
{ {
return tr("Game replays"); return tr("Game replays");
} }

View file

@ -91,10 +91,10 @@ public:
AbstractClient *_client, AbstractClient *_client,
ServerInfo_User *_ownUser, ServerInfo_User *_ownUser,
const ServerInfo_Room &info); const ServerInfo_Room &info);
~TabRoom(); ~TabRoom() override;
void retranslateUi(); void retranslateUi() override;
void closeRequest(); void closeRequest() override;
void tabActivated(); void tabActivated() override;
void processRoomEvent(const RoomEvent &event); void processRoomEvent(const RoomEvent &event);
int getRoomId() const int getRoomId() const
{ {
@ -108,7 +108,7 @@ public:
{ {
return roomName; return roomName;
} }
QString getTabText() const QString getTabText() const override
{ {
return roomName; return roomName;
} }

View file

@ -34,7 +34,7 @@ signals:
void joinRoomRequest(int, bool setCurrent); void joinRoomRequest(int, bool setCurrent);
public: public:
RoomSelector(AbstractClient *_client, QWidget *parent = nullptr); explicit RoomSelector(AbstractClient *_client, QWidget *parent = nullptr);
void retranslateUi(); void retranslateUi();
}; };
@ -56,8 +56,8 @@ private:
public: public:
TabServer(TabSupervisor *_tabSupervisor, AbstractClient *_client, QWidget *parent = nullptr); TabServer(TabSupervisor *_tabSupervisor, AbstractClient *_client, QWidget *parent = nullptr);
void retranslateUi(); void retranslateUi() override;
QString getTabText() const QString getTabText() const override
{ {
return tr("Server"); return tr("Server");
} }

View file

@ -38,28 +38,28 @@ class MacOSTabFixStyle : public QProxyStyle
{ {
Q_OBJECT Q_OBJECT
public: public:
QRect subElementRect(SubElement, const QStyleOption *, const QWidget *) const; QRect subElementRect(SubElement, const QStyleOption *, const QWidget *) const override;
}; };
class CloseButton : public QAbstractButton class CloseButton : public QAbstractButton
{ {
Q_OBJECT Q_OBJECT
public: public:
CloseButton(QWidget *parent = nullptr); explicit CloseButton(QWidget *parent = nullptr);
QSize sizeHint() const; QSize sizeHint() const override;
inline QSize minimumSizeHint() const inline QSize minimumSizeHint() const override
{ {
return sizeHint(); return sizeHint();
} }
protected: protected:
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
void enterEvent(QEnterEvent *event); void enterEvent(QEnterEvent *event) override;
#else #else
void enterEvent(QEvent *event); void enterEvent(QEvent *event) override;
#endif #endif
void leaveEvent(QEvent *event); void leaveEvent(QEvent *event) override;
void paintEvent(QPaintEvent *event); void paintEvent(QPaintEvent *event) override;
}; };
class TabSupervisor : public QTabWidget, public UserlistProxy class TabSupervisor : public QTabWidget, public UserlistProxy
@ -87,8 +87,8 @@ private:
bool isLocalGame; bool isLocalGame;
public: public:
TabSupervisor(AbstractClient *_client, QWidget *parent = nullptr); explicit TabSupervisor(AbstractClient *_client, QWidget *parent = nullptr);
~TabSupervisor(); ~TabSupervisor() override;
void retranslateUi(); void retranslateUi();
void start(const ServerInfo_User &userInfo); void start(const ServerInfo_User &userInfo);
void startLocal(const QList<AbstractClient *> &_clients); void startLocal(const QList<AbstractClient *> &_clients);
@ -116,11 +116,11 @@ public:
} }
bool getAdminLocked() const; bool getAdminLocked() const;
bool closeRequest(); bool closeRequest();
bool isOwnUserRegistered() const; bool isOwnUserRegistered() const override;
QString getOwnUsername() const; QString getOwnUsername() const override;
bool isUserBuddy(const QString &userName) const; bool isUserBuddy(const QString &userName) const override;
bool isUserIgnored(const QString &userName) const; bool isUserIgnored(const QString &userName) const override;
const ServerInfo_User *getOnlineUser(const QString &userName) const; const ServerInfo_User *getOnlineUser(const QString &userName) const override;
bool switchToGameTabIfAlreadyExists(const int gameId); bool switchToGameTabIfAlreadyExists(const int gameId);
void actShowPopup(const QString &message); void actShowPopup(const QString &message);
signals: signals: