Browse Source

glshadercolormap: 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
169fef68a3
No known key found for this signature in database
GPG Key ID: 51C7231FFED0E060
  1. 4
      sdrgui/gui/glshadercolormap.cpp

4
sdrgui/gui/glshadercolormap.cpp

@ -126,7 +126,11 @@ void GLShaderColorMap::initColorMapTextureImmutable(const QString &colorMapName) @@ -126,7 +126,11 @@ void GLShaderColorMap::initColorMapTextureImmutable(const QString &colorMapName)
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() << "GLShaderColorMap::initColorMapTextureImmutable: colorMap " << colorMapName << " not supported";
}

Loading…
Cancel
Save