У меня есть ListModal следующим образом:
ListModel {
ListElement { icon: "qrc:/icons/gallery/20x20/profile.png"; icon.color: "transparent"; title: "Profile"; source: "qrc:/src/qml/pages/Profile.qml" }
ListElement { icon: "qrc:/icons/gallery/20x20/lock.png"; icon.color: "transparent"; title: "Connect"; source: "qrc:/src/qml/pages/Connect.qml" }
}
Когда мое приложение использует темную тему стиля (т.е. универсальный), мои значки плохо видны.Я бы хотел, чтобы у них был прозрачный цвет, чтобы при смене темы он инвертировался, как этот код:
ListView {
id: listView
focus: true
currentIndex: -1
anchors.fill: parent
delegate: ItemDelegate {
width: parent.width
text: model.title
icon.source: model.icon
icon.height: 20
icon.width: 20
icon.color: "transparent"
highlighted: ListView.isCurrentItem
onClicked: {
listView.currentIndex = index
stackView.push(model.source)
drawer.close()
}
}
Есть ли способ, которым я могу сделать это легко?