20 #ifndef NEED_CONFIG_MSG_BOX_H
21 #define NEED_CONFIG_MSG_BOX_H
23 #include <QAbstractButton>
24 #include <QApplication>
25 #include <QDialogButtonBox>
26 #include <QFormLayout>
28 #include <QHBoxLayout>
30 #include <QSpacerItem>
31 #include <QVBoxLayout>
32 #include <tulip/Perspective.h>
34 QFrame *new_NeedConfigurationMsgBox(QString text, QPushButton **okButton) {
35 QFrame *frame =
new QFrame();
36 frame->setFrameShape(QFrame::Box);
37 frame->setFrameShadow(QFrame::Plain);
38 QVBoxLayout *frameLayout =
new QVBoxLayout(frame);
39 QFormLayout *formLayout =
new QFormLayout();
40 QLabel *warningLabel =
new QLabel(frame);
41 warningLabel->setText(
42 "<html><head/><body><p><span style=\" font-size:18pt; font-weight:600; color:#a51d2d;\">Warning !</span></p></body></html>");
43 formLayout->setWidget(0, QFormLayout::LabelRole, warningLabel);
45 QVBoxLayout *verticalLayout =
new QVBoxLayout();
46 QLabel *warningText =
new QLabel(text, frame);
47 verticalLayout->addWidget(warningText);
49 QSpacerItem *verticalSpacer =
50 new QSpacerItem(20, 40, QSizePolicy::Policy::Minimum, QSizePolicy::Policy::Expanding);
51 verticalLayout->addItem(verticalSpacer);
53 QHBoxLayout *horizontalLayout =
new QHBoxLayout();
54 QDialogButtonBox *buttonBox =
new QDialogButtonBox(frame);
55 buttonBox->setStandardButtons(QDialogButtonBox::Ok);
56 *okButton = buttonBox->button(QDialogButtonBox::Ok);
58 horizontalLayout->addWidget(buttonBox);
59 verticalLayout->addLayout(horizontalLayout);
60 formLayout->setLayout(0, QFormLayout::FieldRole, verticalLayout);
61 frameLayout->addLayout(formLayout);
64 frame->setObjectName(
"needConfigurationMessageBox");
66 frame->resize( 365, 151);
static void setStyleSheet(QWidget *w)
a static function to set the same style sheet as the instance main window style sheet