17 #include <QApplication>
19 #include <QMessageBox>
20 #include <QPushButton>
23 #include <QVBoxLayout>
26 const QSize default_dialog_size(512, 300);
30 const QString& details)
31 : QDialog(parent), m_topLabel(new QLabel), m_textEdit(new QTextEdit)
33 setWindowTitle(title);
37 m_textEdit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
38 setWindowFlags(Qt::Dialog);
40 resize(default_dialog_size);
41 setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
43 QColor bgColor(240, 240, 240, 255);
45 palette.setColor(QPalette::Window, bgColor);
46 setAutoFillBackground(
true);
49 auto topLayout =
new QHBoxLayout;
52 topLayout->addStretch(1);
54 auto mainLayout =
new QVBoxLayout;
55 mainLayout->addLayout(topLayout);
59 setLayout(mainLayout);
61 setSizeGripEnabled(
true);
78 auto result =
new QVBoxLayout;
80 QIcon icon = QApplication::style()->standardIcon(QStyle::SP_MessageBoxWarning);
82 auto label =
new QLabel;
83 label->setPixmap(icon.pixmap(128));
85 result->addWidget(label);
86 result->setContentsMargins(5, 5, 5, 5);
97 auto result =
new QVBoxLayout;
99 result->setContentsMargins(5, 5, 5, 5);
107 auto result =
new QHBoxLayout;
109 auto okButton =
new QPushButton(
"Ok");
110 connect(okButton, &QPushButton::clicked,
this, &DetailedMessageBox::reject);
112 result->addStretch(1);
113 result->addWidget(okButton);
Defines class DesignerHelper.
Defines class DetailedMessageBox.
void setText(const QString &text)
void setDetailedText(const QString &text)
DetailedMessageBox(QWidget *parent, const QString &title, const QString &text, const QString &details)
QBoxLayout * createButtonLayout()
Creates button layout with buttons.
QBoxLayout * createInfoLayout()
Creates right layout with text and QComboBox selection.
QBoxLayout * createLogoLayout()
Returns layout with icon for left part of the widget.