Commit 7ed543b5 authored by Madhav Kanbur's avatar Madhav Kanbur Committed by Nate Graham
Browse files

Switch from QGLWidget to QOpenGLWidget



* QGLWidget has been deprecated => Nuke it and don't link Qt5::OpenGL

* Switch to the better, newer QOpenGLWidget (introduced in Qt 5.4)

* Fixes the OpenGL Renderer not working

BUG: 403323
BUG: 410083
BUG: 420672
FIXED-IN: 20.12.3
Signed-off-by: Madhav Kanbur's avatarMadhav Kanbur <abcdjdj@gmail.com>
parent a401e666
...@@ -51,7 +51,7 @@ else() ...@@ -51,7 +51,7 @@ else()
set(GWENVIEW_SEMANTICINFO_BACKEND_BALOO ON) set(GWENVIEW_SEMANTICINFO_BACKEND_BALOO ON)
endif() endif()
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Core Widgets Concurrent Svg OpenGL PrintSupport) find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Core Widgets Concurrent Svg PrintSupport)
find_package(Qt5DBus ${QT_MIN_VERSION} CONFIG QUIET) find_package(Qt5DBus ${QT_MIN_VERSION} CONFIG QUIET)
set(HAVE_QTDBUS ${Qt5DBus_FOUND}) set(HAVE_QTDBUS ${Qt5DBus_FOUND})
......
...@@ -262,7 +262,6 @@ endif() ...@@ -262,7 +262,6 @@ endif()
target_link_libraries(gwenviewlib target_link_libraries(gwenviewlib
Qt5::Concurrent Qt5::Concurrent
Qt5::Svg Qt5::Svg
Qt5::OpenGL
Qt5::PrintSupport Qt5::PrintSupport
KF5::KIOCore KF5::KIOCore
KF5::KIOWidgets KF5::KIOWidgets
......
...@@ -29,7 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA ...@@ -29,7 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
// KDE // KDE
// Qt // Qt
#include <QGLWidget> #include <QOpenGLWidget>
#include <QGraphicsScene> #include <QGraphicsScene>
#include <QPropertyAnimation> #include <QPropertyAnimation>
#include <QTimer> #include <QTimer>
...@@ -87,13 +87,8 @@ DocumentViewContainer::DocumentViewContainer(QWidget* parent) ...@@ -87,13 +87,8 @@ DocumentViewContainer::DocumentViewContainer(QWidget* parent)
d->q = this; d->q = this;
d->mScene = new QGraphicsScene(this); d->mScene = new QGraphicsScene(this);
if (GwenviewConfig::animationMethod() == DocumentView::GLAnimation) { if (GwenviewConfig::animationMethod() == DocumentView::GLAnimation) {
QGLWidget* glWidget = new QGLWidget; QOpenGLWidget* glWidget = new QOpenGLWidget;
if (glWidget->isValid()) { setViewport(glWidget);
setViewport(glWidget);
} else {
qCWarning(GWENVIEW_LIB_LOG) << "Failed to initialize OpenGL support!";
delete glWidget;
}
} }
setScene(d->mScene); setScene(d->mScene);
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
...@@ -304,10 +299,10 @@ void DocumentViewContainer::slotFadeInFinished(DocumentView* view) ...@@ -304,10 +299,10 @@ void DocumentViewContainer::slotFadeInFinished(DocumentView* view)
void DocumentViewContainer::slotConfigChanged() void DocumentViewContainer::slotConfigChanged()
{ {
bool currentlyGL = qobject_cast<QGLWidget*>(viewport()); bool currentlyGL = qobject_cast<QOpenGLWidget*>(viewport());
bool wantGL = GwenviewConfig::animationMethod() == DocumentView::GLAnimation; bool wantGL = GwenviewConfig::animationMethod() == DocumentView::GLAnimation;
if (currentlyGL != wantGL) { if (currentlyGL != wantGL) {
setViewport(wantGL ? new QGLWidget() : new QWidget()); setViewport(wantGL ? new QOpenGLWidget() : new QWidget());
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment