summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/widgets/qcombobox
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2012-10-13 19:15:17 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-16 10:47:41 +0200
commit8f79ab354956119810490a18a1471141025a6db2 (patch)
tree2b931699b02fb25183eb498d8b83b8894473f90b /tests/auto/widgets/widgets/qcombobox
parentf7241e8cb949ecf2d86fae2a759a8e1fdb148a26 (diff)
Fix QComboBox icon testing
The icons used were always null -- the files used to create them were not present. So 1) add back the files used for the test (qtlogo.png, copied from src/widgets/dialogs/images/qtlogo-64.png, and qtlogoinverted.png, its copy rotated by 180°); 2) use QFINDTESTDATA to get the paths to the files. Change-Id: I26f094079e037116e49e2a95345c2dea7496eecb Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/widgets/widgets/qcombobox')
-rw-r--r--tests/auto/widgets/widgets/qcombobox/qtlogo.pngbin0 -> 2991 bytes
-rw-r--r--tests/auto/widgets/widgets/qcombobox/qtlogoinverted.pngbin0 -> 2827 bytes
-rw-r--r--tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp6
3 files changed, 4 insertions, 2 deletions
diff --git a/tests/auto/widgets/widgets/qcombobox/qtlogo.png b/tests/auto/widgets/widgets/qcombobox/qtlogo.png
new file mode 100644
index 0000000000..4f68e162de
--- /dev/null
+++ b/tests/auto/widgets/widgets/qcombobox/qtlogo.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qcombobox/qtlogoinverted.png b/tests/auto/widgets/widgets/qcombobox/qtlogoinverted.png
new file mode 100644
index 0000000000..61efb2f001
--- /dev/null
+++ b/tests/auto/widgets/widgets/qcombobox/qtlogoinverted.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
index 6dfb362c83..6016a19ff2 100644
--- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
@@ -1282,6 +1282,8 @@ void tst_QComboBox::textpixmapdata_data()
QStringList text;
IconList icon;
VariantList variant;
+ QString qtlogoPath = QFINDTESTDATA("qtlogo.png");
+ QString qtlogoinvertedPath = QFINDTESTDATA("qtlogoinverted.png");
{
text.clear(); icon.clear(); variant.clear();
@@ -1293,7 +1295,7 @@ void tst_QComboBox::textpixmapdata_data()
{
text.clear(); icon.clear(); variant.clear();
text << QString() << QString();
- icon << QIcon(QPixmap("qtlogo.png")) << QIcon(QPixmap("qtlogoinverted.png"));
+ icon << QIcon(QPixmap(qtlogoPath)) << QIcon(QPixmap(qtlogoinvertedPath));
variant << QVariant() << QVariant();
QTest::newRow("just icons") << text << icon << variant;
}
@@ -1307,7 +1309,7 @@ void tst_QComboBox::textpixmapdata_data()
{
text.clear(); icon.clear(); variant.clear();
text << "foo" << "bar";
- icon << QIcon(QPixmap("qtlogo.png")) << QIcon(QPixmap("qtlogoinverted.png"));
+ icon << QIcon(QPixmap(qtlogoPath)) << QIcon(QPixmap(qtlogoinvertedPath));
variant << 12 << "bingo";
QTest::newRow("text, icons and user data") << text << icon << variant;
}