summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/widgets/graphicsview
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2020-02-19 11:43:14 +0100
committerJohan Klokkhammer Helsing <johan.helsing@qt.io>2020-02-28 12:03:48 +0100
commit3673ee98236f7b901db3112f0112ad57691a2358 (patch)
tree5020e1f3913eaa053f02268a388285614d9b76c6 /tests/benchmarks/widgets/graphicsview
parentb6fad7588ab2a0012b424b07849de814b77effc6 (diff)
Fix build errors for GraphicsViewBenchmark
QGL* has been removed amongst other things Task-number: QTBUG-74408 Task-number: QTBUG-74409 Change-Id: Ia19774f2bb6d0b86b3fbde224cbc8652b4ae0b22 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'tests/benchmarks/widgets/graphicsview')
-rw-r--r--tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/GraphicsViewBenchmark.pro2
-rw-r--r--tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/main.cpp11
-rw-r--r--tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/button.cpp4
-rw-r--r--tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.cpp2
-rw-r--r--tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp6
-rw-r--r--tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.cpp6
6 files changed, 18 insertions, 13 deletions
diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/GraphicsViewBenchmark.pro b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/GraphicsViewBenchmark.pro
index ded6a06795..addb60433b 100644
--- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/GraphicsViewBenchmark.pro
+++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/GraphicsViewBenchmark.pro
@@ -1,7 +1,7 @@
TEMPLATE = app
QT += svg testlib
-qtHaveModule(opengl): QT += opengl
+qtHaveModule(opengl): QT += opengl openglwidgets
HEADERS += widgets/gvbwidget.h \
widgets/abstractscrollarea.h \
diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/main.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/main.cpp
index 87ab80d74f..907a320d76 100644
--- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/main.cpp
+++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/main.cpp
@@ -28,9 +28,8 @@
#include <QtTest/QtTest>
-#include <QtGui/qgraphicsview.h>
#include <QtGui/qpixmapcache.h>
-#include <QtGui/qdesktopwidget.h>
+#include <QtGui/QScreen>
#include "mainview.h"
#include "dummydatagen.h"
@@ -308,7 +307,8 @@ void tst_GraphicsViewBenchmark::initTestCase()
if (mSettings->size().width() > 0 && mSettings->size().height() > 0) {
mMainView->resize(mSettings->size().width(), mSettings->size().height());
mMainView->show();
- } else if (QApplication::desktop()->width() < 360 || QApplication::desktop()->height() < 640) {
+ } else if (QGuiApplication::primaryScreen()->geometry().width() < 360
+ || QGuiApplication::primaryScreen()->geometry().height() < 640) {
mMainView->showFullScreen();
} else {
mMainView->resize(360, 640);
@@ -326,7 +326,7 @@ void tst_GraphicsViewBenchmark::initTestCase()
currentListSize = -1;
currentListType = None;
- QVERIFY(QTest::qWaitForWindowShown(mMainView));
+ QVERIFY(QTest::qWaitForWindowExposed(mMainView));
}
void tst_GraphicsViewBenchmark::cleanupTestCase()
@@ -760,7 +760,8 @@ int main(int argc, char *argv[])
if (settings.size().width() > 0 && settings.size().height() > 0) {
view.resize(settings.size().width(), settings.size().height());
view.show();
- } else if (QApplication::desktop()->width() < 360 || QApplication::desktop()->height() < 640) {
+ } else if (QGuiApplication::primaryScreen()->geometry().width() < 360
+ || QApplication::primaryScreen()->geometry().height() < 640) {
view.showFullScreen();
} else {
view.resize(360, 640);
diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/button.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/button.cpp
index b8bd55789d..98bf9f8521 100644
--- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/button.cpp
+++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/button.cpp
@@ -26,10 +26,12 @@
**
****************************************************************************/
-#include <QtGui>
#include "button.h"
#include "theme.h"
+#include <QtGui>
+#include <QGraphicsSceneMouseEvent>
+
static const int MinTextWidthAsChars = 8;
class ButtonPrivate {
diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.cpp
index fe87a2abc4..933af2f770 100644
--- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.cpp
+++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.cpp
@@ -78,7 +78,7 @@ bool ListModel::setData(const QModelIndex &index, const QVariant &value, int rol
void ListModel::clear()
{
m_items.clear();
- reset();
+ clear();
}
QModelIndex ListModel::index(int row, int column, const QModelIndex &parent) const
diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp
index 8f7736010d..f2423cb899 100644
--- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp
+++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp
@@ -30,7 +30,7 @@
#include <QApplication>
#include <QGraphicsLinearLayout>
#ifndef QT_NO_OPENGL
-#include <QGLWidget>
+#include <QtOpenGLWidgets/QOpenGLWidget>
#endif
#include <QObject>
@@ -253,10 +253,10 @@ void MainView::construct()
if (m_enableOpenGL) {
qDebug() << "OpenGL enabled";
m_scene->setSortCacheEnabled(false);
- setViewport(new QGLWidget);
+ setViewport(new QOpenGLWidget);
// Qt doc says: This is the preferred update mode for
- // viewports that do not support partial updates, such as QGLWidget...
+ // viewports that do not support partial updates, such as QOpenGLWidget...
setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
} else
#endif
diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.cpp
index 67f34859c1..7ff089fa1e 100644
--- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.cpp
+++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.cpp
@@ -26,8 +26,6 @@
**
****************************************************************************/
-#include <QtGui>
-
#include "simplelistview.h"
#include "scrollbar.h"
#include "simplelistview.h"
@@ -36,6 +34,10 @@
#include "listitemcache.h"
#include "theme.h"
+#include <QtGui>
+#include <QGraphicsGridLayout>
+#include <QGraphicsSceneResizeEvent>
+
class SimpleListViewPrivate
{
Q_DECLARE_PUBLIC(SimpleListView)