DtkWidget
DTK Widget module
载入中...
搜索中...
未找到
dfeaturedisplaydialog_p.h
1// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DFEATUREDISPLAYDIALOG_P_H
6#define DFEATUREDISPLAYDIALOG_P_H
7
9#include "ddialog_p.h"
10
11DWIDGET_BEGIN_NAMESPACE
12class DCommandLinkButton;
13
14class DFeatureItemWidget : public QWidget
15{
16 Q_OBJECT
17public:
18 explicit DFeatureItemWidget(const QIcon &icon = QIcon(), const QString &name = QString(), const QString &description = QString(), QWidget *parent = nullptr);
19 virtual ~DFeatureItemWidget() override;
20
21 void setDescriptionLabelWidth(const int width);
22 int descriptionLabelWidth();
23
24private:
25 QLabel *m_iconLabel = nullptr;
26 QLabel *m_featureNameLabel = nullptr;
27 QLabel *m_featureDescriptionLabel = nullptr;
28};
29
30class DFeatureItemPrivate: public Core::DObjectPrivate
31{
32public:
33 explicit DFeatureItemPrivate(Core::DObject *qq, const QIcon &icon,
34 const QString &name = QString(), const QString &description = QString());
35 ~DFeatureItemPrivate() override;
36
37 QIcon m_icon;
38 QString m_name;
39 QString m_description;
40};
41
43{
44protected:
46
47private:
48 void init();
49 void addFeatureItem(const QIcon &icon, const QString &name, const QString &description);
50 int getDescriptionMaxWidth();
51 void updateItemWidth();
52 void createWidgetItems();
53 void deleteItems();
54 void clearLayout();
55
56private:
57 QLabel *m_title = nullptr;
58 QVBoxLayout *m_vBoxLayout = nullptr;
59 DCommandLinkButton *m_linkBtn = nullptr;
60 QString m_linkUrl;
61 QList<QPointer<DFeatureItem>> m_featureItems;
62
63 Q_DECLARE_PUBLIC(DFeatureDisplayDialog)
64
65private:
66 void _q_toggleLinkBtn();
67};
68
69DWIDGET_END_NAMESPACE
70
71#endif // DFEATUREDISPLAYDIALOG_P_H
DCommandLinkButton 一个继承于 QAbstractButton 的按钮,外形和链接很像;
Definition dcommandlinkbutton.h:15
Definition ddialog_p.h:26
Definition dfeaturedisplaydialog_p.h:43
特性介绍对话框,展示应用更新的新特性
Definition dfeaturedisplaydialog.h:37
Definition dfeaturedisplaydialog_p.h:31
Definition dfeaturedisplaydialog_p.h:15