From 466107107a85e7211c4b7f77b36ec50625657061 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lund=20Martsum?= Date: Mon, 6 Feb 2012 09:24:50 +0100 Subject: Adding hasHeightForWidth as a virtual Widget funcion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Just implements what the note states (and removes the private function) Change-Id: I9a6fd5134460712accf09ba01691df8b9b1f5d0d Reviewed-by: Jan-Arve Sæther --- src/widgets/kernel/qwidget.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'src/widgets/kernel/qwidget.cpp') diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index f095e475af..44995f0959 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -9226,19 +9226,12 @@ int QWidget::heightForWidth(int w) const /*! - \internal - - *virtual private* - - This is a bit hackish, but ideally we would have created a virtual function - in the public API (however, too late...) so that subclasses could reimplement - their own function. - Instead we add a virtual function to QWidgetPrivate. - ### Qt5: move to public class and make virtual + Returns true if the widget's preferred height depends on its width; otherwise returns false. */ -bool QWidgetPrivate::hasHeightForWidth() const +bool QWidget::hasHeightForWidth() const { - return layout ? layout->hasHeightForWidth() : size_policy.hasHeightForWidth(); + Q_D(const QWidget); + return d->layout ? d->layout->hasHeightForWidth() : d->size_policy.hasHeightForWidth(); } /*! -- cgit v1.2.3