onCheckedChanged vs onCheckStateChanged
-
What is the difference between
onCheckedChangedandonCheckStateChanged? Both yield the same result when I check/uncheck the box.import QtQuick 2.12 import QtQuick.Controls 2.4 import QtQuick.Layouts 1.3 Page { id : somepageid CheckBox { checked: true text: qsTr("Check Me") indicator.width: 15 indicator.height: 15 onCheckedChanged: { console.log(checked) } onCheckStateChanged: { console.log(checked) } } } -
What is the difference between
onCheckedChangedandonCheckStateChanged? Both yield the same result when I check/uncheck the box.import QtQuick 2.12 import QtQuick.Controls 2.4 import QtQuick.Layouts 1.3 Page { id : somepageid CheckBox { checked: true text: qsTr("Check Me") indicator.width: 15 indicator.height: 15 onCheckedChanged: { console.log(checked) } onCheckStateChanged: { console.log(checked) } } }@chilarai said in onCheckedChanged vs onCheckStateChanged:
What is the difference between onCheckedChanged and onCheckStateChanged? Both yield the same result when I check/uncheck the box.
As written in documentation:
checkedis a boolean (https://doc.qt.io/qt-5/qml-qtquick-controls2-abstractbutton.html#checked-prop)checkStateis an enumeration valueQt.Unchecked,Qt.PartiallyCheckedorQt.Checked(https://doc.qt.io/qt-5/qml-qtquick-controls2-checkbox.html#checkState-prop)
-
@chilarai said in onCheckedChanged vs onCheckStateChanged:
What is the difference between onCheckedChanged and onCheckStateChanged? Both yield the same result when I check/uncheck the box.
As written in documentation:
checkedis a boolean (https://doc.qt.io/qt-5/qml-qtquick-controls2-abstractbutton.html#checked-prop)checkStateis an enumeration valueQt.Unchecked,Qt.PartiallyCheckedorQt.Checked(https://doc.qt.io/qt-5/qml-qtquick-controls2-checkbox.html#checkState-prop)
@KroMignon Thanks