The use of QML drop-down list box

 
 The only constant in the world is the truth that "everything is constantly changing".  - Sri Lanka 
 
ComboBox {
                        id:combox
                        x: structureTab_label2.x+structureTab_label2.width+5
                        y: structureTab_label2.y
                        currentIndex: 0
                        model: ListModel {
                            id: cbItems
                            ListElement { text: "Before the current node"; color: "Yellow" }
                            ListElement { text: "After the current node"; color: "Green" }
                        }
                        width: 160
                        onCurrentIndexChanged: {
                            if(currentIndex==0){
                                console.debug(cbItems.get(currentIndex).text + ", " + cbItems.get(currentIndex).color)
                                console.debug("0")
                            }
                            if(currentIndex==1){
                                 console.debug("1")
                            }
                        }
        }

It Provides a drop-down list functionality. 

Import Statement: import QtQuick.Controls 1.4
Since: Qt 5.1

Inherits ( inheritance ): FocusScope


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325723156&siteId=291194637