From 3c7d4de151d0d87b687644381c5d8aaef06f21b2 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Wed, 24 Jun 2020 10:25:01 +0200 Subject: Use QList instead of QVector Task-number: QTBUG-84469 Change-Id: I4dc064b70adb054ca4add2dd662e7227255ff970 Reviewed-by: Sona Kurazyan Reviewed-by: Lars Knoll --- tests/auto/cpptest/q3dcustom-volume/tst_custom.cpp | 4 ++-- tests/manual/galaxy/cumulativedistributor.h | 14 +++++++------- tests/manual/qmlvolume/datasource.cpp | 4 ++-- tests/manual/volumetrictest/volumetrictest.cpp | 18 +++++++++--------- tests/manual/volumetrictest/volumetrictest.h | 2 +- 5 files changed, 21 insertions(+), 21 deletions(-) (limited to 'tests') diff --git a/tests/auto/cpptest/q3dcustom-volume/tst_custom.cpp b/tests/auto/cpptest/q3dcustom-volume/tst_custom.cpp index 23aa072c..982353ac 100644 --- a/tests/auto/cpptest/q3dcustom-volume/tst_custom.cpp +++ b/tests/auto/cpptest/q3dcustom-volume/tst_custom.cpp @@ -77,9 +77,9 @@ void tst_custom::construct() QVERIFY(custom); delete custom; - QVector *tdata = new QVector(1000); + QList *tdata = new QList(1000); - QVector table; + QList table; table << QRgb(0xff00ff) << QRgb(0x00ff00); custom = new QCustom3DVolume(QVector3D(1.0, 1.0, 1.0), QVector3D(1.0, 1.0, 1.0), diff --git a/tests/manual/galaxy/cumulativedistributor.h b/tests/manual/galaxy/cumulativedistributor.h index 59610953..56276e98 100644 --- a/tests/manual/galaxy/cumulativedistributor.h +++ b/tests/manual/galaxy/cumulativedistributor.h @@ -38,8 +38,8 @@ #define CUMULATIVEDISTRIBUTOR_H #include +#include #include -#include class CumulativeDistributor { @@ -69,13 +69,13 @@ private: qreal m_a; qreal m_RBulge; - QVector m_vM1; - QVector m_vY1; - QVector m_vX1; + QList m_vM1; + QList m_vY1; + QList m_vX1; - QVector m_vM2; - QVector m_vY2; - QVector m_vX2; + QList m_vM2; + QList m_vY2; + QList m_vX2; void buildCDF(int nSteps); diff --git a/tests/manual/qmlvolume/datasource.cpp b/tests/manual/qmlvolume/datasource.cpp index 6f3d8c15..a06ea6d9 100644 --- a/tests/manual/qmlvolume/datasource.cpp +++ b/tests/manual/qmlvolume/datasource.cpp @@ -57,7 +57,7 @@ void DataSource::fillVolume(QCustom3DVolume *volumeItem) float(textureSize) / 2.0f, float(textureSize) / 2.0f); - QVector *textureData = new QVector(textureSize * textureSize * textureSize / 2); + QList *textureData = new QList(textureSize * textureSize * textureSize / 2); for (int i = 0; i < textureSize; i++) { for (int j = 0; j < textureSize / 2; j++) { for (int k = 0; k < textureSize; k++) { @@ -82,7 +82,7 @@ void DataSource::fillVolume(QCustom3DVolume *volumeItem) volumeItem->setTextureFormat(QImage::Format_Indexed8); volumeItem->setTextureData(textureData); - QVector colorTable(256); + QList colorTable(256); for (int i = 1; i < 256; i++) { if (i < 15) diff --git a/tests/manual/volumetrictest/volumetrictest.cpp b/tests/manual/volumetrictest/volumetrictest.cpp index 6b2a57a8..a60c55bc 100644 --- a/tests/manual/volumetrictest/volumetrictest.cpp +++ b/tests/manual/volumetrictest/volumetrictest.cpp @@ -251,7 +251,7 @@ void VolumetricModifier::handleFpsChange() void VolumetricModifier::testSubtextureSetting() { // Setting the rendered Slice as subtexture should result in identical volume - QVector dataBefore = *m_volumeItem->textureData(); + QList dataBefore = *m_volumeItem->textureData(); dataBefore[0] = dataBefore.at(0); // Make sure we are detached checkRenderCase(1, Qt::XAxis, 56, dataBefore, m_volumeItem); @@ -355,7 +355,7 @@ void VolumetricModifier::testBoundsSetting() } void VolumetricModifier::checkRenderCase(int id, Qt::Axis axis, int index, - const QVector &dataBefore, + const QList &dataBefore, QCustom3DVolume *volumeItem) { QImage slice = volumeItem->renderSlice(axis, index); @@ -384,7 +384,7 @@ void VolumetricModifier::createVolume() << logo.sizeInBytes() << (logo.width() * logo.height()) << logo.bytesPerLine(); - QVector imageArray(imageCount); + QList imageArray(imageCount); for (int i = 0; i < imageCount; i++) { QImage *newImage = new QImage(logo); imageArray[i] = newImage; @@ -399,7 +399,7 @@ void VolumetricModifier::createVolume() m_sliceIndexY = m_volumeItem->textureWidth() / 2; m_sliceIndexZ = m_volumeItem->textureWidth() / 2; - QVector colorTable = m_volumeItem->colorTable(); + QList colorTable = m_volumeItem->colorTable(); // Hack some alpha to the picture for (int i = 0; i < colorTable.size(); i++) { @@ -540,7 +540,7 @@ void VolumetricModifier::createAnotherVolume() logo.save("d:/qt/goobar.png"); - QVector imageArray(imageCount); + QList imageArray(imageCount); for (int i = 0; i < imageCount; i++) { QImage *newImage = new QImage(logo); imageArray[i] = newImage; @@ -582,9 +582,9 @@ void VolumetricModifier::createYetAnotherVolume() // m_volumeItem->textureDepth()); m_volumeItem3->setTextureDimensions(200, 200, 200); - QVector *tdata = new QVector(m_volumeItem3->textureDataWidth() - * m_volumeItem3->textureHeight() - * m_volumeItem3->textureDepth()); + QList *tdata = + new QList(m_volumeItem3->textureDataWidth() * m_volumeItem3->textureHeight() + * m_volumeItem3->textureDepth()); tdata->fill(0); m_volumeItem3->setTextureData(tdata); @@ -592,7 +592,7 @@ void VolumetricModifier::createYetAnotherVolume() m_sliceIndexY = m_volumeItem3->textureWidth() / 2; m_sliceIndexZ = m_volumeItem3->textureWidth() / 2; - QVector colorTable = m_volumeItem->colorTable(); + QList colorTable = m_volumeItem->colorTable(); colorTable[0] = qRgba(0, 0, 0, 0); m_volumeItem3->setColorTable(colorTable); int redIndex = colorTable.size() - 3; diff --git a/tests/manual/volumetrictest/volumetrictest.h b/tests/manual/volumetrictest/volumetrictest.h index 2e4309a6..83e0d01a 100644 --- a/tests/manual/volumetrictest/volumetrictest.h +++ b/tests/manual/volumetrictest/volumetrictest.h @@ -67,7 +67,7 @@ private: void createVolume(); void createAnotherVolume(); void createYetAnotherVolume(); - void checkRenderCase(int id, Qt::Axis axis, int index, const QVector &dataBefore, + void checkRenderCase(int id, Qt::Axis axis, int index, const QList &dataBefore, QCustom3DVolume *volumeItem); QAbstract3DGraph *m_graph; -- cgit v1.2.3