Debian Codegraph @

src/app/view/formatdialog.h

raw symbols SCIP
1 // SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd.
2 //
3 // SPDX-License-Identifier: GPL-3.0-only
4
5 #ifndef FORMATDIALOG_H
6 #define FORMATDIALOG_H
7 #include <DDialog>
8 #include <DLabel>
9
10 DWIDGET_USE_NAMESPACE
11
12
13 struct NewStr {
14 QStringList strList;
15 QString resultStr;
16 int fontHeifht = 0;
17 };
18
19 NewStr autoCutText(const QString &text, DLabel *pDesLbl);
20
21
22 class FormatDialog : public DDialog
23 {
24 Q_OBJECT
25
26 public:
27 explicit FormatDialog(QWidget *parent = nullptr);
28 ~FormatDialog() override;
29
30 /**
31 * @brief initDialog 初始化对话框
32 * @param titleText 标题
33 * @param strFormatText 描述内容
34 * @param btnMsg1 按钮1内容
35 * @param btnType1 按钮1类型
36 * @param btnMsg2 按钮2内容(可省略)
37 * @param btnType2 按钮2类型(可省略)
38 * @return 操作返回值
39 */
40
41 void initDialog(const QString &titleText = "", const QString &strFormatText = "", const QString btnMsg1 = "", ButtonType btnType1 = ButtonNormal,
42 const QString btnMsg2 = "", ButtonType btnType2 = ButtonNormal);
43
44
45 /**
46 * @brief autoFeed 自动换行
47 * @param label
48 */
49 void autoFeed(DLabel *label);
50
51 protected:
52 void changeEvent(QEvent *event) override;
53
54 private:
55 QString m_strFormatText;
56 int m_iLabelOldHeight = 0;
57 int m_iDialogOldHeight = 0;
58 };
59
60 #endif // FORMATDIALOG_H