aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quickcontrols/font/data/resolve.qml
blob: 4e82309dea8f8dc896ec5149e7d12892a51d5a96 (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
43
44
45
46
47
48
49
50
// Copyright (C) 2022 yeshanshan <yeshanshan@uniontech.com>.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

import QtQuick
import QtQuick.Controls

ApplicationWindow {
    id: window
    property alias control1: control1
    property alias control2: control2
    property alias control2ChildControl: control3
    property alias control4: control4

    font {family: "Helvetica"; pointSize: 10; weight: 10}

    Control {
        id: control1
    }

    function changeFont1(font) {
        control1.font.pointSize = font.pointSize
        window.font.weight = font.weight
    }

    Control {
        id: control2

        Control {
            id: control3
            // The font's resolve mask of control4 should be is 0, the
            // controls3's font is same thing. because control3's font
            // resolve mask is 0 also, so the font's all value equal to
            // the parent font values.
            font: control4.font
        }
    }

    Control {
        font.pointSize: 10

        Control {
            id: control4
        }
    }

    function changeFont2(font) {
        control2.font.pointSize = font.pointSize
        control2.font.weight = font.weight
    }
}