0
コンテキスト変数が変更されると、コード内でisOnプロパティも変更されますか?QMLプロパティのバインド
property bool isOn: {
if(context === undefined)
return false;
return true
}
コンテキスト変数が変更されると、コード内でisOnプロパティも変更されますか?QMLプロパティのバインド
property bool isOn: {
if(context === undefined)
return false;
return true
}
トリックはそれを試してみるために、次のとおりです。
import QtQuick 2.7
import QtQuick.Controls 2.0
ApplicationWindow {
id: appWindow
width: 500
height: 800
visible: true
property bool isOn: {
if(context === undefined)
return false;
return true
}
property var context
Button {
text: isOn
onClicked: (context ? context = undefined : context = 1)
}
}
ヒント:
はどうもありがとうございました、はい、私はそれを試してみましょう – yonutix