QML虚拟键盘控制弹出隐藏

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")
    }

}

猜你喜欢

转载自blog.csdn.net/cqltbe131421/article/details/85232602
今日推荐