DtkWidget
DTK Widget module
载入中...
搜索中...
未找到
ddialog_p.h
1// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DDIALOG_P_H
6#define DDIALOG_P_H
7
8#include <QPointer>
9#include <QPushButton>
10#include <QSpacerItem>
11#include <DDialog>
12#include "dabstractdialogprivate_p.h"
13
14QT_BEGIN_NAMESPACE
15class QHBoxLayout;
16QT_END_NAMESPACE
17
18DWIDGET_BEGIN_NAMESPACE
19
20class DIconButton;
21class DTitlebar;
22class DVBoxWidget;
23class DHBoxWidget;
24
26{
27protected:
29
30 QBoxLayout *getContentLayout();
31
32private:
33 bool onButtonClickedClose = true;
34 QIcon icon;
35 QString title;
36 QString message;
37 Qt::TextFormat textFormat;
38
39 QLabel* messageLabel;
40 QLabel* titleLabel;
41
42 DTitlebar *titleBar = nullptr;
43 QHBoxLayout *iconLayout;
44 QVBoxLayout *contentLayout;
45 QWidget *contentWidget = nullptr;
46 QHBoxLayout *buttonLayout;
47 const QScreen *targetScreen = nullptr;
48 QSpacerItem *spacer = nullptr;
49
50 QList<QAbstractButton*> buttonList;
51 QList<QWidget*> contentList;
52
53 QPointer<QAbstractButton> defaultButton;
54
55 int clickedButtonIndex;
56
57 void init();
58 const QScreen *getScreen() const;
59 QString trimTag(QString origin) const;
60 QMap<int, QString> scanTags(const QString origin) const;
61 QString elideString(QString str, const QFontMetrics &fm, int width) const;
62
63 void updateSize();
64 void setSpacer(int height);
65
66 void _q_onButtonClicked();
67 void _q_defaultButtonTriggered();
68
69 Q_DECLARE_PUBLIC(DDialog)
70};
71
72DWIDGET_END_NAMESPACE
73
74#endif // DDIALOG_P_H
75
Definition dabstractdialogprivate_p.h:21
Definition ddialog_p.h:26
DDialog 旨在提供简要的讯问式对话框的快速实现。提供了包含标题,对话框内容,默认图标,用以添加按钮的布局和一个可以自由添加内容的内容布局。
Definition ddialog.h:22
Dtitlebar是Dtk程序通用的标题栏组件,用于实现标题栏的高度定制化
Definition dtitlebar.h:24