Re: [Development] Touch not working with QtQuick1 (event handling issue in QGraphicsView)

2013-03-13 Thread Sorvig Morten
On Mar 12, 2013, at 3:31 PM, Frank Osterfeld frank.osterf...@kdab.com wrote:

 
 I tested with simple Hello-World style examples containing mouse areas 
 reacting to onClicked. Do you have anything else I should test specifically?


The demo is at https://github.com/msorvig/quick1cinematic .

What I'm seeing is that flicking the album covers works (with the patch), but 
tapping the i or settings button doesn't.

Morten
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Touch not working with QtQuick1 (event handling issue in QGraphicsView)

2013-03-12 Thread Sorvig Morten
On Mar 11, 2013, at 2:44 PM, Frank Osterfeld frank.osterf...@kdab.com wrote:

 Hi,
 
 I see two ways to fix it, one is a one-liner, one's more work:
 
  * Don't silently accept touch events if no item is waiting for them. 
 Ignoring the events triggers the touch-mouse fallback. That's the approach 
 the attached patch takes and seems to work fine (tested with the QQ1 hello 
 world example).
  * Make QQ1 items accept touch events and do the touch to mouse mapping 
 internally
 
 Do you see issues with the first approach? I don't see why TouchMove and 
 TouchEnd should be accepted if not handled, but TouchBegin is ignored if not 
 handled.

Hi, see https://codereview.qt-project.org/#change,48865 for further discussion.

I think the simple approach makes sense, as long as we keep it in mind for 
if/when we get gestures working again. We can then revisit it and implement a 
different solution if needed.

I've also had problems getting TouchBegin translated in the Qt Quick iOS demo 
we have. Is everything working flawlessly for you with the patch?

Morten





___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Touch not working with QtQuick1 (event handling issue in QGraphicsView)

2013-03-12 Thread Frank Osterfeld

On Mar 12, 2013, at 2:01 PM, Sorvig Morten wrote:

 On Mar 11, 2013, at 2:44 PM, Frank Osterfeld frank.osterf...@kdab.com wrote:
 
 Hi,
 
 I see two ways to fix it, one is a one-liner, one's more work:
 
 * Don't silently accept touch events if no item is waiting for them. 
 Ignoring the events triggers the touch-mouse fallback. That's the approach 
 the attached patch takes and seems to work fine (tested with the QQ1 hello 
 world example).
 * Make QQ1 items accept touch events and do the touch to mouse mapping 
 internally
 
 Do you see issues with the first approach? I don't see why TouchMove and 
 TouchEnd should be accepted if not handled, but TouchBegin is ignored if not 
 handled.
 
 Hi, see https://codereview.qt-project.org/#change,48865 for further 
 discussion.
 
 I think the simple approach makes sense, as long as we keep it in mind for 
 if/when we get gestures working again. We can then revisit it and implement a 
 different solution if needed.
 
 I've also had problems getting TouchBegin translated in the Qt Quick iOS demo 
 we have. Is everything working flawlessly for you with the patch?


I tested with simple Hello-World style examples containing mouse areas reacting 
to onClicked. Do you have anything else I should test specifically?

-- 
Frank Osterfeld | frank.osterf...@kdab.com | Senior Software Engineer
KDAB (Deutschland) GmbHCo KG, a KDAB Group company
Tel. Germany +49-30-521325470, Sweden (HQ)  +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions



smime.p7s
Description: S/MIME cryptographic signature
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


[Development] Touch not working with QtQuick1 (event handling issue in QGraphicsView)

2013-03-11 Thread Frank Osterfeld
Hi,

I'm debugging a major issue with QtQuick1 I'm seeing with both 5.0.0 and the 
current stable branch: Touch events don't work with QtQuick1's MouseArea 
element.

As QtQuick1 items don't handle touch directly, they they rely on on the 
touch-mouse fallback in QApplication which creates mouse events if a touch 
event wasn't accepted.
That works or TouchBegin events, but fails for subsequent TouchMove and 
TouchEnd events as QGraphicsView silently accepts touch events if it doesn't 
find an item that waits for touch.

If a series of TouchBegin, TouchMove, TouchEnd events is sent to QGraphicsView 
containing QQ1 items, the following happens:

1) GraphicsScenePrivate::touchEventHandler receives a TouchBegin event. As the 
QQ1 items don't accept touch, the event is ignored. That triggers the 
touch-mouse fallback, which works fine.
2) GraphicsScenePrivate::touchEventHandler then receives TouchMove/TouchEnd 
events. The touch handler looks for items needing touch events (items which 
previously accepted a TouchBegin event), but doesn't find any. (because the QQ1 
items received the fallback mouse events, not the touchBegin event)
In that case, it just accepts the touchMove/touchEnd event. As the event is 
accepted, the touch-mouse fallback in QApplication isn't triggered.

I see two ways to fix it, one is a one-liner, one's more work:

 * Don't silently accept touch events if no item is waiting for them. Ignoring 
the events triggers the touch-mouse fallback. That's the approach the attached 
patch takes and seems to work fine (tested with the QQ1 hello world example).
 * Make QQ1 items accept touch events and do the touch to mouse mapping 
internally

Do you see issues with the first approach? I don't see why TouchMove and 
TouchEnd should be accepted if not handled, but TouchBegin is ignored if not 
handled.



touch-qquick1-graphicsview.diff
Description: Binary data



-- 
Frank Osterfeld | frank.osterf...@kdab.com | Senior Software Engineer
KDAB (Deutschland) GmbHCo KG, a KDAB Group company
Tel. Germany +49-30-521325470, Sweden (HQ)  +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions



smime.p7s
Description: S/MIME cryptographic signature
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development