このコードは、2 つの入力テキスト ボックスを作成します。
import QtQuick 1.0
Column
{
width: 500
height: 200
Text
{
id: userInfoTextA
focus: false
text: "Enter a value from 0 to 10:"
}
TextInput
{
id: userInputA
focus: true
anchors.left : userInfoTextA.right
anchors.leftMargin : 20
validator: IntValidator { bottom:0; top: 20 }
Keys.onReturnPressed:
{
console.log (userInputA.text)
}
}
Text
{
id: userInfoTextB
focus: false
text: "Enter a value from 10 to 20:"
}
TextInput
{
id: userInputB
focus: true
anchors.left : userInfoTextB.right
anchors.leftMargin : 20
validator: IntValidator { bottom:0; top: 20 }
Keys.onReturnPressed:
{
console.log (userInputB.text)
}
}
}
出力ウィンドウでは、デフォルトでフォーカスがテキスト ボックス A に設定されています。次の方法でテキスト ボックス B にフォーカスを移動するにはどうすればよいですか?
1. キーボード
2. マウス
?