summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp')
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
index 7e7ec4f313..4ef41f4fca 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
@@ -133,6 +133,14 @@ class FriendlyGraphicsScene : public QGraphicsScene
};
#endif
+static inline void setFrameless(QWidget *w)
+{
+ Qt::WindowFlags flags = w->windowFlags();
+ flags |= Qt::FramelessWindowHint;
+ flags &= ~(Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint);
+ w->setWindowFlags(flags);
+}
+
class tst_QGraphicsView : public QObject
{
Q_OBJECT
@@ -366,6 +374,7 @@ void tst_QGraphicsView::alignment()
scene.addRect(QRectF(-10, -10, 20, 20));
QGraphicsView view(&scene);
+ setFrameless(&view);
view.show();
QVERIFY(QTest::qWaitForWindowExposed(&view));
@@ -649,6 +658,7 @@ void tst_QGraphicsView::dragMode_scrollHand()
{
for (int j = 0; j < 2; ++j) {
QGraphicsView view;
+ setFrameless(&view);
QCOMPARE(view.dragMode(), QGraphicsView::NoDrag);
view.setSceneRect(-1000, -1000, 2000, 2000);
@@ -875,6 +885,7 @@ void tst_QGraphicsView::dragMode_rubberBand()
void tst_QGraphicsView::rubberBandSelectionMode()
{
QWidget toplevel;
+ setFrameless(&toplevel);
QGraphicsScene scene;
QGraphicsRectItem *rect = scene.addRect(QRectF(10, 10, 80, 80));
@@ -1094,6 +1105,7 @@ void tst_QGraphicsView::matrix_combine()
void tst_QGraphicsView::centerOnPoint()
{
QWidget toplevel;
+ setFrameless(&toplevel);
QGraphicsScene scene;
scene.addEllipse(QRectF(-100, -100, 50, 50));
@@ -1757,6 +1769,7 @@ void tst_QGraphicsView::mapToScenePoint()
{
QGraphicsScene scene;
QGraphicsView view(&scene);
+ setFrameless(&view);
view.rotate(90);
view.setFixedSize(117, 117);
view.show();
@@ -1816,6 +1829,7 @@ void tst_QGraphicsView::mapToScenePoly()
{
QGraphicsScene scene;
QGraphicsView view(&scene);
+ setFrameless(&view);
view.translate(100, 100);
view.setFixedSize(117, 117);
view.show();
@@ -2197,6 +2211,7 @@ void tst_QGraphicsView::transformationAnchor()
scene.addRect(QRectF(-50, -50, 100, 100), QPen(Qt::black), QBrush(Qt::blue));
QGraphicsView view(&scene);
+ setFrameless(&view);
for (int i = 0; i < 2; ++i) {
view.resize(100, 100);
@@ -2235,6 +2250,7 @@ void tst_QGraphicsView::resizeAnchor()
scene.addRect(QRectF(-50, -50, 100, 100), QPen(Qt::black), QBrush(Qt::blue));
QGraphicsView view(&scene);
+ setFrameless(&view);
for (int i = 0; i < 2; ++i) {
view.resize(100, 100);
@@ -3175,6 +3191,7 @@ void tst_QGraphicsView::task239047_fitInViewSmallViewport()
// Ensure that with a small viewport, fitInView doesn't mirror the
// scene.
QWidget widget;
+ setFrameless(&widget);
QGraphicsScene scene;
QGraphicsView *view = new QGraphicsView(&scene, &widget);
view->resize(3, 3);
@@ -4434,6 +4451,7 @@ void tst_QGraphicsView::QTBUG_4151_clipAndIgnore()
scene.addItem(ignore);
QGraphicsView view(&scene);
+ setFrameless(&view);
view.setFrameStyle(0);
view.resize(75, 75);
view.show();
@@ -4592,6 +4610,7 @@ void tst_QGraphicsView::QTBUG_16063_microFocusRect()
scene.addItem(item);
QGraphicsView view(&scene);
+ setFrameless(&view);
view.setFixedSize(40, 40);
view.show();