MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / setFPS

Method setFPS

app/src/Misc/TimerEvents.cpp:115–130  ·  view source on GitHub ↗

* @brief Sets the UI timer frequency in Hz. */

Source from the content-addressed store, hash-verified

113 * @brief Sets the UI timer frequency in Hz.
114 */
115void Misc::TimerEvents::setFPS(int hz)
116{
117 hz = qBound(1, hz, 240);
118
119 if (m_uiTimerHz != hz) {
120 m_uiTimerHz = hz;
121 m_settings.setValue("uiRefreshRate", hz);
122
123 if (m_uiTimer.isActive()) {
124 m_uiTimer.stop();
125 m_uiTimer.start(1000 / m_uiTimerHz, Qt::PreciseTimer, this);
126 }
127
128 Q_EMIT fpsChanged();
129 }
130}

Callers 1

Calls 3

isActiveMethod · 0.45
stopMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected