Skip to content
Snippets Groups Projects
Commit 0df8cc2e authored by Ulf Hermann's avatar Ulf Hermann
Browse files

Timeline: Clear excess row heights when reducing the number of rows


Otherwise, if you increase the number of rows again later you get
surprising results.

Change-Id: I3ec809820716368849415f9dcdb1ec9208844353
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@theqtcompany.com>
parent 34f27225
No related branches found
No related tags found
No related merge requests found
......@@ -136,6 +136,8 @@ void TimelineModel::setExpandedRowCount(int rows)
{
Q_D(TimelineModel);
if (d->expandedRowCount != rows) {
if (d->rowOffsets.length() > rows)
d->rowOffsets.resize(rows);
d->expandedRowCount = rows;
emit expandedRowCountChanged();
if (d->expanded)
......
......@@ -232,8 +232,12 @@ void tst_TimelineModel::height()
QCOMPARE(dummy.height(), 2 * DefaultRowHeight);
dummy.setExpanded(true);
QCOMPARE(dummy.height(), 3 * DefaultRowHeight);
dummy.setExpandedRowHeight(0, 80);
dummy.setExpandedRowHeight(1, 80);
QCOMPARE(dummy.height(), 2 * DefaultRowHeight + 80);
dummy.clear();
dummy.loadData();
dummy.setExpanded(true);
QCOMPARE(dummy.rowHeight(1), DefaultRowHeight); // Make sure the row height gets reset.
}
void tst_TimelineModel::count()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment