Merge lp:~dandrader/unity/phablet_mouseTouchAdaptor into lp:unity/phablet
- phablet_mouseTouchAdaptor
- Merge into phablet
Status: | Merged |
---|---|
Approved by: | Michał Sawicz |
Approved revision: | no longer in the source branch. |
Merged at revision: | 685 |
Proposed branch: | lp:~dandrader/unity/phablet_mouseTouchAdaptor |
Merge into: | lp:unity/phablet |
Diff against target: |
295 lines (+175/-13) 7 files modified
CMakeLists.txt (+3/-5) MouseTouchAdaptor.cpp (+97/-0) MouseTouchAdaptor.h (+50/-0) main.cpp (+9/-0) run (+11/-3) run_on_device (+1/-1) tests/autopilot/qml_phone_shell/tests/__init__.py (+4/-4) |
To merge this branch: | bzr merge lp:~dandrader/unity/phablet_mouseTouchAdaptor |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michał Sawicz | Approve | ||
PS Jenkins bot (community) | continuous-integration | Approve | |
Review via email: mp+164870@code.launchpad.net |
Commit message
New build option to convert QMouseEvents into QTouchEvents
You will need this if you want to interact with touch-only components (such as
the upcoming Launcher) using a mouse.
Needed only when manually testing on a desktop.
Description of the change
New build option to convert QMouseEvents into QTouchEvents
You will need this if you want to interact with touch-only components (such as the upcoming Launcher) using a mouse.
Needed only when manually testing on a desktop.
Daniel d'Andrada (dandrader) wrote : | # |
> Hey, do you think it would make sense to make this both a build-time and run-
> time option? I.e. so that we can easily switch between "emulated touch" and
> "real pointer" interaction without rebuilding?
I would rather not do it until we need it, i.e., until we have a real use case for it. Otherwise the needed extra code would just be cruft.
Michał Sawicz (saviq) wrote : | # |
W dniu 21.05.2013 14:36, Daniel d'Andrada pisze:
> I would rather not do it until we need it, i.e., until we have a real use case for it. Otherwise the needed extra code would just be cruft.
Even though we're focused on touch now, we should not forget about
pointer interaction, so IMO this would be useful already to be able to «
./run -- --no-mousetouch » or similar to be able to check out how it
behaves with pointer. And also it'd be like 10 lines maybe?
--
Michał Sawicz <email address hidden>
Canonical Services Ltd.
Daniel d'Andrada (dandrader) wrote : | # |
> W dniu 21.05.2013 14:36, Daniel d'Andrada pisze:
> > I would rather not do it until we need it, i.e., until we have a real use
> case for it. Otherwise the needed extra code would just be cruft.
>
> Even though we're focused on touch now, we should not forget about
> pointer interaction, so IMO this would be useful already to be able to «
> ./run -- --no-mousetouch » or similar to be able to check out how it
> behaves with pointer. And also it'd be like 10 lines maybe?
Actually, 2 more lines are needed to implement that. :)
Done.
Michał Sawicz (saviq) wrote : | # |
214 + #ifdef CONVERT_
215 + MouseTouchAdaptor mouseTouchAdaptor;
216 + mouseTouchAdapt
217 + if (!args.
218 + application.
219 + }
220 + #endif // CONVERT_
Let's not instantiate the MouseTouchAdaptor at all?
Daniel d'Andrada (dandrader) wrote : | # |
> 214 + #ifdef CONVERT_
> 215 + MouseTouchAdaptor mouseTouchAdaptor;
> 216 + mouseTouchAdapt
> 217 + if (!args.
> 218 + application.
> 219 + }
> 220 + #endif // CONVERT_
>
> Let's not instantiate the MouseTouchAdaptor at all?
Ok. Done.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:682
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Michał Sawicz (saviq) wrote : | # |
Restarted the CI job - Jenkins fail.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:682
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:684
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:684
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:685
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:686
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:686
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:686
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:686
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:686
http://
Executed test runs:
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:686
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:688
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:688
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:688
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Michał Sawicz (saviq) : | # |
Preview Diff
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2013-05-16 12:02:23 +0000 | |||
3 | +++ CMakeLists.txt 2013-05-22 16:22:25 +0000 | |||
4 | @@ -139,15 +139,13 @@ | |||
5 | 139 | set(shell_app_HDRS | 139 | set(shell_app_HDRS |
6 | 140 | ) | 140 | ) |
7 | 141 | 141 | ||
8 | 142 | set(shell_app_SRCS | ||
9 | 143 | main.cpp) | ||
10 | 144 | |||
11 | 145 | add_executable(${SHELL_APP} | 142 | add_executable(${SHELL_APP} |
12 | 146 | ${shellapplication_MOC_SRCS} | 143 | ${shellapplication_MOC_SRCS} |
14 | 147 | ${shell_app_SRCS} | 144 | main.cpp |
15 | 145 | MouseTouchAdaptor.cpp | ||
16 | 148 | ) | 146 | ) |
17 | 149 | 147 | ||
19 | 150 | qt5_use_modules(${SHELL_APP} Qml Quick) | 148 | qt5_use_modules(${SHELL_APP} Qml Quick Test) |
20 | 151 | 149 | ||
21 | 152 | target_link_libraries(${SHELL_APP} | 150 | target_link_libraries(${SHELL_APP} |
22 | 153 | ${Qt5Qml_LIBRARIES} | 151 | ${Qt5Qml_LIBRARIES} |
23 | 154 | 152 | ||
24 | === added file 'MouseTouchAdaptor.cpp' | |||
25 | --- MouseTouchAdaptor.cpp 1970-01-01 00:00:00 +0000 | |||
26 | +++ MouseTouchAdaptor.cpp 2013-05-22 16:22:25 +0000 | |||
27 | @@ -0,0 +1,97 @@ | |||
28 | 1 | /* | ||
29 | 2 | * Copyright (C) 2013 Canonical, Ltd. | ||
30 | 3 | * | ||
31 | 4 | * This program is free software; you can redistribute it and/or modify | ||
32 | 5 | * it under the terms of the GNU General Public License as published by | ||
33 | 6 | * the Free Software Foundation; version 3. | ||
34 | 7 | * | ||
35 | 8 | * This program is distributed in the hope that it will be useful, | ||
36 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
37 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
38 | 11 | * GNU General Public License for more details. | ||
39 | 12 | * | ||
40 | 13 | * You should have received a copy of the GNU General Public License | ||
41 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
42 | 15 | * | ||
43 | 16 | * Authored by: Daniel d'Andrada <daniel.dandrada@canonical.com> | ||
44 | 17 | */ | ||
45 | 18 | |||
46 | 19 | #include "MouseTouchAdaptor.h" | ||
47 | 20 | |||
48 | 21 | #include <qpa/qwindowsysteminterface.h> | ||
49 | 22 | |||
50 | 23 | #include <QtGui/QMouseEvent> | ||
51 | 24 | #include <QtTest/QTest> | ||
52 | 25 | |||
53 | 26 | using QTest::QTouchEventSequence; | ||
54 | 27 | |||
55 | 28 | MouseTouchAdaptor::MouseTouchAdaptor(QObject *parent) | ||
56 | 29 | : QObject(parent) | ||
57 | 30 | , m_targetWindow(0) | ||
58 | 31 | { | ||
59 | 32 | m_touchDevice = new QTouchDevice; | ||
60 | 33 | m_touchDevice->setType(QTouchDevice::TouchScreen); | ||
61 | 34 | QWindowSystemInterface::registerTouchDevice(m_touchDevice); | ||
62 | 35 | } | ||
63 | 36 | |||
64 | 37 | void MouseTouchAdaptor::setTargetWindow(QWindow *window) | ||
65 | 38 | { | ||
66 | 39 | m_targetWindow = window; | ||
67 | 40 | } | ||
68 | 41 | |||
69 | 42 | bool MouseTouchAdaptor::eventFilter(QObject *, QEvent *event) | ||
70 | 43 | { | ||
71 | 44 | Q_ASSERT(m_targetWindow); | ||
72 | 45 | |||
73 | 46 | if (event->type() == QEvent::MouseButtonPress) { | ||
74 | 47 | return handleMousePress(static_cast<QMouseEvent*>(event)); | ||
75 | 48 | } else if (event->type() == QEvent::MouseMove) { | ||
76 | 49 | return handleMouseMove(static_cast<QMouseEvent*>(event)); | ||
77 | 50 | } else if (event->type() == QEvent::MouseButtonRelease) { | ||
78 | 51 | return handleMouseRelease(static_cast<QMouseEvent*>(event)); | ||
79 | 52 | } else { | ||
80 | 53 | return false; | ||
81 | 54 | } | ||
82 | 55 | } | ||
83 | 56 | |||
84 | 57 | bool MouseTouchAdaptor::handleMousePress(QMouseEvent *mouseEvent) | ||
85 | 58 | { | ||
86 | 59 | // Just eat the event if it wasn't a left mouse press | ||
87 | 60 | if (mouseEvent->button() != Qt::LeftButton) | ||
88 | 61 | return true; | ||
89 | 62 | |||
90 | 63 | QTouchEventSequence touchEvent = QTest::touchEvent(m_targetWindow, m_touchDevice, | ||
91 | 64 | false /* autoCommit */); | ||
92 | 65 | touchEvent.press(0 /* touchId */, mouseEvent->windowPos().toPoint()); | ||
93 | 66 | touchEvent.commit(false /* processEvents */); | ||
94 | 67 | |||
95 | 68 | return true; | ||
96 | 69 | } | ||
97 | 70 | |||
98 | 71 | bool MouseTouchAdaptor::handleMouseMove(QMouseEvent *mouseEvent) | ||
99 | 72 | { | ||
100 | 73 | // Just eat the event if left button isn't pressed | ||
101 | 74 | if (!(mouseEvent->buttons() & Qt::LeftButton)) | ||
102 | 75 | return true; | ||
103 | 76 | |||
104 | 77 | QTouchEventSequence touchEvent = QTest::touchEvent(m_targetWindow, m_touchDevice, | ||
105 | 78 | false /* autoCommit */); | ||
106 | 79 | touchEvent.move(0 /* touchId */, mouseEvent->windowPos().toPoint()); | ||
107 | 80 | touchEvent.commit(false /* processEvents */); | ||
108 | 81 | |||
109 | 82 | return true; | ||
110 | 83 | } | ||
111 | 84 | |||
112 | 85 | bool MouseTouchAdaptor::handleMouseRelease(QMouseEvent *mouseEvent) | ||
113 | 86 | { | ||
114 | 87 | // Just eat the event if it wasn't a left button release | ||
115 | 88 | if (mouseEvent->button() != Qt::LeftButton) | ||
116 | 89 | return true; | ||
117 | 90 | |||
118 | 91 | QTouchEventSequence touchEvent = QTest::touchEvent(m_targetWindow, m_touchDevice, | ||
119 | 92 | false /* autoCommit */); | ||
120 | 93 | touchEvent.release(0 /* touchId */, mouseEvent->windowPos().toPoint()); | ||
121 | 94 | touchEvent.commit(false /* processEvents */); | ||
122 | 95 | |||
123 | 96 | return true; | ||
124 | 97 | } | ||
125 | 0 | 98 | ||
126 | === added file 'MouseTouchAdaptor.h' | |||
127 | --- MouseTouchAdaptor.h 1970-01-01 00:00:00 +0000 | |||
128 | +++ MouseTouchAdaptor.h 2013-05-22 16:22:25 +0000 | |||
129 | @@ -0,0 +1,50 @@ | |||
130 | 1 | /* | ||
131 | 2 | * Copyright (C) 2013 Canonical, Ltd. | ||
132 | 3 | * | ||
133 | 4 | * This program is free software; you can redistribute it and/or modify | ||
134 | 5 | * it under the terms of the GNU General Public License as published by | ||
135 | 6 | * the Free Software Foundation; version 3. | ||
136 | 7 | * | ||
137 | 8 | * This program is distributed in the hope that it will be useful, | ||
138 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
139 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
140 | 11 | * GNU General Public License for more details. | ||
141 | 12 | * | ||
142 | 13 | * You should have received a copy of the GNU General Public License | ||
143 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
144 | 15 | * | ||
145 | 16 | * Authored by: Daniel d'Andrada <daniel.dandrada@canonical.com> | ||
146 | 17 | */ | ||
147 | 18 | |||
148 | 19 | #ifndef MOUSE_TOUCH_ADAPTOR_H | ||
149 | 20 | #define MOUSE_TOUCH_ADAPTOR_H | ||
150 | 21 | |||
151 | 22 | #include <QtCore/QObject> | ||
152 | 23 | |||
153 | 24 | class QMouseEvent; | ||
154 | 25 | class QTouchDevice; | ||
155 | 26 | class QWindow; | ||
156 | 27 | |||
157 | 28 | // Transforms QMouseEvents into single-finger QTouchEvents. | ||
158 | 29 | class MouseTouchAdaptor : public QObject { | ||
159 | 30 | Q_OBJECT | ||
160 | 31 | |||
161 | 32 | public: | ||
162 | 33 | MouseTouchAdaptor(QObject *parent = 0); | ||
163 | 34 | |||
164 | 35 | // The window that will receive the generated QTouchEvents | ||
165 | 36 | void setTargetWindow(QWindow *window); | ||
166 | 37 | |||
167 | 38 | // Filters QMouseEvents and posts the equivalent QTouchEvents. | ||
168 | 39 | virtual bool eventFilter(QObject *watched, QEvent *event); | ||
169 | 40 | |||
170 | 41 | private: | ||
171 | 42 | bool handleMousePress(QMouseEvent *mouseEvent); | ||
172 | 43 | bool handleMouseMove(QMouseEvent *mouseEvent); | ||
173 | 44 | bool handleMouseRelease(QMouseEvent *mouseEvent); | ||
174 | 45 | |||
175 | 46 | QWindow *m_targetWindow; | ||
176 | 47 | QTouchDevice *m_touchDevice; | ||
177 | 48 | }; | ||
178 | 49 | |||
179 | 50 | #endif // MOUSE_TOUCH_ADAPTOR_H | ||
180 | 0 | 51 | ||
181 | === modified file 'main.cpp' | |||
182 | --- main.cpp 2013-04-30 23:55:56 +0000 | |||
183 | +++ main.cpp 2013-05-22 16:22:25 +0000 | |||
184 | @@ -27,6 +27,7 @@ | |||
185 | 27 | 27 | ||
186 | 28 | // local | 28 | // local |
187 | 29 | #include "paths.h" | 29 | #include "paths.h" |
188 | 30 | #include "MouseTouchAdaptor.h" | ||
189 | 30 | 31 | ||
190 | 31 | namespace { | 32 | namespace { |
191 | 32 | /* When you append and import path to the list of import paths it will be the *last* | 33 | /* When you append and import path to the list of import paths it will be the *last* |
192 | @@ -89,6 +90,14 @@ | |||
193 | 89 | view->setFlags(Qt::FramelessWindowHint); | 90 | view->setFlags(Qt::FramelessWindowHint); |
194 | 90 | } | 91 | } |
195 | 91 | 92 | ||
196 | 93 | // You will need this if you want to interact with touch-only components using a mouse | ||
197 | 94 | // Needed only when manually testing on a desktop. | ||
198 | 95 | if (args.contains(QLatin1String("-mousetouch"))) { | ||
199 | 96 | MouseTouchAdaptor *mouseTouchAdaptor = new MouseTouchAdaptor(&application); | ||
200 | 97 | mouseTouchAdaptor->setTargetWindow(view); | ||
201 | 98 | application.installEventFilter(mouseTouchAdaptor); | ||
202 | 99 | } | ||
203 | 100 | |||
204 | 92 | QPlatformNativeInterface* nativeInterface = QGuiApplication::platformNativeInterface(); | 101 | QPlatformNativeInterface* nativeInterface = QGuiApplication::platformNativeInterface(); |
205 | 93 | /* Shell is declared as a system session so that it always receives all | 102 | /* Shell is declared as a system session so that it always receives all |
206 | 94 | input events. | 103 | input events. |
207 | 95 | 104 | ||
208 | === modified file 'run' | |||
209 | --- run 2013-05-02 17:06:48 +0000 | |||
210 | +++ run 2013-05-22 16:22:25 +0000 | |||
211 | @@ -4,6 +4,7 @@ | |||
212 | 4 | export LD_LIBRARY_PATH=$PWD/../unity_build/build/lib | 4 | export LD_LIBRARY_PATH=$PWD/../unity_build/build/lib |
213 | 5 | GDB=false | 5 | GDB=false |
214 | 6 | FAKE=false | 6 | FAKE=false |
215 | 7 | MOUSE_TOUCH=true | ||
216 | 7 | 8 | ||
217 | 8 | usage() { | 9 | usage() { |
218 | 9 | echo "usage: "$0" [OPTIONS]\n" >&2 | 10 | echo "usage: "$0" [OPTIONS]\n" >&2 |
219 | @@ -12,11 +13,12 @@ | |||
220 | 12 | echo " -f, --fake Force use of fake Qml modules." >&2 | 13 | echo " -f, --fake Force use of fake Qml modules." >&2 |
221 | 13 | echo " -g, --gdb Run through gdb." >&2 | 14 | echo " -g, --gdb Run through gdb." >&2 |
222 | 14 | echo " -h, --help Show this help." >&2 | 15 | echo " -h, --help Show this help." >&2 |
223 | 16 | echo " -m, --nomousetouch Run without -mousetouch argument." >&2 | ||
224 | 15 | echo >&2 | 17 | echo >&2 |
225 | 16 | exit 1 | 18 | exit 1 |
226 | 17 | } | 19 | } |
227 | 18 | 20 | ||
229 | 19 | ARGS=`getopt -n$0 -u -a --longoptions="fake,gdb,help" -o "fgh" -- "$@"` | 21 | ARGS=`getopt -n$0 -u -a --longoptions="fake,gdb,help,nomousetouch" -o "fghm" -- "$@"` |
230 | 20 | [ $? -ne 0 ] && usage | 22 | [ $? -ne 0 ] && usage |
231 | 21 | eval set -- "$ARGS" | 23 | eval set -- "$ARGS" |
232 | 22 | 24 | ||
233 | @@ -26,6 +28,7 @@ | |||
234 | 26 | -f|--fake) FAKE=true;; | 28 | -f|--fake) FAKE=true;; |
235 | 27 | -g|--gdb) GDB=true;; | 29 | -g|--gdb) GDB=true;; |
236 | 28 | -h|--help) usage;; | 30 | -h|--help) usage;; |
237 | 31 | -m|--nomousetouch) MOUSE_TOUCH=false;; | ||
238 | 29 | --) shift;break;; | 32 | --) shift;break;; |
239 | 30 | esac | 33 | esac |
240 | 31 | shift | 34 | shift |
241 | @@ -41,8 +44,13 @@ | |||
242 | 41 | export UBUNTU_ICON_THEME=ubuntu-mobile | 44 | export UBUNTU_ICON_THEME=ubuntu-mobile |
243 | 42 | fi | 45 | fi |
244 | 43 | 46 | ||
245 | 47 | QML_PHONE_SHELL_ARGS="" | ||
246 | 48 | if $MOUSE_TOUCH; then | ||
247 | 49 | QML_PHONE_SHELL_ARGS="$QML_PHONE_SHELL_ARGS -mousetouch" | ||
248 | 50 | fi | ||
249 | 51 | |||
250 | 44 | if $GDB; then | 52 | if $GDB; then |
252 | 45 | gdb -ex run --args $QML_PHONE_SHELL_PATH $@ | 53 | gdb -ex run --args $QML_PHONE_SHELL_PATH $QML_PHONE_SHELL_ARGS $@ |
253 | 46 | else | 54 | else |
255 | 47 | $QML_PHONE_SHELL_PATH $@ | 55 | $QML_PHONE_SHELL_PATH $QML_PHONE_SHELL_ARGS $@ |
256 | 48 | fi | 56 | fi |
257 | 49 | 57 | ||
258 | === modified file 'run_on_device' | |||
259 | --- run_on_device 2013-04-30 21:07:27 +0000 | |||
260 | +++ run_on_device 2013-05-22 16:22:25 +0000 | |||
261 | @@ -129,6 +129,6 @@ | |||
262 | 129 | echo "Building.." | 129 | echo "Building.." |
263 | 130 | build | 130 | build |
264 | 131 | echo "Running.." | 131 | echo "Running.." |
266 | 132 | run | 132 | run --nomousetouch |
267 | 133 | fi | 133 | fi |
268 | 134 | 134 | ||
269 | 135 | 135 | ||
270 | === modified file 'tests/autopilot/qml_phone_shell/tests/__init__.py' | |||
271 | --- tests/autopilot/qml_phone_shell/tests/__init__.py 2013-05-14 12:16:08 +0000 | |||
272 | +++ tests/autopilot/qml_phone_shell/tests/__init__.py 2013-05-22 16:22:25 +0000 | |||
273 | @@ -41,18 +41,18 @@ | |||
274 | 41 | os.environ['QML2_IMPORT_PATH'] = "../../builddir/plugins:../../builddir/tests/mocks" | 41 | os.environ['QML2_IMPORT_PATH'] = "../../builddir/plugins:../../builddir/tests/mocks" |
275 | 42 | if geometry != "0x0": | 42 | if geometry != "0x0": |
276 | 43 | self.app = self.launch_test_application( | 43 | self.app = self.launch_test_application( |
278 | 44 | "../../builddir/qml-phone-shell", "-geometry", geometry, "-frameless") | 44 | "../../builddir/qml-phone-shell", "-geometry", geometry, "-frameless", "-mousetouch") |
279 | 45 | else: | 45 | else: |
280 | 46 | self.app = self.launch_test_application( | 46 | self.app = self.launch_test_application( |
282 | 47 | "../../builddir/qml-phone-shell", "-fullscreen") | 47 | "../../builddir/qml-phone-shell", "-fullscreen", "-mousetouch") |
283 | 48 | 48 | ||
284 | 49 | def launch_test_installed(self, geometry): | 49 | def launch_test_installed(self, geometry): |
285 | 50 | if model() == 'Desktop' and geometry != "0x0": | 50 | if model() == 'Desktop' and geometry != "0x0": |
286 | 51 | self.app = self.launch_test_application( | 51 | self.app = self.launch_test_application( |
288 | 52 | "qml-phone-shell", "-geometry", geometry, "-frameless") | 52 | "qml-phone-shell", "-geometry", geometry, "-frameless", "-mousetouch") |
289 | 53 | else: | 53 | else: |
290 | 54 | self.app = self.launch_test_application( | 54 | self.app = self.launch_test_application( |
292 | 55 | "qml-phone-shell", "-fullscreen") | 55 | "qml-phone-shell", "-fullscreen", "-mousetouch") |
293 | 56 | 56 | ||
294 | 57 | def skipWrapper(*args, **kwargs): | 57 | def skipWrapper(*args, **kwargs): |
295 | 58 | pass | 58 | pass |
Hey, do you think it would make sense to make this both a build-time and run-time option? I.e. so that we can easily switch between "emulated touch" and "real pointer" interaction without rebuilding?