-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running example on Windows #1
Comments
Have you figured this out yet? I'm having the same issue with getting this to work. Thank you, |
Sorry for the late. I got a response from another forum but it is in french. Hope you will find answer to your question. |
Thank you, I was able to get it to run following the final advice by Amnell, but I run into the error that "InputEngine is not defined" every time I press a key. I don't suppose you ran into that error too? |
No I did not :( The only problem I had was syntax error by QTCreator that complains about the not finding some import but while running the executable it was OK. Amnell has notice it too. |
@smelmo I also get "InputEngine is not defined". I had to edit the code to "import QtQuick.VirtualKeyboard 1.0" rather than "import VirtualKeyboard 1.0" everywhere. The keyboard now renders on the screen and I can click buttons, but I get the same error message as you. It seems like this is a type from the enterprise version. I hope I am mistaken, as was hoping to find a starting point to use without getting an enterprise license. @purell since you did not see this error, and presumeable were able to receive keyboard input to your app, can you please confirm which version of QtCreator you are using? @githubuser0xFFFF can you please confirm whether this project requires the InputEngine QML type from the enterprise version to function? I appreciate you sharing the work. Thanks. |
I'm using QTCreator 3.4.2. You do not need the enterprise module "QtQuick.VirtualKeyboard 1.0". Take a look in the file VirtualKeyboadInputContext.cpp, the InputEngine is declared here and implemented in DeclarativeInputEngine.h/cpp : VirtualKeyboardInputContext::VirtualKeyboardInputContext() : It's too bad, I had a complete example that works with this keyboard, but I deleted because I built by myself a new virtual keyboard and it works differently. I took a look in my backup, but it is not there :( |
Thank you, I see what you mean regarding the InputEngine being declared as a singleton. But I must be doing something incorrectly or missing something as that singleton value is not available to my Qml at runtime. Here is what I have done so far. Perhaps someone can tell me what I am doing wrong. I will happily update and provide some clear instructions for those who may have similar problems once I have it working.. From a clean clone I do the following:
Apply these changes (the make install puts the Qml under the QtQuick folder, so the out of the box import statements did not work for me):
This installed the shared lib to Now create a simple QtQuick project (I'm using Qt 5.5) Here is my .pro
Here is my main.cpp
I tried all sorts of variations when setting QT_IM_MODULE (e.g. qtvirtualkeyboard, virtualkeyboard, VirtualKeyboard) And my main.qml
Running this example, I see the virtual keyboard but when I click on buttons I get the following errors:
Am I doing something obviously wrong? If it was working for you, do you see something that I am missing or have incorrect? Thanks, |
I just cloned the project from github and did the following steps to run the example:
I'm using Qt 5.4.1 on Windows with MinGW |
Hello. Thanks for your reply. I've just try your steps. It's work on QT 5.4.1, but didn't on QT 5.5 (module didn't load) Maybe related to this issue ? https://bugreports.qt.io/browse/QTBUG-47255 Any advices ? EDIT1: build is not the problem, even build with QT 5.5, when path is set to QT 5.4.1 (with make install done on QT 5.4.1) it works EDIT2: By replacing "import VirtualKeyboard 1.0" by "import QtQuick.VirtualKeyboard 1.0", application launch with QT 5.5, but Keyboard did not show. Error : file:///D:/Qt/5.5/mingw492_32/qml/QtQuick/VirtualKeyboard/InputPanel.qml:49: ReferenceError: InputEngine is not defined |
This is strange. That means, something has changed from Qt 5.4.1 to Qt 5.5. If have not installed Qt 5.5 and can not fix this issue yet - sorry |
Hi guys, I've tested this with Qt 5.5 and 5.2.0. If you replace "import VirtualKeyboard 1.0" with "import QtQuick.VirtualKeyboard 1.0" you must be sure to put qml files in the right directory relative to import path "QtQuick/VirtualKeyboard" and modifiy a line in
As you can see, I've added "QtQuick" in the uri. With this changes it works fine. Any change you make to uri or version, you have to be sure to change:
QT_IM_MODULE environment variable must have the same value found in
Here the value is "qtvirtualkeyboard". You can change it, but QT_IM_MODULE must match it. When the app start up you should see a message in the log: If this doesn't happen, maybe the app cannot load the InputMethod plugin. Make sure the library is in the right path. In my system (linux) I figured out the right path with the command
This is my output:
Every match of So, if you don't get a |
Hi Alessandro, thak you for sharing your valuable tips. I will test it as soon as I have Qt 5.5 installed. |
Hi,
to
then the plugin will be successful loaded. At the moment i have no time to search further for the problem but maybe my previous research helped. |
Hi guys, I found the solution to this problem that worked for me: fcitx/fcitx-qt5#6 Try to change:
to
I've also moved plugin to app's directory, and it also works if platforminputcontexts directory is created as alessandro-pezzato said. I've tested this with Qt 5.3, 5.4.2, 5.5 |
Great, thank you. Could you please create a pull request to merge these changes? |
Done. |
I merged your request - thank you. |
Hi, I cross compiled QT 5.5.1 and QtFreeVirtualKeyboard for Raspberry PI 2. I copied manually the .qml files for /usr/local/qt5pi/qml/QtQuick/VirtualKeyboard and libVirtualKeyboard.so for /usr/local/qt5pi/plugins/platforminputcontexts/ |
hi, i am completely new to QT or rather even QNX. Please guide me on the same. and sorry if have missed something. thanks |
Hi, If I use "import QtQuick.VirtualKeyboard 1.0" in InputPanel.qml, Using "import VirtualKeyboard 1.0" fixed the problem and I can run application.
qrc:///qmlplayer2.qml:574 Type InputPanel unavailable If the suggestion is to import VirtualKeyboard without QtQuick prefix, should we also change installation path for qml files, should they be copied to qml/VirtualKeyboard instead of qml/QtQuick/VirtualKeyboard (as defined in Makefile, rule install_deployment)? |
Hi, firstly I buildout successfully
open virtualkeyboard.pro,you will see
if you add this code and you will see this output:(this is my output:)
so ,you known two folder.
at this time you can retry execute virtualkeyboardqmldemo |
Hi,
I'm really interested to use your keyboard on Linux and Windows. First thank you so much to share your work.
But I'm not able to get it work under Windows first.
1 - First I build the src project. This produced an VirtualKeyboard.dll.
2 - I copy those file to this folders C:\Qt\5.4\msvc2013\plugins\platforminputcontexts\VirtualKeyboard
- FontAwesome.otf
- InputPanel.qml
- KeyButton.qml
- KeyPopup.qml
- qmldir
- VirtualKeyboard.dll
- VirtualKeyboard.pdb
3 - Now I open the example project and run it.
I'm always getting error about the keyboard module not found.
I have also tried putting all those file inside this directory \examples\qmlapp\VirtualKeyboard. But same problem :(
What is exactly the correct structure to use this plugin ?
Best regards,
The text was updated successfully, but these errors were encountered: