Files
z-bar-qt/Plugins/ZShell/Services/usagefmt.hpp
T
zach cc9aeca98b
C++ / fmt (pull_request) Failing after 4s
C++ / build (pull_request) Failing after 10s
C++ / clang-tidy (pull_request) Failing after 10s
JS/TS / fmt (pull_request) Successful in 10s
JS/TS / lint (pull_request) Successful in 9s
Python / static (pull_request) Successful in 33s
Rust / build (pull_request) Successful in 48s
Python / verify (pull_request) Successful in 1m42s
Rust / fmt (pull_request) Successful in 26s
Rust / clippy (pull_request) Successful in 45s
fix: column index desync after reorder
2026-09-27 22:47:31 +02:00

38 lines
784 B
C++

#pragma once
#include <qaccessible_base.h>
#include <qobject.h>
#include <qobjectdefs.h>
#include <qqmlintegration.h>
#include <qtmetamacros.h>
namespace ZShell::services::usagefmt {
struct FormatResult {
Q_GADGET
QML_ANONYMOUS
Q_PROPERTY(qreal value MEMBER value CONSTANT)
Q_PROPERTY(qreal total MEMBER total CONSTANT)
Q_PROPERTY(QString unit MEMBER unit CONSTANT)
public:
qreal value;
qreal total;
QString unit;
};
class UsageFmt : public QObject {
Q_OBJECT
QML_ELEMENT
QML_SINGLETON
public:
Q_INVOKABLE [[nodiscard]] FormatResult formatKib(qreal kib) const;
Q_INVOKABLE [[nodiscard]] FormatResult formatKib(
qreal kib, qreal total) const;
Q_INVOKABLE [[nodiscard]] FormatResult formatBytes(qreal bytes) const;
};
} // namespace ZShell::services::usagefmt