diff options
author | Gabriel de Dietrich <gabriel.dedietrich@qt.io> | 2016-11-16 17:21:32 -0800 |
---|---|---|
committer | Gabriel de Dietrich <gabriel.dedietrich@qt.io> | 2016-12-02 16:15:58 +0000 |
commit | 2c634a132696376a0a0d7641bf05ae875c50190e (patch) | |
tree | 828b10cad212ca4f320c4b6a012ddc660a023e7a /src/widgets/widgets/qsplitter_p.h | |
parent | 9f2f3cb90b211b273139e12640d36f6ce845dc98 (diff) |
Introducing QSplitter::replaceWidget()
This new API addresses the use case where we want to replace
a widget by another one inside the splitter. Up to now, the
way of doing would include removing one widget and add the
new one at the same place. However, this triggers a series
of resize and paint events because of the successive changes
in the splitter's children leading to a relayout of the
remaining children.
The new widget inherits the same properties as in the previous
slot: geometry, visibility, and collapsed states. The previous
widget, returned by the function, loses its parent and is hidden.
Change-Id: I3dddf6b582d5ce2db8cff3c40bc46084263123ac
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/widgets/widgets/qsplitter_p.h')
-rw-r--r-- | src/widgets/widgets/qsplitter_p.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/widgets/widgets/qsplitter_p.h b/src/widgets/widgets/qsplitter_p.h index 4422d9a8a4..07b43e56b8 100644 --- a/src/widgets/widgets/qsplitter_p.h +++ b/src/widgets/widgets/qsplitter_p.h @@ -125,6 +125,7 @@ public: int findWidgetJustBeforeOrJustAfter(int index, int delta, int &collapsibleSize) const; void updateHandles(); void setSizes_helper(const QList<int> &sizes, bool clampNegativeSize = false); + bool shouldShowWidget(const QWidget *w) const; }; |