diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2012-04-17 13:01:20 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-17 13:09:29 +0200 |
commit | 576a8e152ec36e7465bfdc8ad63998cffbab4091 (patch) | |
tree | 07472de61c7542a90f675869e480b99076c5b439 /src/widgets/kernel/qlayoutitem.cpp | |
parent | fb7f30d2bad0c84ffea4db862a71ba2e03d855d0 (diff) | |
parent | 64255ef6502b1144f7b0aa4b2bf62803e0d4788b (diff) |
Merge "Merge remote-tracking branch 'origin/api_changes'" into refs/staging/master
Diffstat (limited to 'src/widgets/kernel/qlayoutitem.cpp')
-rw-r--r-- | src/widgets/kernel/qlayoutitem.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/widgets/kernel/qlayoutitem.cpp b/src/widgets/kernel/qlayoutitem.cpp index 814b807b82..8e08f5f39f 100644 --- a/src/widgets/kernel/qlayoutitem.cpp +++ b/src/widgets/kernel/qlayoutitem.cpp @@ -414,17 +414,6 @@ int QLayoutItem::heightForWidth(int /* w */) const */ QSizePolicy::ControlTypes QLayoutItem::controlTypes() const { - // ### Qt 5: This function should probably be virtual instead - if (const QWidget *widget = const_cast<QLayoutItem*>(this)->widget()) { - return widget->sizePolicy().controlType(); - } else if (const QLayout *layout = const_cast<QLayoutItem*>(this)->layout()) { - if (layout->count() == 0) - return QSizePolicy::DefaultType; - QSizePolicy::ControlTypes types; - for (int i = layout->count() - 1; i >= 0; --i) - types |= layout->itemAt(i)->controlTypes(); - return types; - } return QSizePolicy::DefaultType; } @@ -688,6 +677,11 @@ bool QWidgetItem::isEmpty() const return wid->isHidden() || wid->isWindow(); } +QSizePolicy::ControlTypes QWidgetItem::controlTypes() const +{ + return wid->sizePolicy().controlType(); +} + /*! \class QWidgetItemV2 \internal |