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

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