summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qwidget.cpp
diff options
context:
space:
mode:
authorThorbjørn Lund Martsum <tmartsum@gmail.com>2012-02-06 09:24:50 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-18 18:40:15 +0100
commit466107107a85e7211c4b7f77b36ec50625657061 (patch)
tree9eb0d64ac6a2ba4e2f0a110322c19cfc879cd047 /src/widgets/kernel/qwidget.cpp
parent908a080006faff333b061b69b0dc0fd9cab36114 (diff)
Adding hasHeightForWidth as a virtual Widget funcion
Just implements what the note states (and removes the private function) Change-Id: I9a6fd5134460712accf09ba01691df8b9b1f5d0d Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
Diffstat (limited to 'src/widgets/kernel/qwidget.cpp')
-rw-r--r--src/widgets/kernel/qwidget.cpp15
1 files changed, 4 insertions, 11 deletions
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();
}
/*!