[Solved] Substitute of QWSMouseHandler class in QT5.x
-
Since you are trying to play with a Qt plugin, put it in your target Qt's installation plugin path
-
Dear SGaist,
Thanks for your reply.
Now i have set the plugins directory by doing:
@export QT_PLUGIN_PATH=/home/Sid/plugins/generic@and QT's mouse plugin: libqevdevmouseplugin.so
is located in the same directory, but still no qDebug lines are printed. I think control is not reaching to the evdevmouse plugin :( -
set QT_DEBUG_PLUGINS=1 to see what happens with your plugins
-
Dear SGaist,
Thanks for highlighting my mistake actually i did this:@export QT_DEBUG_PLUGIN=1@
instead of this:
@export QT_DEBUG_PLUGINS=1@
So i made PLUGIN to PLUGINS now i am getting lot of thins on screen. Let me check in detail. I will get back to you.
Thanks a lot :)
-
Dear SGaist,
I gave following command to run my application:
@./buttonApp -plugin evdevmouse:/dev/ttyS1@
And i got following output:
@
QFactoryLoader::QFactoryLoader() checking directory path "/home/Sid/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/home/Sid/platforms/libqlinuxfb.so"
Found metadata in lib /home/Sid/platforms/libqlinuxfb.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.2",
"MetaData": {
"Keys": [
"linuxfb"
]
},
"className": "QLinuxFbIntegrationPlugin",
"debug": false,
"version": 328193
}Got keys from plugin meta data ("linuxfb")
QFactoryLoader::QFactoryLoader() looking at "/home/Sid/platforms/libqminimal.so"
Found metadata in lib /home/Sid/platforms/libqminimal.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.2",
"MetaData": {
"Keys": [
"minimal"
]
},
"className": "QMinimalIntegrationPlugin",
"debug": false,
"version": 328193
}Got keys from plugin meta data ("minimal")
QFactoryLoader::QFactoryLoader() looking at "/home/Sid/platforms/libqoffscreen.so"
Found metadata in lib /home/Sid/platforms/libqoffscreen.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.2",
"MetaData": {
"Keys": [
"offscreen"
]
},
"className": "QOffscreenIntegrationPlugin",
"debug": false,
"version": 328193
}Got keys from plugin meta data ("offscreen")
QFactoryLoader::QFactoryLoader() checking directory path "/home/Sid/plugins/generic/platforms" ...
loaded library "/home/Sid/platforms/libqlinuxfb.so"QFactoryLoader::QFactoryLoader() checking directory path "/home/Sid/generic" ...
QFactoryLoader::QFactoryLoader() checking directory path "/home/Sid/plugins/generic/generic" ...
QFactoryLoader::QFactoryLoader() checking directory path "/home/Sid/styles" ...
QFactoryLoader::QFactoryLoader() checking directory path "/home/Sid/plugins/generic/styles" ...@
Nothing is shown related to evdevmouse.
Required (.so) file is kept here:
@/home/Sid/plugins/generic/libqevdevmouseplugin.so@Can you please guide me why it is not loading :(
What extra i need to do or some other setting i need to do.Kindly help
Thanks
-
Dear SGaist,
I am able to load the plugin. There was problem in the path. Thanks a lot :) for pointing to the QT_DEBUG_PLUGINS=1I am getting qDebugs getting printed. But again i have one more doubt:
What is the difference between:
/qtbase/src/plugins/generic/evdevmouse
AND
/qtbase/src/platformsupport/input/evdevmouse
Actually to get the touch coordinates i want to add debug points to the code located in :
/qtbase/src/platformsupport/input/evdevmouse
But to my surprise, both the above locations are not interlinked.
Do i need to merge the code?
-
/qtbase/src/plugins/generic/evdevmouse is only the plugin stuff
/qtbase/src/platformsupport/input/evdevmouse is the actual code
AFAIK, the input code is builtin, so if you play with it, you have to deploy the libraries
-
Dear SGaist, Thanks for your reply.
I am now using serial port to read the touch screen values. Actually our touch screen is working as a mouse. I am able to get the exact touch coordinates. But now what should i do with those coordinates?
I saw that in my old QT4x code one slot was called after getting the coordinates:@QWSMouseHandler::mouseChanged(position, state, wheel);@
But now i want to port it to the QT 5. Can u please tell me how to proceed. i have seached evdevmouse plugin but there is no such slot.
My question is that i am able to get the x and y. but how should i pass to the QT so that button can be seen as pressed. Kindly guide me.
Thanks
-
Dear SGaist, i am able to detect the touch by just directly passing the touch coordinates to:
@
QWindowSystemInterface::handleMouseEvent(0, position, position, Qt::LeftButton);
@But i dont know is this a correct way or not. Also in the header file of QWindowSystemInterface some warning is given:
@
//
// W A R N I N G
// -------------
//
// This file is part of the QPA API and is not meant to be used
// in applications. Usage of this API may make your code
// source and binary incompatible with future versions of Qt.
//@
Kindly guide me to the correct way.
Thanks :)
-
How are you doing it ?
-
Dear SGaist,
Actually since tslib was not working with serial port touch screen, i wrote one program to get open the serial port and then get the coordinates. Once i get the coordinates, i immediately emit one custom signal(defined by me) and then i call my slot. Inside that slot i have written:
@
QWindowSystemInterface::handleMouseEvent(0, position, position, Qt::LeftButton);
@So i am able to see the button getting pressed. So i am able to get the touch event. But i am not sure whether this approach is correct or not.
Kindly give your inputs.
Thanks
-
AFAIK there's nothing wrong with that. However, you should create a new generic plugin (you can get some ideas from the tslib one) so you have a reusable component