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?
Moderatorswrote on 2 Aug 2018, 10:38 last edited by raven-worx 8 Sept 2018, 06:54@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");
wrote on 3 Aug 2018, 00:52 last edited by@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.
wrote on 3 Aug 2018, 07:36 last edited by -
wrote on 3 Aug 2018, 07:36 last edited by small_bird 8 Mar 2018, 08:40
-
@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?
...wrote on 6 Aug 2018, 01:07 last edited by@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
onlywrote on 6 Aug 2018, 07:59 last edited by@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
onlywrote on 6 Aug 2018, 08:09 last edited byThis 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
onlywrote on 8 Aug 2018, 06:09 last edited by small_bird 8 Aug 2018, 06:12@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-styleswrote on 8 Aug 2018, 06:58 last edited by@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:
Moderatorswrote on 8 Aug 2018, 07:17 last edited by raven-worx 8 Sept 2018, 06:56- 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?
wrote on 8 Aug 2018, 07:27 last edited by@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?
Moderatorswrote on 8 Aug 2018, 07:38 last edited by raven-worx 8 Sept 2018, 06:46@small_bird
the name of theqml filefolder containing style.qml -
@small_bird
the name of theqml filefolder containing style.qmlwrote on 8 Aug 2018, 07:41 last edited by@raven-worx
Is this all right? -
@raven-worx
Is this all right?Moderatorswrote on 8 Aug 2018, 07:43 last edited by raven-worx 8 Aug 2018, 07:44@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");
wrote on 8 Aug 2018, 07:50 last edited by@raven-worx
Another problem happens! -
@raven-worx
Another problem happens!@small_bird
read my post (regarding the style setup) again line by line and compare it to your code.
Why do you add the layout path to the engine's import path?!The keyboard styles and layout are different concepts, so don't mix them up.
11/37