summaryrefslogtreecommitdiffstats
path: root/examples/multimedia/video/recorder/StyleParameter.qml
blob: 4017b47c6cab0cf0760383b448e750dd71d77530 (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
32
33
34
35
36
37
38
39
40
41
42
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

import QtQuick
import QtQuick.Controls

Row {
    id: root
    spacing: Style.intraSpacing

    property alias label: label.text
    property alias model: comboBox.model
    property alias currentIndex: comboBox.currentIndex
    property alias currentValue: comboBox.currentValue
    property bool enabled: true
    signal activated(var currentValue)

    Text {
        id: label
        height: Style.height
        width: Style.widthShort
        horizontalAlignment: Text.AlignRight
        verticalAlignment: Text.AlignVCenter
        color: root.enabled ? "black" : "gray"
        font.pointSize: Style.fontSize
    }

    ComboBox {
        id: comboBox
        height: Style.height
        width: Style.widthLong
        enabled: root.enabled

        displayText: currentText
        textRole: "text"
        valueRole: "value"
        font.pointSize: Style.fontSize

        background: StyleRectangle { anchors.fill: parent }
        onActivated: root.activated(currentValue)
    }
}