summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJan-Arve Saether <jan-arve.saether@nokia.com>2011-01-19 20:55:06 (GMT)
committerJan-Arve Saether <jan-arve.saether@nokia.com>2011-01-19 20:55:06 (GMT)
commit43f8762367fa6ffc228ae6e97192766475b02ac0 (patch)
tree39a9e484ff3eaaa89f8ab52101ae9551bc189f2a /tests
parentfc2b2b3fdb2fb2ee9e632a0c3df4f783b26397f8 (diff)
downloadQt-43f8762367fa6ffc228ae6e97192766475b02ac0.zip
Qt-43f8762367fa6ffc228ae6e97192766475b02ac0.tar.gz
Qt-43f8762367fa6ffc228ae6e97192766475b02ac0.tar.bz2
Enable the widthForHeight() test case.
While I did that I also found a copy-paste (?) bug in the WFH case of QGridLayoutEngine::sizeHint() that caused the widthForHeight() case to fail. Task-number: QTBUG-14693
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp b/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
index 0ec67f6..92cf7fe 100644
--- a/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
+++ b/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
@@ -3117,7 +3117,6 @@ void tst_QGraphicsGridLayout::heightForWidth()
void tst_QGraphicsGridLayout::widthForHeight()
{
-#if 0
QGraphicsWidget *widget = new QGraphicsWidget;
QGraphicsGridLayout *layout = new QGraphicsGridLayout;
widget->setLayout(layout);
@@ -3144,9 +3143,10 @@ void tst_QGraphicsGridLayout::widthForHeight()
layout->addItem(w10, 1, 0);
RectWidget *w11 = new RectWidget;
- w11->setMinimumSize(1,1);
- w11->setPreferredSize(50, 50);
- w11->setMaximumSize(30000,30000);
+ w11->setSizeHint(Qt::MinimumSize, QSizeF(1,1));
+ w11->setSizeHint(Qt::PreferredSize, QSizeF(50,50));
+ w11->setSizeHint(Qt::MaximumSize, QSizeF(30000,30000));
+
// This will make sure its always square.
w11->setConstraintFunction(wfh);
QSizePolicy sp(QSizePolicy::Preferred, QSizePolicy::Preferred);
@@ -3190,7 +3190,6 @@ void tst_QGraphicsGridLayout::widthForHeight()
QCOMPARE(layout->effectiveSizeHint(Qt::MinimumSize, QSizeF(-1, 300)), QSizeF(1 + 200, 300));
QCOMPARE(layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(-1, 300)), QSizeF(50 + 200, 300));
QCOMPARE(layout->effectiveSizeHint(Qt::MaximumSize, QSizeF(-1, 300)), QSizeF(100 + 200, 300));
-#endif
}
void tst_QGraphicsGridLayout::heightForWidthWithSpanning()