欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

QML虚拟键盘控制弹出隐藏

程序员文章站 2022-03-09 13:32:49
...
import QtQuick 2.0
import QtQuick.Controls 1.3
import QtQuick.Window 2.2
import QtQuick.Controls.Styles 1.2
import "../qml/common"
import QtQuick.VirtualKeyboard 2.1

Rectangle {
    color: "#3A3223"
    id:p_DataBackup
    x:0
    y:0
    width: 1024
    height: 768
    signal closeClickedSignal

    CQLPushButton {
        id: button
        x: 820
        y: 572
        width: 158
        height: 58
        m_text: qsTr("关闭")
        onClickedSignal: {
            console.log("ddddddddd");
            closeClickedSignal();
        }
    }

    InputPanel {
        id: inputPanel
        visible: true
        y:768
        anchors.left: parent.left
        anchors.right: parent.right
        states: State {
            name: "visible"
            when: inputPanel.active
            PropertyChanges {
                target: inputPanel
                y: 768-inputPanel.height
            }
        }
        transitions: Transition {
            from: ""
            to: "visible"
            reversible: true
            ParallelAnimation {
                NumberAnimation {
                    properties: "y"
                    duration: 250
                    easing.type: Easing.InOutQuad
                }
            }
        }
    }

    TextField {
        id: textField
        x: 292
        y: 224
        placeholderText: qsTr("Text Field")
    }

}

相关标签: qml