Rolisteam / RCharacterSheet

submodule for Rolisteam and Rcse about CharacterSheet, sharing code.
6 stars 5 forks source link

Checkbox issues #2

Closed obiwankennedy closed 4 years ago

obiwankennedy commented 6 years ago

Wrong behaviours with checkbox.


CheckBoxField {//Tête 2
    id: _id_29
    text: id_29.value
    textColor:"#ff000000"
    x:865*parent.realscale
    y:600*parent.realscale
    width:40*parent.realscale
    height:40*parent.realscale
    color: "#00000000"
    visible: root.page == 0? true : false
    readOnly: id_29.readOnly
    onTextChanged: {
    id_29.value = text
    }
}

Must be changed to: Don't forget to add import QtQuick.Controls 1.3 at the beginning of the file.

CheckBox {//Tête 2 
    id: _id_29
    checked: id_29.value === "1" ? true : false
    x:825*parent.realscale
    y:600*parent.realscale
    width:40*parent.realscale
    height:40*parent.realscale
    visible: root.page == 0? true : false
    enabled: !id_29.readOnly
    onClicked: {
          if(checked)
               id_29.value = "1"
         else
              id_29.value = "0"
         checked = Qt.binding(function() { return id_29.value === "1" ? true : false })
    }
}