summaryrefslogtreecommitdiff
path: root/tests/auto/other/gestures/tst_gestures.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2022-09-15 10:10:30 +0200
committerLiang Qi <liang.qi@qt.io>2022-09-19 14:39:28 +0000
commit571e7a41f55d60fef019ea7106213ffe37d5eb16 (patch)
tree2744d14f7f3802c843c4f345562e86531b860ff5 /tests/auto/other/gestures/tst_gestures.cpp
parent7ae963292906510b4d589c2c5063520af0d67a4e (diff)
downloadqtbase-571e7a41f55d60fef019ea7106213ffe37d5eb16.tar.gz
tests: improve tst_gestures on GNOME
There are some issues when testing QGraphicsView on GNOME(xorg) overlapping with the default top bar. This change only move the view a bit. Notes: * There is no CentOS in CI any more. * panelPropagation() and panelStacksBehindParent() failed in CI and local vm on Ubuntu 20.04, but only in CI on Ubuntu 22.04. For example, we can turn the top bar off: In Extension Manager, install Just Perfection, and disable Panel in Visibility in it, all tests will pass too. Task-number: QTBUG-84258 Task-number: QTBUG-103054 Pick-to: 6.4 6.2 Change-Id: I05c262540c85af00182cd142760c4a29554b04c9 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests/auto/other/gestures/tst_gestures.cpp')
-rw-r--r--tests/auto/other/gestures/tst_gestures.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/other/gestures/tst_gestures.cpp b/tests/auto/other/gestures/tst_gestures.cpp
index 88ae2661a5..9fe036dd89 100644
--- a/tests/auto/other/gestures/tst_gestures.cpp
+++ b/tests/auto/other/gestures/tst_gestures.cpp
@@ -318,6 +318,8 @@ private slots:
void testQGestureRecognizerCleanup();
void testReuseCanceledGestures();
void bug_13501_gesture_not_accepted();
+private:
+ QPoint m_availableTopLeft;
};
void tst_Gestures::initTestCase()
@@ -325,6 +327,8 @@ void tst_Gestures::initTestCase()
CustomGesture::GestureType = QGestureRecognizer::registerRecognizer(new CustomGestureRecognizer);
QVERIFY(CustomGesture::GestureType != Qt::GestureType(0));
QVERIFY(CustomGesture::GestureType != Qt::CustomGesture);
+ const QScreen *screen = QGuiApplication::primaryScreen();
+ m_availableTopLeft = screen->availableGeometry().topLeft();
}
void tst_Gestures::cleanupTestCase()
@@ -800,6 +804,7 @@ void tst_Gestures::graphicsItemGesture()
QGraphicsScene scene;
QGraphicsView view(&scene);
view.setWindowFlags(Qt::X11BypassWindowManagerHint);
+ view.move(m_availableTopLeft);
GestureItem *item = new GestureItem("item");
scene.addItem(item);
@@ -862,6 +867,7 @@ void tst_Gestures::graphicsView()
QGraphicsScene scene;
QGraphicsView view(&scene);
view.setWindowFlags(Qt::X11BypassWindowManagerHint);
+ view.move(m_availableTopLeft);
GestureItem *item = new GestureItem("item");
scene.addItem(item);
@@ -927,6 +933,7 @@ void tst_Gestures::graphicsItemTreeGesture()
QGraphicsScene scene;
QGraphicsView view(&scene);
view.setWindowFlags(Qt::X11BypassWindowManagerHint);
+ view.move(m_availableTopLeft);
GestureItem *item1 = new GestureItem("item1");
item1->setPos(100, 100);
@@ -984,6 +991,7 @@ void tst_Gestures::explicitGraphicsObjectTarget()
QGraphicsScene scene;
QGraphicsView view(&scene);
view.setWindowFlags(Qt::X11BypassWindowManagerHint);
+ view.move(m_availableTopLeft);
GestureItem *item1 = new GestureItem("item1");
scene.addItem(item1);
@@ -1533,6 +1541,7 @@ void tst_Gestures::autoCancelGestures2()
QGraphicsScene scene;
QGraphicsView view(&scene);
view.setWindowFlags(Qt::X11BypassWindowManagerHint);
+ view.move(m_availableTopLeft);
MockItem *parent = new MockItem("parent");
GestureItem *child = new GestureItem("child");
@@ -1569,6 +1578,7 @@ void tst_Gestures::graphicsViewParentPropagation()
QGraphicsScene scene;
QGraphicsView view(&scene);
view.setWindowFlags(Qt::X11BypassWindowManagerHint);
+ view.move(m_availableTopLeft);
GestureItem *item0 = new GestureItem("item0");
scene.addItem(item0);
@@ -1629,6 +1639,7 @@ void tst_Gestures::panelPropagation()
QGraphicsScene scene;
QGraphicsView view(&scene);
view.setWindowFlags(Qt::X11BypassWindowManagerHint);
+ view.move(m_availableTopLeft);
GestureItem *item0 = new GestureItem("item0");
scene.addItem(item0);
@@ -1753,6 +1764,7 @@ void tst_Gestures::panelStacksBehindParent()
QGraphicsScene scene;
QGraphicsView view(&scene);
view.setWindowFlags(Qt::X11BypassWindowManagerHint);
+ view.move(m_availableTopLeft);
GestureItem *item1 = new GestureItem("item1");
item1->grabGesture(CustomGesture::GestureType);
@@ -1940,6 +1952,7 @@ void tst_Gestures::partialGesturePropagation()
QGraphicsScene scene;
QGraphicsView view(&scene);
view.setWindowFlags(Qt::X11BypassWindowManagerHint);
+ view.move(m_availableTopLeft);
GestureItem *item1 = new GestureItem("item1");
item1->grabGesture(CustomGesture::GestureType);
@@ -2152,6 +2165,7 @@ void tst_Gestures::testReuseCanceledGestures()
mw.setWindowFlags(Qt::X11BypassWindowManagerHint);
QGraphicsView *gv = new QGraphicsView(&mw);
QGraphicsScene *scene = new QGraphicsScene;
+ mw.move(m_availableTopLeft);
gv->setScene(scene);
scene->setSceneRect(0,0,100,100);