Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] Tablet driver unable to produce QTabletEvent::Eraser
Qt 6.11 is out! See what's new in the release blog

[Solved] Tablet driver unable to produce QTabletEvent::Eraser

Scheduled Pinned Locked Moved General and Desktop
11 Posts 2 Posters 6.7k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #2

    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

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    ? 1 Reply Last reply
    0
    • SGaistS SGaist

      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

      ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #3

      @SGaist I don't think this is for me.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #4

        Why not ? That will allow you to determine what plugin is being loaded

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        ? 1 Reply Last reply
        0
        • SGaistS SGaist

          Why not ? That will allow you to determine what plugin is being loaded

          ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #5

          @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?

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #6

            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 ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • ? Offline
              ? Offline
              A Former User
              wrote on last edited by A Former User
              #7

              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.

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #8

                IIRC, Krita is now fully ported to Qt 5. I'd recommend checking directly with the maintainers, you will get quicker to your goal

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • ? Offline
                  ? Offline
                  A Former User
                  wrote on last edited by
                  #9

                  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?

                  1 Reply Last reply
                  0
                  • ? Offline
                    ? Offline
                    A Former User
                    wrote on last edited by
                    #10

                    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!

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #11

                      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 :)

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved