summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2020-05-16 20:43:34 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2020-06-08 20:29:49 +0200
commit44fb925f50471ebc23dcccfaa4e9d9873b05d205 (patch)
treee4e212052b66242ff94aa98f6df7b15dbeb945f7 /tests/benchmarks
parenta061a646429c6e9d695458fc0ecb0021a30e12ee (diff)
Phase 2 of removing QDesktopWidget
Remove QDestopWidget public header, simplify the implementation that maintains a Qt::Desktop type QWidget for each QScreen, and turn QWidget's initial target screen into a QScreen pointer. QApplication::desktop() now takes an optional QScreen pointer, and returns a QWidget pointer, so that applications and widgets can get access to the root widget for a specific screen without having to resort to private APIs. QDesktopWidgetPrivate implementations to look up a screen for an index, widget, or point are now all inline functions that thinly wrap QGuiApplication::screens/screenAt calls. We should consider adding those as convenience APIs to QScreen instead. Note that QWidget::screen is assumed to return a valid pointer; there is code that handles the case that it returns nullptr (but also code that trusts that it never is nullptr), so this needs to be defined, verified with tests, and asserted. We can then simplify the code further. Change-Id: Ifc89be65a0dce265b6729feaf54121c35137cb94 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'tests/benchmarks')
-rw-r--r--tests/benchmarks/gui/painting/qtbench/benchmarktests.h1
-rw-r--r--tests/benchmarks/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp3
2 files changed, 1 insertions, 3 deletions
diff --git a/tests/benchmarks/gui/painting/qtbench/benchmarktests.h b/tests/benchmarks/gui/painting/qtbench/benchmarktests.h
index 6d388fcaad..ed03182597 100644
--- a/tests/benchmarks/gui/painting/qtbench/benchmarktests.h
+++ b/tests/benchmarks/gui/painting/qtbench/benchmarktests.h
@@ -31,7 +31,6 @@
#include <QApplication>
#include <QTextDocument>
-#include <QDesktopWidget>
#include <QTextLayout>
#include <QFontMetrics>
#include <QDebug>
diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
index a9fba18f53..27f5a90bab 100644
--- a/tests/benchmarks/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/benchmarks/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
@@ -33,7 +33,6 @@
#include <QtWidgets/QGraphicsView>
#include <QtGui/QImage>
#include <QtGui/QPixmapCache>
-#include <QtWidgets/QDesktopWidget>
#include "chiptester/chiptester.h"
//#define CALLGRIND_DEBUG
@@ -69,7 +68,7 @@ public:
void tryResize(int width, int height)
{
- QDesktopWidget *desktop = QApplication::desktop();
+ QWidget *desktop = QApplication::desktop();
if (desktop->width() < width)
width = desktop->width();
if (desktop->height() < height)