[Solved] Tablet driver unable to produce QTabletEvent::Eraser
-
Hi and welcome to devnet,
You should be able to see what plugins are loaded by your application by setting the QT_DEBUG_PLUGINS environment variable to 1 in the Run part of the project panel
-
@SGaist I don't think this is for me.
-
Why not ? That will allow you to determine what plugin is being loaded
-
@SGaist I don't know what the "project panel" is. Also, why are plugins relevant to the graphics tablet driver? I can set environment variables though, and when I set QT_DEBUG_PLUGINS, I get a lot of plugin errors like this:
"The file '/usr/lib/kde4/plugins/imageformats/kimg_jp2.so' is not a valid Qt plugin."
Some are not errors, like this:
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt4/plugins/imageformats/libqgif.so"
keys ("gif")There are many. Would you like a list?
-
Sorry, I thought you were using Qt Creator.
It is relevant because it's a way to check if you have the evdev plugin loaded for that or just using the input handling from the platform plugin.
Since you're on linux, what flavor are you using ?
-
Ah right, I should be more specific. I've been trying to get the tablet working with Krita - but since that doesn't (yet) use Qt5 directly for tablet support, I've been using this project to debug what's going on with Qt: https://github.com/callaa/QTabletTest
This is everything I get in the console:
- ╰─➤ QT_DEBUG_PLUGINS=1 ./QTabletTester
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/kde4/plugins/styles/oxygen.so"
"The file '/usr/lib/kde4/plugins/styles/oxygen.so' is not a valid Qt plugin."
not a plugin
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt4/plugins/inputmethods/libqimsw-multi.so"
keys ("imsw-multi")
This is without the tablet plugged in right now. Later on I can try with the tablet plugged in, if that makes any difference.
I am using Ubuntu 14.04.
- ╰─➤ QT_DEBUG_PLUGINS=1 ./QTabletTester
-
IIRC, Krita is now fully ported to Qt 5. I'd recommend checking directly with the maintainers, you will get quicker to your goal
-
I went to the Krita forum first and was told that it checks the QTabletEvent::Eraser flag to determine if the device is an eraser.
This code below is from QTabletTest, which displays the device type returned from
event->pointerType()
. This is always QTabletEvent::Pen, no matter what I do.void TabletTestView::showTabletEvent(QTabletEvent *event) { QString action; if(event->type() == QEvent::TabletMove) action = "moved"; if(event->type() == QEvent::TabletPress) action = "pressed"; else if(event->type() == QEvent::TabletRelease) action = "lifted"; _pointeritem->setPos(event->pos()); QPointF pos = tabletEventPos(event); _pointertext->setText( QString("%1 (%2) %3 at %4, %5, pressure=%6 [id: %7]") .arg(devicename(event->device())) .arg(pointername(event->pointerType())) .arg(action) .arg(pos.x(), 0, 'f', 1) .arg(pos.y(), 0, 'f', 1) .arg(event->pressure() * 100.0, 0, 'f', 1) .arg(event->uniqueId()) ); emit logEvent(_pointertext->text()); }
At this point, all I can do is try to debug Qt to figure out how it detects the pointer type. Is there a way I can build the Qt libs without killing my system? Do I need to build them in a VM? Should I try apt-get source, hack the packages and reinstall them? Is there a way to build debug Qt libs and get QTabletTest to use my hacked libs instead of the system ones?
-
Woohoo, I got it to work! I realised that QTabletTester was actually building with qt4! When I built it with Qt5 qmake it did indeed detect the eraser device!
Thanks anyway!
-
Good !
That's a tricky case :)
Since you have it working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)