From 3673ee98236f7b901db3112f0112ad57691a2358 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Wed, 19 Feb 2020 11:43:14 +0100 Subject: 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 --- .../GraphicsViewBenchmark/GraphicsViewBenchmark.pro | 2 +- .../graphicsview/functional/GraphicsViewBenchmark/main.cpp | 11 ++++++----- .../functional/GraphicsViewBenchmark/widgets/button.cpp | 4 +++- .../functional/GraphicsViewBenchmark/widgets/listmodel.cpp | 2 +- .../functional/GraphicsViewBenchmark/widgets/mainview.cpp | 6 +++--- .../GraphicsViewBenchmark/widgets/simplelistview.cpp | 6 ++++-- 6 files changed, 18 insertions(+), 13 deletions(-) (limited to 'tests/benchmarks/widgets/graphicsview') 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 -#include #include -#include +#include #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 #include "button.h" #include "theme.h" +#include +#include + 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 #include #ifndef QT_NO_OPENGL -#include +#include #endif #include @@ -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 - #include "simplelistview.h" #include "scrollbar.h" #include "simplelistview.h" @@ -36,6 +34,10 @@ #include "listitemcache.h" #include "theme.h" +#include +#include +#include + class SimpleListViewPrivate { Q_DECLARE_PUBLIC(SimpleListView) -- cgit v1.2.3