diff options
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qlayoutitem.cpp | 4 | ||||
-rw-r--r-- | src/gui/kernel/qstackedlayout.cpp | 26 | ||||
-rw-r--r-- | src/gui/kernel/qstackedlayout.h | 2 | ||||
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 17 | ||||
-rw-r--r-- | src/gui/kernel/qwidget.h | 1 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_p.h | 1 |
6 files changed, 3 insertions, 48 deletions
diff --git a/src/gui/kernel/qlayoutitem.cpp b/src/gui/kernel/qlayoutitem.cpp index e615b2d..6a91d95 100644 --- a/src/gui/kernel/qlayoutitem.cpp +++ b/src/gui/kernel/qlayoutitem.cpp @@ -516,7 +516,9 @@ bool QWidgetItem::hasHeightForWidth() const { if (isEmpty()) return false; - return wid->hasHeightForWidth(); + if (wid->layout()) + return wid->layout()->hasHeightForWidth(); + return wid->sizePolicy().hasHeightForWidth(); } /*! diff --git a/src/gui/kernel/qstackedlayout.cpp b/src/gui/kernel/qstackedlayout.cpp index 4b49638..7559066 100644 --- a/src/gui/kernel/qstackedlayout.cpp +++ b/src/gui/kernel/qstackedlayout.cpp @@ -475,32 +475,6 @@ void QStackedLayout::setGeometry(const QRect &rect) } } -bool QStackedLayout::hasHeightForWidth() const -{ - const int n = count(); - - for (int i = 0; i < n; ++i) { - if (QLayoutItem *item = itemAt(i)) { - if (item->hasHeightForWidth()) - return true; - } - } - return false; -} - -int QStackedLayout::heightForWidth(int width) const -{ - const int n = count(); - - int hfw = 0; - for (int i = 0; i < n; ++i) { - if (QLayoutItem *item = itemAt(i)) { - hfw = qMax(hfw, item->heightForWidth(width)); - } - } - return hfw; -} - /*! \enum QStackedLayout::StackingMode \since 4.4 diff --git a/src/gui/kernel/qstackedlayout.h b/src/gui/kernel/qstackedlayout.h index 842b62b..c069149 100644 --- a/src/gui/kernel/qstackedlayout.h +++ b/src/gui/kernel/qstackedlayout.h @@ -95,8 +95,6 @@ public: QLayoutItem *itemAt(int) const; QLayoutItem *takeAt(int); void setGeometry(const QRect &rect); - bool hasHeightForWidth() const; - int heightForWidth(int width) const; Q_SIGNALS: void widgetRemoved(int index); diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index b19f7aa..4fba8cf 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -3820,11 +3820,6 @@ void QWidget::setMaximumSize(int maxw, int maxh) d->updateGeometry_helper(d->extra->minw == d->extra->maxw && d->extra->minh == d->extra->maxh); } -bool QWidgetPrivate::hasHeightForWidth() const -{ - return layout ? layout->hasHeightForWidth() : size_policy.hasHeightForWidth(); -} - /*! \overload @@ -7970,18 +7965,6 @@ QSize QWidget::minimumSizeHint() const return QSize(-1, -1); } -/*! - \internal - This is a bit hackish, but ideally this would have been a virtual - function so that subclasses could reimplement their own function. - Instead we add a virtual function to QWidgetPrivate. -*/ -bool QWidget::hasHeightForWidth() const -{ - Q_D(const QWidget); - return d->hasHeightForWidth(); -} - /*! \fn QWidget *QWidget::parentWidget() const diff --git a/src/gui/kernel/qwidget.h b/src/gui/kernel/qwidget.h index 6e5de7d..e12148b 100644 --- a/src/gui/kernel/qwidget.h +++ b/src/gui/kernel/qwidget.h @@ -524,7 +524,6 @@ public: virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; - bool hasHeightForWidth() const; QSizePolicy sizePolicy() const; void setSizePolicy(QSizePolicy); diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index 05a859c..89ea256 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -493,7 +493,6 @@ public: bool setMinimumSize_helper(int &minw, int &minh); bool setMaximumSize_helper(int &maxw, int &maxh); - virtual bool hasHeightForWidth() const; void setConstraints_sys(); QWidget *childAt_helper(const QPoint &, bool) const; void updateGeometry_helper(bool forceUpdate); |