diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-06-04 14:31:18 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-06-04 15:10:15 +0200 |
commit | 20f6c67635240865d33a370230a156de0f051d07 (patch) | |
tree | d2f6780e02d00de161bca1391db8d1acb1678d56 /examples/activeqt | |
parent | f1c8d2893d385ccfec2049655392ffca309675bd (diff) |
Introduce member initialization
Fix warnings emitted by clang, use default constructors where
applicable.
Remove some unused members.
Change-Id: I287ffa4d884be253ec5272e4266a1645376e7235
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'examples/activeqt')
-rw-r--r-- | examples/activeqt/multiple/ax1.h | 4 | ||||
-rw-r--r-- | examples/activeqt/multiple/ax2.h | 7 |
2 files changed, 4 insertions, 7 deletions
diff --git a/examples/activeqt/multiple/ax1.h b/examples/activeqt/multiple/ax1.h index cbcc9e8..ba2a7f5 100644 --- a/examples/activeqt/multiple/ax1.h +++ b/examples/activeqt/multiple/ax1.h @@ -65,7 +65,7 @@ class QAxWidget1 : public QWidget Q_PROPERTY(QColor fillColor READ fillColor WRITE setFillColor) public: explicit QAxWidget1(QWidget *parent = nullptr) - : QWidget(parent), m_fillColor(Qt::red) + : QWidget(parent) { } @@ -90,7 +90,7 @@ protected: } private: - QColor m_fillColor; + QColor m_fillColor = Qt::red; }; //! [0] diff --git a/examples/activeqt/multiple/ax2.h b/examples/activeqt/multiple/ax2.h index 1e1b312..13e011b 100644 --- a/examples/activeqt/multiple/ax2.h +++ b/examples/activeqt/multiple/ax2.h @@ -67,10 +67,7 @@ class QAxWidget2 : public QWidget Q_PROPERTY(int lineWidth READ lineWidth WRITE setLineWidth) public: - explicit QAxWidget2(QWidget *parent = nullptr) - : QWidget(parent), m_lineWidth(1) - { - } + using QWidget::QWidget; int lineWidth() const { @@ -97,7 +94,7 @@ protected: } private: - int m_lineWidth; + int m_lineWidth = 1; }; //! [0] |