User QML Type

The User type identifies a user who contributed a particular Place content item. 更多...

import 语句: import QtLocation 5.15
Since: QtLocation 5.5

特性

详细描述

每个 Place content item has an associated user who contributed the content. This type provides information about that user.

范例

The following example shows how to display information about the user who submitted an editorial:

import QtQuick 2.0
import QtPositioning 5.5
import QtLocation 5.6
EditorialModel {
    id: editorialModel
    batchSize: 3
    place: place
}
ListView {
    model: editorialModel
    delegate: Item {
        anchors.fill: parent
        Column {
            width: parent.width
            clip: true
            Text {
                text: title
                width: parent.width
                wrapMode: Text.WordWrap
                font.pixelSize: 24
            }
            Text {
                text: text
                width: parent.width
                wrapMode: Text.WordWrap
                font.pixelSize: 20
            }
            Row {
                Image {
                    width: 16
                    height: 16
                    source: supplier.icon.url(Qt.size(width, height), Icon.List)
                }
                Text {
                    text: "Provided by " + supplier.name
                    font.pixelSize: 16
                }
            }
            Text {
                text: "Contributed by " + user.name
                font.pixelSize: 16
            }
            Text {
                text: attribution
                font.pixelSize: 8
            }
        }
    }
}
					

另请参阅 ImageModel , ReviewModel ,和 EditorialModel .

特性文档编制

name : string

This property holds the name of a user.

user : QPlaceUser

For details on how to use this property to interface between C++ and QML see " Interfaces between C++ and QML Code ".

userId : string

This property holds the unique identifier of the user.