7

TextInputqmlでintにanを割り当てるにはどうすればよいですか?

int new_span_seconds

TextInput {
        id: editor
        width: 80
        height: 17
        color: "white"
        font.bold: true; font.pixelSize: 14
        text: "21"
        horizontalAlignment: TextInput.AlignHCenter

    }

    Keys.forwardTo: [ (returnKey), (editor)]

    Item {
        id: returnKey
        Keys.onReturnPressed: new_span_seconds = editor. <<< ?  >>>
        Keys.onEnterPressed:  new_span_seconds = editor. <<< ?  >>>
    }
4

2 に答える 2

8

それは単なるJavascriptの一部です

Keys.onReturnPressed: new_span_seconds = parseInt(editor.text)
于 2011-07-03T11:02:36.977 に答える