diff options
author | Jan Arve Saether <jan-arve.saether@theqtcompany.com> | 2015-02-06 14:47:16 +0100 |
---|---|---|
committer | Jan Arve Sæther <jan-arve.saether@theqtcompany.com> | 2015-02-09 21:10:31 +0000 |
commit | 3ab6653d97a5dd01fd5f5cb4e52d5816274e4cbd (patch) | |
tree | fc94f2cc49a23fedd9571a0e785458d4e8c3d78d /src/widgets | |
parent | e67ebe8ba4f59a4554a47fa26e9c374b1022d36f (diff) |
Fixed crash when adding items with spans
This only occurred if the item added was the only item in the last
row/column, since then the the internal grid failed to expand
(in this case it would always call expand(0, 0), which would not
create the extra row/column).
[ChangeLog][QtWidgets][QGridLayout] Fixed crash that sometimes happened
when adding items with spans that spanned to the bottom/right edge.
Task-number: QTBUG-38052
Change-Id: Iba95f6d9d9356b4d1c84c7b93f4af9b4ea0cf714
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/kernel/qgridlayout.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/kernel/qgridlayout.cpp b/src/widgets/kernel/qgridlayout.cpp index 10d338c40c..3de0eb7960 100644 --- a/src/widgets/kernel/qgridlayout.cpp +++ b/src/widgets/kernel/qgridlayout.cpp @@ -565,7 +565,7 @@ void QGridLayoutPrivate::add(QGridBox *box, int row1, int row2, int col1, int co add(box, row1, col1); return; } - expand(row2 + 1, col2 + 1); + expand(qMax(row1, row2) + 1, qMax(col1, col2) + 1); box->row = row1; box->col = col1; |