#include "x_uimsgboxok.h" #include "ui_x_uimsgboxok.h" #include #include X_UIMsgBoxOk::X_UIMsgBoxOk(QWidget *parent) : BaseDlg(parent), ui(new Ui::X_UIMsgBoxOk) { setAttribute(Qt::WA_DeleteOnClose); ui->setupUi(this); m_bExitTypeFlag=0; } X_UIMsgBoxOk::~X_UIMsgBoxOk() { delete ui; } X_UIMsgBoxOk::X_UIMsgBoxOk(QString strTitle,QString text, QWidget *parent) : BaseDlg(parent), ui(new Ui::X_UIMsgBoxOk) { setAttribute(Qt::WA_DeleteOnClose); 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); ui->pushButton_3->setVisible(false); m_bExitTypeFlag=0; ui->pushButton->setProperty("ssType", "progManageTool"); ui->pushButton_2->setProperty("ssType", "progManageTool"); ui->pushButton_3->setProperty("ssType", "progManageTool"); } X_UIMsgBoxOk::X_UIMsgBoxOk(QString strTitle,QString text, QWidget *parent,int iType) : BaseDlg(parent), ui(new Ui::X_UIMsgBoxOk) { setAttribute(Qt::WA_DeleteOnClose); ui->setupUi(this); m_bExitTypeFlag=0; 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); ui->pushButton_3->setVisible(false); if(iType==1) { ui->lInfoTip->setStyleSheet("background:rgba(206,206,206,1)"); ui->frame->setStyleSheet("QFrame{background:rgba(206,206,206,1)}"); setStyleSheet("X_UIMsgBoxOk{background:rgba(206,206,206,1)}"); ui->pushButton->setProperty("ssType", "progManageTool"); ui->pushButton_2->setProperty("ssType", "progManageTool"); } }