aboutsummaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2024-01-23 08:52:23 +0100
committerJarek Kobus <jaroslaw.kobus@qt.io>2024-01-23 09:32:43 +0000
commit10ff747a0f30f4d6787e4d84550bd77f159d98b6 (patch)
treeb9ab2208268a6914bf196838a4ca8b49f226362d /src/shared
parent9e73dc1f097d933a9978368f95f75196968a942b (diff)
Use more std::chrono and std::chrono_literals namespaces
Change-Id: Ib8c83988d7afe35d81b87ff8c5c87eef2082f12d Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/qtsingleapplication/qtsingleapplication.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/shared/qtsingleapplication/qtsingleapplication.cpp b/src/shared/qtsingleapplication/qtsingleapplication.cpp
index 5b5f80ad6f..6bfdc0edfa 100644
--- a/src/shared/qtsingleapplication/qtsingleapplication.cpp
+++ b/src/shared/qtsingleapplication/qtsingleapplication.cpp
@@ -11,6 +11,8 @@
#include <QSharedMemory>
#include <QWidget>
+using namespace std::chrono;
+
namespace SharedTools {
static const int instancesSize = 1024;
@@ -179,12 +181,11 @@ public:
: QtSingleApplication(id, argc, argv)
, m_align(21, QChar::Space)
{}
- void setFreezeTreshold(std::chrono::milliseconds freezeAbove) { m_threshold = freezeAbove; }
+ void setFreezeTreshold(milliseconds freezeAbove) { m_threshold = freezeAbove; }
bool notify(QObject *receiver, QEvent *event) override {
if (m_inNotify)
return QtSingleApplication::notify(receiver, event);
- using namespace std::chrono;
const auto start = system_clock::now();
const QPointer<QObject> p(receiver);
const QString className = QLatin1String(receiver->metaObject()->className());
@@ -213,7 +214,7 @@ public:
private:
bool m_inNotify = false;
const QString m_align;
- std::chrono::milliseconds m_threshold{100};
+ milliseconds m_threshold{100};
};
QtSingleApplication *createApplication(const QString &id, int &argc, char **argv)
@@ -227,7 +228,7 @@ QtSingleApplication *createApplication(const QString &id, int &argc, char **argv
qDebug() << "Change the freeze detection threshold by setting the" << s_freezeDetector
<< "env var to a different numeric value (in ms).";
ApplicationWithFreezerDetector *app = new ApplicationWithFreezerDetector(id, argc, argv);
- app->setFreezeTreshold(std::chrono::milliseconds(*freezeDetector));
+ app->setFreezeTreshold(milliseconds(*freezeDetector));
return app;
}