Kstars

KSINDIText.qml
1 // SPDX-FileCopyrightText: 2016 Artem Fedoskin <[email protected]>
2 // SPDX-License-Identifier: GPL-2.0-or-later
3 
4 import QtQuick 2.6
5 import QtQuick.Controls 2.0
6 import QtQuick.Layouts 1.2
7 import "../../constants" 1.0
8 import "../../modules"
9 
10 Column {
11  id: columnTextProp
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-2022 The KDE developers.
Generated on Sat Aug 13 2022 04:01:54 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.