Skip to content

Commit 2b252c8

Browse files
committedMay 6, 2020
adapt test
1 parent ab4e179 commit 2b252c8

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed
 

‎tests/src/core/testqgslayouttable.cpp‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,8 +1593,10 @@ void TestQgsLayoutTable::testBaseSort()
15931593
table->setVectorLayer( mVectorLayer );
15941594
table->setDisplayOnlyVisibleFeatures( false );
15951595
table->setMaximumNumberOfFeatures( 1 );
1596-
table->columns()[2].setSortByRank( 1 );
1597-
table->columns()[2].setSortOrder( Qt::DescendingOrder );
1596+
QgsLayoutTableColumn col;
1597+
col.setAttribute(table->columns()[2].attribute());
1598+
col.setSortOrder( Qt::DescendingOrder );
1599+
table->sortColumns() = {col};
15981600
table->refresh();
15991601

16001602
QVector<QStringList> expectedRows;
@@ -1615,10 +1617,12 @@ void TestQgsLayoutTable::testExpressionSort()
16151617
table->setVectorLayer( mVectorLayer );
16161618
table->setDisplayOnlyVisibleFeatures( false );
16171619
table->setMaximumNumberOfFeatures( 1 );
1618-
table->columns()[0].setAttribute( "Heading * -1" );
1619-
table->columns()[0].setHeading( "exp" );
1620-
table->columns()[0].setSortByRank( 1 );
1621-
table->columns()[0].setSortOrder( Qt::AscendingOrder );
1620+
QgsLayoutTableColumn col;
1621+
col.setAttribute( "Heading * -1" );
1622+
col.setHeading( "exp" );
1623+
col.setSortOrder( Qt::AscendingOrder );
1624+
table->sortColumns() = {col};
1625+
table->columns()[0] = col;
16221626
table->refresh();
16231627

16241628
QVector<QStringList> expectedRows;

0 commit comments

Comments
 (0)
Please sign in to comment.