equal
deleted
inserted
replaced
74 void cacheKey(); |
74 void cacheKey(); |
75 void detach(); |
75 void detach(); |
76 void svg(); |
76 void svg(); |
77 void addFile(); |
77 void addFile(); |
78 void availableSizes(); |
78 void availableSizes(); |
|
79 void name(); |
79 void streamAvailableSizes_data(); |
80 void streamAvailableSizes_data(); |
80 void streamAvailableSizes(); |
81 void streamAvailableSizes(); |
81 void fromTheme(); |
82 void fromTheme(); |
82 |
83 |
83 void task184901_badCache(); |
84 void task184901_badCache(); |
548 QVERIFY(QIcon(QLatin1String("")).availableSizes().isEmpty()); |
549 QVERIFY(QIcon(QLatin1String("")).availableSizes().isEmpty()); |
549 QVERIFY(QIcon(QLatin1String("non-existing.png")).availableSizes().isEmpty()); |
550 QVERIFY(QIcon(QLatin1String("non-existing.png")).availableSizes().isEmpty()); |
550 } |
551 } |
551 } |
552 } |
552 |
553 |
|
554 void tst_QIcon::name() |
|
555 { |
|
556 { |
|
557 // No name if icon does not come from a theme |
|
558 QIcon icon(":/image.png"); |
|
559 QString name = icon.name(); |
|
560 QVERIFY(name.isEmpty()); |
|
561 } |
|
562 |
|
563 { |
|
564 // Getting the name of an icon coming from a theme should work |
|
565 QString searchPath = QLatin1String(":/icons"); |
|
566 QIcon::setThemeSearchPaths(QStringList() << searchPath); |
|
567 QString themeName("testtheme"); |
|
568 QIcon::setThemeName(themeName); |
|
569 |
|
570 QIcon icon = QIcon::fromTheme("appointment-new"); |
|
571 QString name = icon.name(); |
|
572 QCOMPARE(name, QLatin1String("appointment-new")); |
|
573 } |
|
574 } |
|
575 |
553 void tst_QIcon::streamAvailableSizes_data() |
576 void tst_QIcon::streamAvailableSizes_data() |
554 { |
577 { |
555 QTest::addColumn<QIcon>("icon"); |
578 QTest::addColumn<QIcon>("icon"); |
556 |
579 |
557 QIcon icon; |
580 QIcon icon; |