aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmldelegatemodel/data/ImageToggle.qml
blob: fa154b25f3b9f121873627684c3ec80a89f8e26d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import QtQuick 2.0

Item {
    property var isSelected: null
    property string source
    implicitWidth: 16
    implicitHeight: 16

    onSourceChanged: {
      updateImageSource()
    }

    onIsSelectedChanged: {
      updateImageSource()
    }

    function updateImageSource() {
     let result = isSelected ? source + "_selected_dark.png" : source + "_active_dark.png"
    }

}