Add display for refresh rates in status bars

This commit is contained in:
Cacodemon345
2025-08-11 17:13:13 +06:00
parent 060f746223
commit 0dfac122e7
5 changed files with 43 additions and 0 deletions

View File

@@ -220,6 +220,16 @@ MainWindow::MainWindow(QWidget *parent)
kana_label->setToolTip(QShortcut::tr("Kana Lock"));
statusBar()->addPermanentWidget(kana_label);
auto hertz_label = new QLabel;
QTimer* frameRateTimer = new QTimer(this);
frameRateTimer->setInterval(1000);
frameRateTimer->setSingleShot(false);
connect(frameRateTimer, &QTimer::timeout, [this, hertz_label] {
hertz_label->setText(QString("%1 Hz").arg(monitors[0].mon_actualrenderedframes));
});
statusBar()->addPermanentWidget(hertz_label);
frameRateTimer->start(1000);
QTimer* ledKeyboardTimer = new QTimer(this);
ledKeyboardTimer->setTimerType(Qt::CoarseTimer);
ledKeyboardTimer->setInterval(1);