How to custom qml virtual keyboard ?
-
Hello, how to custom Qt Quick Virtual Keyboard, that is how to add one button to the qml virtual keyboard?
-
Hello, how to custom Qt Quick Virtual Keyboard, that is how to add one button to the qml virtual keyboard?
@small_bird
https://doc.qt.io/qt-5.11/technical-guide.html#adding-custom-layouts- copy the existing layout files from
QTDIR/qtvirtualkeyboard/src/virtualkeyboard/content/layouts/en_GB
- adapt to your needs
- add the files in a (custom) path (e.g.
:/path/to/my/kb/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");
- copy the existing layout files from
-
@small_bird
https://doc.qt.io/qt-5.11/technical-guide.html#adding-custom-layouts- copy the existing layout files from
QTDIR/qtvirtualkeyboard/src/virtualkeyboard/content/layouts/en_GB
- adapt to your needs
- add the files in a (custom) path (e.g.
:/path/to/my/kb/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");
@raven-worx Yes,I have done like that, however, it shows black rect.
- copy the existing layout files from
-
@raven-worx Yes,I have done like that, however, it shows black rect.
@small_bird
it shows a black rect where?
Where the button should be or where the keyboard should be?Anyway show some code/qrc in order to give proper help.
-
@small_bird
it shows a black rect where?
Where the button should be or where the keyboard should be?Anyway show some code/qrc in order to give proper help.
-
-
@small_bird
any console output?
what is the content ofQT_VIRTUALKEYBOARD_LAYOUT_PATH
?
Did you add an InputPanel element to your application?
... -
@small_bird
any console output?
what is the content ofQT_VIRTUALKEYBOARD_LAYOUT_PATH
?
Did you add an InputPanel element to your application?
...@raven-worx
The QT_VIRTUALKEYBOARD_LAYOUT_PATH is QByteArray(":/layouts/en_GB").
No InputPanel. -
@raven-worx
The QT_VIRTUALKEYBOARD_LAYOUT_PATH is QByteArray(":/layouts/en_GB").
No InputPanel.@small_bird said in How to custom qml virtual keyboard ?:
The QT_VIRTUALKEYBOARD_LAYOUT_PATH is QByteArray(":/layouts/en_GB").
as i stated it should be
:/layouts
only -
@small_bird said in How to custom qml virtual keyboard ?:
The QT_VIRTUALKEYBOARD_LAYOUT_PATH is QByteArray(":/layouts/en_GB").
as i stated it should be
:/layouts
only@raven-worx Thanks a lot! I have made it!
-
@small_bird said in How to custom qml virtual keyboard ?:
The QT_VIRTUALKEYBOARD_LAYOUT_PATH is QByteArray(":/layouts/en_GB").
as i stated it should be
:/layouts
onlyThis post is deleted! -
@small_bird said in How to custom qml virtual keyboard ?:
The QT_VIRTUALKEYBOARD_LAYOUT_PATH is QByteArray(":/layouts/en_GB").
as i stated it should be
:/layouts
only@raven-worx How to change the background color of the keyboard, for example, from black to transparent.
-
@raven-worx How to change the background color of the keyboard, for example, from black to transparent.
@small_bird said in How to custom qml virtual keyboard ?:
How to change the background color of the keyboard, for example, from black to transparent.
did you read the link from my first post at all?
https://doc.qt.io/qt-5.11/technical-guide.html#keyboard-styles -
@small_bird said in How to custom qml virtual keyboard ?:
How to change the background color of the keyboard, for example, from black to transparent.
did you read the link from my first post at all?
https://doc.qt.io/qt-5.11/technical-guide.html#keyboard-styles@raven-worx Yes, I have read that, however, it does not work, this is my shortcut of path:
-
@raven-worx Yes, I have read that, however, it does not work, this is my shortcut of path:
- set the
QT_VIRTUALKEYBOARD_STYLE
to_STYLENAME_
- put the style.qml into your existing qrc (e.g. to the path
:/kbstyles/test.qml
:/kbstyles/QtQuick/VirtualKeyboard/Styles/_STYLENAME_/style.qml
) - add the import path to your QQmlEngine (
engine->addImportPath(":/kbstyles")
)
did you copy the existing (default) virtual keyboard style and made your changes upon it?
- set the
-
- set the
QT_VIRTUALKEYBOARD_STYLE
to_STYLENAME_
- put the style.qml into your existing qrc (e.g. to the path
:/kbstyles/test.qml
:/kbstyles/QtQuick/VirtualKeyboard/Styles/_STYLENAME_/style.qml
) - add the import path to your QQmlEngine (
engine->addImportPath(":/kbstyles")
)
did you copy the existing (default) virtual keyboard style and made your changes upon it?
@raven-worx Yes, I have done that. "set the QT_VIRTUALKEYBOARD_STYLE to test"? What is the meaning? to test.qml file?
- set the
-
@raven-worx Yes, I have done that. "set the QT_VIRTUALKEYBOARD_STYLE to test"? What is the meaning? to test.qml file?
@small_bird
the name of theqml filefolder containing style.qml -
@small_bird
the name of theqml filefolder containing style.qml@raven-worx
Is this all right? -
@raven-worx
Is this all right?@small_bird
you said you read the link didnt you?!
you should set it as a env variable!
qputenv("QT_VIRTUALKEYBOARD_STYLE", "test");
-
@small_bird
you said you read the link didnt you?!
you should set it as a env variable!
qputenv("QT_VIRTUALKEYBOARD_STYLE", "test");
@raven-worx
Another problem happens!