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