mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 22:47:21 -06:00
Prevent precise timers from being used when unnecessary
The implementation of QTimer::singleShot() uses Qt::PreciseTimer if interval is less than 2 seconds. This isn't mentioned in the docs. Qt::PreciseTimer increases the system's timer resolution which negatively affects power consumption. PR #18555. Closes #18350.
This commit is contained in:
committed by
sledgehammer999
parent
abd1ab5539
commit
df08bd331c
@@ -283,7 +283,7 @@ void showSplashScreen()
|
||||
painter.drawText(224 - painter.fontMetrics().horizontalAdvance(version), 270, version);
|
||||
QSplashScreen *splash = new QSplashScreen(splashImg);
|
||||
splash->show();
|
||||
QTimer::singleShot(1500ms, splash, &QObject::deleteLater);
|
||||
QTimer::singleShot(1500ms, Qt::CoarseTimer, splash, &QObject::deleteLater);
|
||||
qApp->processEvents();
|
||||
}
|
||||
#endif // DISABLE_GUI
|
||||
|
||||
Reference in New Issue
Block a user