diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2019-01-08 11:10:13 +0100 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2019-02-08 08:53:47 +0000 |
commit | 00685756021fbacb7f7b0419cd5e6062e2698074 (patch) | |
tree | 047a5b609720b0d4a1d227571d44dacb8b928a4b /tests/auto/quick/qquicktableview/data/usefaultyrowcolumnprovider.qml | |
parent | e04e5db13d2a1d03e4afe139fcc29e0ed5b1edab (diff) |
QQuickTableView: add support for hiding rows and columns
This patch will add support for hiding rows and columns to TableView.
You can now hide a column by returning 0 width for it from the
columnWidthProvider. The same can be done to hide a row (by using the
rowHeightProvider). If you return NaN or negative number, TableView
will fall back to calculate the size of the column/row by looking at
the delegate items, like before. This to make it possible to hide
some rows/columns, without having to calculate and return the heights
and widths of the other rows and columns.
[ChangeLog][QtQuick][TableView] Added support for hiding rows and columns
by setting their size to 0 from the columnsWidthProvider/rowHeightProvider.
Change-Id: If9e1a8db91e257d36cb2787bab4856e6201456ac
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/quick/qquicktableview/data/usefaultyrowcolumnprovider.qml')
-rw-r--r-- | tests/auto/quick/qquicktableview/data/usefaultyrowcolumnprovider.qml | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/auto/quick/qquicktableview/data/usefaultyrowcolumnprovider.qml b/tests/auto/quick/qquicktableview/data/usefaultyrowcolumnprovider.qml index 32d1fc9d0d..1e35d65bcd 100644 --- a/tests/auto/quick/qquicktableview/data/usefaultyrowcolumnprovider.qml +++ b/tests/auto/quick/qquicktableview/data/usefaultyrowcolumnprovider.qml @@ -56,16 +56,14 @@ Item { delegate: tableViewDelegate columnSpacing: 1 rowSpacing: 1 - columnWidthProvider: function(column) { } - rowHeightProvider: function(row) { return 0 } + columnWidthProvider: function(column) { return "notAValidValue" } + rowHeightProvider: function(row) { return "notAValidValue" } } Component { id: tableViewDelegate Rectangle { objectName: "tableViewDelegate" - implicitWidth: 20 - implicitHeight: 20 color: "lightgray" border.width: 1 Text { |