qt/LedOK/LoUIClass/x_uimsgboxokcancel.cpp

49 lines
2.0 KiB
C++
Raw Normal View History

2022-01-04 18:11:48 +08:00
#include "x_uimsgboxokcancel.h"
#include "ui_x_uimsgboxokcancel.h"
X_UIMsgBoxOkCancel::X_UIMsgBoxOkCancel(QWidget *parent) :
LoQDialog(parent),
ui(new Ui::X_UIMsgBoxOkCancel)
{
ui->setupUi(this);
}
X_UIMsgBoxOkCancel::~X_UIMsgBoxOkCancel()
{
delete ui;
}
X_UIMsgBoxOkCancel::X_UIMsgBoxOkCancel(QString strTitle,QString text, QWidget *parent) :
LoQDialog(parent),
ui(new Ui::X_UIMsgBoxOkCancel)
{
ui->setupUi(this);
ui->lInfoTip->adjustSize();
ui->label_3->setText(strTitle);
//让QLabel能够自动判断并换行显示
// ui->lInfoTip->setGeometry(QRect(328, 240, 329, 27*4)); //四倍行距
ui->lInfoTip->setWordWrap(true);
ui->lInfoTip->setAlignment(Qt::AlignTop);
ui->lInfoTip->setText(text);
//if(iType==1)
{
ui->lInfoTip->setStyleSheet("background:rgba(236,236,236,1)");
ui->frame->setStyleSheet("QFrame{background:rgba(236,236,236,1)}");
setStyleSheet("background:rgba(236,236,236,1)");
// ui->buttonBox->setProperty("ssType", "progManageTool");
// ui->buttonBox->setStyleSheet("color:rgba(28,154,210,255);");
ui->pushButton_2->setProperty("ssType", "progManageTool");
ui->pushButton_2->setStyleSheet("QPushButton{background:rgba(28,154,210,255);}");
}
ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("OK"));
ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
ui->buttonBox->button(QDialogButtonBox::Ok)->setProperty("ssType", "progManageTool");
ui->buttonBox->button(QDialogButtonBox::Ok)->setStyleSheet("QPushButton{background:rgba(28,154,210,255);}");
ui->buttonBox->button(QDialogButtonBox::Cancel)->setProperty("ssType", "progManageTool");
ui->buttonBox->button(QDialogButtonBox::Cancel)->setStyleSheet("QPushButton{background:rgba(28,154,210,255);}");
ui->pushButton_2->setProperty("ssType", "progManageTool");
ui->pushButton_2->setStyleSheet("QPushButton{background:rgba(28,154,210,255);}");
}