import QtQuick 2.0 import QtQuick.Controls 2.0 import QtQuick.Layouts 1.0 import QtQuick.Controls.Material 2.0 ItemDelegate { id: control implicitHeight: 50 Rectangle { anchors { top: parent.top left: parent.left right: parent.right topMargin: - control.ListView.view.spacing * 0.5 } color: "lightgrey" height: 1 visible: model.index !== 0 } text: model.text contentItem: RowLayout { spacing: 5 Text { Layout.fillWidth: true elide: Text.ElideRight opacity: model.active ? 1:0.5 color: control.Material.foreground text: control.text Behavior on opacity { NumberAnimation {} } } Chip { Layout.fillHeight: true Layout.preferredWidth: model.scroll ? parent.width * 0.15 : 0 visible: model.scroll color: Material.accent opacity: model.active ? 1:0.5 Behavior on color { ColorAnimation {} } text: model.scroll ? qsTr("scrolling"):qsTr("false") } Chip { Layout.fillHeight: true Layout.preferredWidth: parent.width * 0.1 opacity: model.active ? 1:0.5 color: model.color } Chip { Layout.preferredHeight: parent.height Layout.preferredWidth: parent.width * 0.15 color: model.active ? "#4CAF50" : "#F44336" text: model.active ? qsTr(" active "):qsTr("inactive") onClicked: model.active = !model.active } } }