Diagnosing a tablet headache (QT bug?)

Brendon Higgins blhiggins at gmail.com
Sat Feb 14 06:08:22 CET 2009


Hi list,

I'm very much looking forward to a usable Krita 2. It's sounding very 
promising.

I'm trying to work out why the Krita 2 betas and my tablet don't seem to get 
along, and I think I've narrowed it down to these lines of code:

qreal subpixelX = e->hiResGlobalX();
subpixelX = subpixelX - ((int) subpixelX); // leave only part behind the dot
qreal subpixelY = e->hiResGlobalY();
subpixelY = subpixelY - ((int) subpixelY); // leave only part behind the dot
QPointF pos(e->x() + subpixelX + m_d->documentOffset.x(), e->y() + subpixelY + 
m_d->documentOffset.y());

They appear in kis_qpainter_canvas.cpp and kis_opengl_canvas2.cpp. I whipped 
up a little PyQT app to test if QT was actually reporting my tablet events 
properly. It seems that hiResGlobal functions work correctly, in that they 
report screen-pixel positions with beyond-integer accuracy. However, x() and 
y() functions seem to report raw tablet X/Y data (i.e. points can go up well 
into the thousands). I believe this is what messes up Krita's calculations.

Is that normal (i.e. should Krita not be using those functions that way), or 
do you suppose this is a QT bug? I'm using QT 4.4.3 (unstable Debs) and Krita 
2 beta 6 (experimental Debs).

Not subscribed to list, so please CC me.

Peace,
Brendon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kimageshop/attachments/20090214/6d0eb499/attachment.sig 


More information about the kimageshop mailing list