From 40a54bf565079c007eada8755b9ff7224754949d Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 15 Jun 2016 10:12:35 +0200 Subject: Examples: Replace 'Q_DECL_OVERRIDE' by 'override' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Examples should demonstrate best practice, and we can use the keyword directly nowadays. Change-Id: I1f122e5caceca17290757ffbaf3d660e7daa9ae4 Reviewed-by: Topi Reiniƶ --- examples/sql/books/bookdelegate.h | 8 ++++---- examples/sql/drilldown/imageitem.h | 4 ++-- examples/sql/drilldown/view.h | 2 +- examples/sql/querymodel/customsqlmodel.h | 2 +- examples/sql/querymodel/editablesqlmodel.h | 4 ++-- examples/sql/sqlbrowser/browser.h | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) (limited to 'examples/sql') diff --git a/examples/sql/books/bookdelegate.h b/examples/sql/books/bookdelegate.h index ba46f7d60a..d07f2b9534 100644 --- a/examples/sql/books/bookdelegate.h +++ b/examples/sql/books/bookdelegate.h @@ -64,16 +64,16 @@ public: BookDelegate(QObject *parent); void paint(QPainter *painter, const QStyleOptionViewItem &option, - const QModelIndex &index) const Q_DECL_OVERRIDE; + const QModelIndex &index) const override; - QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE; + QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override; bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, - const QModelIndex &index) Q_DECL_OVERRIDE; + const QModelIndex &index) override; QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, - const QModelIndex &index) const Q_DECL_OVERRIDE; + const QModelIndex &index) const override; private: QPixmap star; diff --git a/examples/sql/drilldown/imageitem.h b/examples/sql/drilldown/imageitem.h index 7b1c869066..4f773a6dfc 100644 --- a/examples/sql/drilldown/imageitem.h +++ b/examples/sql/drilldown/imageitem.h @@ -66,8 +66,8 @@ public: int id(); protected: - void hoverEnterEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE; - void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE; + void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override; + void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override; private slots: void setFrame(int frame); diff --git a/examples/sql/drilldown/view.h b/examples/sql/drilldown/view.h index 3aecf5ab58..9d6ef0e853 100644 --- a/examples/sql/drilldown/view.h +++ b/examples/sql/drilldown/view.h @@ -66,7 +66,7 @@ public: View(const QString &items, const QString &images, QWidget *parent = 0); protected: - void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QMouseEvent *event) override; //! [0] //! [1] diff --git a/examples/sql/querymodel/customsqlmodel.h b/examples/sql/querymodel/customsqlmodel.h index b9b4dd4f95..5d2f625665 100644 --- a/examples/sql/querymodel/customsqlmodel.h +++ b/examples/sql/querymodel/customsqlmodel.h @@ -61,7 +61,7 @@ class CustomSqlModel : public QSqlQueryModel public: CustomSqlModel(QObject *parent = 0); - QVariant data(const QModelIndex &item, int role) const Q_DECL_OVERRIDE; + QVariant data(const QModelIndex &item, int role) const override; }; //! [0] diff --git a/examples/sql/querymodel/editablesqlmodel.h b/examples/sql/querymodel/editablesqlmodel.h index b88c9a3fb1..1341dd372a 100644 --- a/examples/sql/querymodel/editablesqlmodel.h +++ b/examples/sql/querymodel/editablesqlmodel.h @@ -60,8 +60,8 @@ class EditableSqlModel : public QSqlQueryModel public: EditableSqlModel(QObject *parent = 0); - Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE; - bool setData(const QModelIndex &index, const QVariant &value, int role) Q_DECL_OVERRIDE; + Qt::ItemFlags flags(const QModelIndex &index) const override; + bool setData(const QModelIndex &index, const QVariant &value, int role) override; private: bool setFirstName(int personId, const QString &firstName); diff --git a/examples/sql/sqlbrowser/browser.h b/examples/sql/sqlbrowser/browser.h index 8b36952ce4..fef410778b 100644 --- a/examples/sql/sqlbrowser/browser.h +++ b/examples/sql/sqlbrowser/browser.h @@ -117,7 +117,7 @@ class CustomModel: public QSqlTableModel Q_OBJECT public: explicit CustomModel(QObject *parent = 0, QSqlDatabase db = QSqlDatabase()):QSqlTableModel(parent, db) {} - QVariant data(const QModelIndex &idx, int role) const Q_DECL_OVERRIDE + QVariant data(const QModelIndex &idx, int role) const override { if (role == Qt::BackgroundRole && isDirty(idx)) return QBrush(QColor(Qt::yellow)); -- cgit v1.2.3