aboutsummaryrefslogtreecommitdiffstats
path: root/src/labs/stylekit/Style.qml
blob: 20163c250b037c7a1e0cafb0749c05e8660b86f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright (C) 2025 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default

import QtQuick
import Qt.labs.StyleKit
import Qt.labs.StyleKit.impl

BaseStyle {
    id: style

    fallbackStyle: FallbackStyle {}

    /* This function is a work-around (called from c++) since we haven't found a way to
     * instantiate a Theme inside the context of a Style from c++ otherwise. Doing so is
     * needed in order to allow custom style properties to be added as children of a
     * Style, and at the same time, be able to access them from within a Theme instance.
     * For this to work, a style with custom properties also needs to set
     * 'pragma ComponentBehavior: Bound'. */
    function createThemeInsideStyle(themeComponent) {
        return themeComponent.createObject(style)
    }
}