Commit b415bedd authored by Jan Möbius's avatar Jan Möbius
Browse files

Merge branch 'Fix_Qt_5.14_dep_warnings' into 'master'

Fix qt 5.14 dep warnings

See merge request !184
parents 245e85a1 45edb590
...@@ -226,7 +226,7 @@ Core::init() { ...@@ -226,7 +226,7 @@ Core::init() {
connect(scenegraphCheckTimer_, SIGNAL(timeout()), this, SLOT(checkScenegraphDirty()),Qt::DirectConnection); connect(scenegraphCheckTimer_, SIGNAL(timeout()), this, SLOT(checkScenegraphDirty()),Qt::DirectConnection);
// Will measure the time between redraws // Will measure the time between redraws
redrawTime_ = new QTime(); redrawTime_ = new QElapsedTimer();
redrawTime_->start (); redrawTime_->start ();
if ( OpenFlipperSettings().value("Core/Gui/splash",true).toBool() ) { if ( OpenFlipperSettings().value("Core/Gui/splash",true).toBool() ) {
......
...@@ -928,8 +928,8 @@ private slots: ...@@ -928,8 +928,8 @@ private slots:
void stopVideoCapture(); void stopVideoCapture();
private: private:
QTimer videoTimer_; QTimer videoTimer_;
QTime lastVideoTime_; QElapsedTimer lastVideoTime_;
int captureType_; int captureType_;
...@@ -1472,7 +1472,7 @@ private slots: ...@@ -1472,7 +1472,7 @@ private slots:
QTimer *scenegraphCheckTimer_; QTimer *scenegraphCheckTimer_;
/// Holds the time since last redraw /// Holds the time since last redraw
QTime *redrawTime_; QElapsedTimer *redrawTime_;
/** @} */ /** @} */
......
...@@ -341,7 +341,7 @@ void Core::loadPlugins() ...@@ -341,7 +341,7 @@ void Core::loadPlugins()
emit log(LOGOUT,"================================================================================"); emit log(LOGOUT,"================================================================================");
QTime time; QElapsedTimer time;
time.start(); time.start();
......
...@@ -238,8 +238,7 @@ void GaussianBlurFilter::updateKernel() ...@@ -238,8 +238,7 @@ void GaussianBlurFilter::updateKernel()
for (int i = 0; i < samples_; ++i) for (int i = 0; i < samples_; ++i)
weights_[i] /= weightSum; weights_[i] /= weightSum;
QString blurSamplesMacro; QString blurSamplesMacro = QString("#define BLUR_SAMPLES %1").arg(samples_);
blurSamplesMacro.sprintf("#define BLUR_SAMPLES %i", samples_);
macros_.clear(); macros_.clear();
macros_.push_back(blurSamplesMacro); macros_.push_back(blurSamplesMacro);
} }
...@@ -345,8 +344,7 @@ void BilateralBlurFilter::updateKernel() ...@@ -345,8 +344,7 @@ void BilateralBlurFilter::updateKernel()
macros_.clear(); macros_.clear();
QString radiusMacro; QString radiusMacro = QString("#define BLUR_SAMPLES %1").arg(samples_);
radiusMacro.sprintf("#define BLUR_SAMPLES %i", samples_);
int numChannels = GLFormatInfo(internalFormat()).channelCount(); int numChannels = GLFormatInfo(internalFormat()).channelCount();
numChannels = std::max(std::min(numChannels, 4), 1); numChannels = std::max(std::min(numChannels, 4), 1);
...@@ -359,8 +357,8 @@ void BilateralBlurFilter::updateKernel() ...@@ -359,8 +357,8 @@ void BilateralBlurFilter::updateKernel()
"BLUR_RGBA" "BLUR_RGBA"
}; };
QString channelMacro; // %1 printed as %s
channelMacro.sprintf("#define BLUR_CHANNELS %s", blurChannels[numChannels - 1]); QString channelMacro = QString("#define BLUR_CHANNELS %1").arg(blurChannels[numChannels - 1]);
macros_.push_back(radiusMacro); macros_.push_back(radiusMacro);
macros_.push_back(channelMacro); macros_.push_back(channelMacro);
...@@ -449,8 +447,8 @@ void RadialBlurFilter::setKernel( int _numSamples ) ...@@ -449,8 +447,8 @@ void RadialBlurFilter::setKernel( int _numSamples )
samples_ = _numSamples; samples_ = _numSamples;
macros_.clear(); macros_.clear();
QString sampleMacro;
sampleMacro.sprintf("#define BLUR_SAMPLES %i", _numSamples); QString sampleMacro = QString("#define BLUR_SAMPLES %1").arg(_numSamples);
macros_.push_back(sampleMacro); macros_.push_back(sampleMacro);
} }
...@@ -633,8 +631,7 @@ PoissonBlurFilter::PoissonBlurFilter(float _radius, float _sampleDistance, int _ ...@@ -633,8 +631,7 @@ PoissonBlurFilter::PoissonBlurFilter(float _radius, float _sampleDistance, int _
samplesScaled_ = samples_; samplesScaled_ = samples_;
QString samplesMacro; QString samplesMacro= QString("#define BLUR_SAMPLES %1").arg(numSamples);
samplesMacro.sprintf("#define BLUR_SAMPLES %i", numSamples);
macros_.push_back(samplesMacro); macros_.push_back(samplesMacro);
} }
......
...@@ -207,8 +207,7 @@ protected: ...@@ -207,8 +207,7 @@ protected:
private: private:
int radius_, int radius_, samples_;
samples_;
/// blur std /// blur std
float sigma_; float sigma_;
......
...@@ -188,10 +188,7 @@ GLFormatInfo::GLFormatInfo( GLenum _intfmt, GLenum _fmt, GLenum _type, int _r, i ...@@ -188,10 +188,7 @@ GLFormatInfo::GLFormatInfo( GLenum _intfmt, GLenum _fmt, GLenum _type, int _r, i
if (channelCount_ > 3) if (channelCount_ > 3)
strfmt += "A"; strfmt += "A";
QString bitCount; strfmt += QString ("%1").arg(channelBits_[0]);
bitCount.sprintf("%i", channelBits_[0]);
strfmt += bitCount;
if (isNormalized()) if (isNormalized())
{ {
......
...@@ -156,8 +156,7 @@ GLSL::Program* ACG::ShaderCache::getProgram( const ShaderGenDesc* _desc, const s ...@@ -156,8 +156,7 @@ GLSL::Program* ACG::ShaderCache::getProgram( const ShaderGenDesc* _desc, const s
{ {
static int counter = 0; static int counter = 0;
QString fileName; QString fileName = QString("shader_%1.glsl").arg(counter++,2,10,QLatin1Char('0')) ;
fileName.sprintf("shader_%02d.glsl", counter++);
fileName = dbgOutputDir_ + QDir::separator() + fileName; fileName = dbgOutputDir_ + QDir::separator() + fileName;
QFile fileOut(fileName); QFile fileOut(fileName);
...@@ -517,8 +516,7 @@ GLSL::Program* ACG::ShaderCache::getComputeProgram(const char* _computeShaderFil ...@@ -517,8 +516,7 @@ GLSL::Program* ACG::ShaderCache::getComputeProgram(const char* _computeShaderFil
} }
} }
QString fnv_string; QString fnv_string = QString::number(fnv_hash,16).toUpper();
fnv_string.sprintf("%X", fnv_hash);
std::string dumpFilename = QString(dbgOutputDir_ + QDir::separator() + fileInfo.fileName() + fnv_string).toStdString(); std::string dumpFilename = QString(dbgOutputDir_ + QDir::separator() + fileInfo.fileName() + fnv_string).toStdString();
......
...@@ -220,7 +220,7 @@ void ShaderGenerator::initVertexShaderIO(const ShaderGenDesc* _desc, const Defau ...@@ -220,7 +220,7 @@ void ShaderGenerator::initVertexShaderIO(const ShaderGenDesc* _desc, const Defau
QString texcoordType; QString texcoordType;
if (texdim > 1) if (texdim > 1)
texcoordType.sprintf("vec%i", texdim); texcoordType =QString("vec%1").arg(texdim);
else else
texcoordType = "float"; texcoordType = "float";
...@@ -402,12 +402,14 @@ void ShaderGenerator::initDefaultUniforms() ...@@ -402,12 +402,14 @@ void ShaderGenerator::initDefaultUniforms()
} }
#define ADDLIGHT(x) (sz.sprintf(x"_%d", lightIndex_), addUniform(sz)) #define ADDLIGHT(x) addUniform( QString( QString(x) + "_%1").arg(lightIndex_) )
void ShaderGenerator::addLight(int lightIndex_, ShaderGenLightType _light) void ShaderGenerator::addLight(int lightIndex_, ShaderGenLightType _light)
{ {
QString sz; QString sz;
QTextStream stream(&sz);
ADDLIGHT("vec3 g_cLightDiffuse"); ADDLIGHT("vec3 g_cLightDiffuse");
ADDLIGHT("vec3 g_cLightAmbient"); ADDLIGHT("vec3 g_cLightAmbient");
ADDLIGHT("vec3 g_cLightSpecular"); ADDLIGHT("vec3 g_cLightSpecular");
...@@ -553,8 +555,7 @@ void ShaderGenerator::addIOToCode(const QStringList& _cmds) ...@@ -553,8 +555,7 @@ void ShaderGenerator::addIOToCode(const QStringList& _cmds)
void ShaderGenerator::buildShaderCode(QStringList* _pMainCode, const QStringList& _defaultLightingFunctions) void ShaderGenerator::buildShaderCode(QStringList* _pMainCode, const QStringList& _defaultLightingFunctions)
{ {
QString glslversion; QString glslversion = QString("#version %1").arg(version_);
glslversion.sprintf("#version %d", version_);
code_.push_back(glslversion); code_.push_back(glslversion);
...@@ -1053,8 +1054,7 @@ void ShaderProgGenerator::initGenDefines(ShaderGenerator* _gen) ...@@ -1053,8 +1054,7 @@ void ShaderProgGenerator::initGenDefines(ShaderGenerator* _gen)
_gen->addDefine("SG_POSOS 1"); _gen->addDefine("SG_POSOS 1");
// # lights define // # lights define
QString strNumLights; QString strNumLights = QString("SG_NUM_LIGHTS %1").arg(desc_.numLights);
strNumLights.sprintf("SG_NUM_LIGHTS %d", desc_.numLights);
_gen->addDefine(strNumLights); _gen->addDefine(strNumLights);
// light types define // light types define
...@@ -1065,11 +1065,8 @@ void ShaderProgGenerator::initGenDefines(ShaderGenerator* _gen) ...@@ -1065,11 +1065,8 @@ void ShaderProgGenerator::initGenDefines(ShaderGenerator* _gen)
_gen->addDefine(lightTypeNames[i]); _gen->addDefine(lightTypeNames[i]);
for (int i = 0; i < desc_.numLights; ++i) for (int i = 0; i < desc_.numLights; ++i) {
{ _gen->addDefine( QString ("SG_LIGHT_TYPE_%1 %2").arg(i).arg(lightTypeNames[desc_.lightTypes[i]]) );
QString strLightType;
strLightType.sprintf("SG_LIGHT_TYPE_%d %s", i, lightTypeNames[desc_.lightTypes[i]]);
_gen->addDefine(strLightType);
} }
_gen->addDefine("SG_ALPHA g_vMaterial.y"); _gen->addDefine("SG_ALPHA g_vMaterial.y");
...@@ -1986,7 +1983,7 @@ void ShaderProgGenerator::addTexGenCode( QStringList* _code, bool _fragmentShade ...@@ -1986,7 +1983,7 @@ void ShaderProgGenerator::addTexGenCode( QStringList* _code, bool _fragmentShade
if (texcoordVarDim == 1) if (texcoordVarDim == 1)
texcoordVarInit = "float sg_vTexCoord"; texcoordVarInit = "float sg_vTexCoord";
else else
texcoordVarInit.sprintf("vec%i sg_vTexCoord", texcoordVarDim); texcoordVarInit = QString("vec%1 sg_vTexCoord").arg(texcoordVarDim);
// init with default value: input or zero // init with default value: input or zero
if (ioDesc_.inputTexCoord_ && !generateTexCoord) if (ioDesc_.inputTexCoord_ && !generateTexCoord)
...@@ -2072,20 +2069,16 @@ void ShaderProgGenerator::addTexGenCode( QStringList* _code, bool _fragmentShade ...@@ -2072,20 +2069,16 @@ void ShaderProgGenerator::addTexGenCode( QStringList* _code, bool _fragmentShade
_code->push_back("vec3 sg_TexGenRefl2 = sg_TexGenRefl; sg_TexGenRefl2.z += 1.0;"); _code->push_back("vec3 sg_TexGenRefl2 = sg_TexGenRefl; sg_TexGenRefl2.z += 1.0;");
_code->push_back("float sg_TexGenMRcp = 0.5 * inversesqrt(dot(sg_TexGenRefl2, sg_TexGenRefl2));"); _code->push_back("float sg_TexGenMRcp = 0.5 * inversesqrt(dot(sg_TexGenRefl2, sg_TexGenRefl2));");
for (int i = 0; i < desc_.texGenDim; ++i) for (int i = 0; i < desc_.texGenDim; ++i)
{ {
QString assignmentInstrString; _code->push_back(QString ("sg_vTexCoord.%1 = sg_TexGenRefl.%2 * sg_TexGenMRcp + 0.5;").arg(texGenCoordString[i]).arg(texGenCoordString[i]));
assignmentInstrString.sprintf("sg_vTexCoord.%s = sg_TexGenRefl.%s * sg_TexGenMRcp + 0.5;", texGenCoordString[i], texGenCoordString[i]);
_code->push_back(assignmentInstrString);
} }
} break; } break;
case GL_NORMAL_MAP: case GL_NORMAL_MAP:
{ {
for (int i = 0; i < desc_.texGenDim; ++i) for (int i = 0; i < desc_.texGenDim; ++i)
{ {
QString assignmentInstrString; _code->push_back( QString ("sg_vTexCoord.%1 = sg_vNormalVS.%2;").arg(texGenCoordString[i]).arg(texGenCoordString[i]) );
assignmentInstrString.sprintf("sg_vTexCoord.%s = sg_vNormalVS.%s;", texGenCoordString[i], texGenCoordString[i]);
_code->push_back(assignmentInstrString);
} }
} break; } break;
...@@ -2095,9 +2088,8 @@ void ShaderProgGenerator::addTexGenCode( QStringList* _code, bool _fragmentShade ...@@ -2095,9 +2088,8 @@ void ShaderProgGenerator::addTexGenCode( QStringList* _code, bool _fragmentShade
_code->push_back("vec3 sg_TexGenRefl = reflect(sg_vPosVS_unit, sg_vNormalVS);"); _code->push_back("vec3 sg_TexGenRefl = reflect(sg_vPosVS_unit, sg_vNormalVS);");
for (int i = 0; i < desc_.texGenDim; ++i) for (int i = 0; i < desc_.texGenDim; ++i)
{ {
QString assignmentInstrString;
assignmentInstrString.sprintf("sg_vTexCoord.%s = sg_TexGenRefl.%s;", texGenCoordString[i], texGenCoordString[i]); _code->push_back( QString ("sg_vTexCoord.%1 = sg_TexGenRefl.%2;").arg(texGenCoordString[i]).arg(texGenCoordString[i]) );
_code->push_back(assignmentInstrString);
} }
} break; } break;
......
...@@ -60,8 +60,7 @@ ...@@ -60,8 +60,7 @@
#include <QApplication> #include <QApplication>
#include <QObject> #include <QObject>
#include <QEvent> #include <QEvent>
#include <QDateTime> #include <QElapsedTimer>
#include <QTimerEvent> #include <QTimerEvent>
// stdc++ // stdc++
...@@ -184,7 +183,7 @@ private: ...@@ -184,7 +183,7 @@ private:
int timer_id_; int timer_id_;
// stop Time // stop Time
QTime time_; QElapsedTimer time_;
// vector to store events and top-levels sizes // vector to store events and top-levels sizes
FootPrints events_, toplevels_; FootPrints events_, toplevels_;
......
...@@ -793,7 +793,7 @@ void QtBaseViewer::updateGL() ...@@ -793,7 +793,7 @@ void QtBaseViewer::updateGL()
void QtBaseViewer::drawScene() void QtBaseViewer::drawScene()
{ {
QTime timer; QElapsedTimer timer;
timer.start(); timer.start();
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
#include <QString> #include <QString>
#include <QMenu> #include <QMenu>
#include <QToolBar> #include <QToolBar>
#include <QTime> #include <QElapsedTimer>
#include <vector> #include <vector>
#include <string> #include <string>
...@@ -89,7 +89,7 @@ class QPushButton; ...@@ -89,7 +89,7 @@ class QPushButton;
class QToolButton; class QToolButton;
class QStatusBar; class QStatusBar;
class QSplitter; class QSplitter;
class QTimer; class QElapsedTimer;
class QImage; class QImage;
class QSocketNotifier; class QSocketNotifier;
class QGraphicsWidget; class QGraphicsWidget;
...@@ -906,7 +906,7 @@ private: ...@@ -906,7 +906,7 @@ private:
std::vector< QAction * > drawMenuActions_; std::vector< QAction * > drawMenuActions_;
// Used to calculate the time passed between redraws // Used to calculate the time passed between redraws
QTime redrawTime_; QElapsedTimer redrawTime_;
//=========================================================================== //===========================================================================
/** @name view handling /** @name view handling
......
...@@ -402,7 +402,7 @@ bool QtExaminerViewer::mapToSphere(const QPoint& _v2D, Vec3d& _v3D) const ...@@ -402,7 +402,7 @@ bool QtExaminerViewer::mapToSphere(const QPoint& _v2D, Vec3d& _v3D) const
void QtExaminerViewer::slotAnimation() void QtExaminerViewer::slotAnimation()
{ {
QTime t; QElapsedTimer t;
t.start(); t.start();
makeCurrent(); makeCurrent();
rotate( lastRotationAxis_, lastRotationAngle_ ); rotate( lastRotationAxis_, lastRotationAngle_ );
......
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
#include "QtBaseViewer.hh" #include "QtBaseViewer.hh"
#include <QElapsedTimer>
#include <QTime> #include <QTime>
#include <QMouseEvent> #include <QMouseEvent>
#include <QWheelEvent> #include <QWheelEvent>
...@@ -160,7 +161,7 @@ private: ...@@ -160,7 +161,7 @@ private:
// animation stuff // animation stuff
Vec3d lastRotationAxis_; Vec3d lastRotationAxis_;
double lastRotationAngle_; double lastRotationAngle_;
QTime lastMoveTime_; QElapsedTimer lastMoveTime_;
QTimer* timer_; QTimer* timer_;
}; };
......
...@@ -174,7 +174,7 @@ glViewer::glViewer( QGraphicsScene* _scene, ...@@ -174,7 +174,7 @@ glViewer::glViewer( QGraphicsScene* _scene,
sp.setVerticalStretch( 1 ); sp.setVerticalStretch( 1 );
setSizePolicy( sp ); setSizePolicy( sp );
redrawTime_.start (); redrawTime_.start();
// timer for animation // timer for animation
timer_ = new QTimer( this ); timer_ = new QTimer( this );
...@@ -543,7 +543,7 @@ void glViewer::drawScene(double _aspect) ...@@ -543,7 +543,7 @@ void glViewer::drawScene(double _aspect)
// Inside the glWidget rendering, the system should not send extra updates // Inside the glWidget rendering, the system should not send extra updates
properties_.blockSignals(true); properties_.blockSignals(true);
QTime timer; QElapsedTimer timer;
timer.start(); timer.start();
// ***************************************************************** // *****************************************************************
...@@ -1595,7 +1595,7 @@ void glViewer::mousePressEvent(QGraphicsSceneMouseEvent* _e) ...@@ -1595,7 +1595,7 @@ void glViewer::mousePressEvent(QGraphicsSceneMouseEvent* _e)
if (clickTimer_.isActive ()) if (clickTimer_.isActive ())
{ {
clickTime_ = QTime (); clickTime_.invalidate();
clickTimer_.stop (); clickTimer_.stop ();
} }
else else
...@@ -1720,9 +1720,9 @@ void glViewer::mouseReleaseEvent(QGraphicsSceneMouseEvent* _e) ...@@ -1720,9 +1720,9 @@ void glViewer::mouseReleaseEvent(QGraphicsSceneMouseEvent* _e)
case Viewer::ExamineMode: case Viewer::ExamineMode:
viewMouseEvent(&me); viewMouseEvent(&me);
if (!clickTime_.isNull ()) if (clickTime_.isValid())
{ {
int elapsed = clickTime_.elapsed (); int elapsed = clickTime_.elapsed();
QPoint diff = clickEvent_.pos () - me.pos (); QPoint diff = clickEvent_.pos () - me.pos ();
if (abs (diff.x ()) <= 1 && abs (diff.y ()) <= 1 && elapsed <= QApplication::doubleClickInterval () / 2) if (abs (diff.x ()) <= 1 && abs (diff.y ()) <= 1 && elapsed <= QApplication::doubleClickInterval () / 2)
...@@ -1733,7 +1733,7 @@ void glViewer::mouseReleaseEvent(QGraphicsSceneMouseEvent* _e) ...@@ -1733,7 +1733,7 @@ void glViewer::mouseReleaseEvent(QGraphicsSceneMouseEvent* _e)
} }
else else
{ {
clickTime_ = QTime (); clickTime_.invalidate();
clickTimer_.stop (); clickTimer_.stop ();
} }
} }
......
...@@ -76,6 +76,7 @@ ...@@ -76,6 +76,7 @@
#include <QTimer> #include <QTimer>
#include <QMouseEvent> #include <QMouseEvent>
#include <QTime> #include <QTime>
#include <QElapsedTimer>
//== FORWARDDECLARATIONS ====================================================== //== FORWARDDECLARATIONS ======================================================
...@@ -618,7 +619,7 @@ private: ...@@ -618,7 +619,7 @@ private:
std::vector< QAction * > drawMenuActions_; std::vector< QAction * > drawMenuActions_;
// Used to calculate the time passed between redraws // Used to calculate the time passed between redraws
QTime redrawTime_; QElapsedTimer redrawTime_;
// Default VAO needed in core profile mode // Default VAO needed in core profile mode
ACG::VertexArrayObject defaultVAO_; ACG::VertexArrayObject defaultVAO_;
...@@ -955,12 +956,12 @@ private: ...@@ -955,12 +956,12 @@ private:
ACG::Vec3d lastRotationAxis_; ACG::Vec3d lastRotationAxis_;
ACG::Vec3d constrainedRotationAxis_; ACG::Vec3d constrainedRotationAxis_;
double lastRotationAngle_; double lastRotationAngle_;
QTime lastMoveTime_; QElapsedTimer lastMoveTime_;
QTimer* timer_; QTimer* timer_;
double fovyModifier_; double fovyModifier_;
QTimer clickTimer_; QTimer clickTimer_;
QTime clickTime_; QElapsedTimer clickTime_;
QMouseEvent clickEvent_; QMouseEvent clickEvent_;
......
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