summaryrefslogtreecommitdiff
path: root/examples/script/defaultprototypes/code.js
blob: 048e1319dfca0521aed3f67295e54025a6ddd9b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//! [0]
listWidget.addItem("Red");
listWidget.addItem("Blue");
listWidget.addItem("Green");
listWidget.addItem("Cyan");
listWidget.addItem("Yellow");
listWidget.addItem("Purple");
listWidget.addItems(["Orange", "Gray"]);
//! [0]

//! [1]
listWidget.currentItemChanged.connect(
    function(item)
    {
        listWidget.setBackgroundColor(item.text);
    }
);
//! [1]

listWidget.show();