summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2015-07-17 15:06:22 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-07-17 16:35:42 +0200
commitb2603b76655ac819e43c063bb6f16bc95f358083 (patch)
tree0fbe2c367ebfffdb70e9e3f21a7cf408bafd9626 /tests/auto/gui
parent99b94aadf875c822afb6c2580e43355ac392ac92 (diff)
parent756266d01560157b7274e466b9ffc1b0e2ef9a1f (diff)
Merge remote-tracking branch 'origin/5.5' into HEAD
Conflicts: src/plugins/platforms/windows/qwindowsopengltester.cpp Change-Id: Ia7abeba9395ccf84e2fa81b91a5725a86dedb9fe
Diffstat (limited to 'tests/auto/gui')
-rw-r--r--tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp b/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp
index aa1f573aa9..fd3cfd55ff 100644
--- a/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp
+++ b/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp
@@ -170,7 +170,10 @@ public:
}
QRectF boundingRect() const Q_DECL_OVERRIDE { return QRectF(0, 0, 10, 10); }
- void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) Q_DECL_OVERRIDE { }
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) Q_DECL_OVERRIDE
+ {
+ painter->fillRect(QRectF(QPointF(0, 0), boundingRect().size()), Qt::yellow);
+ }
bool sceneEvent(QEvent *event) Q_DECL_OVERRIDE
{
@@ -1446,6 +1449,7 @@ void tst_QTouchEvent::touchBeginWithGraphicsWidget()
{
QGraphicsScene scene;
QGraphicsView view(&scene);
+ view.setWindowTitle(QTest::currentTestFunction());
QScopedPointer<tst_QTouchEventGraphicsItem> root(new tst_QTouchEventGraphicsItem);
root->setAcceptTouchEvents(true);
scene.addItem(root.data());
@@ -1454,10 +1458,13 @@ void tst_QTouchEvent::touchBeginWithGraphicsWidget()
glassWidget->setMinimumSize(100, 100);
scene.addItem(glassWidget.data());
- view.resize(200, 200);
+ view.setAlignment(Qt::AlignLeft | Qt::AlignTop);
+ const QRect availableGeometry = QGuiApplication::primaryScreen()->availableGeometry();
+ view.resize(availableGeometry.size() - QSize(100, 100));
+ view.move(availableGeometry.topLeft() + QPoint(50, 50));
+ view.fitInView(scene.sceneRect());
view.show();
QVERIFY(QTest::qWaitForWindowExposed(&view));
- view.fitInView(scene.sceneRect());
QTest::touchEvent(&view, touchScreenDevice)
.press(0, view.mapFromScene(root->mapToScene(3,3)), view.viewport());