| 1 |
|
| 2 |
|
| 3 |
|
| 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 |
化对话框 |
| 32 |
标题 |
| 33 |
述内容 |
| 34 |
钮1内容 |
| 35 |
钮1类型 |
| 36 |
容(可省略) |
| 37 |
型(可省略) |
| 38 |
作返回值 |
| 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 |
动换行 |
| 47 |
|
| 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 |