diff options
author | Alexander Volkov <a.volkov@rusbitech.ru> | 2016-11-24 02:28:39 +0300 |
---|---|---|
committer | Alexander Volkov <a.volkov@rusbitech.ru> | 2016-11-29 12:39:24 +0000 |
commit | 7adbdddbb6b6977e8b86ea0bf6262721d0c6ef6e (patch) | |
tree | e7c855cc95817f46fe2888df59afdf9916a9a400 /src/widgets/widgets | |
parent | c050a1bdea993df5634fec9ed05f682cf5a81691 (diff) |
QtWidgets: Add missing override
Change-Id: I991659db5510acbbb44d0f5987edc213acf62a74
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r-- | src/widgets/widgets/qabstractspinbox.h | 40 | ||||
-rw-r--r-- | src/widgets/widgets/qabstractspinbox_p.h | 4 | ||||
-rw-r--r-- | src/widgets/widgets/qcombobox_p.h | 46 | ||||
-rw-r--r-- | src/widgets/widgets/qdatetimeedit.h | 26 | ||||
-rw-r--r-- | src/widgets/widgets/qdatetimeedit_p.h | 8 | ||||
-rw-r--r-- | src/widgets/widgets/qmacnativewidget_mac.h | 4 | ||||
-rw-r--r-- | src/widgets/widgets/qmdisubwindow_p.h | 2 | ||||
-rw-r--r-- | src/widgets/widgets/qmenubar.h | 36 | ||||
-rw-r--r-- | src/widgets/widgets/qspinbox.h | 10 |
9 files changed, 88 insertions, 88 deletions
diff --git a/src/widgets/widgets/qabstractspinbox.h b/src/widgets/widgets/qabstractspinbox.h index d93489e663..ac46894a27 100644 --- a/src/widgets/widgets/qabstractspinbox.h +++ b/src/widgets/widgets/qabstractspinbox.h @@ -117,12 +117,12 @@ public: void setGroupSeparatorShown(bool shown); bool isGroupSeparatorShown() const; - QSize sizeHint() const; - QSize minimumSizeHint() const; + QSize sizeHint() const override; + QSize minimumSizeHint() const override; void interpretText(); - bool event(QEvent *event); + bool event(QEvent *event) override; - QVariant inputMethodQuery(Qt::InputMethodQuery) const; + QVariant inputMethodQuery(Qt::InputMethodQuery) const override; virtual QValidator::State validate(QString &input, int &pos) const; virtual void fixup(QString &input) const; @@ -134,24 +134,24 @@ public Q_SLOTS: void selectAll(); virtual void clear(); protected: - void resizeEvent(QResizeEvent *event); - void keyPressEvent(QKeyEvent *event); - void keyReleaseEvent(QKeyEvent *event); + void resizeEvent(QResizeEvent *event) override; + void keyPressEvent(QKeyEvent *event) override; + void keyReleaseEvent(QKeyEvent *event) override; #ifndef QT_NO_WHEELEVENT - void wheelEvent(QWheelEvent *event); + void wheelEvent(QWheelEvent *event) override; #endif - void focusInEvent(QFocusEvent *event); - void focusOutEvent(QFocusEvent *event); - void contextMenuEvent(QContextMenuEvent *event); - void changeEvent(QEvent *event); - void closeEvent(QCloseEvent *event); - void hideEvent(QHideEvent *event); - void mousePressEvent(QMouseEvent *event); - void mouseReleaseEvent(QMouseEvent *event); - void mouseMoveEvent(QMouseEvent *event); - void timerEvent(QTimerEvent *event); - void paintEvent(QPaintEvent *event); - void showEvent(QShowEvent *event); + void focusInEvent(QFocusEvent *event) override; + void focusOutEvent(QFocusEvent *event) override; + void contextMenuEvent(QContextMenuEvent *event) override; + void changeEvent(QEvent *event) override; + void closeEvent(QCloseEvent *event) override; + void hideEvent(QHideEvent *event) override; + void mousePressEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; + void mouseMoveEvent(QMouseEvent *event) override; + void timerEvent(QTimerEvent *event) override; + void paintEvent(QPaintEvent *event) override; + void showEvent(QShowEvent *event) override; void initStyleOption(QStyleOptionSpinBox *option) const; QLineEdit *lineEdit() const; diff --git a/src/widgets/widgets/qabstractspinbox_p.h b/src/widgets/widgets/qabstractspinbox_p.h index 47ca10a183..5ec59d899b 100644 --- a/src/widgets/widgets/qabstractspinbox_p.h +++ b/src/widgets/widgets/qabstractspinbox_p.h @@ -156,8 +156,8 @@ class QSpinBoxValidator : public QValidator { public: QSpinBoxValidator(QAbstractSpinBox *qptr, QAbstractSpinBoxPrivate *dptr); - QValidator::State validate(QString &input, int &) const; - void fixup(QString &) const; + QValidator::State validate(QString &input, int &) const override; + void fixup(QString &) const override; private: QAbstractSpinBox *qptr; QAbstractSpinBoxPrivate *dptr; diff --git a/src/widgets/widgets/qcombobox_p.h b/src/widgets/widgets/qcombobox_p.h index 7ca077abf9..6c36359f81 100644 --- a/src/widgets/widgets/qcombobox_p.h +++ b/src/widgets/widgets/qcombobox_p.h @@ -86,13 +86,13 @@ public: QComboBoxListView(QComboBox *cmb = 0) : combo(cmb) {} protected: - void resizeEvent(QResizeEvent *event) + void resizeEvent(QResizeEvent *event) override { resizeContents(viewport()->width(), contentsSize().height()); QListView::resizeEvent(event); } - QStyleOptionViewItem viewOptions() const + QStyleOptionViewItem viewOptions() const override { QStyleOptionViewItem option = QListView::viewOptions(); option.showDecorationSelected = true; @@ -101,7 +101,7 @@ protected: return option; } - void paintEvent(QPaintEvent *e) + void paintEvent(QPaintEvent *e) override { if (combo) { QStyleOptionComboBox opt; @@ -142,7 +142,7 @@ public: setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); setAttribute(Qt::WA_NoMousePropagation); } - QSize sizeHint() const { + QSize sizeHint() const override { return QSize(20, style()->pixelMetric(QStyle::PM_MenuScrollerHeight)); } @@ -156,14 +156,14 @@ protected: fast = false; } - void enterEvent(QEvent *) { + void enterEvent(QEvent *) override { startTimer(); } - void leaveEvent(QEvent *) { + void leaveEvent(QEvent *) override { stopTimer(); } - void timerEvent(QTimerEvent *e) { + void timerEvent(QTimerEvent *e) override { if (e->timerId() == timer.timerId()) { emit doScroll(sliderAction); if (fast) { @@ -172,11 +172,11 @@ protected: } } } - void hideEvent(QHideEvent *) { + void hideEvent(QHideEvent *) override { stopTimer(); } - void mouseMoveEvent(QMouseEvent *e) + void mouseMoveEvent(QMouseEvent *e) override { // Enable fast scrolling if the cursor is directly above or below the popup. const int mouseX = e->pos().x(); @@ -188,7 +188,7 @@ protected: fast = horizontallyInside && verticallyOutside; } - void paintEvent(QPaintEvent *) { + void paintEvent(QPaintEvent *) override { QPainter p(this); QStyleOptionMenuItem menuOpt; menuOpt.init(this); @@ -235,15 +235,15 @@ public Q_SLOTS: void viewDestroyed(); protected: - void changeEvent(QEvent *e); - bool eventFilter(QObject *o, QEvent *e); - void mousePressEvent(QMouseEvent *e); - void mouseReleaseEvent(QMouseEvent *e); - void showEvent(QShowEvent *e); - void hideEvent(QHideEvent *e); - void timerEvent(QTimerEvent *timerEvent); - void leaveEvent(QEvent *e); - void resizeEvent(QResizeEvent *e); + void changeEvent(QEvent *e) override; + bool eventFilter(QObject *o, QEvent *e) override; + void mousePressEvent(QMouseEvent *e) override; + void mouseReleaseEvent(QMouseEvent *e) override; + void showEvent(QShowEvent *e) override; + void hideEvent(QHideEvent *e) override; + void timerEvent(QTimerEvent *timerEvent) override; + void leaveEvent(QEvent *e) override; + void resizeEvent(QResizeEvent *e) override; QStyleOptionComboBox comboStyleOption() const; Q_SIGNALS: @@ -270,13 +270,13 @@ public: protected: void paint(QPainter *painter, const QStyleOptionViewItem &option, - const QModelIndex &index) const { + const QModelIndex &index) const override { QStyleOptionMenuItem opt = getStyleOption(option, index); painter->fillRect(option.rect, opt.palette.background()); mCombo->style()->drawControl(QStyle::CE_MenuItem, &opt, painter, mCombo); } QSize sizeHint(const QStyleOptionViewItem &option, - const QModelIndex &index) const { + const QModelIndex &index) const override { QStyleOptionMenuItem opt = getStyleOption(option, index); return mCombo->style()->sizeFromContents( QStyle::CT_MenuItem, &opt, option.rect.size(), mCombo); @@ -309,7 +309,7 @@ public: protected: void paint(QPainter *painter, const QStyleOptionViewItem &option, - const QModelIndex &index) const { + const QModelIndex &index) const override { if (isSeparator(index)) { QRect rect = option.rect; if (const QAbstractItemView *view = qobject_cast<const QAbstractItemView*>(option.widget)) @@ -323,7 +323,7 @@ protected: } QSize sizeHint(const QStyleOptionViewItem &option, - const QModelIndex &index) const { + const QModelIndex &index) const override { if (isSeparator(index)) { int pm = mCombo->style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, mCombo); return QSize(pm, pm); diff --git a/src/widgets/widgets/qdatetimeedit.h b/src/widgets/widgets/qdatetimeedit.h index c261ce369b..5c9f4e0f9d 100644 --- a/src/widgets/widgets/qdatetimeedit.h +++ b/src/widgets/widgets/qdatetimeedit.h @@ -159,12 +159,12 @@ public: Qt::TimeSpec timeSpec() const; void setTimeSpec(Qt::TimeSpec spec); - QSize sizeHint() const; + QSize sizeHint() const override; - virtual void clear(); - virtual void stepBy(int steps); + void clear() override; + void stepBy(int steps) override; - bool event(QEvent *event); + bool event(QEvent *event) override; Q_SIGNALS: void dateTimeChanged(const QDateTime &dateTime); void timeChanged(const QTime &time); @@ -176,20 +176,20 @@ public Q_SLOTS: void setTime(const QTime &time); protected: - virtual void keyPressEvent(QKeyEvent *event); + void keyPressEvent(QKeyEvent *event) override; #ifndef QT_NO_WHEELEVENT - virtual void wheelEvent(QWheelEvent *event); + void wheelEvent(QWheelEvent *event) override; #endif - virtual void focusInEvent(QFocusEvent *event); - virtual bool focusNextPrevChild(bool next); - virtual QValidator::State validate(QString &input, int &pos) const; - virtual void fixup(QString &input) const; + void focusInEvent(QFocusEvent *event) override; + bool focusNextPrevChild(bool next) override; + QValidator::State validate(QString &input, int &pos) const override; + void fixup(QString &input) const override; virtual QDateTime dateTimeFromText(const QString &text) const; virtual QString textFromDateTime(const QDateTime &dt) const; - virtual StepEnabled stepEnabled() const; - virtual void mousePressEvent(QMouseEvent *event); - virtual void paintEvent(QPaintEvent *event); + StepEnabled stepEnabled() const override; + void mousePressEvent(QMouseEvent *event) override; + void paintEvent(QPaintEvent *event) override; void initStyleOption(QStyleOptionSpinBox *option) const; QDateTimeEdit(const QVariant &val, QVariant::Type parserType, QWidget *parent = Q_NULLPTR); diff --git a/src/widgets/widgets/qdatetimeedit_p.h b/src/widgets/widgets/qdatetimeedit_p.h index 6889bda041..730aa0f0b2 100644 --- a/src/widgets/widgets/qdatetimeedit_p.h +++ b/src/widgets/widgets/qdatetimeedit_p.h @@ -167,10 +167,10 @@ private Q_SLOTS: void dateSelectionChanged(); protected: - void hideEvent(QHideEvent *); - void mousePressEvent(QMouseEvent *e); - void mouseReleaseEvent(QMouseEvent *); - bool event(QEvent *e); + void hideEvent(QHideEvent *) override; + void mousePressEvent(QMouseEvent *e) override; + void mouseReleaseEvent(QMouseEvent *) override; + bool event(QEvent *e) override; private: QCalendarWidget *verifyCalendarInstance(); diff --git a/src/widgets/widgets/qmacnativewidget_mac.h b/src/widgets/widgets/qmacnativewidget_mac.h index 84389f16df..a8faffd6be 100644 --- a/src/widgets/widgets/qmacnativewidget_mac.h +++ b/src/widgets/widgets/qmacnativewidget_mac.h @@ -54,11 +54,11 @@ public: QMacNativeWidget(NSView *parentView = Q_NULLPTR); ~QMacNativeWidget(); - QSize sizeHint() const; + QSize sizeHint() const override; NSView *nativeView() const; protected: - bool event(QEvent *ev); + bool event(QEvent *ev) override; }; QT_END_NAMESPACE diff --git a/src/widgets/widgets/qmdisubwindow_p.h b/src/widgets/widgets/qmdisubwindow_p.h index 650d3b0bfb..33fa73eb0d 100644 --- a/src/widgets/widgets/qmdisubwindow_p.h +++ b/src/widgets/widgets/qmdisubwindow_p.h @@ -80,7 +80,7 @@ public: mdiChild = child; } - void *qt_metacast(const char *classname) + void *qt_metacast(const char *classname) override { if (classname && strcmp(classname, "ControlElement") == 0) return this; diff --git a/src/widgets/widgets/qmenubar.h b/src/widgets/widgets/qmenubar.h index ec15155710..7ad205b77a 100644 --- a/src/widgets/widgets/qmenubar.h +++ b/src/widgets/widgets/qmenubar.h @@ -86,9 +86,9 @@ public: void setDefaultUp(bool); bool isDefaultUp() const; - QSize sizeHint() const; - QSize minimumSizeHint() const; - int heightForWidth(int) const; + QSize sizeHint() const override; + QSize minimumSizeHint() const override; + int heightForWidth(int) const override; QRect actionGeometry(QAction *) const; QAction *actionAt(const QPoint &) const; @@ -104,27 +104,27 @@ public: void setNativeMenuBar(bool nativeMenuBar); QPlatformMenuBar *platformMenuBar(); public Q_SLOTS: - virtual void setVisible(bool visible); + void setVisible(bool visible) override; Q_SIGNALS: void triggered(QAction *action); void hovered(QAction *action); protected: - void changeEvent(QEvent *); - void keyPressEvent(QKeyEvent *); - void mouseReleaseEvent(QMouseEvent *); - void mousePressEvent(QMouseEvent *); - void mouseMoveEvent(QMouseEvent *); - void leaveEvent(QEvent *); - void paintEvent(QPaintEvent *); - void resizeEvent(QResizeEvent *); - void actionEvent(QActionEvent *); - void focusOutEvent(QFocusEvent *); - void focusInEvent(QFocusEvent *); - void timerEvent(QTimerEvent *); - bool eventFilter(QObject *, QEvent *); - bool event(QEvent *); + void changeEvent(QEvent *) override; + void keyPressEvent(QKeyEvent *) override; + void mouseReleaseEvent(QMouseEvent *) override; + void mousePressEvent(QMouseEvent *) override; + void mouseMoveEvent(QMouseEvent *) override; + void leaveEvent(QEvent *) override; + void paintEvent(QPaintEvent *) override; + void resizeEvent(QResizeEvent *) override; + void actionEvent(QActionEvent *) override; + void focusOutEvent(QFocusEvent *) override; + void focusInEvent(QFocusEvent *) override; + void timerEvent(QTimerEvent *) override; + bool eventFilter(QObject *, QEvent *) override; + bool event(QEvent *) override; void initStyleOption(QStyleOptionMenuItem *option, const QAction *action) const; private: diff --git a/src/widgets/widgets/qspinbox.h b/src/widgets/widgets/qspinbox.h index 2e77f0be7a..2eb12fd90d 100644 --- a/src/widgets/widgets/qspinbox.h +++ b/src/widgets/widgets/qspinbox.h @@ -91,11 +91,11 @@ public: void setDisplayIntegerBase(int base); protected: - bool event(QEvent *event); - virtual QValidator::State validate(QString &input, int &pos) const; + bool event(QEvent *event) override; + QValidator::State validate(QString &input, int &pos) const override; virtual int valueFromText(const QString &text) const; virtual QString textFromValue(int val) const; - virtual void fixup(QString &str) const; + void fixup(QString &str) const override; public Q_SLOTS: @@ -151,10 +151,10 @@ public: int decimals() const; void setDecimals(int prec); - virtual QValidator::State validate(QString &input, int &pos) const; + QValidator::State validate(QString &input, int &pos) const override; virtual double valueFromText(const QString &text) const; virtual QString textFromValue(double val) const; - virtual void fixup(QString &str) const; + void fixup(QString &str) const override; public Q_SLOTS: void setValue(double val); |