diff options
Diffstat (limited to 'src/imports/controls/universal')
6 files changed, 29 insertions, 31 deletions
diff --git a/src/imports/controls/universal/qquickuniversalbusyindicator.cpp b/src/imports/controls/universal/qquickuniversalbusyindicator.cpp index a3d09094..70170296 100644 --- a/src/imports/controls/universal/qquickuniversalbusyindicator.cpp +++ b/src/imports/controls/universal/qquickuniversalbusyindicator.cpp @@ -58,12 +58,12 @@ public: private: struct Phase { - Phase() : duration(0), from(0), to(0), curve(QEasingCurve::Linear) { } + Phase() = default; Phase(int d, qreal f, qreal t, QEasingCurve::Type c) : duration(d), from(f), to(t), curve(c) { } - int duration; - qreal from; - qreal to; - QEasingCurve curve; + int duration = 0; + qreal from = 0; + qreal to = 0; + QEasingCurve curve = QEasingCurve::Linear; }; Phase m_phases[PhaseCount]; @@ -186,7 +186,7 @@ void QQuickUniversalBusyIndicatorNode::sync(QQuickItem *item) } QQuickUniversalBusyIndicator::QQuickUniversalBusyIndicator(QQuickItem *parent) - : QQuickItem(parent), m_count(5), m_elapsed(0), m_color(Qt::black) + : QQuickItem(parent) { setFlag(ItemHasContents); } diff --git a/src/imports/controls/universal/qquickuniversalbusyindicator_p.h b/src/imports/controls/universal/qquickuniversalbusyindicator_p.h index 6b888463..119091b5 100644 --- a/src/imports/controls/universal/qquickuniversalbusyindicator_p.h +++ b/src/imports/controls/universal/qquickuniversalbusyindicator_p.h @@ -75,9 +75,9 @@ protected: QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override; private: - int m_count; - int m_elapsed; - QColor m_color; + int m_count = 5; + int m_elapsed = 0; + QColor m_color = Qt::black; }; QT_END_NAMESPACE diff --git a/src/imports/controls/universal/qquickuniversalprogressbar.cpp b/src/imports/controls/universal/qquickuniversalprogressbar.cpp index 25dfda6f..7d4642c5 100644 --- a/src/imports/controls/universal/qquickuniversalprogressbar.cpp +++ b/src/imports/controls/universal/qquickuniversalprogressbar.cpp @@ -67,21 +67,20 @@ public: private: struct Phase { - Phase() : duration(0), from(0), to(0) { } + Phase() = default; Phase(int d, qreal f, qreal t) : duration(d), from(f), to(t) { } - int duration; - qreal from; - qreal to; + int duration = 0; + qreal from = 0; + qreal to = 0; }; - bool m_indeterminate; + bool m_indeterminate = false; Phase m_borderPhases[PhaseCount]; Phase m_ellipsePhases[PhaseCount]; }; QQuickUniversalProgressBarNode::QQuickUniversalProgressBarNode(QQuickUniversalProgressBar *item) - : QQuickAnimatedNode(item), - m_indeterminate(false) + : QQuickAnimatedNode(item) { setLoopCount(Infinite); setDuration(TotalDuration); @@ -267,7 +266,7 @@ void QQuickUniversalProgressBarNode::sync(QQuickItem *item) } QQuickUniversalProgressBar::QQuickUniversalProgressBar(QQuickItem *parent) - : QQuickItem(parent), m_color(Qt::black), m_progress(0.0), m_indeterminate(false) + : QQuickItem(parent) { setFlag(ItemHasContents); } diff --git a/src/imports/controls/universal/qquickuniversalprogressbar_p.h b/src/imports/controls/universal/qquickuniversalprogressbar_p.h index ef34289c..449f7965 100644 --- a/src/imports/controls/universal/qquickuniversalprogressbar_p.h +++ b/src/imports/controls/universal/qquickuniversalprogressbar_p.h @@ -77,9 +77,9 @@ protected: QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override; private: - QColor m_color; - qreal m_progress; - bool m_indeterminate; + QColor m_color = Qt::black; + qreal m_progress = 0.0; + bool m_indeterminate = false; }; QT_END_NAMESPACE diff --git a/src/imports/controls/universal/qquickuniversalstyle.cpp b/src/imports/controls/universal/qquickuniversalstyle.cpp index dbc409fd..d46752f3 100644 --- a/src/imports/controls/universal/qquickuniversalstyle.cpp +++ b/src/imports/controls/universal/qquickuniversalstyle.cpp @@ -152,7 +152,6 @@ static bool HasGlobalForeground = false; static bool HasGlobalBackground = false; QQuickUniversalStyle::QQuickUniversalStyle(QObject *parent) : QQuickAttachedObject(parent), - m_explicitTheme(false), m_explicitAccent(false), m_explicitForeground(false), m_explicitBackground(false), m_hasForeground(HasGlobalForeground), m_hasBackground(HasGlobalBackground), m_theme(GlobalTheme), m_accent(GlobalAccent), m_foreground(GlobalForeground), m_background(GlobalBackground) { diff --git a/src/imports/controls/universal/qquickuniversalstyle_p.h b/src/imports/controls/universal/qquickuniversalstyle_p.h index eb9f6d83..429621d7 100644 --- a/src/imports/controls/universal/qquickuniversalstyle_p.h +++ b/src/imports/controls/universal/qquickuniversalstyle_p.h @@ -217,21 +217,21 @@ private: // These reflect whether a color value was explicitly set on the specific // item that this attached style object represents. - bool m_explicitTheme; - bool m_explicitAccent; - bool m_explicitForeground; - bool m_explicitBackground; + bool m_explicitTheme = false; + bool m_explicitAccent = false; + bool m_explicitForeground = false; + bool m_explicitBackground = false; // These will be true when this item has an explicit or inherited foreground/background // color, or these colors were declared globally via settings (e.g. conf or env vars). // Some color properties of the style will return different values depending on whether // or not these are set. - bool m_hasForeground; - bool m_hasBackground; + bool m_hasForeground = false; + bool m_hasBackground = false; // The actual values for this item, whether explicit, inherited or globally set. - QQuickUniversalStyle::Theme m_theme; - QRgb m_accent; - QRgb m_foreground; - QRgb m_background; + Theme m_theme = Light; + QRgb m_accent = Qt::blue; + QRgb m_foreground = Qt::black; + QRgb m_background = Qt::white; }; QT_END_NAMESPACE |