Bug 69617 - [Qt][WK2] Touch mocking is broken with Qt 5 post refactor merge
Summary: [Qt][WK2] Touch mocking is broken with Qt 5 post refactor merge
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Hausmann
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-07 04:25 PDT by Simon Hausmann
Modified: 2011-10-07 05:33 PDT (History)
0 users

See Also:


Attachments
Patch (8.52 KB, patch)
2011-10-07 04:30 PDT, Simon Hausmann
kling: review+
kling: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Hausmann 2011-10-07 04:25:11 PDT
[Qt][WK2] Touch mocking is broken with Qt 5 post refactor merge
Comment 1 Simon Hausmann 2011-10-07 04:30:13 PDT
Created attachment 110123 [details]
Patch
Comment 2 Andreas Kling 2011-10-07 04:58:23 PDT
Comment on attachment 110123 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=110123&action=review

r=me with some tweaks:

> Tools/MiniBrowser/qt/MiniBrowserApplication.cpp:96
> +    if (isMouseEvent(event) && targetWindow) {

Nit: The targetWindow null check is cheaper so it should be first.

> Tools/MiniBrowser/qt/MiniBrowserApplication.cpp:100
> +        touchPoint.area = QRectF(mouseEvent->globalPos(), QSizeF(1., 1.));

Style: Unless required in order to force floating point math, do not append .0, .f and .0f to floating point literals.

> Tools/MiniBrowser/qt/MiniBrowserApplication.cpp:132
> +        for (QHash<int, QWindowSystemInterface::TouchPoint>::iterator it = m_touchPoints.begin(); it != m_touchPoints.end(); ++it) {

Nit: I like it when we cache the end iterator. :)

> Tools/MiniBrowser/qt/MiniBrowserApplication.cpp:142
> +        QEvent::Type eventType;
> +         switch (touchPoint.state) {

Something goes wrong with indentation here.

> Tools/MiniBrowser/qt/MiniBrowserApplication.cpp:150
> +             // don't send the event if nothing changed

Style: comments should be in sentence form.
Comment 3 Simon Hausmann 2011-10-07 05:33:30 PDT
Committed r96931: <http://trac.webkit.org/changeset/96931>