mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-25 17:28:50 -05:00
Replace obsolete QGLWidget by QOpenGLWidget
This commit is contained in:
parent
60d4b2f126
commit
cbdf46098d
@ -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();
|
||||
|
@ -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
|
||||
|
||||
|
@ -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()
|
||||
|
@ -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:
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user