DtkCore
DTK Core module
载入中...
搜索中...
未找到
dlicenseinfo.h
浏览该文件的文档.
1// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DLICENSEINFO_H
6#define DLICENSEINFO_H
7
8#include <QVector>
9
10#include <dtkcore_global.h>
11#include <dobject.h>
12
13DCORE_BEGIN_NAMESPACE
14
15class DLicenseInfoPrivate;
16class LIBDTKCORESHARED_EXPORT DLicenseInfo : public DObject
17{
18public:
19 explicit DLicenseInfo(DObject *parent = nullptr);
20
21 bool loadContent(const QByteArray &content);
22 bool loadFile(const QString &file);
23 void setLicenseSearchPath(const QString &path);
24 QByteArray licenseContent(const QString &licenseName);
25
26 class DComponentInfoPrivate;
27 class LIBDTKCORESHARED_EXPORT DComponentInfo : public DObject
28 {
29 public:
30 explicit DComponentInfo(DObject *parent = nullptr);
31 ~DComponentInfo() override;
32
33 QString name() const;
34 QString version() const;
35 QString copyRight() const;
36 QString licenseName() const;
37
38 private:
39 D_DECLARE_PRIVATE(DComponentInfo)
40 friend class DLicenseInfoPrivate;
41 };
42 using DComponentInfos = QVector<DComponentInfo*>;
43 DComponentInfos componentInfos() const;
44
45private:
46 D_DECLARE_PRIVATE(DLicenseInfo)
47};
48
49DCORE_END_NAMESPACE
50
51#endif // DLICENSEINFO_H
dcomponentinfo 是一组用于查询组件所用开源协议信息的类
Definition dlicenseinfo.h:28
QString version() const
获取组件的版本号
QString name() const
获取组件的名称
QString licenseName() const
获取组件的所用开源许可协议名称
DComponentInfo(DObject *parent=nullptr)
组件信息类的构造函数
QString copyRight() const
获取组件的授权信息
dlicenseinfo是一组用于查询应用所用开源许可协议相关信息的类
Definition dlicenseinfo.h:17
void setLicenseSearchPath(const QString &path)
设置协议内容路径path
DLicenseInfo(DObject *parent=nullptr)
开源许可协议信息类的构造函数
bool loadFile(const QString &file)
通过文件file加载协议
DComponentInfos componentInfos() const
获取组件的相关信息
bool loadContent(const QByteArray &content)
通过内容content加载协议
QByteArray licenseContent(const QString &licenseName)
获取协议名为licenseName的内容
Definition dobject.h:25