From 130fd22d399624c863bbaad2f72d2213a48e9e13 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 24 May 2019 19:51:38 +0200 Subject: QWidget/QLineEdit: deprecate get{Contents,Text}Margins() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Lars Knoll --- src/widgets/widgets/qcombobox.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/widgets/widgets/qcombobox.cpp') diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index 5c368db83a..8b54d61e8e 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -2714,15 +2714,14 @@ void QComboBox::showPopup() int heightMargin = container->topMargin() + container->bottomMargin(); // add the frame of the container - int marginTop, marginBottom; - container->getContentsMargins(0, &marginTop, 0, &marginBottom); - heightMargin += marginTop + marginBottom; + const QMargins cm = container->contentsMargins(); + heightMargin += cm.top() + cm.bottom(); //add the frame of the view - view()->getContentsMargins(0, &marginTop, 0, &marginBottom); - marginTop += static_cast(QObjectPrivate::get(view()))->top; - marginBottom += static_cast(QObjectPrivate::get(view()))->bottom; - heightMargin += marginTop + marginBottom; + const QMargins vm = view()->contentsMargins(); + heightMargin += vm.top() + vm.bottom(); + heightMargin += static_cast(QObjectPrivate::get(view()))->top; + heightMargin += static_cast(QObjectPrivate::get(view()))->bottom; listRect.setHeight(listRect.height() + heightMargin); } -- cgit v1.2.3