Browse Source

glshaderspectrogram: Fix deprecated QOpenGLTexture::setData() call

Use the const void* overload on Qt 5.3 and later to eliminate
the compiler deprecation warning, while retaining compatibility
with older Qt 5 versions.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
chirpmodem-v8.1.0
Robin Getz 4 weeks ago
parent
commit
993d5d2710
No known key found for this signature in database
GPG Key ID: 51C7231FFED0E060
  1. 4
      sdrgui/gui/glshaderspectrogram.cpp

4
sdrgui/gui/glshaderspectrogram.cpp

@ -279,7 +279,11 @@ void GLShaderSpectrogram::initColorMapTextureImmutable(const QString &colorMapNa @@ -279,7 +279,11 @@ void GLShaderSpectrogram::initColorMapTextureImmutable(const QString &colorMapNa
GLfloat *colorMap = (GLfloat *)ColorMap::getColorMap(colorMapName);
if (colorMap) {
#if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0))
m_colorMapTexture->setData(QOpenGLTexture::RGB, QOpenGLTexture::Float32, static_cast<const void *>(colorMap));
#else
m_colorMapTexture->setData(QOpenGLTexture::RGB, QOpenGLTexture::Float32, colorMap);
#endif
} else {
qDebug() << "GLShaderSpectrogram::initColorMapTextureImmutable: colorMap " << colorMapName << " not supported";
}

Loading…
Cancel
Save