diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2019-05-24 19:51:38 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2019-07-30 22:41:19 +0300 |
commit | 130fd22d399624c863bbaad2f72d2213a48e9e13 (patch) | |
tree | b8ae7745316d031ae79c6d7ddf6910fd59643a78 /src/widgets/kernel/qwidget.cpp | |
parent | 76be819345228d589cbc4f5129617151ea604750 (diff) |
QWidget/QLineEdit: deprecate get{Contents,Text}Margins()
We have contentsMargins() and textMargins() methods since 4.6 which
are much more efficient and easier to use.
[ChangeLog][QtWidgets][QLineEdit] The getTextMargins() member function
has been deprecated in favor of textMargins().
[ChangeLog][QtWidgets][QWidget] The getContentsMargins() member
function has been deprecated in favor of contentsMargins().
Change-Id: Ifdb890af6198fc682b94701786c67a5b945a4b4c
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/widgets/kernel/qwidget.cpp')
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index f0230f4f32..209a4407a0 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -7634,7 +7634,7 @@ bool QWidget::restoreGeometry(const QByteArray &geometry) Changing the margins will trigger a resizeEvent(). - \sa contentsRect(), getContentsMargins() + \sa contentsRect(), contentsMargins() */ void QWidget::setContentsMargins(int left, int top, int right, int bottom) { @@ -7664,7 +7664,7 @@ void QWidget::setContentsMargins(int left, int top, int right, int bottom) Changing the margins will trigger a resizeEvent(). - \sa contentsRect(), getContentsMargins() + \sa contentsRect(), contentsMargins() */ void QWidget::setContentsMargins(const QMargins &margins) { @@ -7693,7 +7693,11 @@ void QWidgetPrivate::updateContentsRect() QCoreApplication::sendEvent(q, &e); } +#if QT_DEPRECATED_SINCE(5, 14) /*! + \obsolete + Use contentsMargins(). + Returns the widget's contents margins for \a left, \a top, \a right, and \a bottom. @@ -7711,6 +7715,7 @@ void QWidget::getContentsMargins(int *left, int *top, int *right, int *bottom) c if (bottom) *bottom = m.bottom(); } +#endif // FIXME: Move to qmargins.h for next minor Qt release QMargins operator|(const QMargins &m1, const QMargins &m2) @@ -7724,7 +7729,7 @@ QMargins operator|(const QMargins &m1, const QMargins &m2) \brief The contentsMargins function returns the widget's contents margins. - \sa getContentsMargins(), setContentsMargins(), contentsRect() + \sa setContentsMargins(), contentsRect() */ QMargins QWidget::contentsMargins() const { @@ -7737,7 +7742,7 @@ QMargins QWidget::contentsMargins() const /*! Returns the area inside the widget's margins. - \sa setContentsMargins(), getContentsMargins() + \sa setContentsMargins(), contentsMargins() */ QRect QWidget::contentsRect() const { |