qt/LedOK/LoUIClass/louimsgboxokcancel.cpp
2022-01-04 18:11:48 +08:00

38 lines
1.0 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#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;
}