@@ -225,6 +225,7 @@ void TestQgsCompositionConverter::importComposerTemplateShape()
225
225
QCOMPARE ( shape->pos ().y (), 83.1791 );
226
226
QCOMPARE ( shape->sizeWithUnits ().width (), 12.0988 );
227
227
QCOMPARE ( shape->sizeWithUnits ().height (), 33.2716 );
228
+ QCOMPARE ( shape->sizeWithUnits ().units (), QgsUnitTypes::LayoutUnit::LayoutMillimeters );
228
229
QCOMPARE ( shape->referencePoint (), QgsLayoutItem::ReferencePoint::MiddleRight );
229
230
QCOMPARE ( shape->frameStrokeColor (), QColor ( 0 , 0 , 0 , 255 ) );
230
231
QCOMPARE ( shape->frameStrokeWidth ().length (), 0.3 );
@@ -457,11 +458,11 @@ void TestQgsCompositionConverter::importComposerTemplateAttributeTable()
457
458
QVERIFY ( layout.get () );
458
459
QCOMPARE ( layout->pageCollection ()->pageCount (), 1 );
459
460
460
- QList<QgsLayoutMultiFrame *> items = layout->multiFrames ();
461
+ // Check the table
462
+ QList<QgsLayoutItemAttributeTable *> items;
463
+ layout->layoutObjects <QgsLayoutItemAttributeTable>( items );
461
464
QVERIFY ( items.size () > 0 );
462
-
463
- // Check the HTML
464
- const QgsLayoutItemAttributeTable *table = qobject_cast<QgsLayoutItemAttributeTable * >( items.at ( 0 ) );
465
+ const QgsLayoutItemAttributeTable *table = items.at ( 0 );
465
466
QVERIFY ( table );
466
467
QVERIFY ( table->sourceLayer () );
467
468
QVERIFY ( table->sourceLayer ()->isValid () );
@@ -481,11 +482,11 @@ void TestQgsCompositionConverter::importComposerTemplateHtml()
481
482
QVERIFY ( layout.get () );
482
483
QCOMPARE ( layout->pageCollection ()->pageCount (), 7 );
483
484
484
- QList<QgsLayoutMultiFrame *> items = layout->multiFrames ();
485
- QVERIFY ( items.size () > 0 );
486
-
487
485
// Check the HTML
488
- const QgsLayoutItemHtml *html = qobject_cast<QgsLayoutItemHtml * >( items.at ( 0 ) );
486
+ QList<QgsLayoutItemHtml *> items;
487
+ layout->layoutObjects <QgsLayoutItemHtml>( items );
488
+ QVERIFY ( items.size () > 0 );
489
+ const QgsLayoutItemHtml *html = items.at ( 0 );
489
490
QVERIFY ( html );
490
491
QCOMPARE ( html->contentMode (), QgsLayoutItemHtml::ContentMode::ManualHtml );
491
492
QCOMPARE ( html->html (), QStringLiteral ( " <div style=\" height:5000px; background-color:green; color:white;\" >aaaaA</div>\t\n " ) );
@@ -609,7 +610,6 @@ void TestQgsCompositionConverter::importComposerTemplate()
609
610
// We have at least one item linked to a map for this test
610
611
QVERIFY ( count > 0 );
611
612
}
612
- // TODO: attr table (not yet imported)
613
613
614
614
checkRenderedImage ( layout.get (), QTest::currentTestFunction (), 0 );
615
615
checkRenderedImage ( layout.get (), QTest::currentTestFunction (), 1 );
@@ -642,7 +642,7 @@ void TestQgsCompositionConverter::checkRenderedImage( QgsLayout *layout, const Q
642
642
QSize size ( layout->pageCollection ()->page ( pageNumber )->sizeWithUnits ().width () * 3.77 , layout->pageCollection ()->page ( pageNumber )->sizeWithUnits ().height () * 3.77 );
643
643
checker.setSize ( size );
644
644
checker.setControlPathPrefix ( QStringLiteral ( " compositionconverter" ) );
645
- QVERIFY ( checker.testLayout ( mReport , pageNumber ) );
645
+ QVERIFY ( checker.testLayout ( mReport , pageNumber, 0 , true ) );
646
646
}
647
647
648
648
0 commit comments