IconWidget and Svg's in QML

Onur-Hayri Bakici thehayro at gmail.com
Mon May 9 15:07:24 CEST 2011


Hey guys,

I came across a certain problem when arranging a SvgItem in a row.
If I have code like

Row {
    anchors.fill: parent
    PlasmaWidgets.IconWidget {
        id: iconWidget
        text: "Click me"
    }
    // i *must* combine these
    Item {
        id: closeItem
        PlasmaCore.Svg {
            id: iconSvg
            imagePath: "widgets/configuration-icons"
        }
        PlasmaCore.SvgItem {
            id: closeWidget
            height: 32
            width: 32
            svg: iconSvg
            elementId: "close"
        }
    }
}

If you test this code you will see that the svgItem overlaps with the 
iconWidget. Which shouldn't be.
Is there any way I can load a svg in IconWidget (like in C++) in qml? And also 
is there any way i can fix the code above?

thanks


More information about the Plasma-devel mailing list