ReviewDelegate.qml Example File
places/views/ReviewDelegate.qml
import QtQuick 2.5
import QtLocation 5.6
import QtQuick.Controls 1.4
Item {
id: root
signal showReview()
width: parent.width
height: icon.height + 8
Image {
id: icon
width: 64
height: 64
anchors.verticalCenter: root.verticalCenter
anchors.left: root.left
anchors.leftMargin: 4
source: model.supplier.icon.url(Qt.size(64, 64), Icon.List)
fillMode: Image.PreserveAspectFit
}
Label {
anchors.top: icon.top
anchors.topMargin: 4
anchors.left: icon.right
anchors.leftMargin: 4
anchors.right: root.right
anchors.rightMargin: 4
text: model.title
font.bold: true
wrapMode: Text.WordWrap
elide: Text.ElideRight
maximumLineCount: 2
}
RatingView {
anchors.bottom: icon.bottom
anchors.bottomMargin: 4
anchors.left: icon.right
anchors.leftMargin: 4
anchors.right: root.right
anchors.rightMargin: 4
rating: model.rating
size: 16
}
MouseArea {
anchors.fill: parent
onClicked: showReview()
}
}