diff options
Diffstat (limited to 'tests/barstest/chart.cpp')
-rw-r--r-- | tests/barstest/chart.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/barstest/chart.cpp b/tests/barstest/chart.cpp index 6ecd375a..0a8bef55 100644 --- a/tests/barstest/chart.cpp +++ b/tests/barstest/chart.cpp @@ -237,6 +237,10 @@ GraphModifier::GraphModifier(Q3DBars *barchart, QColorDialog *colorDialog) QObject::connect(&m_rotationTimer, &QTimer::timeout, this, &GraphModifier::triggerRotation); + QObject::connect(m_graph, &QAbstract3DGraph::currentFpsChanged, this, + &GraphModifier::handleFpsChange); + + resetTemperatureData(); } @@ -1213,6 +1217,12 @@ void GraphModifier::handleValueAxisLabelsChanged() qDebug() << __FUNCTION__; } +void GraphModifier::handleFpsChange(qreal fps) +{ + static const QString fpsPrefix(QStringLiteral("FPS: ")); + m_fpsLabel->setText(fpsPrefix + QString::number(qRound(fps))); +} + void GraphModifier::setBackgroundEnabled(int enabled) { m_graph->activeTheme()->setBackgroundEnabled(bool(enabled)); @@ -1235,6 +1245,11 @@ void GraphModifier::rotateY(int rotation) m_graph->scene()->activeCamera()->setCameraPosition(m_xRotation, m_yRotation); } +void GraphModifier::setFpsMeasurement(bool enable) +{ + m_graph->setMeasureFps(enable); +} + void GraphModifier::setSpecsRatio(int barwidth) { m_graph->setBarThickness((float)barwidth / 30.0f); |