[Qt-interest] QGesture Behavior Inconsistencies

Sean Hayes sean.t.hayes at vanderbilt.edu
Tue Feb 22 04:21:07 CET 2011


I have attached a small example to better explain what I am talking about.
If the QScrollArea is removed by commenting out lines 20-22 of
MainWindow.cpp, the gestures are received correctly. With the QScrollArea
included, gesture do not work over any child widgets (although you can get a
gesture to come through if you touch exactly in the margins/spacing between
child widgets). Received gesture information is output to the console.

Is this a bug with Qt? Any suggestions on how to get around this?

I am using Qt 4.7.1 with Windows 7.

Thank you,
Sean

On Mon, Feb 21, 2011 at 5:04 PM, Sean Hayes <sean.t.hayes at vanderbilt.edu>wrote:

> I have a QWidget, A, that grabs a gesture. The gesture accepts a variable
> number of touch points. Widget A has a layout with several children that do
> not grab gestures themselves. If none of these child widgets inherit
> QAbstractScrollArea, then the gestures behave as expected. No mater where on
> widget A you add a finger it gets grouped in the same QTouchPoints set and
> is added to the same QGesture. However, if any one of the child widgets
> inherit QAbstractScrollArea, additional touch points can only be added if
> they originate on the same child widget. It is as if I set grabGesture() on
> each child widget instead of just widget A. Why is this? Any ideas on how to
> fix this?
>
> Have tried calling
> QAbstractScrollArea::viewport()->setAttribute(Qt::WA_AcceptTouchEvents),
> which allows it to "grab gestures" incorrectly like all the other child
> widgets, but new touch points still cannot added outside of the child
> widget.
>
> Thank you for your help,
> Sean
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110221/76208b74/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GesturesWithScrollArea.zip
Type: application/zip
Size: 4254 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110221/76208b74/attachment.zip 


More information about the Qt-interest-old mailing list