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. QML Virtual keyboard, KeyboardLayout, BaseKey BaseKey.qml:193: ReferenceError: keyboard is not defined
Forum Updated to NodeBB v4.3 + New Features

QML Virtual keyboard, KeyboardLayout, BaseKey BaseKey.qml:193: ReferenceError: keyboard is not defined

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 430 Views
  • 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.
  • C Offline
    C Offline
    CubeEd
    wrote on last edited by
    #1

    Hi. I have encounter with referenceError when use KeyboardLayout with Key.
    error BaseKey.qml:193: ReferenceError: keyboard is not defined
    For any help will be thankful.
    code:

    import QtQuick 2.7
    import QtQuick.Layouts 1.3
    import QtQuick.Controls 2.2
    import QtQuick.VirtualKeyboard 2.1
    Item
    {
    
        KeyboardLayout {
    
            keyWeight: 160
    
            KeyboardRow {
                Key {
                    key: Qt.Key_Q
                    text: "q"
                }
                Key {
                    key: Qt.Key_W
                    text: "w"
                    //keyWeight: 200
                }
            }
        }
    
    }
    
    1 Reply Last reply
    0
    • C Offline
      C Offline
      CubeEd
      wrote on last edited by
      #2

      I didn't read carefully documentation and as a result i have this question, what ones should do is :

      1. copy the existing layout files from QTDIR/qtvirtualkeyboard/src/virtualkeyboard/content/layouts/en_GB
      2. adapt to your needs
      3. add the files in a (custom) path (e.g. :/path/to/my/layouts/en_GB) to your qrc
      in the beginning of your main() add:
      qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard"));
      qputenv("QT_VIRTUALKEYBOARD_LAYOUT_PATH", ":/path/to/my/kb/layouts");
      
      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