2019-12-19 22:46:16 +11:00
|
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
|
2019-12-18 09:50:21 +11:00
|
|
|
// The Utils class exposes various useful functions for QML that aren't
|
|
|
|
// normally provided by Qt.
|
|
|
|
|
2019-09-15 05:42:24 +10:00
|
|
|
#ifndef UTILS_H
|
|
|
|
#define UTILS_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QLocale>
|
|
|
|
|
|
|
|
|
|
|
|
class Utils : public QObject {
|
|
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
Utils();
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
QString formattedBytes(qint64 bytes, int precision = 2);
|
2019-12-04 21:22:04 +11:00
|
|
|
QString uuid();
|
2019-09-15 05:42:24 +10:00
|
|
|
|
|
|
|
private:
|
|
|
|
QLocale m_locale;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|