Index: sources/gui/qml/compounds/CheckListView.qml =================================================================== diff -u -rf0cbe4cfc8a5e6e7aa58a8eeaab2d838cf2ff957 -r2ef03b2ce51b4dc507f66e9671953a8e0824bde9 --- sources/gui/qml/compounds/CheckListView.qml (.../CheckListView.qml) (revision f0cbe4cfc8a5e6e7aa58a8eeaab2d838cf2ff957) +++ sources/gui/qml/compounds/CheckListView.qml (.../CheckListView.qml) (revision 2ef03b2ce51b4dc507f66e9671953a8e0824bde9) @@ -1,15 +1,15 @@ /*! * - * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * Copyright (c) 2021-2024 Diality Inc. - All Rights Reserved. * \copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file CheckListView.qml * \author (last) Behrouz NematiPour - * \date (last) 15-Mar-2021 + * \date (last) 01-Aug-2023 * \author (original) Behrouz NematiPour - * \date (original) 15-Mar-2021 + * \date (original) 16-Mar-2021 * */ @@ -47,12 +47,80 @@ } } } - function setItem(vIndex, vEntered) { - let model = _listView.itemAt(vIndex) - if ( vEntered ) model.stepStart = true - else model.stepDone = true + + property int pIndex:-1 + function setClear (vModel) { vModel.stepStart = false ; vModel.stepDone = false } + function setWait (vModel) { vModel.stepStart = true ; vModel.stepDone = false } + function setDone (vModel) { vModel.stepStart = true ; vModel.stepDone = true } + function setItemExt (vIndex, vEntered) { + let goBak = pIndex > vIndex + let goTop = pIndex < vIndex + // if ( pIndex === vIndex && !vEntered ) return + + for ( let i = 0; i < _listView.count; i++ ) { + let model = _listView.itemAt(i) + //DEBUG console.log(i, pIndex, vEntered?"I":"O", vIndex/*, goBak?"B":" ", goTop?"T":" "*/) + if ( i < vIndex ) { + if ( goTop ) { + // Do nothing + } + else { + // setDone(model) + } + } + if ( i > vIndex ) { + setClear(model) + } + if ( i === vIndex ) { + if ( vEntered ) { + setWait(model) + } + else { + if ( goTop ) { + setClear(model) + } + else { + if ( goBak ) { + setClear(model) + } + else { + setDone(model) + } + } + } + } + } + pIndex = vIndex + //DEBUG console.log("-----") } + //DEBUG Test function for investigation + function setItemExt2 (vIndex, vValue, vMode) { + for ( let i = 0; i < _listView.count; i++ ) { + let model = _listView.itemAt(i) + if ( i < vIndex ) { + setDone(model) + continue + } + if ( i > vIndex ) { + setClear(model) + continue + } + if ( vMode === 0 ) // enter + setWait(model) + if ( vMode === 1 ) // in Progress + setWait(model) + if ( vMode === 2 ) // exit + setDone(model) + if ( vMode === 9 ){// depending on value + if ( vValue ) setWait(model) + else setDone(model) + } + + } + + } + width : _root.delegateWidth height : _root.delegateHeight * _root.stepNames.length