12 QVBoxLayout *mainLayout =
new QVBoxLayout();
14 m_layout =
new QHBoxLayout();
15 mainLayout->addLayout(m_layout);
17 QHBoxLayout *buttonLayout =
new QHBoxLayout();
19 m_closeButton =
new QPushButton(tr(
"Close"));
20 buttonLayout->addWidget(m_closeButton);
22 mainLayout->addLayout(buttonLayout);
24 setLayout(mainLayout);
26 connect(m_closeButton, SIGNAL(clicked()),
this, SLOT(
close()));
27 connect(
this, SIGNAL(accepted()),
this, SLOT(
close()));
28 connect(
this, SIGNAL(rejected()),
this, SLOT(
close()));
40 m_widgetParent = widget->parentWidget();
43 m_widgetWidth = m_widget->width();
44 m_widgetHeight = m_widget->height();
47 m_widget->resize(m_widgetWidth * 2, m_widgetHeight * 2);
48 m_layout->addWidget(m_widget);
55 return QDialog::close();
62 QDialog::done(result);
65 void PopupWidget::closePopup()
67 if (m_widget && m_widgetParent) {
68 if (QGroupBox *w = qobject_cast<QGroupBox *>(m_widgetParent)) {
69 m_widget->resize(m_widgetWidth, m_widgetHeight);
70 w->layout()->addWidget(m_widget);