summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qlayoutitem.cpp2
-rw-r--r--src/widgets/kernel/qwidget.cpp15
-rw-r--r--src/widgets/kernel/qwidget.h1
-rw-r--r--src/widgets/kernel/qwidget_p.h1
4 files changed, 6 insertions, 13 deletions
diff --git a/src/widgets/kernel/qlayoutitem.cpp b/src/widgets/kernel/qlayoutitem.cpp
index 860f1cc193..664334d725 100644
--- a/src/widgets/kernel/qlayoutitem.cpp
+++ b/src/widgets/kernel/qlayoutitem.cpp
@@ -522,7 +522,7 @@ bool QWidgetItem::hasHeightForWidth() const
{
if (isEmpty())
return false;
- return wid->d_func()->hasHeightForWidth();
+ return wid->hasHeightForWidth();
}
/*!
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();
}
/*!
diff --git a/src/widgets/kernel/qwidget.h b/src/widgets/kernel/qwidget.h
index 0594fd6f50..78b693c78d 100644
--- a/src/widgets/kernel/qwidget.h
+++ b/src/widgets/kernel/qwidget.h
@@ -524,6 +524,7 @@ public:
void setSizePolicy(QSizePolicy);
inline void setSizePolicy(QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical);
virtual int heightForWidth(int) const;
+ virtual bool hasHeightForWidth() const;
QRegion visibleRegion() const;
diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h
index 0da0c65aaa..8b66f14540 100644
--- a/src/widgets/kernel/qwidget_p.h
+++ b/src/widgets/kernel/qwidget_p.h
@@ -468,7 +468,6 @@ public:
bool setMinimumSize_helper(int &minw, int &minh);
bool setMaximumSize_helper(int &maxw, int &maxh);
- virtual bool hasHeightForWidth() const;
void setConstraints_sys();
bool pointInsideRectAndMask(const QPoint &) const;
QWidget *childAt_helper(const QPoint &, bool) const;