set properties from listView

This commit is contained in:
Anika Raemer 2021-03-13 16:38:12 +01:00
parent f2fd2e880a
commit 693078b892
3 changed files with 14 additions and 10 deletions

View file

@ -2,27 +2,29 @@ import QtQuick 2.11
import QtQuick.Controls 2.4
import QtGraphicalEffects 1.0
/**
* @brief Delegate of navigation list.
*
* The delegate is either a circle or a rectangle containing an image.
*/
ItemDelegate{
id: container
property var model
property bool isCircleDelegate: true
property alias imageSource: contentImage.source
padding: 5
onClicked:{
model.onClicked();
}
background: Rectangle{
id: background
implicitWidth: 150
implicitHeight: implicitWidth
radius: model.pIsCircleDelegate ? height/2 : 0
radius: container.isCircleDelegate ? height/2 : 0
color: "blue"
Image{
id: contentImage
source: model ? model.pImageSource : "qrc:/default_image"
source: "qrc:/default_image"
anchors.fill: parent
anchors.margins: 5