Libksysguard

FormatterWrapper.cpp
1/*
2 SPDX-FileCopyrightText: 2020 Arjen Hiemstra <ahiemstra@heimr.nl>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "FormatterWrapper.h"
8
9#include "Formatter.h"
10
11namespace KSysGuard
12{
13QString FormatterWrapper::formatValue(const QVariant &value, KSysGuard::Unit unit, KSysGuard::MetricPrefix targetPrefix)
14{
15 return Formatter::formatValue(value, unit, targetPrefix);
16}
17
18QString FormatterWrapper::formatValueShowNull(const QVariant &value, KSysGuard::Unit unit, KSysGuard::MetricPrefix targetPrefix)
19{
20 return Formatter::formatValue(value, unit, targetPrefix, FormatOptionShowNull);
21}
22
23QString FormatterWrapper::formatValueWithPrecision(const QVariant &value, KSysGuard::Unit unit, int precision)
24{
25 return Formatter::formatValue(value, unit, MetricPrefixAutoAdjust, FormatOptionShowNull, precision);
26}
27
28qreal KSysGuard::FormatterWrapper::maximumLength(KSysGuard::Unit unit, const QFont &font)
29{
30 return Formatter::maximumLength(unit, font);
31}
32
33}
static QString formatValue(const QVariant &value, Unit unit, MetricPrefix targetPrefix=MetricPrefixAutoAdjust, FormatOptions options=FormatOptionNone, int precision=-1)
Converts value to the appropriate displayable string.
static qreal maximumLength(Unit unit, const QFont &font)
Return the maximum length of a formatted string for the specified unit and font.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:58:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.