Commit cfe44c53 authored by Aleksei German's avatar Aleksei German
Browse files

Washing Machine Clickable program settings

parent ad260f0e
cmake_minimum_required (VERSION 3.13)
cmake_minimum_required (VERSION 3.15)
project(washingMachineUI VERSION 0.0.1 LANGUAGES C CXX ASM)
......
......@@ -9,94 +9,89 @@ Item {
QtObject {
id: privateContainer
property int previousIndex: -1
property int activeColorId
property int activeSoilId
property int activeFabricId
property int activeTimeId
property int activeTemperatureId
property int activeTimerId
property int activeWeightId
property int activeSpinId
property int activeWaterId
}
function newItemSelected(index : int) {
//pick correct model
// var element
// var localView
// switch(settingsModelId) {
// case 0:
// localView = colorView
// break;
// case 1:
// localView = soilView
// break;
// case 2:
// localView = fabricView
// break;
// case 3:
// localView = timeView
// break;
// case 4:
// localView = temperatureView
// break;
// case 5:
// localView = timerView
// break;
// case 6:
// localView = weightView
// break;
// case 7:
// localView = spinView
// break;
// case 8:
// localView = waterView
// break;
// default: return;
// }
// switch(settingsModelId) {
// case 0:
// element = colorView.itemAtIndex(index)
// break;
// case 1:
// element = soilView.itemAtIndex(index)
// break;
// case 2:
// element = fabricView.itemAtIndex(index)
// break;
// case 3:
// element = timeView.itemAtIndex(index)
// break;
// case 4:
// element = temperatureView.itemAtIndex(index)
// break;
// case 5:
// element = timerView.itemAtIndex(index)
// break;
// case 6:
// element = weightView.itemAtIndex(index)
// break;
// case 7:
// element = spinView.itemAtIndex(index)
// break;
// case 8:
// element = waterView.itemAtIndex(index)
// break;
// default: return;
// }
// if (privateContainer.previousIndex > -1) {
// //deselect item
// var element = localView.itemAtIndex(privateContainer.previousIndex)
// if (element != null)
// element.selected = false
// }
// var i;
// for (i = 0; i < localView.model.count; i++) {
// var element = localView.itemAtIndex(i)
// if (element != null)
// element.selected = false
// }
// // select indexed item
// localView.itemAtIndex(index).selected = true
// privateContainer.previousIndex = index
var i
switch(settingsModelId) {
case 0:
for (i = 0; i < colorModel.count; i++) {
var element = colorView.itemAtIndex(i)
// if (element !== null)
element.selected = false
}
colorView.itemAtIndex(index).selected = true
break;
case 1:
for (i = 0; i < soilModel.count; i++) {
var element = soilView.itemAtIndex(i)
element.selected = false
}
soilView.itemAtIndex(index).selected = true
break;
case 2:
for (i = 0; i < fabricModel.count; i++) {
var element = fabricView.itemAtIndex(i)
element.selected = false
}
fabricView.itemAtIndex(index).selected = true
break;
case 3:
for (i = 0; i < timeModel.count; i++) {
var element = timeView.itemAtIndex(i)
element.selected = false
}
timeView.itemAtIndex(index).selected = true
break;
case 4:
for (i = 0; i < temperatureModel.count; i++) {
var element = temperatureView.itemAtIndex(i)
element.selected = false
}
temperatureView.itemAtIndex(index).selected = true
break;
case 5:
for (i = 0; i < timerModel.count; i++) {
var element = timerView.itemAtIndex(i)
element.selected = false
}
timerView.itemAtIndex(index).selected = true
break;
case 6:
for (i = 0; i < weightModel.count; i++) {
var element = weightView.itemAtIndex(i)
element.selected = false
}
weightView.itemAtIndex(index).selected = true
break;
case 7:
for (i = 0; i < spinModel.count; i++) {
var element = spinView.itemAtIndex(i)
element.selected = false
}
spinView.itemAtIndex(index).selected = true
break;
case 8:
for (i = 0; i < waterModel.count; i++) {
var element = waterView.itemAtIndex(i)
element.selected = false
}
waterView.itemAtIndex(index).selected = true
break;
default: return;
}
}
Component {
......@@ -108,7 +103,7 @@ Item {
width: 60
height: delegateHeight
property bool selected: false
property bool selected
Text {
id: delegateText
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment