blob: 8d828671b96d064d036f456c86ca88c42eb8f8ab (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#include "tracing_global.h"
#include <QString>
#include <QObject>
#include <QtQml/qqml.h>
#include <limits>
namespace Timeline {
QString TRACING_EXPORT formatTime(qint64 timestamp,
qint64 reference = std::numeric_limits<qint64>::max());
class TRACING_EXPORT TimeFormatter : public QObject {
Q_OBJECT
QML_ELEMENT
QML_SINGLETON
public:
Q_INVOKABLE QString format(qint64 timestamp, qint64 reference)
{
return formatTime(timestamp, reference);
}
};
}
|