qt/LedOK/LoUIClass/louimsgboxokcancel.cpp

38 lines
1.0 KiB
C++
Raw Normal View History

2022-01-04 18:11:48 +08:00
#include "louimsgboxokcancel.h"
#include "ui_louimsgboxokcancel.h"
LoUIMsgBoxOkCancel::LoUIMsgBoxOkCancel(QWidget *parent) :
LoQDialog(parent),
ui(new Ui::LoUIMsgBoxOkCancel)
{
ui->setupUi(this);
//让QLabel自适应text的大小直接用下面的代码
ui->lInfo->adjustSize();
//让QLabel能够自动判断并换行显示
ui->lInfo->setGeometry(QRect(328, 240, 329, 27*4)); //四倍行距
ui->lInfo->setWordWrap(true);
ui->lInfo->setAlignment(Qt::AlignTop);
}
LoUIMsgBoxOkCancel::LoUIMsgBoxOkCancel(QString text, QWidget *parent) :
LoQDialog(parent),
ui(new Ui::LoUIMsgBoxOkCancel)
{
ui->setupUi(this);
ui->lInfo->setText(text);
// ui->plainTextEdit->sett>setText(text);
}
LoUIMsgBoxOkCancel::LoUIMsgBoxOkCancel(QPixmap icon, QString text, QWidget *parent) :
LoQDialog(parent),
ui(new Ui::LoUIMsgBoxOkCancel)
{
ui->setupUi(this);
ui->lInfo->setText(text);
ui->lIcon->setPixmap(icon);
}
LoUIMsgBoxOkCancel::~LoUIMsgBoxOkCancel()
{
delete ui;
}