diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-02-24 15:07:01 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-06-12 13:46:38 +0200 |
commit | c0f6506eda7ebd7f61f7c03b6d9a59cc530a7116 (patch) | |
tree | 08feb473ca77d6806ea5c1598297b1a25ee6a7b4 /examples/datavisualization/graphgallery/surfacegraphmodifier.cpp | |
parent | 0a1e9dce13c1113a6fc6720c8102ee1663b713fe (diff) |
Use auto in graphgallery example
Fixing clazy warnings about not repeating type names.
Pick-to: 6.6 6.5
Task-number: QTBUG-110698
Change-Id: I574c79bc27ba93e2e84aa454281c8648cd5ddc47
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'examples/datavisualization/graphgallery/surfacegraphmodifier.cpp')
-rw-r--r-- | examples/datavisualization/graphgallery/surfacegraphmodifier.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/examples/datavisualization/graphgallery/surfacegraphmodifier.cpp b/examples/datavisualization/graphgallery/surfacegraphmodifier.cpp index 527a0d4a..190a96b9 100644 --- a/examples/datavisualization/graphgallery/surfacegraphmodifier.cpp +++ b/examples/datavisualization/graphgallery/surfacegraphmodifier.cpp @@ -152,10 +152,10 @@ void SurfaceGraphModifier::fillSqrtSinProxy() float stepZ = (sampleMax - sampleMin) / float(sampleCountZ - 1); //! [1] - QSurfaceDataArray *dataArray = new QSurfaceDataArray; + auto *dataArray = new QSurfaceDataArray; dataArray->reserve(sampleCountZ); for (int i = 0 ; i < sampleCountZ ; ++i) { - QSurfaceDataRow *newRow = new QSurfaceDataRow; + auto *newRow = new QSurfaceDataRow; newRow->reserve(sampleCountX); // Keep values within range bounds, since just adding step can cause minor drift due // to the rounding errors. @@ -447,10 +447,10 @@ void SurfaceGraphModifier::toggleItemOne(bool show) color.fill(Qt::red); //! [9] //! [11] - QCustom3DItem *item = new QCustom3DItem(":/data/oilrig.obj", positionOne, - QVector3D(0.025f, 0.025f, 0.025f), - QQuaternion::fromAxisAndAngle(0.f, 1.f, 0.f, 45.f), - color); + auto *item = new QCustom3DItem(":/data/oilrig.obj", positionOne, + QVector3D(0.025f, 0.025f, 0.025f), + QQuaternion::fromAxisAndAngle(0.f, 1.f, 0.f, 45.f), + color); //! [11] //! [12] m_graph->addCustomItem(item); @@ -463,7 +463,7 @@ void SurfaceGraphModifier::toggleItemOne(bool show) m_graph->addCustomItem(item); //! [13] - QCustom3DLabel *label = new QCustom3DLabel(); + auto *label = new QCustom3DLabel(); label->setText("Oil Rig One"); label->setPosition(positionOneLabel); label->setScaling(QVector3D(1.f, 1.f, 1.f)); @@ -487,7 +487,7 @@ void SurfaceGraphModifier::toggleItemTwo(bool show) if (show) { QImage color = QImage(2, 2, QImage::Format_RGB32); color.fill(Qt::red); - QCustom3DItem *item = new QCustom3DItem(); + auto *item = new QCustom3DItem(); item->setMeshFile(":/data/oilrig.obj"); item->setPosition(positionTwo); item->setScaling(QVector3D(0.025f, 0.025f, 0.025f)); @@ -501,7 +501,7 @@ void SurfaceGraphModifier::toggleItemTwo(bool show) item->setShadowCasting(false); m_graph->addCustomItem(item); - QCustom3DLabel *label = new QCustom3DLabel(); + auto *label = new QCustom3DLabel(); label->setText("Oil Rig Two"); label->setPosition(positionTwoLabel); label->setScaling(QVector3D(1.f, 1.f, 1.f)); @@ -521,7 +521,7 @@ void SurfaceGraphModifier::toggleItemThree(bool show) if (show) { QImage color = QImage(2, 2, QImage::Format_RGB32); color.fill(Qt::darkMagenta); - QCustom3DItem *item = new QCustom3DItem(); + auto *item = new QCustom3DItem(); item->setMeshFile(":/data/refinery.obj"); item->setPosition(positionThree); item->setScaling(QVector3D(0.04f, 0.04f, 0.04f)); @@ -529,7 +529,7 @@ void SurfaceGraphModifier::toggleItemThree(bool show) item->setTextureImage(color); m_graph->addCustomItem(item); - QCustom3DLabel *label = new QCustom3DLabel(); + auto *label = new QCustom3DLabel(); label->setText("Refinery"); label->setPosition(positionThreeLabel); label->setScaling(QVector3D(1.f, 1.f, 1.f)); |