Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 文本字段文本字段不';t QML | QT 5.12上的返回值_Android_Qt_Android Ndk_Qml_Textfield - Fatal编程技术网

Android 文本字段文本字段不';t QML | QT 5.12上的返回值

Android 文本字段文本字段不';t QML | QT 5.12上的返回值,android,qt,android-ndk,qml,textfield,Android,Qt,Android Ndk,Qml,Textfield,我需要帮助。 这是我的代码: TextField { id: passwordIDText placeholderText: "Insert text..." color: "Black" font.bold: true font.pixelSize: 21 anchors.top: parent.top anchors.topMargin: parent.height / 10 anchors.horizontalCenter:

我需要帮助。 这是我的代码:

TextField {
    id: passwordIDText
    placeholderText: "Insert text..."
    color: "Black"
    font.bold: true
    font.pixelSize: 21
    anchors.top: parent.top
    anchors.topMargin: parent.height / 10
    anchors.horizontalCenter: parent.horizontalCenter
    text: "aaa"
}
我使用安卓8(P20)、Qt12.4、安卓NDK20和安卓SDK 28。 所以,当我在android屏幕上单击按钮(我使用20来测试)时,在调试中,为了获取passwordIDText.text,字段是空的,为什么??但如果我将文本设置为“aaa”硬编码,则会得到passwordIDText.text=“aaa”

问题外观文本字段未获取用户插入的值。我在屏幕上的文本字段中插入了123456,然后单击按钮:

MouseArea {
    anchors.fill: parent
    onClicked: {
        var test = passwordIDText.text;
        //passwordIDText.text is empty wtf !??

    }
}
有人也有同样的问题吗?在旧版本的Android上,TextField工作正常

我的配置:


我认为这可能是一个类似的问题,与您需要访问预测文本时未提交预测文本有关

尝试使用
passwordIDText.displayText
而不是
passwordIDText.text

或者,您可以关闭预测性文本输入:


inputMethodHights:Qt.ImhNoPredictiveText

'ImhNoPredictiveText'不能解决我在Qt5.14中遇到的问题。所以我用

inputMethodHints: Qt.ImhSensitiveData
而且效果很好