Qt/QML编程之路:小键盘keyboard(36)

小键盘对于qml应用是经常用到的,在qml里面,就如一个fileDialog也要自己画一样,小键盘keyboard也是要自己画的,对于相应的每个按键的clicked都要一一实现的。

这里有一个示例:

Qt/QML编程之路:小键盘keyboard(36)_第1张图片

代码如下: 

import QtQuick 2.5
import QtQuick.Controls 1.4
import QtQuick.Window 2.0
import QtQuick.Layouts 1.1

ApplicationWindow {
    visible: true
    width: 700
    height: 480
    title: qsTr("Hello World")
    Grid{
         anchors.right:parent.right
         anchors.rightMargin: 60
         anchors.top:parent.top
         anchors.topMargin: 20
         flow:Grid.LeftToRight
         spacing: 0
         width: 360
         height: 400
         clip: true
         Repeater{
             id:numGridRep
             model:["1","2","3","","4","5","6","","7","8","9","",&

你可能感兴趣的:(qt,qml)