diff --git a/python/core/auto_generated/pointcloud/qgspointcloudattribute.sip.in b/python/core/auto_generated/pointcloud/qgspointcloudattribute.sip.in index 5ec12c6364e7..fefef2f516f9 100644 --- a/python/core/auto_generated/pointcloud/qgspointcloudattribute.sip.in +++ b/python/core/auto_generated/pointcloud/qgspointcloudattribute.sip.in @@ -46,7 +46,7 @@ Ctor Returns name of the attribute %End - size_t size() const; + int size() const; %Docstring Returns size of the attribute in bytes %End @@ -133,7 +133,7 @@ Returns the index of the attribute with the specified ``name``. Returns -1 if a matching attribute was not found. %End - size_t pointRecordSize() const; + int pointRecordSize() const; %Docstring Returns total size of record %End diff --git a/src/core/pointcloud/qgspointcloudattribute.h b/src/core/pointcloud/qgspointcloudattribute.h index f39f27137e22..6e720ede9609 100644 --- a/src/core/pointcloud/qgspointcloudattribute.h +++ b/src/core/pointcloud/qgspointcloudattribute.h @@ -53,7 +53,7 @@ class CORE_EXPORT QgsPointCloudAttribute QString name() const { return mName; } //! Returns size of the attribute in bytes - size_t size() const { return mSize; } + int size() const { return mSize; } //! Returns the data type DataType type() const { return mType; } @@ -84,7 +84,7 @@ class CORE_EXPORT QgsPointCloudAttribute void updateSize(); QString mName; - size_t mSize = 0; + int mSize = 0; DataType mType; }; @@ -133,17 +133,17 @@ class CORE_EXPORT QgsPointCloudAttributeCollection int indexOf( const QString &name ) const; //! Returns total size of record - size_t pointRecordSize() const { return mSize; } + int pointRecordSize() const { return mSize; } private: - std::size_t mSize = 0; + int mSize = 0; QVector mAttributes; struct CachedAttributeData { int index; - std::size_t offset; - CachedAttributeData( int index, std::size_t offset ) + int offset; + CachedAttributeData( int index, int offset ) : index( index ) , offset( offset ) {} diff --git a/tests/src/core/testqgspointcloudattribute.cpp b/tests/src/core/testqgspointcloudattribute.cpp index 8c3a6de4b651..af3a2e33d606 100644 --- a/tests/src/core/testqgspointcloudattribute.cpp +++ b/tests/src/core/testqgspointcloudattribute.cpp @@ -79,7 +79,7 @@ void TestQgsPointCloudAttribute::testAttribute() QgsPointCloudAttribute attribute( QStringLiteral( "name" ), QgsPointCloudAttribute::DataType::Float ); QCOMPARE( attribute.name(), QStringLiteral( "name" ) ); QCOMPARE( attribute.type(), QgsPointCloudAttribute::DataType::Float ); - QCOMPARE( attribute.size(), static_cast< std::size_t >( 4 ) ); + QCOMPARE( attribute.size(), 4 ); } void TestQgsPointCloudAttribute::testAttributeDisplayType() @@ -106,7 +106,7 @@ void TestQgsPointCloudAttribute::testCollection() QgsPointCloudAttributeCollection collection; QVERIFY( collection.attributes().empty() ); QCOMPARE( collection.count(), 0 ); - QCOMPARE( collection.pointRecordSize(), static_cast< std::size_t >( 0 ) ); + QCOMPARE( collection.pointRecordSize(), 0 ); int offset = 0; QVERIFY( !collection.find( QStringLiteral( "test" ), offset ) ); @@ -115,7 +115,7 @@ void TestQgsPointCloudAttribute::testCollection() QCOMPARE( collection.count(), 1 ); QCOMPARE( collection.at( 0 ).name(), QStringLiteral( "at1" ) ); QCOMPARE( collection.attributes().at( 0 ).name(), QStringLiteral( "at1" ) ); - QCOMPARE( collection.pointRecordSize(), static_cast< std::size_t >( 4 ) ); + QCOMPARE( collection.pointRecordSize(), 4 ); QVERIFY( !collection.find( QStringLiteral( "test" ), offset ) ); QCOMPARE( collection.find( QStringLiteral( "at1" ), offset )->name(), QStringLiteral( "at1" ) ); QCOMPARE( collection.indexOf( QStringLiteral( "test" ) ), -1 ); @@ -129,7 +129,7 @@ void TestQgsPointCloudAttribute::testCollection() QCOMPARE( collection.at( 1 ).name(), QStringLiteral( "at2" ) ); QCOMPARE( collection.attributes().at( 0 ).name(), QStringLiteral( "at1" ) ); QCOMPARE( collection.attributes().at( 1 ).name(), QStringLiteral( "at2" ) ); - QCOMPARE( collection.pointRecordSize(), static_cast< std::size_t >( 6 ) ); + QCOMPARE( collection.pointRecordSize(), 6 ); QVERIFY( !collection.find( QStringLiteral( "test" ), offset ) ); QCOMPARE( collection.find( QStringLiteral( "at1" ), offset )->name(), QStringLiteral( "at1" ) ); QCOMPARE( offset, 0 ); @@ -145,7 +145,7 @@ void TestQgsPointCloudAttribute::testCollection() QCOMPARE( collection.attributes().at( 0 ).name(), QStringLiteral( "at1" ) ); QCOMPARE( collection.attributes().at( 1 ).name(), QStringLiteral( "at2" ) ); QCOMPARE( collection.attributes().at( 2 ).name(), QStringLiteral( "at3" ) ); - QCOMPARE( collection.pointRecordSize(), static_cast< std::size_t >( 14 ) ); + QCOMPARE( collection.pointRecordSize(), 14 ); QVERIFY( !collection.find( QStringLiteral( "test" ), offset ) ); QCOMPARE( collection.find( QStringLiteral( "at1" ), offset )->name(), QStringLiteral( "at1" ) ); QCOMPARE( offset, 0 ); @@ -164,7 +164,7 @@ void TestQgsPointCloudAttribute::testCollection() QCOMPARE( collection2.attributes().at( 0 ).name(), QStringLiteral( "at1" ) ); QCOMPARE( collection2.attributes().at( 1 ).name(), QStringLiteral( "at2" ) ); QCOMPARE( collection2.attributes().at( 2 ).name(), QStringLiteral( "at3" ) ); - QCOMPARE( collection2.pointRecordSize(), static_cast< std::size_t >( 14 ) ); + QCOMPARE( collection2.pointRecordSize(), 14 ); QVERIFY( !collection2.find( QStringLiteral( "test" ), offset ) ); QCOMPARE( collection2.find( QStringLiteral( "at1" ), offset )->name(), QStringLiteral( "at1" ) ); QCOMPARE( offset, 0 );