From b2492f31fd55b7b7335154464c1c12a6895f5a23 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Thu, 29 Oct 2015 14:00:29 +0100 Subject: BasicTableView: Use ListView's overlay header for the table header Previoulsy we manually positioned the table header over the table contents, which required some manual tweakings. Since 5.4, ListView support overlay headers that we can use them to clean our code in BasicTableView. There is, however, a small issue on Mac where the vertical scrollbar (specially in non-transient mode) is displayed below the table header. Since the header can't span beyond the ListView boundaries, we need to account for the vertical scrollbar width in the ListView's content width. This patch also updates the Desktop style to set the transientScrollBars property and some small tweaks to the Base style. Change-Id: I4433d0703328f23eadb0ae4563fbef5bba0168db Task-number: QTBUG-34344 Reviewed-by: Mitch Curtis --- tests/auto/controls/data/tableview/table_buttondelegate.qml | 5 +++-- tests/auto/controls/data/tst_tableview.qml | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/auto/controls/data/tableview/table_buttondelegate.qml b/tests/auto/controls/data/tableview/table_buttondelegate.qml index 3f1be964..3c347b36 100644 --- a/tests/auto/controls/data/tableview/table_buttondelegate.qml +++ b/tests/auto/controls/data/tableview/table_buttondelegate.qml @@ -55,15 +55,16 @@ TableView { onClicked: ++clickCount TableViewColumn { + id: column width: 100 } rowDelegate: Item { height: 40 - width: parent.width + width: column.width } itemDelegate: Button { height: 40 - width: parent.width + width: column.width text: styleData.value activeFocusOnPress: true onClicked: ++table.buttonClickCount diff --git a/tests/auto/controls/data/tst_tableview.qml b/tests/auto/controls/data/tst_tableview.qml index a01df56f..8a821661 100644 --- a/tests/auto/controls/data/tst_tableview.qml +++ b/tests/auto/controls/data/tst_tableview.qml @@ -91,7 +91,10 @@ TestCase { model: 10; \n\ }', testCase, '') wait(50); - verify(table.__viewTopMargin > 0) + testCase.visible = true // ### FIXME Why do I need this at all? + verify(table.visible) + verify(table.__listView.headerItem.visible) + verify(table.__listView.headerItem.height > 0) table.destroy() } -- cgit v1.2.1