Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Customised virtual keyboard in QT not working
Forum Updated to NodeBB v4.3 + New Features

Customised virtual keyboard in QT not working

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 875 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Shwetha
    wrote on last edited by
    #1

    I tried to increase the key pad size in qt virtual keyboard but its not working by using the below link https://stackoverflow.com/questions/48592098/qt-virtual-keyboard-custom-style.Could you please help me if i have missed anything?

    S 1 Reply Last reply
    0
    • S Shwetha

      I tried to increase the key pad size in qt virtual keyboard but its not working by using the below link https://stackoverflow.com/questions/48592098/qt-virtual-keyboard-custom-style.Could you please help me if i have missed anything?

      S Offline
      S Offline
      sonicss
      wrote on last edited by
      #2

      @Shwetha using the QT_VIRTUALKEYBOARD_LAYOUT_PATH work well in my app.

      I copy the style.qml file and layouts dir(en_US, zh_CN, fallback) in my project. and add put these files in a resources file.

      Change the files in layouts and I can meet my requirment.

      for example ,the keypad width is 3 times of height in the following pic(I change the digitals.qml)

      KeyboardLayout {
          inputMethod: PlainInputMethod {}
          inputMode: InputEngine.InputMode.Numeric
      
          KeyboardColumn {
              Layout.fillWidth: false
              Layout.fillHeight: true
              Layout.alignment: Qt.AlignHCenter
              Layout.preferredWidth: 3 * height    // three times of height
              KeyboardRow {
                          Key {        
                              key: Qt.Key_7        
                              text: "7"        
                          }        
                          Key {        
                              key: Qt.Key_8       
                              text: "8"        
                          }        
                          Key {        
                              key: Qt.Key_9        
                              text: "9"        
                          }        
                          BackspaceKey {}
              
                      }
      
      

      digital.png

      // in mail.cpp file
      /* QT6键盘布局不合适,使用自定义虚拟键盘布局 */
      qputenv("QT_VIRTUALKEYBOARD_LAYOUT_PATH", "qrc:/CalfFeeding/QtQuick/VirtualKeyboard/Styles/black/layouts");

      /* 设置自定义键盘样式 */
      qputenv("QT_VIRTUALKEYBOARD_STYLE", "black");
      
      /* 使用虚拟键盘 */
      qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard"));
      
      1 Reply Last reply
      0
      • S Offline
        S Offline
        Shwetha
        wrote on last edited by
        #3

        Thanks for the reply. I tried above solution but its not working after adding above lines even keyboard is not visible. Let me how to fix this issue.
        20220309_230449.jpg

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved