diff options
author | Jan Arve Sæther <jan-arve.saether@qt.io> | 2019-11-12 18:00:52 +0100 |
---|---|---|
committer | Jan Arve Sæther <jan-arve.saether@qt.io> | 2019-11-13 15:11:13 +0100 |
commit | 554309a1c1127b4a614cdba4f9ece46fc85df7e1 (patch) | |
tree | 9ec566ef87a9afa8f4f01119b4e1e9ceb047f05a /tests | |
parent | 34d1b179256706111703e557cd1d86b6f9a2180a (diff) |
Qt Quick Layouts: Do not assert when specifying an invalid row/column
We now print a warning and try to gracefully handle it
Change-Id: I66e79fe918808f5fede78a23df50e9e95b7b832d
Fixes: QTBUG-67204
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/quick/qquicklayouts/data/tst_gridlayout.qml | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicklayouts/data/tst_gridlayout.qml b/tests/auto/quick/qquicklayouts/data/tst_gridlayout.qml index e8b3960486..be94fca8d4 100644 --- a/tests/auto/quick/qquicklayouts/data/tst_gridlayout.qml +++ b/tests/auto/quick/qquicklayouts/data/tst_gridlayout.qml @@ -1073,5 +1073,38 @@ Item { layout[propName] = data.value compare(layout.spy.count, 1) } + + Component { + id: layout_columnIsOutsideGrid_Component + GridLayout { + columns: 2 + Item { + Layout.row: 0 + Layout.column: 1 + } + Item { + implicitWidth: 10 + implicitHeight: 10 + Layout.row: 0 + Layout.column: 2 + } + Item { + Layout.columnSpan: 2 + Layout.fillWidth: true + Layout.fillHeight: true + } + } + } + + function test_columnIsOutsideGrid() + { + ignoreWarning(/QML Item: Layout: column \(2\) should be less than the number of columns \(2\)/); + var layout = layout_columnIsOutsideGrid_Component.createObject(container); + layout.width = layout.implicitWidth + layout.height = layout.implicitHeight + waitForRendering(layout); + layout.destroy() + } + } } |