Replace obsolete QGLWidget by QOpenGLWidget

pull/1180/head
f4exb 2022-03-18 18:13:08 +01:00
rodzic 60d4b2f126
commit cbdf46098d
8 zmienionych plików z 25 dodań i 20 usunięć

Wyświetl plik

@ -39,7 +39,8 @@ const GLfloat GLScope::m_q3RadiiConst[] = {
1.0f, 0.75f, 0.0f, 0.25f // 150
};
GLScope::GLScope(QWidget *parent) : QGLWidget(parent),
GLScope::GLScope(QWidget *parent) :
QOpenGLWidget(parent),
m_tracesData(nullptr),
m_traces(nullptr),
m_projectionTypes(nullptr),
@ -195,7 +196,7 @@ void GLScope::initializeGL()
}
}
connect(glCurrentContext, &QOpenGLContext::aboutToBeDestroyed, this, &GLScope::cleanup); // TODO: when migrating to QOpenGLWidget
connect(glCurrentContext, &QOpenGLContext::aboutToBeDestroyed, this, &GLScope::cleanup);
QOpenGLFunctions *glFunctions = QOpenGLContext::currentContext()->functions();
glFunctions->initializeOpenGLFunctions();

Wyświetl plik

@ -19,7 +19,7 @@
#ifndef SDRBASE_GUI_GLSCOPENG_H_
#define SDRBASE_GUI_GLSCOPENG_H_
#include <QGLWidget>
#include <QOpenGLWidget>
#include <QPen>
#include <QTimer>
#include <QMutex>
@ -40,7 +40,7 @@
class QPainter;
class SDRGUI_API GLScope: public QGLWidget, public GLScopeInterface
class SDRGUI_API GLScope: public QOpenGLWidget, public GLScopeInterface
{
Q_OBJECT

Wyświetl plik

@ -40,7 +40,7 @@ const float GLSpectrum::m_maxFrequencyZoom = 10.0f;
const float GLSpectrum::m_annotationMarkerHeight = 20.0f;
GLSpectrum::GLSpectrum(QWidget* parent) :
QGLWidget(parent),
QOpenGLWidget(parent),
m_markersDisplay(SpectrumSettings::MarkersDisplaySpectrum),
m_cursorState(CSNormal),
m_cursorChannel(0),
@ -697,7 +697,7 @@ void GLSpectrum::initializeGL()
return;
}
connect(glCurrentContext, &QOpenGLContext::aboutToBeDestroyed, this, &GLSpectrum::cleanup); // TODO: when migrating to QOpenGLWidget
connect(glCurrentContext, &QOpenGLContext::aboutToBeDestroyed, this, &GLSpectrum::cleanup);
QOpenGLFunctions *glFunctions = QOpenGLContext::currentContext()->functions();
glFunctions->initializeOpenGLFunctions();
@ -3034,14 +3034,14 @@ void GLSpectrum::enterEvent(QEvent* event)
{
m_mouseInside = true;
update();
QGLWidget::enterEvent(event);
QOpenGLWidget::enterEvent(event);
}
void GLSpectrum::leaveEvent(QEvent* event)
{
m_mouseInside = false;
update();
QGLWidget::enterEvent(event);
QOpenGLWidget::enterEvent(event);
}
void GLSpectrum::tick()

Wyświetl plik

@ -27,7 +27,7 @@
#include <QOpenGLBuffer>
#include <QOpenGLVertexArrayObject>
#include <QMatrix4x4>
#include <QGLWidget>
#include <QOpenGLWidget>
#include "gui/scaleengine.h"
#include "gui/glshadersimple.h"
#include "gui/glshadertextured.h"
@ -43,7 +43,7 @@ class QOpenGLShaderProgram;
class MessageQueue;
class SpectrumVis;
class SDRGUI_API GLSpectrum : public QGLWidget, public GLSpectrumInterface {
class SDRGUI_API GLSpectrum : public QOpenGLWidget, public GLSpectrumInterface {
Q_OBJECT
public:

Wyświetl plik

@ -33,7 +33,7 @@
// Note: When this object is created, QWidget* is converted to bool
TVScreen::TVScreen(bool color, QWidget* parent) :
QGLWidget(parent),
QOpenGLWidget(parent),
m_mutex(QMutex::Recursive),
m_glShaderArray(color)
{
@ -156,7 +156,7 @@ void TVScreen::initializeGL()
&QOpenGLContext::aboutToBeDestroyed,
this,
&TVScreen::cleanup
); // TODO: when migrating to QOpenGLWidget
);
m_glContextInitialized = true;
}

Wyświetl plik

@ -22,7 +22,7 @@
#ifndef INCLUDE_TVSCREEN_H
#define INCLUDE_TVSCREEN_H
#include <QGLWidget>
#include <QOpenGLWidget>
#include <QPen>
#include <QTimer>
#include <QMutex>
@ -36,7 +36,7 @@
class QPainter;
class SDRGUI_API TVScreen: public QGLWidget
class SDRGUI_API TVScreen: public QOpenGLWidget
{
Q_OBJECT

Wyświetl plik

@ -64,8 +64,8 @@ static const char* fragmentShaderSource =
" gl_FragColor = vec4(p);\n"
"}\n";
TVScreenAnalog::TVScreenAnalog(QWidget *parent)
: QGLWidget(parent),
TVScreenAnalog::TVScreenAnalog(QWidget *parent) :
QOpenGLWidget(parent),
m_shader(nullptr),
m_imageTexture(nullptr),
m_lineShiftsTexture(nullptr)
@ -134,8 +134,12 @@ void TVScreenAnalog::initializeGL()
{
initializeOpenGLFunctions();
connect(QOpenGLContext::currentContext(), &QOpenGLContext::aboutToBeDestroyed,
this, &TVScreenAnalog::cleanup); // TODO: when migrating to QOpenGLWidget
connect(
QOpenGLContext::currentContext(),
&QOpenGLContext::aboutToBeDestroyed,
this,
&TVScreenAnalog::cleanup
);
m_shader = new QOpenGLShaderProgram(this);

Wyświetl plik

@ -27,7 +27,7 @@
#include <QMutex>
#include <QTimer>
#include <QGLWidget>
#include <QOpenGLWidget>
#include <QOpenGLTexture>
#include <QOpenGLFunctions>
#include <QOpenGLShaderProgram>
@ -108,7 +108,7 @@ private:
int* m_outOfBoundsLine;
};
class SDRGUI_API TVScreenAnalog : public QGLWidget, protected QOpenGLFunctions
class SDRGUI_API TVScreenAnalog : public QOpenGLWidget, protected QOpenGLFunctions
{
Q_OBJECT