@@ -259,6 +259,12 @@ void TestQgsLayoutUnits::createSize()
259
259
QCOMPARE ( empty.units (), QgsUnitTypes::LayoutPixels );
260
260
QCOMPARE ( empty.width (), 0.0 );
261
261
QCOMPARE ( empty.height (), 0.0 );
262
+
263
+ // test constructing from QSizeF
264
+ QgsLayoutSize fromQSizeF ( QSizeF ( 17.0 , 18.0 ), QgsUnitTypes::LayoutInches );
265
+ QCOMPARE ( fromQSizeF.units (), QgsUnitTypes::LayoutInches );
266
+ QCOMPARE ( fromQSizeF.width (), 17.0 );
267
+ QCOMPARE ( fromQSizeF.height (), 18.0 );
262
268
}
263
269
264
270
void TestQgsLayoutUnits::sizeGettersSetters ()
@@ -393,6 +399,12 @@ void TestQgsLayoutUnits::createPoint()
393
399
QCOMPARE ( empty.units (), QgsUnitTypes::LayoutPixels );
394
400
QCOMPARE ( empty.x (), 0.0 );
395
401
QCOMPARE ( empty.y (), 0.0 );
402
+
403
+ // test constructing from QPointF
404
+ QgsLayoutPoint fromQPointF ( QPointF ( 17.0 , 18.0 ), QgsUnitTypes::LayoutInches );
405
+ QCOMPARE ( fromQPointF.units (), QgsUnitTypes::LayoutInches );
406
+ QCOMPARE ( fromQPointF.x (), 17.0 );
407
+ QCOMPARE ( fromQPointF.y (), 18.0 );
396
408
}
397
409
398
410
void TestQgsLayoutUnits::pointGettersSetters ()
0 commit comments