diff options
author | Andy Shaw <andy.shaw@qt.io> | 2018-04-13 09:19:48 +0200 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2019-03-15 12:24:02 +0000 |
commit | edf2e699856e0385746ea03fea23ec20c08c0b2c (patch) | |
tree | de4b6b0df07ce91c024fb2298996baab8336a781 /src | |
parent | 11228e54b6f0799a1ed432db98de19de0c6f792a (diff) |
Don't increase the size of the layout unnecessarily when moving toolbars
When the toolbar was moved from one position to another it could end up
increasing the size of the saveState data due to extra lines. This
removes any needless ones that should not be included.
Change-Id: I1c5d094ae1405d6a82db5fcdc3cd081904706837
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/widgets/widgets/qtoolbararealayout.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/widgets/widgets/qtoolbararealayout.cpp b/src/widgets/widgets/qtoolbararealayout.cpp index 884eface3c..adc329131c 100644 --- a/src/widgets/widgets/qtoolbararealayout.cpp +++ b/src/widgets/widgets/qtoolbararealayout.cpp @@ -1078,7 +1078,11 @@ bool QToolBarAreaLayout::insertGap(const QList<int> &path, QLayoutItem *item) void QToolBarAreaLayout::remove(const QList<int> &path) { Q_ASSERT(path.count() == 3); - docks[path.at(0)].lines[path.at(1)].toolBarItems.removeAt(path.at(2)); + QToolBarAreaLayoutInfo &dock = docks[path.at(0)]; + QToolBarAreaLayoutLine &line = dock.lines[path.at(1)]; + line.toolBarItems.removeAt(path.at(2)); + if (line.toolBarItems.isEmpty()) + dock.lines.removeAt(path.at(1)); } void QToolBarAreaLayout::remove(QLayoutItem *item) |