Is it possible to write a custom keyboard driver without using Qt's plugin system?
-
Qt version: Qt for embedded 4.8.6
Accoriding to Qt for Embedded Linux Character Input I have used the "LinuxInput" keyboard driver in my embedded device by setting the QWS_KEYBOARD environment variable:
export QWS_KEYBOARD="LinuxInput:/dev/input/event0"
Now I would like to create my own input driver and register it but I don't want to touch the Qt directory itself to register my plugins. I would also prefer a solution where I don't have to build a separate library with its own project file.
Is it somehow possible to simply inherit from QWSKeyboardHandler and QKbdDriverPlugin and register this code so that Qt can find/load my driver? I would like to place all my code within my application project. I'm afraid that this might not be possible according to How to Create Qt Plugins but maybe that's just because it is usually done like this to be write "portable" plugins?
-
Hi,
From memory and IIRC, Qt's plugin loader will look in several places between the application folder and the installation folder, thus I guess you should be able to get it working.
Otherwise, you can also use QCoreApplication::addLibaryPath to give add additional folders to search from. However, I don't know whether you have to follow the same folder structure to find a given plugin type. In any case, it's likely a good idea to have it that way.
-
@SGaist Thanks for the input. Qt is looking for plugins at several places, I found someone who tried to explain a few common pitfalls in One hundred reasons my Qt plugin is not working.
But my main question is if Qt is only looking for *.so files? So I thought Qt is looking for already built plugins created by their own *.pro file. Do you suggest to simply try to copy the plugin source files into the directories?
-
@FrozenTarzan said in Is it possible to write a custom keyboard driver without using Qt's plugin system?:
@SGaist Thanks for the input. Qt is looking for plugins at several places, I found someone who tried to explain a few common pitfalls in One hundred reasons my Qt plugin is not working.
But my main question is if Qt is only looking for *.so files? So I thought Qt is looking for already built plugins created by their own *.pro file. Do you suggest to simply try to copy the plugin source files into the directories?
No, never did I. You have to build the plugin. What I was saying is that you should not need to put it in your Qt installation plugin folders.