QML reference to number in Loader
-
Hello,
How to assign reference - not value to Comoponent?
I have simple code where Im using Loader..
I using two components, first is for GPIO variable, and second is for bit's in GPIO variable.
When I click on bit (button) - I need propagate change to global VarGpioPP_OUT.
How to put reference to component in cascade??Thank you
import QtQuick 2.0 Page{ property int varGpioPP_OUT: 4 Column{ Text{ text:"PP Out:"+varGpioPP_OUT} Loader{ sourceComponent: gpioComponent onLoaded: item.gpio = varGpioPP_OUT; } } Component{ id: gpioComponent Row{ id: gpioPPOUT property int gpio onGpioChanged: { for (var i = 0; i < gpioRepeater.count; i++) { gpioRepeater.itemAt(i).item.gpio =gpioPPOUT.gpio; //Need put reference NOT value!, without this gpioDelegat has no value. } } Repeater{ id: gpioRepeater model: 8 Loader { sourceComponent: gpioDelegat onLoaded: { item.gpio = gpioPPOUT.gpio; item.index = index; } } } } } Component{ id: gpioDelegat StandardBTN{ property int gpio property int index width: 80 text: gpio&(0x01<<index) ? 1:0 onClicked: { gpio ^= (0x01<<index); } } } }