summaryrefslogtreecommitdiff
path: root/src/location/doc/snippets/declarative/content/Cell.qml
blob: e0373c62a1cf7d59e6fad8a34ed498386ad7529f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

import Qt 4.7

Item {
    id: container
    property string action: "no-op"
    signal clicked(string action)

    width: 100; height:30

    Rectangle {
        id: rectangle
        border.color: "white"
        border.width: 2
        anchors.fill: parent // Fill the whole container
    }
    Text {
        id: text
        text: container.action
        color: "black"
        anchors.left: parent.left
        anchors.leftMargin: 5
        anchors.verticalCenter: parent.verticalCenter
    }
    MouseArea {
        anchors.fill: parent // Whole container is clickable
        onClicked: container.clicked(container.action)
    }
}