diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-01-13 08:40:29 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-01-14 05:02:57 +0000 |
commit | efa22507386d3a0dcc97b703219dcf9714f55a8d (patch) | |
tree | 6bd165292ec835382c4ea933fb0dd4868faa1c42 /src/quick/items/qquicktext.cpp | |
parent | e85ebe01b61a64ed64592dedb71c5913cd5080fd (diff) |
Deprecate Text::doLayout() in favor of forceLayout()
Item views and positioners all have now forceLayout(), so make the
Text element API consistent with them. The old doLayout(), which
sounds more like an internal helper method, is deprecated and marked
for removal in Qt 6.
[ChangeLog][QtQuick][Text] Deprecated doLayout() in favor of
forceLayout().
Change-Id: I051988fca13c4cd84904f7b268d51f6a96f28af3
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Diffstat (limited to 'src/quick/items/qquicktext.cpp')
-rw-r--r-- | src/quick/items/qquicktext.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp index 30e9c71143..965fb0102f 100644 --- a/src/quick/items/qquicktext.cpp +++ b/src/quick/items/qquicktext.cpp @@ -2795,11 +2795,23 @@ void QQuickText::setRenderType(QQuickText::RenderType renderType) /*! \qmlmethod QtQuick::Text::doLayout() + \deprecated - Triggers a re-layout of the displayed text. + Use \l forceLayout() instead. */ void QQuickText::doLayout() { + forceLayout(); +} + +/*! + \qmlmethod QtQuick::Text::forceLayout() + \since 5.9 + + Triggers a re-layout of the displayed text. +*/ +void QQuickText::forceLayout() +{ Q_D(QQuickText); d->updateSize(); } |