on xenial help sign in
Don't specify a distanceThreshold as it conflicts with hintDisplacment
f7a361aDaniel d'Andrada
qml/Panel/IndicatorsMenu.qml+2−2
@@ -167,7 +167,8 @@ Showable {
167 enabled: !root.shown && root.available
167 enabled: !root.shown && root.available
168 autoCompleteDragThreshold: maxTotalDragDistance / 2
168 autoCompleteDragThreshold: maxTotalDragDistance / 2
169 stretch: true
169 stretch: true
170− distanceThreshold: minimizedPanelHeight
170+ distanceThreshold: enableHint ? 0 : minimizedPanelHeight
171+
171 onTapped: showTapped(Qt.point(touchSceneX, touchSceneY));
172 onTapped: showTapped(Qt.point(touchSceneX, touchSceneY));
172
173
173 // using hint regulates minimum to hint displacement, but in fullscreen mode, we need to do it manually.
174 // using hint regulates minimum to hint displacement, but in fullscreen mode, we need to do it manually.
@@ -185,7 +186,6 @@ Showable {
185 autoCompleteDragThreshold: maxTotalDragDistance / 6
186 autoCompleteDragThreshold: maxTotalDragDistance / 6
186 stretch: true
187 stretch: true
187 maxTotalDragDistance: openedHeight - expandedPanelHeight - handle.height
188 maxTotalDragDistance: openedHeight - expandedPanelHeight - handle.height
188− distanceThreshold: 0
189
189
190 onTouchSceneXChanged: {
190 onTouchSceneXChanged: {
191 if (root.state === "locked") {
191 if (root.state === "locked") {
tests/uqmlscene/main.cpp+5−5
@@ -428,6 +428,10 @@ int main(int argc, char ** argv)
428
428
429 MouseTouchAdaptor mouseTouchAdaptor;
429 MouseTouchAdaptor mouseTouchAdaptor;
430 app.installNativeEventFilter(&mouseTouchAdaptor);
430 app.installNativeEventFilter(&mouseTouchAdaptor);
431+ // Create it before loading the module, so that TestUtil
432+ // doesn't create one with a fake timer factory.
433+ // When interacting manually with a test we want the real deal.
434+ new TouchRegistry;
431
435
432#ifndef QT_NO_TRANSLATION
436#ifndef QT_NO_TRANSLATION
433 QTranslator translator;
437 QTranslator translator;
@@ -499,11 +503,7 @@ int main(int argc, char ** argv)
499 QQuickItem *contentItem = qobject_cast<QQuickItem *>(topLevel);
503 QQuickItem *contentItem = qobject_cast<QQuickItem *>(topLevel);
500 if (contentItem) {
504 if (contentItem) {
501 qxView = new QQuickView(&engine, nullptr);
505 qxView = new QQuickView(&engine, nullptr);
502− if (TouchRegistry::instance() == nullptr) {
503− new TouchRegistry(qxView);
504− } else {
505− TouchRegistry::instance()->setParent(qxView);
506+ TouchRegistry::instance()->setParent(qxView);
506− }
507 qxView->installEventFilter(TouchRegistry::instance());
507 qxView->installEventFilter(TouchRegistry::instance());
508 window = qxView;
508 window = qxView;
509 // Set window default properties; the qml can still override them
509 // Set window default properties; the qml can still override them
tests/utils/modules/Unity/Test/testutil.cpp+10−22
@@ -31,7 +31,6 @@ TestUtil::TestUtil(QObject *parent)
31 : QObject(parent)
31 : QObject(parent)
32 , m_targetWindow(0)
32 , m_targetWindow(0)
33 , m_touchDevice(0)
33 , m_touchDevice(0)
34− , m_installedTouchRegistry(false)
35{
34{
36}
35}
37
36
@@ -83,30 +82,19 @@ void TestUtil::ensureTouchDevice()
83
82
84void TestUtil::ensureTouchRegistryInstalled()
83void TestUtil::ensureTouchRegistryInstalled()
85{
84{
86− if (m_installedTouchRegistry)
85+ if (TouchRegistry::instance())
87 return;
86 return;
88
87
89− TouchRegistry *touchRegistry;
88+ if (!m_targetWindow)
90− if (TouchRegistry::instance() == nullptr) {
89+ return;
91− // Tests can be *very* slow to run and we don't want things timing out because
92− // of that. So give it fake timers to use (they will never time out)
93− touchRegistry = new TouchRegistry(this, new FakeTimerFactory);
94− } else {
95− touchRegistry = TouchRegistry::instance();
96− if (touchRegistry->parent() != this) {
97− // someone else created it. leave it alone
98− m_installedTouchRegistry = true;
99− }
100− }
101
90
102− ensureTargetWindow();
91+ // Tests can be *very* slow to run and we don't want things timing out because
92+ // of that. So give it fake timers to use (they will never time out)
93+ TouchRegistry *touchRegistry = new TouchRegistry(this, new FakeTimerFactory);
103
94
104− if (m_targetWindow) {
105− QQuickView *view = qobject_cast<QQuickView*>(m_targetWindow);
95+ QQuickView *view = qobject_cast<QQuickView*>(m_targetWindow);
106− if (view) {
96+ if (view) {
107− view->installEventFilter(touchRegistry);
97+ view->installEventFilter(touchRegistry);
108− touchRegistry->setParent(view);
98+ touchRegistry->setParent(view);
109− m_installedTouchRegistry = true;
110− }
111 }
99 }
112}
100}
tests/utils/modules/Unity/Test/testutil.h−1
@@ -42,7 +42,6 @@ private:
42
42
43 QWindow *m_targetWindow;
43 QWindow *m_targetWindow;
44 QTouchDevice *m_touchDevice;
44 QTouchDevice *m_touchDevice;
45− bool m_installedTouchRegistry;
46};
45};
47
46
48QML_DECLARE_TYPE(TestUtil)
47QML_DECLARE_TYPE(TestUtil)