diff options
author | hjk <hjk@theqtcompany.com> | 2016-06-15 10:12:35 +0200 |
---|---|---|
committer | hjk <hjk@theqtcompany.com> | 2016-06-15 09:32:30 +0000 |
commit | 40a54bf565079c007eada8755b9ff7224754949d (patch) | |
tree | ccd3bb45ca7369b79fc54d26955cf5b0dfc8ece1 /examples/widgets/animation/moveblocks/main.cpp | |
parent | 4d3ffae3d562e5b3b2748a2d92eb4ab2933422e7 (diff) |
Examples: Replace 'Q_DECL_OVERRIDE' by 'override'
Examples should demonstrate best practice, and we can use the keyword
directly nowadays.
Change-Id: I1f122e5caceca17290757ffbaf3d660e7daa9ae4
Reviewed-by: Topi Reiniƶ <topi.reinio@theqtcompany.com>
Diffstat (limited to 'examples/widgets/animation/moveblocks/main.cpp')
-rw-r--r-- | examples/widgets/animation/moveblocks/main.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/widgets/animation/moveblocks/main.cpp b/examples/widgets/animation/moveblocks/main.cpp index 3b271339e4..f85211ef88 100644 --- a/examples/widgets/animation/moveblocks/main.cpp +++ b/examples/widgets/animation/moveblocks/main.cpp @@ -80,7 +80,7 @@ class QGraphicsRectWidget : public QGraphicsWidget { public: void paint(QPainter *painter, const QStyleOptionGraphicsItem *, - QWidget *) Q_DECL_OVERRIDE + QWidget *) override { painter->fillRect(rect(), Qt::blue); } @@ -98,14 +98,14 @@ public: protected: //![14] - virtual bool eventTest(QEvent *event) Q_DECL_OVERRIDE + virtual bool eventTest(QEvent *event) override { return (event->type() == QEvent::Type(StateSwitchEvent::StateSwitchType)) && (static_cast<StateSwitchEvent *>(event)->rand() == m_rand); } //![14] - virtual void onTransition(QEvent *) Q_DECL_OVERRIDE {} + virtual void onTransition(QEvent *) override {} private: int m_rand; @@ -122,7 +122,7 @@ public: //![10] //![11] - virtual void onEntry(QEvent *) Q_DECL_OVERRIDE + virtual void onEntry(QEvent *) override { int n; while ((n = (qrand() % m_stateCount + 1)) == m_lastIndex) @@ -130,7 +130,7 @@ public: m_lastIndex = n; machine()->postEvent(new StateSwitchEvent(n)); } - virtual void onExit(QEvent *) Q_DECL_OVERRIDE {} + virtual void onExit(QEvent *) override {} //![11] //![12] @@ -174,7 +174,7 @@ public: } protected: - virtual void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE + virtual void resizeEvent(QResizeEvent *event) override { fitInView(scene()->sceneRect()); QGraphicsView::resizeEvent(event); |