summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLorn Potter <lorn.potter@gmail.com>2018-06-04 18:57:52 +1000
committerLorn Potter <lorn.potter@gmail.com>2018-06-05 04:25:34 +0000
commite7adaf997019864ab1d52a208a0a797aafb04d5a (patch)
treeb576d6ece4363591e2730f36f1dd0041878511a2 /examples
parent313dba2d81735313b4d245ed4d463bb1ce6619de (diff)
wasm: remove FPS code form wiggly
was intended for testing purposes Change-Id: I510025bed389ae122a908f50f4cf9858413bfa0b Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/widgets/widgets/wiggly/wigglywidget.cpp32
1 files changed, 0 insertions, 32 deletions
diff --git a/examples/widgets/widgets/wiggly/wigglywidget.cpp b/examples/widgets/widgets/wiggly/wigglywidget.cpp
index 3162796834..1b8f3cffad 100644
--- a/examples/widgets/widgets/wiggly/wigglywidget.cpp
+++ b/examples/widgets/widgets/wiggly/wigglywidget.cpp
@@ -52,14 +52,6 @@
#include "wigglywidget.h"
-#include <chrono>
-#include <iostream>
-#include <sstream>
-
-std::chrono::steady_clock::time_point tp;
-int frames = 0;
-float fps = -1.0;
-
//! [0]
WigglyWidget::WigglyWidget(QWidget *parent)
: QWidget(parent)
@@ -73,8 +65,6 @@ WigglyWidget::WigglyWidget(QWidget *parent)
step = 0;
timer.start(60, this);
-
- tp = std::chrono::steady_clock::now();
}
//! [0]
@@ -82,20 +72,6 @@ WigglyWidget::WigglyWidget(QWidget *parent)
void WigglyWidget::paintEvent(QPaintEvent * /* event */)
//! [1] //! [2]
{
- auto dt = std::chrono::steady_clock::now() - tp;
-
- auto const interval = std::chrono::seconds(1);
- if (dt > interval)
- {
- float const seconds = std::chrono::duration_cast<std::chrono::duration<float>>(interval).count();
- fps = (float)frames/seconds;
- std::cout << "Rendered " << frames << " in " << seconds << " seconds. Fps: " << fps << std::endl;
- frames = 0;
- tp = std::chrono::steady_clock::now();
- }
- else
- ++frames;
-
static const int sineTable[16] = {
0, 38, 71, 92, 100, 92, 71, 38, 0, -38, -71, -92, -100, -92, -71, -38
};
@@ -117,14 +93,6 @@ void WigglyWidget::paintEvent(QPaintEvent * /* event */)
QString(text[i]));
x += metrics.horizontalAdvance(text[i]);
}
-
- std::ostringstream ss;
- if (fps > 0.0f)
- ss << "Fps: " << fps;
- else
- ss << "Fps: --";
-
- painter.drawText(10, 40, QString(ss.str().c_str()));
}
//! [4]