In the previous post we have seen, how to create icons which scale properly. Additionally I have added a scalingFactor property to the IconSVG:
//IconSVG.qml
import QtQuick 2.0
import QtQuick.Window 2.2
import QtGraphicalEffects 1.0
Image {
id: root
property alias color: colorOverlay.color
property int size: 24 // default
property real scalingFactor: 1
sourceSize.width: size * scalingFactor
sourceSize.height: size * scalingFactor
ColorOverlay {
id: colorOverlay
anchors.fill: root
source: root
color: "#000000"
}
}
Now let’s see, how this can be useful in a real usecase.