EditorialPage.qml Example File
places/views/EditorialPage.qml
import QtQuick 2.5
import QtLocation 5.6
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.2
Item {
id: root
property variant editorial
width: parent.width
height: parent.height
ScrollView {
id: scrollView
flickableItem.interactive: true
anchors.fill: parent
anchors.margins: 15
ColumnLayout {
width: scrollView.width - 30
spacing: 10
Rectangle {
anchors.left: parent.left
anchors.right: parent.right
height: 1
color: "#46a2da"
}
Label {
text: editorial.title
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
wrapMode: Text.WordWrap
textFormat: Text.RichText
}
Label {
text: editorial.text
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
wrapMode: Text.WordWrap
textFormat: Text.RichText
}
Rectangle {
anchors.left: parent.left
anchors.right: parent.right
height: 1
color: "#46a2da"
}
Image {
Layout.alignment: Qt.AlignHCenter
source: editorial.supplier.icon.url(Qt.size(width, height), Icon.List)
}
Label {
text: editorial.supplier.name
Layout.alignment: Qt.AlignHCenter
wrapMode: Text.WordWrap
textFormat: Text.RichText
}
Button {
id: button
text: qsTr("Open url")
Layout.alignment: Qt.AlignHCenter
onClicked: {
Qt.openUrlExternally(editorial.supplier.url)
}
}
}
}
}