• 2943阅读
  • 1回复

zhengtianzuo系列-QmlAndroid输入法的隐藏和显示 [复制链接]

上一主题 下一主题
离线zhengtianzuo
 

只看楼主 倒序阅读 楼主  发表于: 2017-11-25
Qt Android下显示和隐藏原生的输入法分别是 Qt.inputMethod.show()和Qt.inputMethod.hide()

```
TextEdit{
            id: textEdit
            text: qsTr("输入一些文字")
            font.family: "microsoft yahei"
            font.pixelSize: dpH*15
            height: dpH*24
            width: parent.width - button.width
            horizontalAlignment: Text.AlignHCenter
            selectByKeyboard: true
            selectByMouse: true
            onVisibleChanged: {
                if (visible){
                    Qt.inputMethod.show()
                }else{
                    Qt.inputMethod.hide()
                }
                isClicked = visible
            }
            onActiveFocusOnPressChanged: {
                if (activeFocus){
                    Qt.inputMethod.show()
                    isClicked = true;
                }
            }
        }
```



需要完整代码请访问 QtAndroidExamples
博客地址: https://blog.csdn.net/zhengtianzuo06
Github: https://github.com/zhengtianzuo
个人产品: https://github.com/zhengtianzuo/Silk
产品网站: http://www.camelstudio.cn
离线big_mouse

只看该作者 1楼 发表于: 2020-04-23
快速回复
限100 字节
 
上一个 下一个