Kstars

KSComboBox.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
6
7ComboBox {
8 id: comboBox
9 property string deviceName: ""
10 property string propName: ""
11
12 Connections {
13 target: ClientManagerLite
14 onNewINDISwitch: {
15 if(comboBox.deviceName == deviceName) {
16 if(comboBox.propName == propName) {
17 for(var i = 0; i < model.count; ++i) {
18 if(model.get(i).name == switchName && isOn) {
19 currentIndex = i;
20 break;
21 }
22 }
23 }
24 }
25 }
26 }
27
28 onActivated: {
29 if(index >= 0) {
30 ClientManagerLite.sendNewINDISwitch(comboBox.deviceName, comboBox.propName,index)
31 }
32 }
33
34 model: ListModel {
35
36 }
37}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.