diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2018-11-24 12:14:44 +0100 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2018-12-02 14:27:29 +0000 |
commit | d1df55d128cd544c9b4035cad4b71aa521e93201 (patch) | |
tree | 6294d1402dfa8c70c65aed0d1ab08baa9d374451 /src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.cpp | |
parent | 383f0b9fcc6f2e6faad002d01560a81df0ca1813 (diff) | |
download | qt-creator-d1df55d128cd544c9b4035cad4b71aa521e93201.tar.gz |
QmlProfiler: Modernize
modernize-*
Change-Id: Ibdf9c0ae91bf8a622facc7f323112b550f532f15
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.cpp')
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.cpp | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.cpp b/src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.cpp index 767696613b..2ac1850735 100644 --- a/src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.cpp @@ -33,15 +33,15 @@ namespace Internal { class BindingLoopMaterial : public QSGMaterial { public: - QSGMaterialType *type() const; - QSGMaterialShader *createShader() const; + QSGMaterialType *type() const override; + QSGMaterialShader *createShader() const override; BindingLoopMaterial(); }; class BindingLoopsRenderPassState : public Timeline::TimelineRenderPass::State { public: BindingLoopsRenderPassState(const QmlProfilerRangeModel *model); - ~BindingLoopsRenderPassState(); + ~BindingLoopsRenderPassState() override; BindingLoopMaterial *material() { return &m_material; } void updateIndexes(int from, int to); @@ -50,8 +50,8 @@ public: int indexTo() const { return m_indexTo; } QSGNode *expandedRow(int row) const { return m_expandedRows[row]; } - const QVector<QSGNode *> &expandedRows() const { return m_expandedRows; } - QSGNode *collapsedOverlay() const { return m_collapsedOverlay; } + const QVector<QSGNode *> &expandedRows() const override { return m_expandedRows; } + QSGNode *collapsedOverlay() const override { return m_collapsedOverlay; } private: QVector<QSGNode *> m_expandedRows; @@ -70,12 +70,11 @@ struct BindlingLoopsGeometry { static const QSGGeometry::AttributeSet &point2DWithOffset(); static const int maxEventsPerNode = 0xffff / 18; - BindlingLoopsGeometry() : allocatedVertices(0), usedVertices(0), currentY(-1), node(nullptr) {} - uint allocatedVertices; - uint usedVertices; - float currentY; + uint allocatedVertices = 0; + uint usedVertices = 0; + float currentY = -1; - QSGGeometryNode *node; + QSGGeometryNode *node = nullptr; Point2DWithOffset *vertexData(); void allocate(QSGMaterial *material); @@ -90,9 +89,7 @@ const QmlProfilerBindingLoopsRenderPass *QmlProfilerBindingLoopsRenderPass::inst return &pass; } -QmlProfilerBindingLoopsRenderPass::QmlProfilerBindingLoopsRenderPass() -{ -} +QmlProfilerBindingLoopsRenderPass::QmlProfilerBindingLoopsRenderPass() = default; static inline bool eventOutsideRange(const QmlProfilerRangeModel *model, const Timeline::TimelineRenderState *parentState, int i) @@ -163,8 +160,7 @@ Timeline::TimelineRenderPass::State *QmlProfilerBindingLoopsRenderPass::update( Q_UNUSED(stateChanged); Q_UNUSED(spacing); - const QmlProfilerRangeModel *model = qobject_cast<const QmlProfilerRangeModel *>( - renderer->model()); + auto model = qobject_cast<const QmlProfilerRangeModel *>(renderer->model()); if (!model || indexFrom < 0 || indexTo > model->count() || indexFrom >= indexTo) return oldState; @@ -229,8 +225,7 @@ Point2DWithOffset *BindlingLoopsGeometry::vertexData() void BindlingLoopsGeometry::allocate(QSGMaterial *material) { - QSGGeometry *geometry = new QSGGeometry(BindlingLoopsGeometry::point2DWithOffset(), - usedVertices); + auto geometry = new QSGGeometry(BindlingLoopsGeometry::point2DWithOffset(), usedVertices); Q_ASSERT(geometry->vertexData()); geometry->setIndexDataPattern(QSGGeometry::StaticPattern); geometry->setVertexDataPattern(QSGGeometry::StaticPattern); @@ -367,7 +362,7 @@ BindingLoopsRenderPassState::BindingLoopsRenderPassState(const QmlProfilerRangeM m_collapsedOverlay->setFlag(QSGNode::OwnedByParent, false); m_expandedRows.reserve(model->expandedRowCount()); for (int i = 0; i < model->expandedRowCount(); ++i) { - QSGNode *node = new QSGNode; + auto node = new QSGNode; node->setFlag(QSGNode::OwnedByParent, false); m_expandedRows << node; } |