Image: Fix that HiDPI image was not found with QRC alias
authorEike Ziller <eike.ziller@theqtcompany.com>
Wed, 21 Jan 2015 13:32:08 +0000 (14:32 +0100)
committerEike Ziller <eike.ziller@theqtcompany.com>
Fri, 23 Jan 2015 14:09:22 +0000 (15:09 +0100)
When using images in QRC and giving the 1x and 2x image files
respective aliases but without any file extension
(for example 'myimage' and 'myimage@2x'),
then Image would fail to find the 2x variant.

Task-number: QTBUG-44049
Change-Id: I20d0cb2eb48b909775b0ba737b850bc1b6697b35
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
src/quick/items/qquickimagebase.cpp

index a4c4af4..bdd0ef0 100644 (file)
@@ -310,7 +310,7 @@ static QString image2xPath(const QString &path)
 {
     const int dotIndex = path.lastIndexOf(QLatin1Char('.'));
     if (dotIndex == -1)
-        return path;
+        return path + QLatin1String("@2x");
     if (path.contains(QLatin1String("@2x.")))
         return path;