Use override
This commit is contained in:
parent
041c05555f
commit
8dc2956edf
|
@ -28,7 +28,7 @@ public:
|
|||
const std::vector<const char *> &dependencyVersions, const QString &website = QString(), const QString &description = QString(),
|
||||
const QImage &image = QImage());
|
||||
explicit AboutDialog(QWidget *parent, const QString &description = QString(), const QImage &image = QImage());
|
||||
~AboutDialog();
|
||||
~AboutDialog() override;
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui::AboutDialog> m_ui;
|
||||
|
|
|
@ -26,7 +26,7 @@ class QT_UTILITIES_EXPORT EnterPasswordDialog : public QDialog {
|
|||
|
||||
public:
|
||||
explicit EnterPasswordDialog(QWidget *parent = nullptr);
|
||||
~EnterPasswordDialog();
|
||||
~EnterPasswordDialog() override;
|
||||
const QString &userName() const;
|
||||
const QString &password() const;
|
||||
QString description() const;
|
||||
|
@ -42,8 +42,8 @@ public:
|
|||
static bool isCapslockPressed();
|
||||
|
||||
protected:
|
||||
bool event(QEvent *event);
|
||||
bool eventFilter(QObject *sender, QEvent *event);
|
||||
bool event(QEvent *event) override;
|
||||
bool eventFilter(QObject *sender, QEvent *event) override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void updateShowPassword();
|
||||
|
|
|
@ -74,18 +74,18 @@ class QT_UTILITIES_EXPORT ChecklistModel : public QAbstractListModel {
|
|||
public:
|
||||
explicit ChecklistModel(QObject *parent = nullptr);
|
||||
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
||||
QMap<int, QVariant> itemData(const QModelIndex &index) const;
|
||||
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::DisplayRole);
|
||||
bool setItemData(const QModelIndex &index, const QMap<int, QVariant> &roles);
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||
QMap<int, QVariant> itemData(const QModelIndex &index) const override;
|
||||
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::DisplayRole) override;
|
||||
bool setItemData(const QModelIndex &index, const QMap<int, QVariant> &roles) override;
|
||||
bool setChecked(int row, bool checked);
|
||||
bool setChecked(int row, Qt::CheckState checked);
|
||||
virtual QString labelForId(const QVariant &id) const;
|
||||
Qt::DropActions supportedDropActions() const;
|
||||
bool insertRows(int row, int count, const QModelIndex &parent);
|
||||
bool removeRows(int row, int count, const QModelIndex &parent);
|
||||
Qt::DropActions supportedDropActions() const override;
|
||||
bool insertRows(int row, int count, const QModelIndex &parent) override;
|
||||
bool removeRows(int row, int count, const QModelIndex &parent) override;
|
||||
const QList<ChecklistItem> &items() const;
|
||||
void setItems(const QList<ChecklistItem> &items);
|
||||
void restore(QSettings &settings, const QString &name);
|
||||
|
|
|
@ -17,7 +17,7 @@ class QT_UTILITIES_EXPORT ColorButton : public QToolButton {
|
|||
Q_PROPERTY(bool backgroundCheckered READ isBackgroundCheckered WRITE setBackgroundCheckered)
|
||||
public:
|
||||
ColorButton(QWidget *parent = nullptr);
|
||||
~ColorButton();
|
||||
~ColorButton() override;
|
||||
|
||||
bool isBackgroundCheckered() const;
|
||||
void setBackgroundCheckered(bool checkered);
|
||||
|
@ -31,13 +31,13 @@ Q_SIGNALS:
|
|||
void colorChanged(const QColor &color);
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event);
|
||||
void mousePressEvent(QMouseEvent *event);
|
||||
void mouseMoveEvent(QMouseEvent *event);
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
void mousePressEvent(QMouseEvent *event) override;
|
||||
void mouseMoveEvent(QMouseEvent *event) override;
|
||||
#ifndef QT_NO_DRAGANDDROP
|
||||
void dragEnterEvent(QDragEnterEvent *event);
|
||||
void dragLeaveEvent(QDragLeaveEvent *event);
|
||||
void dropEvent(QDropEvent *event);
|
||||
void dragEnterEvent(QDragEnterEvent *event) override;
|
||||
void dragLeaveEvent(QDragLeaveEvent *event) override;
|
||||
void dropEvent(QDropEvent *event) override;
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
|
|
@ -19,7 +19,7 @@ class QT_UTILITIES_EXPORT OptionCategory : public QObject {
|
|||
|
||||
public:
|
||||
explicit OptionCategory(QObject *parent = nullptr);
|
||||
~OptionCategory();
|
||||
~OptionCategory() override;
|
||||
|
||||
const QString &displayName() const;
|
||||
void setDisplayName(const QString &displayName);
|
||||
|
|
|
@ -11,7 +11,7 @@ public:
|
|||
explicit OptionCategoryFilterModel(QObject *parent = nullptr);
|
||||
|
||||
protected:
|
||||
virtual bool filterAcceptsRow(int source_row, const QModelIndex &sourceParent) const;
|
||||
virtual bool filterAcceptsRow(int source_row, const QModelIndex &sourceParent) const override;
|
||||
};
|
||||
} // namespace Dialogs
|
||||
|
||||
|
|
|
@ -16,14 +16,14 @@ class QT_UTILITIES_EXPORT OptionCategoryModel : public QAbstractListModel {
|
|||
public:
|
||||
explicit OptionCategoryModel(QObject *parent = nullptr);
|
||||
explicit OptionCategoryModel(const QList<OptionCategory *> &categories, QObject *parent = nullptr);
|
||||
virtual ~OptionCategoryModel();
|
||||
virtual ~OptionCategoryModel() override;
|
||||
|
||||
const QList<OptionCategory *> &categories() const;
|
||||
OptionCategory *category(const QModelIndex &index) const;
|
||||
OptionCategory *category(int row) const;
|
||||
void setCategories(const QList<OptionCategory *> categories);
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void categoryChangedName();
|
||||
|
|
|
@ -91,13 +91,13 @@ inline QStringList &OptionPage::errors()
|
|||
template <class UiClass> class QT_UTILITIES_EXPORT UiFileBasedOptionPage : public OptionPage {
|
||||
public:
|
||||
explicit UiFileBasedOptionPage(QWidget *parentWindow = nullptr);
|
||||
~UiFileBasedOptionPage();
|
||||
~UiFileBasedOptionPage() override;
|
||||
|
||||
bool apply() = 0;
|
||||
void reset() = 0;
|
||||
bool apply() override = 0;
|
||||
void reset() override = 0;
|
||||
|
||||
protected:
|
||||
QWidget *setupWidget();
|
||||
QWidget *setupWidget() override;
|
||||
UiClass *ui();
|
||||
|
||||
private:
|
||||
|
@ -152,9 +152,9 @@ template <class UiClass> inline UiClass *UiFileBasedOptionPage<UiClass>::ui()
|
|||
class QT_UTILITIES_EXPORT SomeClass : public ::Dialogs::OptionPage { \
|
||||
public: \
|
||||
explicit SomeClass(QWidget *parentWidget = nullptr); \
|
||||
~SomeClass(); \
|
||||
bool apply(); \
|
||||
void reset(); \
|
||||
~SomeClass() override; \
|
||||
bool apply() override; \
|
||||
void reset() override; \
|
||||
\
|
||||
private:
|
||||
|
||||
|
@ -167,9 +167,9 @@ template <class UiClass> inline UiClass *UiFileBasedOptionPage<UiClass>::ui()
|
|||
typedef ::Dialogs::OptionPage SomeClass##Base; \
|
||||
class QT_UTILITIES_EXPORT SomeClass : public ::Dialogs::OptionPage { \
|
||||
public: \
|
||||
~SomeClass(); \
|
||||
bool apply(); \
|
||||
void reset(); \
|
||||
~SomeClass() override; \
|
||||
bool apply() override; \
|
||||
void reset() override; \
|
||||
\
|
||||
private:
|
||||
|
||||
|
@ -185,9 +185,9 @@ template <class UiClass> inline UiClass *UiFileBasedOptionPage<UiClass>::ui()
|
|||
typedef ::Dialogs::UiFileBasedOptionPage<Ui::SomeClass> SomeClass##Base; \
|
||||
class QT_UTILITIES_EXPORT SomeClass : public ::Dialogs::UiFileBasedOptionPage<Ui::SomeClass> { \
|
||||
public: \
|
||||
~SomeClass(); \
|
||||
bool apply(); \
|
||||
void reset(); \
|
||||
~SomeClass() override; \
|
||||
bool apply() override; \
|
||||
void reset() override; \
|
||||
\
|
||||
private:
|
||||
|
||||
|
@ -268,7 +268,7 @@ private:
|
|||
*/
|
||||
#define DECLARE_SETUP_WIDGETS \
|
||||
protected: \
|
||||
QWidget *setupWidget(); \
|
||||
QWidget *setupWidget() override; \
|
||||
\
|
||||
private:
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ class QT_UTILITIES_EXPORT SettingsDialog : public QDialog {
|
|||
|
||||
public:
|
||||
explicit SettingsDialog(QWidget *parent = nullptr);
|
||||
~SettingsDialog();
|
||||
~SettingsDialog() override;
|
||||
bool isTabBarAlwaysVisible() const;
|
||||
void setTabBarAlwaysVisible(bool value);
|
||||
OptionCategoryModel *categoryModel();
|
||||
|
@ -38,7 +38,7 @@ Q_SIGNALS:
|
|||
void resetted();
|
||||
|
||||
protected:
|
||||
void showEvent(QShowEvent *event);
|
||||
void showEvent(QShowEvent *event) override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void currentCategoryChanged(const QModelIndex &index);
|
||||
|
|
|
@ -11,12 +11,12 @@ class QT_UTILITIES_EXPORT ClearComboBox : public QComboBox, public ButtonOverlay
|
|||
Q_OBJECT
|
||||
public:
|
||||
explicit ClearComboBox(QWidget *parent = nullptr);
|
||||
~ClearComboBox();
|
||||
bool isCleared() const;
|
||||
~ClearComboBox() override;
|
||||
bool isCleared() const override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void handleTextChanged(const QString &text);
|
||||
void handleClearButtonClicked();
|
||||
void handleClearButtonClicked() override;
|
||||
};
|
||||
|
||||
} // namespace Widgets
|
||||
|
|
|
@ -15,12 +15,12 @@ class QT_UTILITIES_EXPORT ClearLineEdit : public QLineEdit, public ButtonOverlay
|
|||
Q_OBJECT
|
||||
public:
|
||||
explicit ClearLineEdit(QWidget *parent = nullptr);
|
||||
~ClearLineEdit();
|
||||
bool isCleared() const;
|
||||
~ClearLineEdit() override;
|
||||
bool isCleared() const override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void handleTextChanged(const QString &text);
|
||||
void handleClearButtonClicked();
|
||||
void handleClearButtonClicked() override;
|
||||
};
|
||||
} // namespace Widgets
|
||||
|
||||
|
|
|
@ -11,12 +11,12 @@ class QT_UTILITIES_EXPORT ClearPlainTextEdit : public QPlainTextEdit, public But
|
|||
Q_OBJECT
|
||||
public:
|
||||
explicit ClearPlainTextEdit(QWidget *parent = nullptr);
|
||||
~ClearPlainTextEdit();
|
||||
bool isCleared() const;
|
||||
~ClearPlainTextEdit() override;
|
||||
bool isCleared() const override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void handleTextChanged();
|
||||
void handleClearButtonClicked();
|
||||
void handleClearButtonClicked() override;
|
||||
void handleScroll();
|
||||
};
|
||||
|
||||
|
|
|
@ -20,20 +20,20 @@ class QT_UTILITIES_EXPORT ClearSpinBox : public QSpinBox, public ButtonOverlay {
|
|||
|
||||
public:
|
||||
explicit ClearSpinBox(QWidget *parent = nullptr);
|
||||
~ClearSpinBox();
|
||||
~ClearSpinBox() override;
|
||||
bool minimumHidden() const;
|
||||
void setMinimumHidden(bool value);
|
||||
QString placeholderText() const;
|
||||
void setPlaceholderText(const QString &placeholderText);
|
||||
bool isCleared() const;
|
||||
bool isCleared() const override;
|
||||
|
||||
protected:
|
||||
int valueFromText(const QString &text) const;
|
||||
QString textFromValue(int val) const;
|
||||
int valueFromText(const QString &text) const override;
|
||||
QString textFromValue(int val) const override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void handleValueChanged(int value);
|
||||
void handleClearButtonClicked();
|
||||
void handleClearButtonClicked() override;
|
||||
|
||||
private:
|
||||
bool m_minimumHidden;
|
||||
|
|
|
@ -14,16 +14,16 @@ class QT_UTILITIES_EXPORT IconButton : public QAbstractButton {
|
|||
|
||||
public:
|
||||
explicit IconButton(QWidget *parent = nullptr);
|
||||
~IconButton();
|
||||
~IconButton() override;
|
||||
|
||||
const QPixmap &pixmap() const;
|
||||
void setPixmap(const QPixmap &pixmap);
|
||||
QSize sizeHint() const;
|
||||
QSize sizeHint() const override;
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event);
|
||||
void keyPressEvent(QKeyEvent *event);
|
||||
void keyReleaseEvent(QKeyEvent *event);
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
void keyPressEvent(QKeyEvent *event) override;
|
||||
void keyReleaseEvent(QKeyEvent *event) override;
|
||||
|
||||
private:
|
||||
QPixmap m_pixmap;
|
||||
|
|
|
@ -23,7 +23,7 @@ public:
|
|||
void provideCustomFileDialog(QFileDialog *customFileDialog);
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *obj, QEvent *event);
|
||||
bool eventFilter(QObject *obj, QEvent *event) override;
|
||||
|
||||
private slots:
|
||||
void showFileDialog();
|
||||
|
|
Loading…
Reference in New Issue