Kstars

KSComboBox.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 
7 ComboBox {
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-2022 The KDE developers.
Generated on Fri Aug 12 2022 04:00:54 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.