qt-interest@trolltech.com
[Top] [All Lists]

Re: Qt4 Tablet problem

Subject: Re: Qt4 Tablet problem
From: Trenton Schulz
Date: Mon, 3 Apr 2006 11:50:16 +0200

On Mar 31, 2006, at 4:02 PM, Simon Blais wrote:

I have a problem with the tablet in Qt4.1.1. When I move the stylus quickly the points returned by the QTabletEvents far apart. It seems like some events are dropped. With Qt3.3.6, the same thing returned points that are much closer together.

It does not look like the tablet buffer is overflowing, it is correctly emptied.

Has something changed in the event processing that would cause this behaviour?

This can be reproduced by modifying the scribble example to use tablet events instead of mouse events. ( since I did not find a tablet example in Qt4)

------
Added to scribblearea.cpp

void ScribbleArea::tabletEvent( QTabletEvent * event )
{
 event->accept();
 if (event->type() == QEvent::TabletPress )
 {
   lastPoint = event->pos();
   scribbling = true;
 }
 else if (event->type() == QEvent::TabletMove && scribbling )
 {
   drawLineTo(event->pos());
 }
 else if (event->type() == QEvent::TabletRelease && scribbling)
 {
   drawLineTo(event->pos());
   scribbling = false;
 }
}
------
Added to scribblearea.h
void tabletEvent( QTabletEvent * event );
------


Hi,

Is the problem you're seeing that there are some "holes" in the lines? This is an issue with the scribble example. It seems that it is able to determine the update area well for a mouse, but not for a stylus. If you, for example, save the image or change the active window, the parts will get filled in. Or if you tell it to update everything, it should generate what you want.

I know it's a shame we don't have a real tablet example at the moment. It is on the todo list though.

-- Trenton

--
To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with 
"unsubscribe" in the subject or the body.
List archive and information: http://lists.trolltech.com/qt-interest/

<Prev in Thread] Current Thread [Next in Thread>