KCoreAddons

formats.cpp
1/*
2 SPDX-FileCopyrightText: 2014 Bhushan Shah <bhush94@gmail.com>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#include "formats.h"
8
9QString Formats::formatByteSize(double size, int precision) const
10{
11 return m_format.formatByteSize(size, precision);
12}
13
14QString Formats::formatDuration(quint64 msecs, KFormat::DurationFormatOptions options) const
15{
16 return m_format.formatDuration(msecs, options);
17}
18
19QString Formats::formatDuration(quint64 msecs, int options) const
20{
21 return m_format.formatDuration(msecs, static_cast<KFormat::DurationFormatOptions>(options));
22}
23
24QString Formats::formatDecimalDuration(quint64 msecs, int decimalPlaces) const
25{
26 return m_format.formatDecimalDuration(msecs, decimalPlaces);
27}
28
29QString Formats::formatSpelloutDuration(quint64 msecs) const
30{
31 return m_format.formatSpelloutDuration(msecs);
32}
33
34QString Formats::formatRelativeDate(const QDate &date, QLocale::FormatType format) const
35{
36 return m_format.formatRelativeDate(date, format);
37}
38
39QString Formats::formatRelativeDateTime(const QDateTime &dateTime, QLocale::FormatType format) const
40{
41 return m_format.formatRelativeDateTime(dateTime, format);
42}
43
44#include "moc_formats.cpp"
QString formatByteSize(double size, int precision=1, KFormat::BinaryUnitDialect dialect=KFormat::DefaultBinaryDialect, KFormat::BinarySizeUnits units=KFormat::DefaultBinaryUnits) const
Converts size from bytes to the appropriate string representation using the binary unit dialect diale...
Definition kformat.cpp:34
QString formatRelativeDateTime(const QDateTime &dateTime, QLocale::FormatType format) const
Returns a string formatted to a relative datetime style.
Definition kformat.cpp:75
QString formatDecimalDuration(quint64 msecs, int decimalPlaces=2) const
Given a number of milliseconds, converts that to a string containing the localized equivalent to the ...
Definition kformat.cpp:60
QString formatSpelloutDuration(quint64 msecs) const
Given a number of milliseconds, converts that to a spell-out string containing the localized equivale...
Definition kformat.cpp:65
QString formatDuration(quint64 msecs, KFormat::DurationFormatOptions options=KFormat::DefaultDuration) const
Given a number of milliseconds, converts that to a string containing the localized equivalent,...
Definition kformat.cpp:55
QString formatRelativeDate(const QDate &date, QLocale::FormatType format) const
Returns a string formatted to a relative date style.
Definition kformat.cpp:70
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 7 2024 12:01:00 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.