DtkSystemSettings  1.0.3
dtk library for systemsettings.
Dtk::SystemTime::DSystemTime类 参考

用于管理系统时间和系统时间同步 更多...

#include <dsystemtime.h>

类 Dtk::SystemTime::DSystemTime 继承关系图:
Dtk::SystemTime::DSystemTime 的协作图:

Public 槽

DExpected< QStringList > listTimezones () const
 列举时区
 
DExpected< void > setLocalRTC (bool localRTC, bool fixSystem, bool interactive)
 
DExpected< void > enableNTP (bool useNTP, bool interactive)
 设置是否使用NTP同步时间 更多...
 
DExpected< void > setRelativeTime (qint64 usecUTC, bool interactive)
 设置相对时间 更多...
 
DExpected< void > setAbsoluteTime (const QDateTime &time, bool interactive)
 设置绝对时间 更多...
 
DExpected< void > setTimezone (const QString &timezone, bool interactive)
 设置本地时区 更多...
 

Public 成员函数

 DSystemTime (QObject *parent=nullptr)
 
bool canNTP () const
 是否有通过网络进行时间同步的服务
 
bool localRTC () const
 
bool NTP () const
 是否启用了NTP服务
 
bool NTPSynchronized () const
 NTPSynchronized显示内核是否报告时间是同步的
 
QString timezone () const
 
quint64 RTCTimeUSec () const
 显示RTC中当前时间 更多...
 
QDateTime timeDate () const
 时区显示当前配置的时区 更多...
 
QStringList fallbackNTPServers () const
 返回可用的NTP服务器列表
 
QStringList linkNTPServers () const
 
QStringList systemNTPServers () const
 系统设置的NTP服务器
 
qint64 frequency () const
 系统和NTP服务器同步频率
 
QString serverName () const
 NTP服务器名
 
Address serverAddress () const
 NTP服务器地址
 
Message NTPMessage () const
 NTP服务器传回信息
 
quint64 pollIntervalMaxUSec () const
 与NTP服务器同步的最大周期时间
 
quint64 pollIntervalMinUSec () const
 与NTP服务器同步的最小周期时间
 
quint64 pollIntervalUSec () const
 与NTP服务器同步时间
 
quint64 rootDistanceMaxUSec () const
 与根NTP服务器通讯最大延时
 

属性

bool canNTP
 
bool localRTC
 
bool NTP
 
bool NTPSynchronized
 
QString timezone
 
quint64 RTCTimeUSec
 
QDateTime timeDate
 
QStringList fallbackNTPServers
 
QStringList linkNTPServers
 
QStringList systemNTPServers
 
qint64 frequency
 
QString serverName
 
Address serverAddress
 
Message NTPMessage
 
quint64 pollIntervalMaxUSec
 
quint64 pollIntervalMinUSec
 
quint64 pollIntervalUSec
 
quint64 rootDistanceMaxUSec
 

详细描述

用于管理系统时间和系统时间同步

成员函数说明

◆ enableNTP

void DSystemTime::enableNTP ( bool  useNTP,
bool  interactive 
)
slot

设置是否使用NTP同步时间

参数
[in]use_NTP布尔值,开启或者关闭NTP服务
[in]interactive如果为true则会调用polkit进行鉴权

◆ RTCTimeUSec()

quint64 DSystemTime::RTCTimeUSec ( ) const

显示RTC中当前时间

返回
显示RTC中当前时间

◆ setAbsoluteTime

void DSystemTime::setAbsoluteTime ( const QDateTime &  time,
bool  interactive 
)
slot

设置绝对时间

参数
[in]time使用QDateTime表示的时间点
[in]interactive如果为true则会调用polkit进行鉴权

◆ setLocalRTC

void DSystemTime::setLocalRTC ( bool  localRTC,
bool  fixSystem,
bool  interactive 
)
slot

@bref 设置本地RTC时钟是否开启

参数
[in]interactive如果为true则会调用polkit进行鉴权

◆ setRelativeTime

void DSystemTime::setRelativeTime ( qint64  usecUTC,
bool  interactive 
)
slot

设置相对时间

参数
[in]usec_utc与当前时间的间隔
[in]interactive如果为true则会调用polkit进行鉴权

◆ setTimezone

void DSystemTime::setTimezone ( const QString &  timezone,
bool  interactive 
)
slot

设置本地时区

参数
[in]timezone时区
[in]interactive如果为true则会调用polkit进行鉴权
参见
DSystemTime::listTimezones() const

◆ timeDate()

QDateTime DSystemTime::timeDate ( ) const

时区显示当前配置的时区

返回当前系统时间的QDateTime变量

返回
当前配置的时区
当前系统时间的QDateTime

该类的文档由以下文件生成: