| |   |
| 193 | 193 | |
| 194 | 194 | |
| 195 | 195 | //----------------------------- Test class ------------------------------------ |
| class TestGraphicsAnchorLayout : public QObject |
| class tst_QGraphicsAnchorLayout1 : public QObject |
| 197 | 197 | { |
| 198 | 198 | Q_OBJECT |
| 199 | 199 | |
| … | … | |
| 246 | 246 | }; |
| 247 | 247 | |
| 248 | 248 | |
| void TestGraphicsAnchorLayout::testCount() |
| void tst_QGraphicsAnchorLayout1::testCount() |
| 250 | 250 | { |
| 251 | 251 | QGraphicsWidget *widget = new QGraphicsWidget; |
| 252 | 252 | |
| … | … | |
| 270 | 270 | delete widget; |
| 271 | 271 | } |
| 272 | 272 | |
| void TestGraphicsAnchorLayout::testRemoveAt() |
| void tst_QGraphicsAnchorLayout1::testRemoveAt() |
| 274 | 274 | { |
| 275 | 275 | TheAnchorLayout *layout = new TheAnchorLayout(); |
| 276 | 276 | QVERIFY( layout->count() == 0 ); |
| … | … | |
| 298 | 298 | delete widget2; |
| 299 | 299 | } |
| 300 | 300 | |
| void TestGraphicsAnchorLayout::testRemoveItem() |
| void tst_QGraphicsAnchorLayout1::testRemoveItem() |
| 302 | 302 | { |
| 303 | 303 | TheAnchorLayout *layout = new TheAnchorLayout(); |
| 304 | 304 | QCOMPARE( layout->count(), 0 ); |
| … | … | |
| 330 | 330 | delete widget2; |
| 331 | 331 | } |
| 332 | 332 | |
| void TestGraphicsAnchorLayout::testItemAt() |
| void tst_QGraphicsAnchorLayout1::testItemAt() |
| 334 | 334 | { |
| 335 | 335 | QGraphicsWidget *widget = new QGraphicsWidget; |
| 336 | 336 | |
| … | … | |
| 356 | 356 | delete widget; |
| 357 | 357 | } |
| 358 | 358 | |
| void TestGraphicsAnchorLayout::testIndexOf() |
| void tst_QGraphicsAnchorLayout1::testIndexOf() |
| 360 | 360 | { |
| 361 | 361 | QGraphicsWidget *widget = new QGraphicsWidget; |
| 362 | 362 | |
| … | … | |
| 386 | 386 | delete widget; |
| 387 | 387 | } |
| 388 | 388 | |
| void TestGraphicsAnchorLayout::testAddAndRemoveAnchor() |
| void tst_QGraphicsAnchorLayout1::testAddAndRemoveAnchor() |
| 390 | 390 | { |
| 391 | 391 | QGraphicsWidget *widget = new QGraphicsWidget; |
| 392 | 392 | |
| … | … | |
| 461 | 461 | delete widget; |
| 462 | 462 | } |
| 463 | 463 | |
| void TestGraphicsAnchorLayout::testIsValid() |
| void tst_QGraphicsAnchorLayout1::testIsValid() |
| 465 | 465 | { |
| 466 | 466 | // ###: REMOVE ME |
| 467 | 467 | return; |
| … | … | |
| 547 | 547 | } |
| 548 | 548 | } |
| 549 | 549 | |
| void TestGraphicsAnchorLayout::testSpecialCases() |
| void tst_QGraphicsAnchorLayout1::testSpecialCases() |
| 551 | 551 | { |
| 552 | 552 | // One widget, setLayout before defining layouts |
| 553 | 553 | { |
| … | … | |
| 755 | 755 | } |
| 756 | 756 | } |
| 757 | 757 | |
| void TestGraphicsAnchorLayout::testBasicLayout_data() |
| void tst_QGraphicsAnchorLayout1::testBasicLayout_data() |
| 759 | 759 | { |
| 760 | 760 | QTest::addColumn<QSizeF>("size"); |
| 761 | 761 | QTest::addColumn<BasicLayoutTestDataList>("data"); |
| … | … | |
| 1117 | 1117 | } |
| 1118 | 1118 | } |
| 1119 | 1119 | |
| void TestGraphicsAnchorLayout::testNegativeSpacing_data() |
| void tst_QGraphicsAnchorLayout1::testNegativeSpacing_data() |
| 1121 | 1121 | { |
| 1122 | 1122 | QTest::addColumn<QSizeF>("size"); |
| 1123 | 1123 | QTest::addColumn<BasicLayoutTestDataList>("data"); |
| … | … | |
| 1280 | 1280 | } |
| 1281 | 1281 | } |
| 1282 | 1282 | |
| void TestGraphicsAnchorLayout::testMixedSpacing_data() |
| void tst_QGraphicsAnchorLayout1::testMixedSpacing_data() |
| 1284 | 1284 | { |
| 1285 | 1285 | QTest::addColumn<QSizeF>("size"); |
| 1286 | 1286 | QTest::addColumn<BasicLayoutTestDataList>("data"); |
| … | … | |
| 1442 | 1442 | } |
| 1443 | 1443 | } |
| 1444 | 1444 | |
| void TestGraphicsAnchorLayout::testMulti_data() |
| void tst_QGraphicsAnchorLayout1::testMulti_data() |
| 1446 | 1446 | { |
| 1447 | 1447 | QTest::addColumn<QSizeF>("size"); |
| 1448 | 1448 | QTest::addColumn<BasicLayoutTestDataList>("data"); |
| … | … | |
| 1668 | 1668 | return widgets[index]; |
| 1669 | 1669 | } |
| 1670 | 1670 | |
| void TestGraphicsAnchorLayout::testBasicLayout() |
| void tst_QGraphicsAnchorLayout1::testBasicLayout() |
| 1672 | 1672 | { |
| 1673 | 1673 | QFETCH(QSizeF, size); |
| 1674 | 1674 | QFETCH(BasicLayoutTestDataList, data); |
| … | … | |
| 1741 | 1741 | delete widget; |
| 1742 | 1742 | } |
| 1743 | 1743 | |
| void TestGraphicsAnchorLayout::testNegativeSpacing() |
| void tst_QGraphicsAnchorLayout1::testNegativeSpacing() |
| 1745 | 1745 | { |
| 1746 | 1746 | // use the same frame |
| 1747 | 1747 | testBasicLayout(); |
| 1748 | 1748 | } |
| 1749 | 1749 | |
| void TestGraphicsAnchorLayout::testMixedSpacing() |
| void tst_QGraphicsAnchorLayout1::testMixedSpacing() |
| 1751 | 1751 | { |
| 1752 | 1752 | // use the same frame |
| 1753 | 1753 | testBasicLayout(); |
| 1754 | 1754 | } |
| 1755 | 1755 | |
| void TestGraphicsAnchorLayout::testMulti() |
| void tst_QGraphicsAnchorLayout1::testMulti() |
| 1757 | 1757 | { |
| 1758 | 1758 | // use the same frame |
| 1759 | 1759 | testBasicLayout(); |
| 1760 | 1760 | } |
| 1761 | 1761 | |
| void TestGraphicsAnchorLayout::testCenterAnchors_data() |
| void tst_QGraphicsAnchorLayout1::testCenterAnchors_data() |
| 1763 | 1763 | { |
| 1764 | 1764 | QTest::addColumn<QSizeF>("size"); |
| 1765 | 1765 | QTest::addColumn<BasicLayoutTestDataList>("data"); |
| … | … | |
| 2037 | 2037 | |
| 2038 | 2038 | } |
| 2039 | 2039 | |
| void TestGraphicsAnchorLayout::testCenterAnchors() |
| void tst_QGraphicsAnchorLayout1::testCenterAnchors() |
| 2041 | 2041 | { |
| 2042 | 2042 | // use the same frame |
| 2043 | 2043 | testBasicLayout(); |
| 2044 | 2044 | } |
| 2045 | 2045 | |
| void TestGraphicsAnchorLayout::testRemoveCenterAnchor_data() |
| void tst_QGraphicsAnchorLayout1::testRemoveCenterAnchor_data() |
| 2047 | 2047 | { |
| 2048 | 2048 | QTest::addColumn<QSizeF>("size"); |
| 2049 | 2049 | QTest::addColumn<BasicLayoutTestDataList>("data"); |
| … | … | |
| 2168 | 2168 | |
| 2169 | 2169 | } |
| 2170 | 2170 | |
| void TestGraphicsAnchorLayout::testRemoveCenterAnchor() |
| void tst_QGraphicsAnchorLayout1::testRemoveCenterAnchor() |
| 2172 | 2172 | { |
| 2173 | 2173 | QFETCH(QSizeF, size); |
| 2174 | 2174 | QFETCH(BasicLayoutTestDataList, data); |
| … | … | |
| 2231 | 2231 | delete widget; |
| 2232 | 2232 | } |
| 2233 | 2233 | |
| void TestGraphicsAnchorLayout::testSingleSizePolicy_data() |
| void tst_QGraphicsAnchorLayout1::testSingleSizePolicy_data() |
| 2235 | 2235 | { |
| 2236 | 2236 | QTest::addColumn<QSizeF>("size"); |
| 2237 | 2237 | QTest::addColumn<QSizePolicy>("policy"); |
| … | … | |
| 2348 | 2348 | } |
| 2349 | 2349 | } |
| 2350 | 2350 | |
| void TestGraphicsAnchorLayout::testSingleSizePolicy() |
| void tst_QGraphicsAnchorLayout1::testSingleSizePolicy() |
| 2352 | 2352 | { |
| 2353 | 2353 | QFETCH(QSizeF, size); |
| 2354 | 2354 | QFETCH(QSizePolicy, policy); |
| … | … | |
| 2377 | 2377 | Q_UNUSED( childRect ); |
| 2378 | 2378 | } |
| 2379 | 2379 | |
| void TestGraphicsAnchorLayout::testDoubleSizePolicy_data() |
| void tst_QGraphicsAnchorLayout1::testDoubleSizePolicy_data() |
| 2381 | 2381 | { |
| 2382 | 2382 | // tests only horizontal direction |
| 2383 | 2383 | QTest::addColumn<QSizePolicy>("policy1"); |
| … | … | |
| 2501 | 2501 | } |
| 2502 | 2502 | } |
| 2503 | 2503 | |
| void TestGraphicsAnchorLayout::testDoubleSizePolicy() |
| void tst_QGraphicsAnchorLayout1::testDoubleSizePolicy() |
| 2505 | 2505 | { |
| 2506 | 2506 | // ### Size policy is not yet supported |
| 2507 | 2507 | return; |
| … | … | |
| 2544 | 2544 | typedef QMap<int,qreal> SizeHintArray; |
| 2545 | 2545 | Q_DECLARE_METATYPE(SizeHintArray) |
| 2546 | 2546 | |
| void TestGraphicsAnchorLayout::testSizeDistribution_data() |
| void tst_QGraphicsAnchorLayout1::testSizeDistribution_data() |
| 2548 | 2548 | { |
| 2549 | 2549 | // tests only horizontal direction |
| 2550 | 2550 | QTest::addColumn<SizeHintArray>("sizeHints1"); |
| … | … | |
| 2637 | 2637 | |
| 2638 | 2638 | } |
| 2639 | 2639 | |
| void TestGraphicsAnchorLayout::testSizeDistribution() |
| void tst_QGraphicsAnchorLayout1::testSizeDistribution() |
| 2641 | 2641 | { |
| 2642 | 2642 | QFETCH(SizeHintArray, sizeHints1); |
| 2643 | 2643 | QFETCH(SizeHintArray, sizeHints2); |
| … | … | |
| 2679 | 2679 | } |
| 2680 | 2680 | } |
| 2681 | 2681 | |
| void TestGraphicsAnchorLayout::testSizeHint() |
| void tst_QGraphicsAnchorLayout1::testSizeHint() |
| 2683 | 2683 | { |
| 2684 | 2684 | QGraphicsWidget *widget[5]; |
| 2685 | 2685 | |
| … | … | |
| 2816 | 2816 | |
| 2817 | 2817 | #ifdef TEST_COMPLEX_CASES |
| 2818 | 2818 | |
| void TestGraphicsAnchorLayout::testComplexCases_data() |
| void tst_QGraphicsAnchorLayout1::testComplexCases_data() |
| 2820 | 2820 | { |
| 2821 | 2821 | QTest::addColumn<QSizeF>("size"); |
| 2822 | 2822 | QTest::addColumn<BasicLayoutTestDataList>("data"); |
| … | … | |
| 3009 | 3009 | } |
| 3010 | 3010 | } |
| 3011 | 3011 | |
| void TestGraphicsAnchorLayout::testComplexCases() |
| void tst_QGraphicsAnchorLayout1::testComplexCases() |
| 3013 | 3013 | { |
| 3014 | 3014 | QFETCH(QSizeF, size); |
| 3015 | 3015 | QFETCH(BasicLayoutTestDataList, data); |
| … | … | |
| 3090 | 3090 | #endif //TEST_COMPLEX_CASES |
| 3091 | 3091 | |
| 3092 | 3092 | |
| QTEST_MAIN(TestGraphicsAnchorLayout) |
| QTEST_MAIN(tst_QGraphicsAnchorLayout1) |
| 3094 | 3094 | #include "tst_qgraphicsanchorlayout1.moc" |
| 3095 | 3095 | //----------------------------------------------------------------------------- |