Rendering parts of svg-file in QML
-
Hi,
I am trying to draw parts of an svg-file in QML. The file is svg-cards.svg and can be obtained from "here":http://svg-cards.sourceforge.net/
The cards are inside an SVG-group but when I try to use a single cards in qml image-element like this
@
Image{
sourceSize.width: parent.width
sourceSize.height: parent.height
source: "svg-cards.svg#black_joker"
}@It shows the whole SVG-file with all the cards in it. Is it even possible to use the SVG-files like this in QML. I know that I can do this in Qt with QGraphicsSvgItem.
-
Hello,
AFAIK you can't do this with Image element. You should subclass "QDeclarativeItem":http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeitem.html to provide your custom QML element.