diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index a01329e4903..0e4e2309195 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -55,7 +55,7 @@ Q_LOGGING_CATEGORY(pluginLog, "qtc.extensionsystem", QtWarningMsg) const char C_IGNORED_PLUGINS[] = "Plugins/Ignored"; const char C_FORCEENABLED_PLUGINS[] = "Plugins/ForceEnabled"; -const int DELAYED_INITIALIZE_INTERVAL = 20; // ms +const std::chrono::milliseconds DELAYED_INITIALIZE_INTERVAL{20}; enum { debugLeaks = 0 }; diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp index 7c950382b96..623c7a6577a 100644 --- a/src/plugins/coreplugin/icore.cpp +++ b/src/plugins/coreplugin/icore.cpp @@ -1344,7 +1344,8 @@ void ICorePrivate::init() if (HostOsInfo::isLinuxHost()) { m_trimTimer.setSingleShot(true); - m_trimTimer.setInterval(60000); + using namespace std::chrono_literals; + m_trimTimer.setInterval(60s); // glibc may not actually free memory in free(). #ifdef Q_OS_LINUX connect(&m_trimTimer, &QTimer::timeout, this, [] { malloc_trim(0); }); diff --git a/src/plugins/coreplugin/locator/locator.cpp b/src/plugins/coreplugin/locator/locator.cpp index 0666831355a..fbe023d3095 100644 --- a/src/plugins/coreplugin/locator/locator.cpp +++ b/src/plugins/coreplugin/locator/locator.cpp @@ -163,7 +163,7 @@ void Locator::loadSettings() : QString("QuickOpen"); const Settings def; DB::beginGroup(settingsGroup); - m_refreshTimer.setInterval(DB::value("RefreshInterval", 60).toInt() * 60000); + m_refreshTimer.setInterval(std::chrono::minutes(DB::value("RefreshInterval", 60).toInt())); m_settings.useCenteredPopup = DB::value(kUseCenteredPopup, def.useCenteredPopup).toBool(); for (ILocatorFilter *filter : std::as_const(m_filters)) { @@ -359,7 +359,7 @@ void Locator::setRefreshInterval(int interval) m_refreshTimer.setInterval(0); return; } - m_refreshTimer.setInterval(interval * 60000); + m_refreshTimer.setInterval(std::chrono::minutes(interval)); m_refreshTimer.start(); } diff --git a/src/plugins/coreplugin/locator/locatorwidget.cpp b/src/plugins/coreplugin/locator/locatorwidget.cpp index 5876c20827c..6b008ccc13a 100644 --- a/src/plugins/coreplugin/locator/locatorwidget.cpp +++ b/src/plugins/coreplugin/locator/locatorwidget.cpp @@ -612,7 +612,8 @@ LocatorWidget::LocatorWidget(Locator *locator) m_progressIndicator->raise(); m_progressIndicator->hide(); m_showProgressTimer.setSingleShot(true); - m_showProgressTimer.setInterval(50); // don't show progress for < 50ms tasks + using namespace std::chrono_literals; + m_showProgressTimer.setInterval(50ms); // don't show progress for < 50ms tasks connect(&m_showProgressTimer, &QTimer::timeout, this, [this] { setProgressIndicatorVisible(true); }); diff --git a/src/plugins/coreplugin/outputwindow.cpp b/src/plugins/coreplugin/outputwindow.cpp index dfc7e0c9d87..7e32bcc807d 100644 --- a/src/plugins/coreplugin/outputwindow.cpp +++ b/src/plugins/coreplugin/outputwindow.cpp @@ -37,6 +37,7 @@ const int chunkSize = 10000; using namespace Utils; +using namespace std::chrono_literals; namespace Core { @@ -89,7 +90,7 @@ OutputWindow::OutputWindow(Context context, const Key &settingsKey, QWidget *par d->formatter.setPlainTextEdit(this); d->queueTimer.setSingleShot(true); - d->queueTimer.setInterval(10); + d->queueTimer.setInterval(10ms); connect(&d->queueTimer, &QTimer::timeout, this, &OutputWindow::handleNextOutputChunk); d->settingsKey = settingsKey; @@ -149,7 +150,7 @@ OutputWindow::OutputWindow(Context context, const Key &settingsKey, QWidget *par cutAction->setEnabled(false); copyAction->setEnabled(false); - d->scrollTimer.setInterval(10); + d->scrollTimer.setInterval(10ms); d->scrollTimer.setSingleShot(true); connect(&d->scrollTimer, &QTimer::timeout, this, &OutputWindow::scrollToBottom); diff --git a/src/plugins/coreplugin/welcomepagehelper.cpp b/src/plugins/coreplugin/welcomepagehelper.cpp index 9854991f3d8..4fb0cd08079 100644 --- a/src/plugins/coreplugin/welcomepagehelper.cpp +++ b/src/plugins/coreplugin/welcomepagehelper.cpp @@ -644,7 +644,8 @@ void ListItemDelegate::goon() SectionedGridView::SectionedGridView(QWidget *parent) : QStackedWidget(parent) { - m_searchTimer.setInterval(320); + using namespace std::chrono_literals; + m_searchTimer.setInterval(320ms); m_searchTimer.setSingleShot(true); connect(&m_searchTimer, &QTimer::timeout, this, [this] { setSearchString(m_delayedSearchString);