SVG image provider for QML

Posted: 11th September 2011 by siraj in PlexyDesk General
SVG Background rendering with QML

SVG QML item

I’m pleased to announce that Plexydesk now supports accessing  SVG elements from QML. So if you need to access an element with a SVG file, first you should define the size with “sourceSize.width” and  “sourceSize.height” , then provide the source URL as “image://plexydesk_svgprovider/background#center”.  “background” part of the URL is the file name, normally background.svg or background.svgz, and you don’t need to specify the file extension, and “centre” is the element name of which you would like as the source image. When you use this in your QML application, you should write it as “source: “image://plexydesk_svgprovider/background#center”. The final note is that, you should always set the sourceSize.width and sourceSize.height properties of the image item. Plexydesk widget backgrounds now support this feature, as you can see in the screenshot above.

Image {
id: background
sourceSize.width: parent.width - 20
sourceSize.height: parent.height - 20
source: "image://plexydesk_svgprovider/background#center"
x : 10
y : 10
z: -100
asynchronous : true
opacity: 0.35
smooth: true
}

  1. Vadi says:

    Cool! I’d love it if you could have a way to run OS commands from a widget though, the ‘add widgets’ link in there could use a link to open the file browser where some default widgets are stored at.