DtkCore
DTK Core module
|
DTimeUnitFormatter是用来获取时间单位的类, 通过枚举值. 更多...
Public 类型 | |
enum | TimeUnits { Seconds , Minute , Hour , Day } |
Public 成员函数 | |
DTimeUnitFormatter () | |
DTimeUnitFormatter的构造函数 | |
QString | unitStr (int unitId) const override |
根据枚举返回对应单位的缩写 更多... | |
![]() | |
DAbstractUnitFormatter () | |
DAbstractUnitFormatter 的构造函数. | |
~DAbstractUnitFormatter () | |
DAbstractUnitFormatter 的析构函数 | |
qreal | formatAs (qreal value, int currentUnit, const int targetUnit) const |
将传入的值从当前转换单位转换到目标单位上,返回转换过的值 如果当前转换单位小于目标单位,值会被缩小,反之会放大,当前转换单位也会被缩小和放大,直至当前转换单位等于目标单位。 更多... | |
QPair< qreal, int > | format (const qreal value, const int unit) const |
将值转换到最合适的单位上 更多... | |
QList< QPair< qreal, int > > | formatAsUnitList (const qreal value, int unit) const |
是 format() ,但是包含了完整的转换数据 更多... | |
Protected 成员函数 | |
int | unitMax () const override |
返回最大时间单位的枚举 更多... | |
int | unitMin () const override |
返回最小时间单位的枚举 更多... | |
uint | unitConvertRate (int unitId) const override |
根据枚举返回对应的单位进制 更多... | |
![]() | |
virtual int | unitMax () const =0 |
返回列表中最大的单位. 更多... | |
virtual int | unitMin () const =0 |
返回列表中最小的单位. 更多... | |
virtual uint | unitConvertRate (int unitId) const =0 |
返回当前设置的转换单位. unitId 单元ID. 更多... | |
virtual qreal | unitValueMax (int unitId) const |
返回列表中根据当前设置的转换单位的最大值. unitId 单元ID. | |
virtual qreal | unitValueMin (int unitId) const |
返回列表中根据当前设置的转换单位的最小值. unitId 单元ID. | |
virtual QString | unitStr (int unitId) const =0 |
传入id,返回列表中对应的字符串. unitId 单元ID. 更多... | |
DTimeUnitFormatter是用来获取时间单位的类, 通过枚举值.
\inmodule dtkcore
获取不同类型时间单位的进制
|
overrideprotectedvirtual |
根据枚举返回对应的单位进制
unitId DTimeUnitFormatter::TimeUnits 的枚举值
|
inlineoverrideprotectedvirtual |
返回最大时间单位的枚举
|
inlineoverrideprotectedvirtual |
返回最小时间单位的枚举
|
overridevirtual |
根据枚举返回对应单位的缩写
unitId DTimeUnitFormatter::TimeUnits 的枚举值