diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp | 8 | ||||
-rw-r--r-- | tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp b/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp index c8a9fac..09e2ee2 100644 --- a/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp +++ b/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp @@ -1951,7 +1951,7 @@ void tst_QGraphicsAnchorLayout::simplifiableUnfeasible() if (hasSimplification) QVERIFY(!usedSimplex(l, Qt::Horizontal)); - // Now we make it valid again + // Now we make it valid b->setMinimumWidth(100); l->invalidate(); @@ -1979,9 +1979,9 @@ void tst_QGraphicsAnchorLayout::simplificationVsOrder() QSizeF pref(20, 10); QSizeF max(50, 10); - QGraphicsWidget *a = createItem(min, pref, max); - QGraphicsWidget *b = createItem(min, pref, max); - QGraphicsWidget *c = createItem(min, pref, max); + QGraphicsWidget *a = createItem(min, pref, max, "A"); + QGraphicsWidget *b = createItem(min, pref, max, "B"); + QGraphicsWidget *c = createItem(min, pref, max, "C"); QGraphicsAnchorLayout *l = new QGraphicsAnchorLayout; diff --git a/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp b/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp index 1c7a159..2d6b44b 100644 --- a/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp +++ b/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp @@ -162,10 +162,14 @@ Q_DECLARE_METATYPE(AnchorItemSizeHintList) class TestWidget : public QGraphicsWidget { public: - inline TestWidget(QGraphicsItem *parent = 0) + inline TestWidget(QGraphicsItem *parent = 0, const QString &name = QString()) : QGraphicsWidget(parent) { setContentsMargins( 0,0,0,0 ); + if (name.isEmpty()) + setData(0, QString::fromAscii("w%1").arg(int(this))); + else + setData(0, name); } ~TestWidget() { @@ -1684,7 +1688,7 @@ void tst_QGraphicsAnchorLayout1::testBasicLayout() // Create dummy widgets QList<QGraphicsWidget *> widgets; for (int i = 0; i < widgetCount; ++i) { - TestWidget *w = new TestWidget; + TestWidget *w = new TestWidget(0, QString::fromAscii("W%1").arg(i)); widgets << w; } |