summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicslayoutitem.cpp
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2010-09-30 09:40:39 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2010-09-30 09:44:21 (GMT)
commit5bd6f7eb5c7d87c08539b6c2df416990cc417ec7 (patch)
tree847fbd3546bbfeaf36a8ead14781150618dd6d48 /src/gui/graphicsview/qgraphicslayoutitem.cpp
parentc1f9978c9d61bcbdb2f280185a3abdea13d7f532 (diff)
downloadQt-5bd6f7eb5c7d87c08539b6c2df416990cc417ec7.zip
Qt-5bd6f7eb5c7d87c08539b6c2df416990cc417ec7.tar.gz
Qt-5bd6f7eb5c7d87c08539b6c2df416990cc417ec7.tar.bz2
Revert "Fix (implement!) hfw/wfh in QGridLayoutEngine"
This reverts commit 62b5ef3cc1306e46a4042b14867f2f92d9a110f3. The implementation of hfw from this patch is unfortunately not robust enough. It doesn't manage correctly the constraints on the layouts and the cell spans. It caused bad behaviour or regressions seen in tasks: QTBUG-13547, QTBUG-13067, QTBUG-13549, and more Reviewed-By: ogoffart
Diffstat (limited to 'src/gui/graphicsview/qgraphicslayoutitem.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicslayoutitem.cpp51
1 files changed, 1 insertions, 50 deletions
diff --git a/src/gui/graphicsview/qgraphicslayoutitem.cpp b/src/gui/graphicsview/qgraphicslayoutitem.cpp
index 634f68c..ad4b2b5 100644
--- a/src/gui/graphicsview/qgraphicslayoutitem.cpp
+++ b/src/gui/graphicsview/qgraphicslayoutitem.cpp
@@ -48,7 +48,6 @@
#include "qgraphicslayoutitem.h"
#include "qgraphicslayoutitem_p.h"
#include "qwidget.h"
-#include "qgraphicswidget.h"
#include <QtDebug>
@@ -140,11 +139,9 @@ QSizeF *QGraphicsLayoutItemPrivate::effectiveSizeHints(const QSizeF &constraint)
if (!sizeHintCacheDirty && cachedConstraint == constraint)
return cachedSizeHints;
- const bool hasConstraint = constraint.width() >= 0 || constraint.height() >= 0;
-
for (int i = 0; i < Qt::NSizeHints; ++i) {
cachedSizeHints[i] = constraint;
- if (userSizeHints && !hasConstraint)
+ if (userSizeHints)
combineSize(cachedSizeHints[i], userSizeHints[i]);
}
@@ -262,52 +259,6 @@ void QGraphicsLayoutItemPrivate::setSizeComponent(
q->updateGeometry();
}
-
-bool QGraphicsLayoutItemPrivate::hasHeightForWidth() const
-{
- Q_Q(const QGraphicsLayoutItem);
- if (isLayout) {
- const QGraphicsLayout *l = static_cast<const QGraphicsLayout *>(q);
- for (int i = l->count() - 1; i >= 0; --i) {
- if (QGraphicsLayoutItemPrivate::get(l->itemAt(i))->hasHeightForWidth())
- return true;
- }
- } else if (QGraphicsItem *item = q->graphicsItem()) {
- if (item->isWidget()) {
- QGraphicsWidget *w = static_cast<QGraphicsWidget *>(item);
- if (w->layout()) {
- return QGraphicsLayoutItemPrivate::get(w->layout())->hasHeightForWidth();
- }
- }
- }
- return q->sizePolicy().hasHeightForWidth();
-}
-
-bool QGraphicsLayoutItemPrivate::hasWidthForHeight() const
-{
- // enable this code when we add QSizePolicy::hasWidthForHeight() (For 4.8)
-#if 1
- return false;
-#else
- Q_Q(const QGraphicsLayoutItem);
- if (isLayout) {
- const QGraphicsLayout *l = static_cast<const QGraphicsLayout *>(q);
- for (int i = l->count() - 1; i >= 0; --i) {
- if (QGraphicsLayoutItemPrivate::get(l->itemAt(i))->hasWidthForHeight())
- return true;
- }
- } else if (QGraphicsItem *item = q->graphicsItem()) {
- if (item->isWidget()) {
- QGraphicsWidget *w = static_cast<QGraphicsWidget *>(item);
- if (w->layout()) {
- return QGraphicsLayoutItemPrivate::get(w->layout())->hasWidthForHeight();
- }
- }
- }
- return q->sizePolicy().hasWidthForHeight();
-#endif
-}
-
/*!
\class QGraphicsLayoutItem
\brief The QGraphicsLayoutItem class can be inherited to allow your custom