Commit 45edb590 authored by Jan's avatar Jan

Fixed remaining QElapsedTimer warnings

parent d5fcc1ab
...@@ -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() ) {
......
...@@ -929,7 +929,7 @@ private slots: ...@@ -929,7 +929,7 @@ private slots:
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();
......
...@@ -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