0

I am working with an old Siemens tablet. What i am trying to do is to obtain the pressure exerted by the pen on the screen. I have managed to use a Qt software in C++ where QTabletEvent::pressure() returns pressure values of 0.0 to 1.0. My question is, how can i convert these values into newtons? If the tablet has 256 pressure levels, what does that also mean in terms of newtons?

Thanks in advance

IbraM
  • 21
  • 2
  • Use Qt Sensors: http://doc.qt.io/qt-5/qtsensors-index.html, http://doc.qt.io/qt-5/qpressurereading.html – eyllanesc Nov 18 '17 at 19:16

1 Answers1

0

Accordingly to this:

Returns the pressure for the device. 0.0 indicates that the stylus is not on the tablet, 1.0 indicates the maximum amount of pressure for the stylus.

For you it means that you can't get "absolute" value of pressure (at least via pure Qt), because it returns to you only relative info between 0 and 1, so your application can react accordingly to this info.

You can really use QtSensors or you can use native API of your hardware or you can try luck to get maxPressure from Qt internals using int QTabletDeviceData::maxPressure, because QTabletEvent::pressure() get this info in next way:

qreal(pressure / qreal(tablet->maxPressure - tablet->minPressure))
Jablonski
  • 18,083
  • 2
  • 46
  • 47