SVG not supported?

2,665 views
Skip to first unread message

Harri Pasanen

unread,
Feb 23, 2012, 5:08:55 AM2/23/12
to android-qt
I've included QtSVG lib, but still at run time I get:

QML Image: Error decoding: qrc:/icons/erase.svg: Unsupported


It's not that big a deal for me as I can change it to png, but
I suppose it would be nice to have SVG support in some cases.


Harri

Koying

unread,
Feb 23, 2012, 11:30:25 AM2/23/12
to andro...@googlegroups.com
There is one specific case in QML (not specifically for android) where SVG is not supported as an input, but I can't remember which.

Other than that, SVG is working fine in Android.

Harri Pasanen

unread,
Feb 23, 2012, 11:39:08 AM2/23/12
to andro...@googlegroups.com

Well, for me:

Image {
source: "qrc:/icons/erase.png"
}

works, but

Image {
source: "qrc:/icons/erase.svg"
}

does not work on Android. Both work in simulator or N9/Meego.

Harri

Enrico Miglino

unread,
Feb 23, 2012, 11:43:35 AM2/23/12
to andro...@googlegroups.com
Hi,

just a clarification. You mean that works on N9/harmattan physical device (and it's obvious) or harmattan simulator of Android simulator ?

If it works on android simulator - it is a concern of mine too - then the problem maybe that some qt libraries are not installed on the android device...

Enrico

Harri Pasanen

unread,
Feb 23, 2012, 12:02:10 PM2/23/12
to andro...@googlegroups.com
No, I meant N9 physical phone, and Qt Simulator (neither obviously
using Necessitas).

On Android I've only tested on Nexus One physical phone.


On 02/23/2012 05:43 PM, Enrico Miglino wrote:
> Hi,
>
> just a clarification. You mean that works on N9/harmattan physical
> device (and it's obvious) or harmattan simulator of Android simulator ?
>
> If it works on android simulator - it is a concern of mine too - then
> the problem maybe that some qt libraries are not installed on the
> android device...
>
> Enrico
>
> On 23 February 2012 17:39, Harri Pasanen <ha...@mpaja.com

Koying

unread,
Feb 23, 2012, 1:41:50 PM2/23/12
to andro...@googlegroups.com
Did you include QtSvg in the list of Qt libs dependencies of your project?

Harri Pasanen

unread,
Feb 23, 2012, 2:38:06 PM2/23/12
to andro...@googlegroups.com
On 02/23/2012 07:41 PM, Koying wrote:
> Did you include QtSvg in the list of Qt libs dependencies of your project?

yes I did. I'll need to check if it got deployed though.

Harri

Harri Pasanen

unread,
Feb 23, 2012, 3:59:31 PM2/23/12
to andro...@googlegroups.com
On 02/23/2012 07:41 PM, Koying wrote:
> Did you include QtSvg in the list of Qt libs dependencies of your project?


The QtSvg library is checked.


Everything got deployed, but it doesn't work.


lib/libQtSvg.so -> /data/local/qt/lib/libQtSvg.so


plugins/imageformats/libqsvg.so ->
/data/local/qt/plugins/imageformats/libqsvg.so


But I still get:

QML Image: Error decoding: qrc:/icons/erase.svg: Unsupported image format


Btw. Another small glitch I noticed is that QML Page element does not
seem to
respect anchors in layout. As setting y property works, I can go around it.


The show stopper for me is the virtual keyboard.
It pops up, but I can't get rid of it.


I tried TextField.platformCloseSoftwareInputPanel() to close it
"manually", but
that does not seem to exist.


Harri

Koying

unread,
Feb 23, 2012, 6:16:16 PM2/23/12
to andro...@googlegroups.com
Stupid question, but you did try with different svg's, right?

I'm most often using Nokia's icons for toolbars, etc... (http://www.developer.nokia.com/Resources/Library/Design_and_UX/designing-for-nokia-platforms/Nokia%20Icon%20Toolkit.zip) and I do not have problems...

Calugar George

unread,
Feb 23, 2012, 6:39:42 PM2/23/12
to andro...@googlegroups.com
Hi Koying,
I have the same problem, and i used some SVG from Symbian components.
What was strange, when i compiled the app on main computer (OSX), there was SVG Error. Compiled on Windows computer, everything works.
After a while i removed the Ministro, and rebuild the application, (both OSX and Windows) and the error appear again.

@Harri can you pleas try again to run application from Necessitas, but now, by selecting deploy local Qt Libs? ( is to late for me now to try this) and let us know if it working.

Jonny

unread,
Feb 23, 2012, 9:31:55 PM2/23/12
to android-qt
Did you try: QT_PLUGIN += qsvg
http://developer.qt.nokia.com/doc/qt-4.8/qtplugin.html#Q_IMPORT_PLUGIN

If gif or jpg images are not working you may need to add them as well.
This caused me grief deploying to QNX, not sure if its the problem
here or not...
Cheers,
Jon
> >http://www.developer.nokia.com/Resources/Library/Design_and_UX/design...)

Harri Pasanen

unread,
Feb 24, 2012, 6:16:00 AM2/24/12
to andro...@googlegroups.com

Yes, tried with backspace.svg from Nokia Symbian icons, same results, it
doesn't work
for me.

I'd imagine the SVG engine is the same in android-qt as regular Qt?
From the symptoms it does look like the SVG plugin does not get installed.


Harri

Jonny

unread,
Feb 24, 2012, 9:52:58 AM2/24/12
to android-qt
If your using Koying's android components, just add the libqsvg.so
plugin to the package the same way koying adds the component plugins
and give it a whirl... You may need to set the QT_PLUGIN_PATH too...
Cheers,
Jon

On Feb 24, 6:16 am, Harri Pasanen <ha...@mpaja.com> wrote:
> On 02/24/2012 12:16 AM, Koying wrote:
>
> > Stupid question, but you did try with different svg's, right?
>
> > I'm most often using Nokia's icons for toolbars, etc...
> > (http://www.developer.nokia.com/Resources/Library/Design_and_UX/design...)

JamesL

unread,
Feb 11, 2013, 8:13:31 PM2/11/13
to andro...@googlegroups.com, ha...@mpaja.com
I know this is an old topic but I thought I'd reply with an answer that worked for me.  I was also having trouble fully running the flickr components example due to svg's not being supported.  I traced the problem down to not fully loading the plugins dependencies.  The imageformats/libqsvg.so depends on the following Qt libraries. QtSvg, QtXml, QtGui, and QtCore.  If you deploy your project without those libraries checked svg's will not work. 

I was able to determine what dependencies were needed by running the following command on plugins/imageformats/libqsvg.so
arm-linux-androideabi-objdump -p /necessitas/Android/Qt/482/armeabi-v7a/plugins/imageformats/libqsvg.so $f | awk '/ NEEDED / { print $2 }

Marcus Lindblom Sonestedt

unread,
Nov 11, 2013, 5:29:44 AM11/11/13
to andro...@googlegroups.com, ha...@mpaja.com


Den tisdagen den 12:e februari 2013 kl. 02:13:31 UTC+1 skrev JamesL:
I know this is an old topic but I thought I'd reply with an answer that worked for me.  I was also having trouble fully running the flickr components example due to svg's not being supported.  I traced the problem down to not fully loading the plugins dependencies.  The imageformats/libqsvg.so depends on the following Qt libraries. QtSvg, QtXml, QtGui, and QtCore.  If you deploy your project without those libraries checked svg's will not work. 

The QtXml was missing for me too (Qt 5.1.1), causing the same error.

Many thanks for posting the answer!


Reply all
Reply to author
Forward
0 new messages