#include <QtDeclarative/qdeclarativeexpression.h>
#include <QtTest/QSignalSpy>
#include <QtGui/QPainter>
+#include <QtGui/QImageReader>
#include "../../../shared/util.h"
#include "../shared/testhttpserver.h"
<< true << true << "file::2:1: QML Image: Cannot open: " + QUrl::fromLocalFile(SRCDIR "/data/no-such-file-1.png").toString();
QTest::newRow("remote") << SERVER_ADDR "/colors.png" << 120.0 << 120.0 << true << false << true << "";
QTest::newRow("remote redirected") << SERVER_ADDR "/oldcolors.png" << 120.0 << 120.0 << true << false << false << "";
- QTest::newRow("remote svg") << SERVER_ADDR "/heart.svg" << 550.0 << 500.0 << true << false << false << "";
+ if (QImageReader::supportedImageFormats().contains("svg"))
+ QTest::newRow("remote svg") << SERVER_ADDR "/heart.svg" << 550.0 << 500.0 << true << false << false << "";
+
QTest::newRow("remote not found") << SERVER_ADDR "/no-such-file.png" << 0.0 << 0.0 << true
<< false << true << "file::2:1: QML Image: Error downloading " SERVER_ADDR "/no-such-file.png - server replied: Not found";
void tst_qsgimage::svg()
{
+ if (!QImageReader::supportedImageFormats().contains("svg"))
+ QSKIP("svg support not available", SkipAll);
+
QString src = QUrl::fromLocalFile(SRCDIR "/data/heart.svg").toString();
QString componentStr = "import QtQuick 2.0\nImage { source: \"" + src + "\"; sourceSize.width: 300; sourceSize.height: 300 }";
QDeclarativeComponent component(&engine);