Kstars

KSINDIText.qml
1// SPDX-FileCopyrightText: 2016 Artem Fedoskin <afedoskin3@gmail.com>
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4import QtQuick 2.6
5import QtQuick.Controls 2.0
6import QtQuick.Layouts 1.2
7import "../../constants" 1.0
8import "../../modules"
9
10Column {
12 Layout.fillHeight: true
13 Layout.fillWidth: true
14 spacing: 5 * Num.dp
15 property string propLabel: ""
16
17 KSLabel {
18 text: propLabel
19 }
20
21 Rectangle {
22 id: separator
23 height: Num.dp
24 color: Num.sysPalette.light
25 width: parent.width
26 }
27
28 function addField(isNumber, deviceName, propName, fieldName, propText, writable) {
29 var textItem
30 if(writable) {
31 var textComp = Qt.createComponent("KSINDITextField.qml");
32 textItem = textComp.createObject(this)
33 textItem.deviceName = deviceName
34 textItem.propName = propName
35 textItem.fieldName = fieldName
36 textItem.textField.text = propText
37 textItem.isNumber = isNumber
38 } else {
39 textItem = Qt.createQmlObject('import QtQuick 2.6
40 import QtQuick.Layouts 1.2
41 import "../../constants" 1.0
42 import "../../modules"
43 KSText {
44 }', this)
45 textItem.text = propText
46 }
47 //textItem.anchors.top = separator.bottom
48 }
49}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:19:03 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.