import QtQuick 2.0 import QtQuick.Dialogs 1.2 import QtQuick.Controls 1.4 import QtQml.Models 2.1 import "qrc:/js/service.js" as Service import "qrc:/js/helper.js" as Helperjs Rectangle{ id:permissionDialog x: mm width: messageColumn.width-5*mm height:root.height/3 Text{ x:0.5*mm y:0.5*mm text: "Contacts" } ListView { id: contactView x:0.5*mm y:5.5*mm width: permissionDialog.width/2-2*mm height: permissionDialog.height-14*mm clip: true spacing: 1 model: contactModel delegate: contactItem } ListModel{id: contactModel} Component{ id:contactItem Rectangle{ id:contactitemRect width:contactView.width height: 5*mm property string contactstatus:"neutral" onContactstatusChanged: {if(contactstatus=="positive"){contactitemRect.color="light green"} else if (contactstatus=="negative"){contactitemRect.color= "light red"} else{contactitemRect.color= "white"}} color: "white" border.color:"grey" Text{ color:"grey" text:contact.screen_name } MouseArea{ anchors.fill: parent onClicked:{ if(contactModel.get(index).contactstatus=="neutral"){ contactModel.set(index,{"contactstatus":"positive"}); contactstatus="positive" } else if (contactModel.get(index).contactstatus=="positive"){ contactModel.set(index,{"contactstatus":"negative"}) contactstatus="negative" } else{contactModel.set(index,{"contactstatus":"neutral"}); contactstatus="neutral"; } }} } } Text{ x:contactView.width+2*mm y:0.5*mm text: "Groups" } ListView { id: groupView x:contactView.width+2*mm y:5.5*mm width: permissionDialog.width/2-2*mm height: permissionDialog.height-14*mm clip: true spacing: 1 model: groupModel delegate: groupItem } ListModel{id: groupModel} Component{ id:groupItem Rectangle{ id:groupitemRect width:groupView.width height: 5*mm property string groupstatus:"neutral" onGroupstatusChanged: {if(groupstatus=="positive"){groupitemRect.color="light green"} else if (groupstatus=="negative"){groupitemRect.color= "light red"} else{groupitemRect.color= "white"}} color: "white" border.color:"grey" Text{ color:"grey" text:group.groupname } MouseArea{ anchors.fill: parent onClicked:{ if(groupModel.get(index).groupstatus=="neutral"){ groupModel.set(index,{"groupstatus":"positive"}); groupstatus="positive"} else if (groupModel.get(index).groupstatus=="positive"){ groupModel.set(index,{"groupstatus":"negative"}); groupstatus="negative"} else{groupModel.set(index,{"groupstatus":"neutral"}) groupstatus="neutral"} }} } } Button{ anchors.horizontalCenter: parent.horizontalCenter anchors.bottom: parent.bottom anchors.bottomMargin:1 text:qsTr("Done") onClicked:{//var group_allow=[];var group_deny=[]; for (var i=0;i