#include "rm_popup_message.h" #include #include "rm_button.h" #include "rm_popup_content_background.h" RMPopupMessage::RMPopupMessage(QWidget *parent, QString title, QString message) : RMPopup(parent,title,"") { QFont font = QFont(); font.setBold(true); font.setPointSize(16); QFontMetrics fontMetric(font); QRect bounds = fontMetric.boundingRect(message); this->setFixedWidth(bounds.width() + 30); //this->setFixedSize(bounds.width() + 30,bounds.height() + 43 + POPUP_TITLE_BAR_HEIGHT + 16); QVBoxLayout* layout = new QVBoxLayout(_contentWidget); layout->setContentsMargins(10,13,10,12); RMPopupContentBackground* bg = new RMPopupContentBackground(_contentWidget); bg->setMinimumHeight(80); layout->addWidget(bg); QVBoxLayout* contentLayout = new QVBoxLayout(bg); contentLayout->setAlignment(Qt::AlignTop | Qt::AlignLeading); QLabel* label = RMLayout::addLabel(bg,contentLayout,message,"text_header_label"); label->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding); label->setWordWrap(true); #if (LIVE_LANGUAGE2) RMButton* okButton = RMButton::create2(_buttonWidget,_buttonLayout,"popup_button","ok",QSize(120,30)); #else RMButton* okButton = RMButton::create(_buttonWidget,_buttonLayout,"popup_button",QString("OK"),QSize(120,30)); #endif okButton->setText("OK"); connect(okButton,SIGNAL(clicked()),this,SLOT(accept())); }