summaryrefslogtreecommitdiffstats
path: root/tests/auto/qicon
diff options
context:
space:
mode:
authorJens Bache-Wiig <jbache@trolltech.com>2010-03-04 11:16:16 +0100
committerJens Bache-Wiig <jbache@trolltech.com>2010-03-04 11:19:16 +0100
commit7727a4355876607a1a022ff54e2570dae883f79c (patch)
treec88526dd233bc33136b17d49f8af60946649f2a3 /tests/auto/qicon
parent6f974452ec60ec03fd64bb2d12be6544435ae6be (diff)
Do not crash when loading themed icons statically
We do not officially support static loading of icons. In fact they still crash for simple png cases due to missing X11 resources. But since we lazily create themed icons we can certainly avoid the crash in this case. You will not be able to use fallbacks here though, since we cannot know if a fallback should be used or not in this case. Reviewed-by: ogoffart Task-number: QTBUG-8666
Diffstat (limited to 'tests/auto/qicon')
-rw-r--r--tests/auto/qicon/tst_qicon.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/qicon/tst_qicon.cpp b/tests/auto/qicon/tst_qicon.cpp
index f861e40a0b..fae9cc0d3f 100644
--- a/tests/auto/qicon/tst_qicon.cpp
+++ b/tests/auto/qicon/tst_qicon.cpp
@@ -86,8 +86,14 @@ private slots:
private:
QString oldCurrentDir;
+
+ const static QIcon staticIcon;
};
+// Creating an icon statically should not cause a crash.
+// But we do not officially support this. See QTBUG-8666
+const QIcon tst_QIcon::staticIcon = QIcon::fromTheme("edit-find");
+
void tst_QIcon::init()
{
QString srcdir(QLatin1String(SRCDIR));