Hello, I’m using the ComboBox item of QML with more than two Items with a ListModel like that:
ComboBox { id: rateType anchors.horizontalCenter: parent.horizontalCenter width: parent.width*0.9 Component.onCompleted: { if ( models.appointment.lead == null ) { rateType.currentIndex = 0 } else if ( models.appointment.lead.type == 'contact' ) { rateType.currentIndex = 0 } else if ( models.appointment.lead.type == 'brochure' ) { rateType.currentIndex = 1 } else if ( models.appointment.lead.type == 'tentative' ) { rateType.currentIndex = 2 } else if ( models.appointment.lead.type == 'definite' ) { rateType.currentIndex = 3 } } model: ListModel { ListElement { leadType: 'contact' leadText: 'Contact only' } ListElement { leadType: 'brochure' leadText: 'Brochure request' } ListElement { leadType: 'tentative' leadText: 'Tentative lead' } ListElement { leadType: 'definite' leadText: 'Definite lead' } } textRole: "leadText" But the popup menu appearing for select the option contain the elements into a different order than ListModel and when you select one of those the ComboBox select a different one. In such a way that it seems the index are correct but the labels of the popup menu are wrong. Someone hits this error before ? I’m using Qt 5.5 for now. Ciao, Gianluca.
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest