DtkCore
DTK Core module
Dtk::Core::DSysInfo类 参考

dsysinfo 是一组用于查询系统信息的静态类 更多...

Public 类型

enum  ProductType {
  UnknownType = 0 , Deepin , ArchLinux , CentOS ,
  Debian , Fedora , LinuxMint , Manjaro ,
  openSUSE , SailfishOS , Ubuntu , Uos ,
  Gentoo , NixOS
}
 产品信息 更多...
 
enum  DeepinType {
  UnknownDeepin = 0 , DeepinDesktop , DeepinProfessional , DeepinServer ,
  DeepinPersonal
}
 深度操作系统版本 更多...
 
enum  LogoType { Normal = 0 , Light , Symbolic , Transparent }
 系统的logo类型 更多...
 
enum  OrgType { Distribution , Distributor , Manufacturer }
 
enum  UosType {
  UosTypeUnknown , UosDesktop , UosServer , UosDevice ,
  UosTypeCount
}
 UOS版本类型 更多...
 
enum  UosEdition {
  UosEditionUnknown , UosProfessional , UosHome , UosCommunity ,
  UosMilitary , UosEnterprise , UosEnterpriseC , UosEuler ,
  UosMilitaryS , UosDeviceEdition , UosEducation , UosEditionCount
}
 详细uos版本 更多...
 
enum  UosArch {
  UosArchUnknown , UosAMD64 = 1 << 0 , UosARM64 = 1 << 1 , UosMIPS64 = 1 << 2 ,
  UosSW64 = 1 << 3
}
 UOS使用的架构 更多...
 
enum  Arch {
  ARM64 , ARM64_BE , ARM , ARM_BE ,
  ALPHA , SW_64 , ARC , ARC_BE ,
  CRIS , X86_64 , X86 , IA64 ,
  LOONGARCH64 , M68K , MIPS64_LE , MIPS64 ,
  MIPS_LE , MIPS , NIOS2 , PARISC64 ,
  PARISC , PPC64_LE , PPC64 , PPC ,
  PPC_LE , RISCV32 , RISCV64 , S390X ,
  S390 , SH64 , SH , SPARC64 ,
  SPARC , TILEGX , NUM_ARCHES
}
 

Public 成员函数

 Q_ENUM (Arch) static bool isDeepin()
 
 Q_DECL_DEPRECATED_X ("Use arch() instead") static UosType uosType()
 
 Q_DECL_DEPRECATED_X ("Use distributionInfoPath() instead") static QString deepinDistributionInfoPath()
 
 Q_DECL_DEPRECATED_X ("Use deepinDistributionOrgName() instead") static QString deepinDistributorName()
 
 Q_DECL_DEPRECATED_X ("Use deepinDistributionOrgWebsite() instead") static QPair< QString
 
QString deepinDistributorWebsite ()
 
 Q_DECL_DEPRECATED_X ("Use deepinDistributionOrgLogo() instead") static QString deepinDistributorLogo(LogoType type
 

静态 Public 成员函数

static bool isDDE ()
 是否使用dde桌面环境 更多...
 
static DeepinType deepinType ()
 deepin系统类型 更多...
 
static QString deepinTypeDisplayName (const QLocale &locale=QLocale::system())
 显示的deepin发行版类型名称 更多...
 
static QString deepinVersion ()
 deepin版本 更多...
 
static QString deepinEdition ()
 
static QString deepinCopyright ()
 deepin 开源许可协议 更多...
 
static UosEdition uosEditionType ()
 DSysInfo::osEditionType 版本类型 显示版本类型 专业版/个人版/社区版.. 更多...
 
static UosArch uosArch ()
 DSysInfo::osArch 架构信息 更多...
 
static QString uosProductTypeName (const QLocale &locale=QLocale::system())
 
static QString uosSystemName (const QLocale &locale=QLocale::system())
 SystemName[xx] 项对应的值 更多...
 
static QString uosEditionName (const QLocale &locale=QLocale::system())
 
static QString spVersion ()
 阶段版本名称 更多...
 
static QString udpateVersion ()
 更新版本名称 小版本号 A-BC-D 中 D、A.B.C 模式中的 C 返回 update1… update9, 如果正式版返回空 X.Y.Z模式下暂不支持返回此版本号 更多...
 
static QString majorVersion ()
 主版本号 主版本号 【20】【23】【25】【26】【29】【30】 更多...
 
static QString minorVersion ()
 小版本号 【ABCD】 ·[0-9]{4} 【A.B.C】 或者【X.Y.Z】 更多...
 
static QString buildVersion ()
 小版本号 系统镜像批次号, 按时间顺序(不可回退)从100-999递增 更多...
 
static QString distributionInfoPath ()
 
static QString distributionInfoSectionName (OrgType type)
 返回distribution.info 文件中SectionName字段的值
 
static QString distributionOrgName (OrgType type=Distribution, const QLocale &locale=QLocale::system())
 返回组织名称 更多...
 
static QPair< QString, QString > distributionOrgWebsite (OrgType type=Distribution)
 发行版组织的网站名称和网址。使用 type 作为 Distribution 获取当前 deepin 发行版本身的名称。
 
static QString distributionOrgLogo (OrgType orgType=Distribution, LogoType type=Normal, const QString &fallback=QString())
 获得的组织logo路径, 如果不存在, 则返回给定的其他路径 更多...
 
static QString operatingSystemName ()
 操作系统名
 
static ProductType productType ()
 产品类型
 
static QString productTypeString ()
 
static QString productVersion ()
 产品版本
 
static bool isCommunityEdition ()
 检查当前版本是否是社区版 开发者可以使用这种方式来检查我们是否需要启用或禁用社区版或企业版的功能。 更多...
 
static QString computerName ()
 电脑名
 
static QString cpuModelName ()
 cpu模式名
 
static qint64 memoryInstalledSize ()
 内存安装大小
 
static qint64 memoryTotalSize ()
 实际内存大小
 
static qint64 systemDiskSize ()
 系统磁盘大小
 
static QDateTime bootTime ()
 系统启动时间点
 
static QDateTime shutdownTime ()
 上一次正常关机时间点(重启也会被记录在内)
 
static qint64 uptime ()
 系统启动到现在时长 更多...
 
static Arch arch ()
 cpu架构信息 更多...
 

Public 属性

const QString & fallback = QString())
 

详细描述

dsysinfo 是一组用于查询系统信息的静态类

成员枚举类型说明

◆ DeepinType

深度操作系统版本

dsysinfo.h

序号 含义
UnknownDeepin 0 未知版本
DeepinDesktop 1 deepin桌面发行版
DeepinProfessional 2 deepin专业版, 现为uos专业版
DeepinServer 3 deepin服务器版本, 现为uos服务器版
DeepinPersonal 4 deepin个人版, 现为uos家庭版

◆ LogoType

系统的logo类型

序号 含义
Normal 0 正常
Light 1 亮色
Symbolic 2 符号
Transparent 3 水印

◆ OrgType

序号 含义
Distribution 0 当前版本
Distributor 1 当前发行版
Manufacturer 2 当前发行版或设备的制造商

◆ ProductType

产品信息

dsysinfo.h

序号 含义
UnknownType 0 未知类型
deepin 1 深度社区版
ArchLinux 2
CentOS 3
Debian 4
Fedora 5
LinuxMint 6
Manjaro 7
openSUSE 8
SailfishOS 9
Ubuntu 10
Uos 11
Gentoo 12
NixOS 13

◆ UosArch

UOS使用的架构

序号 含义
UosArchUnknown 0 未知架构
UosAMD64 1 x86_64
UosARM64 2 arm64
UosMIPS64 4 mips64
UosSW64 8 sw_64

◆ UosEdition

详细uos版本

序号 含义
UosEditionUnknown 0 未知发行版
UosProfessional 1 UOS专业版
UosHome 2 UOS家庭版
UosCommunity 3 社区版
UosMilitary 4 *
UosEnterprise 5 UOS企业版
UosEnterpriseC 6 UOS行业版
UosEuler 7 UOS服务器欧拉版
UosMilitaryS 8 *
UosDeviceEdition 9 UOS专用设备版
UosEducation 10 UOS教育版
UosEditionCount 11 记录枚举数量

◆ UosType

UOS版本类型

序号 含义
UosTypeUnknown 0 未知版本
UosDesktop 1 UOS桌面版
UosServer 2 UOS服务器版
UosDevice 3 UOS设备版
UosTypeCount 4 记录枚举数量

成员函数说明

◆ arch()

static Arch Dtk::Core::DSysInfo::arch ( )
static

cpu架构信息

注解
此处架构是从gcc编译器获取的

◆ buildVersion()

static QString Dtk::Core::DSysInfo::buildVersion ( )
static

小版本号 系统镜像批次号, 按时间顺序(不可回退)从100-999递增

注解
此方法仅在linux平台下可用

◆ deepinCopyright()

static QString Dtk::Core::DSysInfo::deepinCopyright ( )
static

deepin 开源许可协议

注解
此方法仅在linux平台下可用

◆ deepinType()

static DeepinType Dtk::Core::DSysInfo::deepinType ( )
static

deepin系统类型

注解
此方法仅在linux平台下可用

◆ deepinTypeDisplayName()

static QString Dtk::Core::DSysInfo::deepinTypeDisplayName ( const QLocale &  locale = QLocale::system())
static

显示的deepin发行版类型名称

注解
此方法仅在linux平台下可用

◆ deepinVersion()

static QString Dtk::Core::DSysInfo::deepinVersion ( )
static

deepin版本

注解
此方法仅在linux平台下可用

◆ distributionInfoPath()

static QString Dtk::Core::DSysInfo::distributionInfoPath ( )
static

@brie 返回distribution文件地址 一般在/usr/share/deepin/目录下

◆ distributionOrgLogo()

static QString Dtk::Core::DSysInfo::distributionOrgLogo ( OrgType  orgType = Distribution,
LogoType  type = Normal,
const QString &  fallback = QString() 
)
static

获得的组织logo路径, 如果不存在, 则返回给定的其他路径

使用 type 作为 Distribution 获取当前 deepin 发行版本身的logo。

◆ distributionOrgName()

static Dtk::Core::DSysInfo::distributionOrgName ( OrgType  type = Distribution,
const QLocale &  locale = QLocale::system() 
)
static

返回组织名称

使用类型为Distribution来获取当前deepin distribution本身的名称

◆ isCommunityEdition()

static bool Dtk::Core::DSysInfo::isCommunityEdition ( )
static

检查当前版本是否是社区版 开发者可以使用这种方式来检查我们是否需要启用或禁用社区版或企业版的功能。

目前的规则: 专业版、服务器版、个人版(DeepinType)将被视为企业版。
Uos(ProductType)将被视为企业版。

◆ isDDE()

static bool Dtk::Core::DSysInfo::isDDE ( )
static

是否使用dde桌面环境

注解
此方法仅在linux平台下可用

◆ majorVersion()

static QString Dtk::Core::DSysInfo::majorVersion ( )
static

主版本号 主版本号 【20】【23】【25】【26】【29】【30】

注解
此方法仅在linux平台下可用

◆ minorVersion()

static QString Dtk::Core::DSysInfo::minorVersion ( )
static

小版本号 【ABCD】 ·[0-9]{4} 【A.B.C】 或者【X.Y.Z】

注解
此方法仅在linux平台下可用

◆ spVersion()

static QString Dtk::Core::DSysInfo::spVersion ( )
static

阶段版本名称

小版本号 A-BC-D 中 BC、 A.B.C 中的 B 返回 SP1-SPxx, 如果正式版返回空 X.Y.Z模式下暂不支持返回此版本号

注解
minVersion.BC == 00 正式版本, minVersion.BC | minVersion.B == 01-99 SP1….SP99
此方法仅在linux平台下可用

◆ udpateVersion()

static QString Dtk::Core::DSysInfo::udpateVersion ( )
static

更新版本名称 小版本号 A-BC-D 中 D、A.B.C 模式中的 C 返回 update1… update9, 如果正式版返回空 X.Y.Z模式下暂不支持返回此版本号

注解
minVersion.D == 0;正式版本 minVersion.D | minVersion.C == 1-9;update1… update9, updateA...updateZ
此方法仅在linux平台下可用

◆ uosArch()

static UosArch Dtk::Core::DSysInfo::uosArch ( )
static

DSysInfo::osArch 架构信息

(使用一个字节的二进制位, 从低位到高位) 【0x8 sw64】【0x4 mips64】【0x2 arm64】【0x1 amd64】

注解
此处架构是从OsBuild获取的系统版本的Arch信息, 并不是指硬件的Arch信息
此方法仅在linux平台下可用

◆ uosEditionType()

static UosEdition Dtk::Core::DSysInfo::uosEditionType ( )
static

DSysInfo::osEditionType 版本类型 显示版本类型 专业版/个人版/社区版..

注解
根据 osBuild.B && osBuild.D
此方法仅在linux平台下可用

◆ uosSystemName()

static QString Dtk::Core::DSysInfo::uosSystemName ( const QLocale &  locale = QLocale::system())
static

SystemName[xx] 项对应的值

如果找不到对应语言的默认使用 SystemName 的值 Uniontech OS locale 当前系统语言

注解
此方法仅在linux平台下可用

◆ uptime()

static qint64 Dtk::Core::DSysInfo::uptime ( )
static

系统启动到现在时长

注解
参见cat /proc/uptime命令

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