Merge lp:~zsombi/ubuntu-ui-toolkit/fix-sensingArea-on-phablet into lp:ubuntu-ui-toolkit

Proposed by Zsombor Egri
Status: Merged
Approved by: Michał Sawicz
Approved revision: 511
Merged at revision: 513
Proposed branch: lp:~zsombi/ubuntu-ui-toolkit/fix-sensingArea-on-phablet
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 104 lines (+60/-3)
4 files modified
modules/Ubuntu/Components/plugin/quickutils.cpp (+3/-2)
tests/unit/tst_inversemousearea/SensingAreaError.qml (+45/-0)
tests/unit/tst_inversemousearea/tst_inversemousearea.pro (+2/-1)
tests/unit/tst_inversemousearea/tst_inversemouseareatest.cpp (+10/-0)
To merge this branch: bzr merge lp:~zsombi/ubuntu-ui-toolkit/fix-sensingArea-on-phablet
Reviewer Review Type Date Requested Status
Michał Sawicz functional Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+165533@code.launchpad.net

Commit message

[inversemaousearea] Fixing sensingArea not updated on phablet.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

Yup, that helps!

review: Approve (functional)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'modules/Ubuntu/Components/plugin/quickutils.cpp'
2--- modules/Ubuntu/Components/plugin/quickutils.cpp 2013-04-18 11:29:24 +0000
3+++ modules/Ubuntu/Components/plugin/quickutils.cpp 2013-05-24 05:36:32 +0000
4@@ -29,7 +29,8 @@
5 #include <private/qquicktextedit_p.h>
6
7 QuickUtils::QuickUtils(QObject *parent) :
8- QObject(parent)
9+ QObject(parent),
10+ m_rootView(0)
11 {
12 QGuiApplication::instance()->installEventFilter(this);
13 // connect to focusObjectChanged() to get the latest active focus object
14@@ -44,7 +45,7 @@
15 */
16 bool QuickUtils::eventFilter(QObject *obj, QEvent *event)
17 {
18- if (!m_rootView && (event->type() == QEvent::ChildAdded))
19+ if (!m_rootView && (event->type() == QEvent::ApplicationActivate))
20 lookupQuickView();
21
22 return QObject::eventFilter(obj, event);
23
24=== added file 'tests/unit/tst_inversemousearea/SensingAreaError.qml'
25--- tests/unit/tst_inversemousearea/SensingAreaError.qml 1970-01-01 00:00:00 +0000
26+++ tests/unit/tst_inversemousearea/SensingAreaError.qml 2013-05-24 05:36:32 +0000
27@@ -0,0 +1,45 @@
28+/*
29+ * Copyright 2013 Canonical Ltd.
30+ *
31+ * This program is free software; you can redistribute it and/or modify
32+ * it under the terms of the GNU Lesser General Public License as published by
33+ * the Free Software Foundation; version 3.
34+ *
35+ * This program is distributed in the hope that it will be useful,
36+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
37+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38+ * GNU Lesser General Public License for more details.
39+ *
40+ * You should have received a copy of the GNU Lesser General Public License
41+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
42+ */
43+
44+import QtQuick 2.0
45+import Ubuntu.Components 0.1
46+
47+Item {
48+ id: root
49+ width: units.gu(40)
50+ height: units.gu(40)
51+
52+ property string log: ""
53+
54+ MouseArea {
55+ anchors.fill: parent
56+
57+ onClicked: root.log = "MA"
58+ }
59+
60+ Rectangle {
61+ width: units.gu(10)
62+ height: units.gu(10)
63+ anchors.centerIn: parent
64+ color: "red"
65+
66+ InverseMouseArea {
67+ anchors.fill: parent
68+ sensingArea: root
69+ onClicked: root.log = "IMA"
70+ }
71+ }
72+}
73
74=== modified file 'tests/unit/tst_inversemousearea/tst_inversemousearea.pro'
75--- tests/unit/tst_inversemousearea/tst_inversemousearea.pro 2013-04-15 07:51:36 +0000
76+++ tests/unit/tst_inversemousearea/tst_inversemousearea.pro 2013-05-24 05:36:32 +0000
77@@ -4,4 +4,5 @@
78
79 OTHER_FILES += \
80 InverseMouseAreaPropagateEvents.qml \
81- InverseMouseAreaDoNotPropagateEvents.qml
82+ InverseMouseAreaDoNotPropagateEvents.qml \
83+ SensingAreaError.qml
84
85=== modified file 'tests/unit/tst_inversemousearea/tst_inversemouseareatest.cpp'
86--- tests/unit/tst_inversemousearea/tst_inversemouseareatest.cpp 2013-04-15 07:49:30 +0000
87+++ tests/unit/tst_inversemousearea/tst_inversemouseareatest.cpp 2013-05-24 05:36:32 +0000
88@@ -132,6 +132,16 @@
89 QVERIFY(eventCleanup.isEmpty());
90 }
91
92+ void testCase_sensingAreaError()
93+ {
94+ InverseMouseAreaType *area = testArea("SensingAreaError.qml");
95+ QVERIFY(area);
96+
97+ QTest::mouseClick(quickView, Qt::LeftButton, 0, QPoint(20, 20));
98+ QTest::waitForEvents();
99+ QCOMPARE(quickView->rootObject()->property("log").toString(), QString("IMA"));
100+ }
101+
102 };
103
104 QTEST_MAIN(tst_InverseMouseAreaTest)

Subscribers

People subscribed via source and target branches

to status/vote changes: