{
Q_Q(QQuickItemView);
if (isValid()) {
+ qreal extra = headerSize() + footerSize();
if (layoutOrientation() == Qt::Vertical)
- q->setContentHeight(endPosition() - startPosition());
+ q->setContentHeight(endPosition() - startPosition() + extra);
else
- q->setContentWidth(endPosition() - startPosition());
+ q->setContentWidth(endPosition() - startPosition() + extra);
}
}
QCOMPARE(footer->height(), 30.);
QCOMPARE(QPointF(gridview->contentX(), gridview->contentY()), initialContentPos);
+ if (flow == QQuickGridView::LeftToRight)
+ QCOMPARE(gridview->contentHeight(), (model.count()+2) / 3 * 60. + footer->height());
+ else
+ QCOMPARE(gridview->contentWidth(), (model.count()+3) / 5 * 80. + footer->width());
+
QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", 0);
QVERIFY(item);
QCOMPARE(item->pos(), firstDelegatePos);
QCOMPARE(header->height(), 30.);
QCOMPARE(QPointF(gridview->contentX(), gridview->contentY()), initialContentPos);
+ if (flow == QQuickGridView::LeftToRight)
+ QCOMPARE(gridview->contentHeight(), (model.count()+2) / 3 * 60. + header->height());
+ else
+ QCOMPARE(gridview->contentWidth(), (model.count()+3) / 5 * 80. + header->width());
+
QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", 0);
QVERIFY(item);
QCOMPARE(item->pos(), firstDelegatePos);
QCOMPARE(header->pos(), initialHeaderPos);
QCOMPARE(QPointF(listview->contentX(), listview->contentY()), initialContentPos);
+ if (orientation == QQuickListView::Vertical)
+ QCOMPARE(listview->contentHeight(), model.count() * 30. + header->height());
+ else
+ QCOMPARE(listview->contentWidth(), model.count() * 240. + header->width());
+
QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", 0);
QVERIFY(item);
QCOMPARE(item->pos(), firstDelegatePos);
QCOMPARE(footer->height(), 30.);
QCOMPARE(QPointF(listview->contentX(), listview->contentY()), initialContentPos);
+ if (orientation == QQuickListView::Vertical)
+ QCOMPARE(listview->contentHeight(), model.count() * 20. + footer->height());
+ else
+ QCOMPARE(listview->contentWidth(), model.count() * 40. + footer->width());
+
QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", 0);
QVERIFY(item);
QCOMPARE(item->pos(), firstDelegatePos);