summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJan-Arve Sæther <jan-arve.saether@nokia.com>2009-06-24 07:31:29 (GMT)
committerJan-Arve Sæther <jan-arve.saether@nokia.com>2009-06-24 07:31:29 (GMT)
commitcfcbd3f694169437894e711d33d8fb183316be16 (patch)
tree7928ddf6aa2b2e5786e9b5dbe0cbede5e32a3bfb /tests/auto
parent2ec56d158dc140f68efb45e2e0613f0e4026ddf6 (diff)
downloadQt-cfcbd3f694169437894e711d33d8fb183316be16.zip
Qt-cfcbd3f694169437894e711d33d8fb183316be16.tar.gz
Qt-cfcbd3f694169437894e711d33d8fb183316be16.tar.bz2
Removed trailing whitespace.
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp118
-rw-r--r--tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp42
2 files changed, 80 insertions, 80 deletions
diff --git a/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp b/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
index 2f70b62..a548329 100644
--- a/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
+++ b/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
@@ -194,7 +194,7 @@ class RectWidget : public QGraphicsWidget
public:
RectWidget(QGraphicsItem *parent = 0) : QGraphicsWidget(parent){}
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
Q_UNUSED(option);
Q_UNUSED(widget);
@@ -238,11 +238,11 @@ static void populateLayout(QGraphicsGridLayout *gridLayout, int width, int heigh
* |+---|---+|xxxx|
* ||span=2 ||hole|
* |+---|---+|xxxx|
- * +----+----+----+
+ * +----+----+----+
* |xxxx|+---|---+|
* |hole||span=2 ||
* |xxxx|+---|---+|
- * +----+----+----+
+ * +----+----+----+
*/
static void populateLayoutWithSpansAndHoles(QGraphicsGridLayout *gridLayout)
{
@@ -299,7 +299,7 @@ void tst_QGraphicsGridLayout::addItem()
QTest::ignoreMessage(QtWarningMsg, "QGraphicsGridLayout::addItem: invalid row/column: -1");
} else if (rowSpan < 1 || columnSpan < 1) {
char buf[1024];
- ::qsnprintf(buf, sizeof(buf), "QGraphicsGridLayout::addItem: invalid row span/column span: %d",
+ ::qsnprintf(buf, sizeof(buf), "QGraphicsGridLayout::addItem: invalid row span/column span: %d",
rowSpan < 1 ? rowSpan : columnSpan);
QTest::ignoreMessage(QtWarningMsg, buf);
}
@@ -461,7 +461,7 @@ void tst_QGraphicsGridLayout::columnCount()
QCOMPARE(layout->columnCount(), 3);
layout->addItem(new RectWidget(widget), 1, 2);
QCOMPARE(layout->columnCount(), 3);
-
+
// ### Talk with Jasmin. Not sure if removeAt() should adjust columnCount().
widget->setLayout(0);
layout = new QGraphicsGridLayout();
@@ -527,7 +527,7 @@ void tst_QGraphicsGridLayout::columnMinimumWidth()
populateLayout(layout, 3, 2);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
-
+
// should at least be a very large number
QCOMPARE(layout->columnMinimumWidth(0), 0.0);
QCOMPARE(layout->columnMinimumWidth(0), layout->columnMinimumWidth(1));
@@ -562,7 +562,7 @@ void tst_QGraphicsGridLayout::columnPreferredWidth()
populateLayout(layout, 3, 2);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
-
+
// default preferred width ??
QCOMPARE(layout->columnPreferredWidth(0), 0.0);
QCOMPARE(layout->columnPreferredWidth(0), layout->columnPreferredWidth(1));
@@ -597,7 +597,7 @@ void tst_QGraphicsGridLayout::setColumnFixedWidth()
populateLayout(layout, 3, 2);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
-
+
layout->setColumnFixedWidth(0, 20);
layout->setColumnFixedWidth(2, 40);
@@ -629,7 +629,7 @@ void tst_QGraphicsGridLayout::columnSpacing()
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
QCOMPARE(layout->columnSpacing(0), 0.0);
-
+
layout->setColumnSpacing(0, 20);
view.show();
widget->show();
@@ -658,7 +658,7 @@ void tst_QGraphicsGridLayout::columnStretchFactor()
populateLayout(layout, 3, 2);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
-
+
layout->setColumnStretchFactor(0, 1);
layout->setColumnStretchFactor(1, 2);
layout->setColumnStretchFactor(2, 3);
@@ -744,7 +744,7 @@ void tst_QGraphicsGridLayout::contentsMargins()
scene.addItem(widget);
widget->setLayout(layout);
layout->addItem(sublayout,0, 1);
-
+
qreal left, top, right, bottom;
// sublayouts have 0 margin
sublayout->getContentsMargins(&left, &top, &right, &bottom);
@@ -753,7 +753,7 @@ void tst_QGraphicsGridLayout::contentsMargins()
QCOMPARE(right, 0.0);
QCOMPARE(bottom, 0.0);
- // top level layouts have style dependent margins.
+ // top level layouts have style dependent margins.
// we'll just check if its different from 0. (applies to all our styles)
layout->getContentsMargins(&left, &top, &right, &bottom);
QVERIFY(left >= 0.0);
@@ -774,7 +774,7 @@ void tst_QGraphicsGridLayout::itemAt()
scene.addItem(widget);
widget->setLayout(layout);
populateLayoutWithSpansAndHoles(layout);
-
+
//itemAt(int row, int column)
QVERIFY( layout->itemAt(0,0));
QVERIFY( layout->itemAt(0,1));
@@ -877,7 +877,7 @@ void tst_QGraphicsGridLayout::rowAlignment()
QCOMPARE(layout->alignment(layout->itemAt(1,0)), Qt::AlignTop);
QCOMPARE(layout->itemAt(1,0)->geometry(), QRectF(0, 101, 50, 50));
QCOMPARE(layout->rowAlignment(1), Qt::AlignVCenter);
- QCOMPARE(layout->itemAt(1,1)->geometry(), QRectF(101, 126, 50, 50));
+ QCOMPARE(layout->itemAt(1,1)->geometry(), QRectF(101, 126, 50, 50));
QCOMPARE(layout->alignment(layout->itemAt(2,0)), Qt::AlignHCenter);
QCOMPARE(layout->itemAt(2,0)->geometry(), QRectF(25, 202, 50, 50));
QCOMPARE(layout->rowAlignment(2), Qt::AlignTop);
@@ -925,7 +925,7 @@ void tst_QGraphicsGridLayout::rowMaximumHeight()
populateLayout(layout, 2, 3);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
-
+
// should at least be a very large number
QVERIFY(layout->rowMaximumHeight(0) >= 10000);
QCOMPARE(layout->rowMaximumHeight(0), layout->rowMaximumHeight(1));
@@ -960,7 +960,7 @@ void tst_QGraphicsGridLayout::rowMinimumHeight()
populateLayout(layout, 2, 3);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
-
+
// should at least be a very large number
QCOMPARE(layout->rowMinimumHeight(0), 0.0);
QCOMPARE(layout->rowMinimumHeight(0), layout->rowMinimumHeight(1));
@@ -995,7 +995,7 @@ void tst_QGraphicsGridLayout::rowPreferredHeight()
populateLayout(layout, 2, 3);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
-
+
// default preferred height ??
QCOMPARE(layout->rowPreferredHeight(0), 0.0);
QCOMPARE(layout->rowPreferredHeight(0), layout->rowPreferredHeight(1));
@@ -1031,7 +1031,7 @@ void tst_QGraphicsGridLayout::setRowFixedHeight()
populateLayout(layout, 2, 3);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
-
+
layout->setRowFixedHeight(0, 20.);
layout->setRowFixedHeight(2, 40.);
@@ -1063,7 +1063,7 @@ void tst_QGraphicsGridLayout::rowSpacing()
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
QCOMPARE(layout->columnSpacing(0), 0.0);
-
+
layout->setColumnSpacing(0, 20);
view.show();
widget->show();
@@ -1093,7 +1093,7 @@ void tst_QGraphicsGridLayout::rowStretchFactor()
populateLayout(layout, 2, 3);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
-
+
layout->setRowStretchFactor(0, 1);
layout->setRowStretchFactor(1, 2);
layout->setRowStretchFactor(2, 3);
@@ -1124,7 +1124,7 @@ void tst_QGraphicsGridLayout::setColumnSpacing()
{
QFETCH(int, column);
QFETCH(qreal, spacing);
-
+
QGraphicsScene scene;
QGraphicsView view(&scene);
QGraphicsWidget *widget = new QGraphicsWidget(0, Qt::Window);
@@ -1178,7 +1178,7 @@ void tst_QGraphicsGridLayout::setRowSpacing()
{
QFETCH(int, row);
QFETCH(qreal, spacing);
-
+
QGraphicsScene scene;
QGraphicsView view(&scene);
QGraphicsWidget *widget = new QGraphicsWidget(0, Qt::Window);
@@ -1232,7 +1232,7 @@ void tst_QGraphicsGridLayout::setSpacing()
void tst_QGraphicsGridLayout::sizeHint_data()
{
-
+
/*
QTest::addColumn<Qt::SizeHint>("which");
QTest::addColumn<QSizeF>("constraint");
@@ -1311,7 +1311,7 @@ void tst_QGraphicsGridLayout::layoutDirection()
RectWidget *w4 = new RectWidget;
w4->setMinimumSize(30, 20);
layout->addItem(w4, 1, 1);
-
+
layout->setAlignment(w2, Qt::AlignRight);
layout->setAlignment(w3, Qt::AlignLeft);
@@ -1328,7 +1328,7 @@ void tst_QGraphicsGridLayout::layoutDirection()
QCOMPARE(w3->geometry().right(), 21.0);
QCOMPARE(w4->geometry().left(), 37.0);
QCOMPARE(w4->geometry().right(), 67.0);
-
+
window->setLayoutDirection(Qt::RightToLeft);
QApplication::processEvents();
QCOMPARE(w1->geometry().left(), 39.0);
@@ -1339,7 +1339,7 @@ void tst_QGraphicsGridLayout::layoutDirection()
QCOMPARE(w3->geometry().right(), 69.0);
QCOMPARE(w4->geometry().left(), 3.0);
QCOMPARE(w4->geometry().right(), 33.0);
-
+
delete window;
}
@@ -1440,7 +1440,7 @@ struct ItemDesc
m_sizes[Qt::MaximumSize] = sz;
return (*this);
}
-
+
ItemDesc &alignment(Qt::Alignment alignment) {
m_align = alignment;
return (*this);
@@ -1509,8 +1509,8 @@ void tst_QGraphicsGridLayout::defaultStretchFactors_data()
)
<< QSizeF()
<< (SizeList()
- << QSizeF(10,10) << QSizeF(10,10) << QSizeF(10,10)
- << QSizeF(10,10) << QSizeF(10,10) << QSizeF(10,10)
+ << QSizeF(10,10) << QSizeF(10,10) << QSizeF(10,10)
+ << QSizeF(10,10) << QSizeF(10,10) << QSizeF(10,10)
);
QTest::newRow("ignoreitem01") << (ItemList()
@@ -1530,8 +1530,8 @@ void tst_QGraphicsGridLayout::defaultStretchFactors_data()
)
<< QSizeF()
<< (SizeList()
- << QSizeF(10,10) << QSizeF(10,10) << QSizeF(10,10)
- << QSizeF(10,10) << QSizeF(10,10) << QSizeF(10,10)
+ << QSizeF(10,10) << QSizeF(10,10) << QSizeF(10,10)
+ << QSizeF(10,10) << QSizeF(10,10) << QSizeF(10,10)
);
QTest::newRow("ignoreitem01_resize120x40") << (ItemList()
@@ -1551,8 +1551,8 @@ void tst_QGraphicsGridLayout::defaultStretchFactors_data()
)
<< QSizeF(120, 40)
<< (SizeList()
- << QSizeF(20,20) << QSizeF(40,20) << QSizeF(60,20)
- << QSizeF(20,20) << QSizeF(40,20) << QSizeF(60,20)
+ << QSizeF(20,20) << QSizeF(40,20) << QSizeF(60,20)
+ << QSizeF(20,20) << QSizeF(40,20) << QSizeF(60,20)
);
QTest::newRow("ignoreitem11_resize120x40") << (ItemList()
@@ -1572,8 +1572,8 @@ void tst_QGraphicsGridLayout::defaultStretchFactors_data()
)
<< QSizeF(120, 60)
<< (SizeList()
- << QSizeF(20,20) << QSizeF(40,20) << QSizeF(60,20)
- << QSizeF(20,40) << QSizeF(40,40) << QSizeF(60,40)
+ << QSizeF(20,20) << QSizeF(40,20) << QSizeF(60,20)
+ << QSizeF(20,40) << QSizeF(40,40) << QSizeF(60,40)
);
QTest::newRow("ignoreitem01_span01_resize70x60") << (ItemList()
@@ -1592,10 +1592,10 @@ void tst_QGraphicsGridLayout::defaultStretchFactors_data()
)
<< QSizeF(70, 60)
<< (SizeList()
- << QSizeF(20,20) << QSizeF(10,60) << QSizeF(40,20)
- << QSizeF(20,40) << QSizeF(40,40)
+ << QSizeF(20,20) << QSizeF(10,60) << QSizeF(40,20)
+ << QSizeF(20,40) << QSizeF(40,40)
);
-
+
QTest::newRow("ignoreitem10_resize40x120") << (ItemList()
<< ItemDesc(0,0)
.preferredSizeHint(QSizeF(10,10))
@@ -1613,11 +1613,11 @@ void tst_QGraphicsGridLayout::defaultStretchFactors_data()
)
<< QSizeF(40, 120)
<< (SizeList()
- << QSizeF(20,20) << QSizeF(20,20)
- << QSizeF(20,40) << QSizeF(20,40)
- << QSizeF(20,60) << QSizeF(20,60)
+ << QSizeF(20,20) << QSizeF(20,20)
+ << QSizeF(20,40) << QSizeF(20,40)
+ << QSizeF(20,60) << QSizeF(20,60)
);
-
+
QTest::newRow("ignoreitem01_span02") << (ItemList()
<< ItemDesc(0,0)
.preferredSizeHint(QSizeF(10,10))
@@ -1634,7 +1634,7 @@ void tst_QGraphicsGridLayout::defaultStretchFactors_data()
)
<< QSizeF()
<< (SizeList()
- << QSizeF(10,10) << QSizeF(0,20) << QSizeF(10,10)
+ << QSizeF(10,10) << QSizeF(0,20) << QSizeF(10,10)
<< QSizeF(10,10) << QSizeF(10,10)
);
@@ -1654,7 +1654,7 @@ void tst_QGraphicsGridLayout::defaultStretchFactors_data()
)
<< QSizeF()
<< (SizeList()
- << QSizeF(10,10) << QSizeF(10,10) << QSizeF(0,20)
+ << QSizeF(10,10) << QSizeF(10,10) << QSizeF(0,20)
<< QSizeF(10,10) << QSizeF(10,10)
);
@@ -1673,7 +1673,7 @@ void tst_QGraphicsGridLayout::defaultStretchFactors_data()
)
<< QSizeF()
<< (SizeList()
- << QSizeF(10,20) << QSizeF(10,10) << QSizeF(0,20)
+ << QSizeF(10,20) << QSizeF(10,10) << QSizeF(0,20)
<< QSizeF(10,10)
);
@@ -1693,7 +1693,7 @@ void tst_QGraphicsGridLayout::defaultStretchFactors_data()
)
<< QSizeF()
<< (SizeList()
- << QSizeF(20,10) << QSizeF(10,10) << QSizeF(10,10)
+ << QSizeF(20,10) << QSizeF(10,10) << QSizeF(10,10)
<< QSizeF(10,10) << QSizeF(10,10)
);
@@ -1713,10 +1713,10 @@ void tst_QGraphicsGridLayout::defaultStretchFactors_data()
)
<< QSizeF()
<< (SizeList()
- << QSizeF(10,10) << QSizeF(20,10) << QSizeF(10,10)
+ << QSizeF(10,10) << QSizeF(20,10) << QSizeF(10,10)
<< QSizeF(10,10) << QSizeF(10,10)
);
-
+
QTest::newRow("ignorecolumn1_resize70x60") << (ItemList()
<< ItemDesc(0,0)
.preferredSizeHint(QSizeF(10,10))
@@ -1735,8 +1735,8 @@ void tst_QGraphicsGridLayout::defaultStretchFactors_data()
)
<< QSizeF(70, 60)
<< (SizeList()
- << QSizeF(20,20) << QSizeF(10,20) << QSizeF(40,20)
- << QSizeF(20,40) << QSizeF(10,40) << QSizeF(40,40)
+ << QSizeF(20,20) << QSizeF(10,20) << QSizeF(40,20)
+ << QSizeF(20,40) << QSizeF(10,40) << QSizeF(40,40)
);
QTest::newRow("ignorerow0") << (ItemList()
@@ -1759,7 +1759,7 @@ void tst_QGraphicsGridLayout::defaultStretchFactors_data()
<< QSizeF()
<< (SizeList()
<< QSizeF(10,0) << QSizeF(10,0) << QSizeF(10,0)
- << QSizeF(10,10) << QSizeF(10,10) << QSizeF(10,10)
+ << QSizeF(10,10) << QSizeF(10,10) << QSizeF(10,10)
);
QTest::newRow("ignorerow1") << (ItemList()
@@ -1781,10 +1781,10 @@ void tst_QGraphicsGridLayout::defaultStretchFactors_data()
)
<< QSizeF()
<< (SizeList()
- << QSizeF(10,10) << QSizeF(10,10) << QSizeF(10,10)
+ << QSizeF(10,10) << QSizeF(10,10) << QSizeF(10,10)
<< QSizeF(10,0) << QSizeF(10,0) << QSizeF(10,0)
);
-
+
QTest::newRow("ignorerow0_resize60x50") << (ItemList()
<< ItemDesc(0,0)
.sizePolicy(QSizePolicy::Ignored)
@@ -1805,9 +1805,9 @@ void tst_QGraphicsGridLayout::defaultStretchFactors_data()
<< QSizeF(60, 50)
<< (SizeList()
<< QSizeF(10,10) << QSizeF(20,10) << QSizeF(30,10)
- << QSizeF(10,40) << QSizeF(20,40) << QSizeF(30,40)
+ << QSizeF(10,40) << QSizeF(20,40) << QSizeF(30,40)
);
-
+
}
void tst_QGraphicsGridLayout::defaultStretchFactors()
@@ -1840,13 +1840,13 @@ void tst_QGraphicsGridLayout::defaultStretchFactors()
view.resize(400,300);
if (newSize.isValid())
widget->resize(newSize);
-
+
QApplication::processEvents();
for (i = 0; i < expectedSizes.count(); ++i) {
QSizeF itemSize = layout->itemAt(i)->geometry().size();
QCOMPARE(itemSize, expectedSizes.at(i));
}
-
+
delete widget;
}
@@ -2027,7 +2027,7 @@ void tst_QGraphicsGridLayout::geometries_data()
<< (RectList()
<< QRectF(0, 0, 50,10) << QRectF(0, 10, 10,10)
);
-
+
QTest::newRow("combine_min_sizes") << (ItemList()
<< ItemDesc(0,0)
.minSize(QSizeF(50,10))
@@ -2038,7 +2038,7 @@ void tst_QGraphicsGridLayout::geometries_data()
<< (RectList()
<< QRectF(0, 0, 60,10) << QRectF(0, 10, 60,10)
);
-
+
}
void tst_QGraphicsGridLayout::geometries()
diff --git a/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp b/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
index c5ce1b9..a30e5e5 100644
--- a/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
+++ b/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
@@ -163,19 +163,19 @@ class RectWidget : public QGraphicsWidget
public:
RectWidget(QGraphicsItem *parent = 0, const QBrush &brush = QBrush()) : QGraphicsWidget(parent){ m_brush = brush;}
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
Q_UNUSED(option);
Q_UNUSED(widget);
painter->setBrush(m_brush);
painter->drawRoundRect(rect());
}
-
+
void setSizeHint(Qt::SizeHint which, const QSizeF &size) {
m_sizeHints[which] = size;
updateGeometry();
}
-
+
virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const {
if (m_sizeHints[which].isValid()) {
return m_sizeHints[which];
@@ -283,7 +283,7 @@ void tst_QGraphicsLinearLayout::alignment()
int i;
bool addWidget = true;
for (i = 0; i < sizeof(alignmentsToTest)/sizeof(Qt::Alignment); ++i) {
- QGraphicsLayoutItem *loutItem;
+ QGraphicsLayoutItem *loutItem;
Qt::Alignment align = alignmentsToTest[i];
if (!align && i > 0)
addWidget = false;
@@ -535,7 +535,7 @@ void tst_QGraphicsLinearLayout::insertItem()
QSizeF oldSizeHint = layout.sizeHint(Qt::PreferredSize, QSizeF());
layout.insertItem(insertItemAt, item);
QCOMPARE(layout.count(), itemCount + layoutCount + 1);
-
+
if (insertItemAt >= 0 && (itemCount + layoutCount >= 0)) {
QCOMPARE(layout.itemAt(itemCount + layoutCount), item);
}
@@ -697,7 +697,7 @@ void tst_QGraphicsLinearLayout::orientation_data()
void tst_QGraphicsLinearLayout::orientation()
{
QFETCH(Qt::Orientation, orientation);
-
+
QGraphicsScene scene;
QGraphicsView view(&scene);
QGraphicsWidget *widget = new QGraphicsWidget(0, Qt::Window);
@@ -723,7 +723,7 @@ void tst_QGraphicsLinearLayout::orientation()
qreal pos;
if (initialOrientation == Qt::Horizontal)
pos = item->pos().x();
- else
+ else
pos = item->pos().y();
positions.append(pos);
@@ -738,7 +738,7 @@ void tst_QGraphicsLinearLayout::orientation()
QGraphicsWidget *item = static_cast<QGraphicsWidget*>(layout.itemAt(i));
if (initialOrientation == Qt::Horizontal)
QCOMPARE(item->pos().y(), positions.at(i));
- else
+ else
QCOMPARE(item->pos().x(), positions.at(i));
}
@@ -887,7 +887,7 @@ void tst_QGraphicsLinearLayout::setSpacing_data()
void tst_QGraphicsLinearLayout::setSpacing()
{
QFETCH(qreal, spacing);
-
+
QGraphicsScene scene;
QGraphicsView view(&scene);
QGraphicsWidget *widget = new QGraphicsWidget(0, Qt::Window);
@@ -999,7 +999,7 @@ void tst_QGraphicsLinearLayout::itemSpacing()
/**
* The stretch factors are not applied linearly, but they are used together with both the preferred size, maximum size to form the
* internal effective stretch factor.
- * There is only need to apply stretch factors if the size of the layout is different than the layouts preferred size.
+ * There is only need to apply stretch factors if the size of the layout is different than the layouts preferred size.
* (If the size of the layout is the preferred size, then all items should get their preferred sizes.
* However, imagine this use case:
* Layout
@@ -1012,7 +1012,7 @@ void tst_QGraphicsLinearLayout::itemSpacing()
* layout->resize(120, h)
*
* In QLayout, C would become 50, B would become 50 and A would get 20. When scaling a layout this would give a jerky feeling, since
- * the item with the highest stretch factor will first resize. When that has reached its maximum the next candidate for stretch will
+ * the item with the highest stretch factor will first resize. When that has reached its maximum the next candidate for stretch will
* resize, and finally, item with the lowest stretch factor will resize.
* In QGraphicsLinearLayout we try to scale all items so that they all reach their maximum at the same time. This means that
* their relative sizes are not proportional to their stretch factors.
@@ -1064,7 +1064,7 @@ void tst_QGraphicsLinearLayout::setStretchFactor()
view.show();
widget->show();
-
+
qreal firstStretch = -1;
qreal firstExtent = -1.;
qreal sumExtent = 0;
@@ -1078,7 +1078,7 @@ void tst_QGraphicsLinearLayout::setStretchFactor()
QCOMPARE(extent, firstExtent);
else if (stretch > firstStretch)
QVERIFY(extent > firstExtent);
- else
+ else
QVERIFY(extent < firstExtent);
} else {
firstStretch = (qreal)stretch;
@@ -1087,7 +1087,7 @@ void tst_QGraphicsLinearLayout::setStretchFactor()
sumExtent+= extent;
}
QCOMPARE(sumExtent, totalSize);
-
+
delete widget;
}
@@ -1172,7 +1172,7 @@ void tst_QGraphicsLinearLayout::defaultStretchFactors()
QSizePolicy sp = item->sizePolicy();
if (orientation == Qt::Horizontal)
sp.setHorizontalPolicy(QSizePolicy::Policy(sp.horizontalPolicy() | QSizePolicy::IgnoreFlag));
- else
+ else
sp.setVerticalPolicy(QSizePolicy::Policy(sp.verticalPolicy() | QSizePolicy::IgnoreFlag));
item->setSizePolicy(sp);
}
@@ -1185,7 +1185,7 @@ void tst_QGraphicsLinearLayout::defaultStretchFactors()
view.resize(400,300);
if (newSize.isValid())
widget->resize(newSize);
-
+
QApplication::processEvents();
for (i = 0; i < count; ++i) {
QSizeF itemSize = layout->itemAt(i)->geometry().size();
@@ -1194,7 +1194,7 @@ void tst_QGraphicsLinearLayout::defaultStretchFactors()
if (i < expectedSizes.count())
QCOMPARE(itemSize.width(), qreal(expectedSizes.at(i)));
}
-
+
delete widget;
}
@@ -1259,7 +1259,7 @@ void tst_QGraphicsLinearLayout::updateGeometry()
layout->setContentsMargins(0, 0, 0, 0);
QCOMPARE(w1->parentLayoutItem(), static_cast<QGraphicsLayoutItem*>(layout));
QCOMPARE(layout->parentLayoutItem(), static_cast<QGraphicsLayoutItem*>(window));
-
+
view.show();
QApplication::processEvents();
QCOMPARE(window->size().toSize(), QSize(100, 50));
@@ -1288,7 +1288,7 @@ void tst_QGraphicsLinearLayout::updateGeometry()
QApplication::processEvents();
w1->setMinimumSize(120, 60);
QApplication::processEvents();
- QCOMPARE(window->size().toSize(), QSize(124, 64));
+ QCOMPARE(window->size().toSize(), QSize(124, 64));
}
{
@@ -1346,7 +1346,7 @@ void tst_QGraphicsLinearLayout::layoutDirection()
w2->setPreferredSize(20, 20);
w2->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
layout->addItem(w2);
-
+
scene.addItem(window);
window->setLayout(layout);
view.show();
@@ -1364,7 +1364,7 @@ void tst_QGraphicsLinearLayout::layoutDirection()
QCOMPARE(w1->geometry().left(), 29.0);
QCOMPARE(w2->geometry().right(), 23.0);
QCOMPARE(w2->geometry().left(), 3.0);
-
+
delete window;
}