lena_pi/LenaPi/NavigationListDelegate.qml
2021-03-13 16:22:47 +01:00

36 lines
826 B
QML

import QtQuick 2.11
import QtQuick.Controls 2.4
import QtGraphicalEffects 1.0
ItemDelegate{
id: container
property var model
property alias imageSource: contentImage.source
padding: 5
onClicked:{
model.onClicked();
}
background: Rectangle{
id: background
implicitWidth: 150
implicitHeight: implicitWidth
radius: model.pIsCircleDelegate ? height/2 : 0
color: "blue"
Image{
id: contentImage
source: model ? model.pImageSource : "qrc:/default_image"
anchors.fill: parent
anchors.margins: 5
fillMode: Image.PreserveAspectCrop
layer.enabled: true
layer.effect: OpacityMask{
maskSource: background
}
}
}
}