| 178 | } |
| 179 | |
| 180 | bool MiniQtHelper::ShowWidgetAsDialog(QWidget *widget) |
| 181 | { |
| 182 | QWidget *mainWindow = m_Ctx.GetMainWindow()->Widget(); |
| 183 | |
| 184 | m_CurrentDialog = new QDialog(mainWindow); |
| 185 | m_CurrentDialog->setWindowFlags(m_CurrentDialog->windowFlags() & ~Qt::WindowContextHelpButtonHint); |
| 186 | m_CurrentDialog->setWindowIcon(mainWindow->windowIcon()); |
| 187 | m_CurrentDialog->setWindowTitle(widget->windowTitle()); |
| 188 | m_CurrentDialog->setModal(true); |
| 189 | |
| 190 | QVBoxLayout l; |
| 191 | l.addWidget(widget); |
| 192 | l.setMargin(3); |
| 193 | |
| 194 | m_CurrentDialog->setLayout(&l); |
| 195 | |
| 196 | bool success = (RDDialog::show(m_CurrentDialog) == QDialog::Accepted); |
| 197 | |
| 198 | m_CurrentDialog->deleteLater(); |
| 199 | m_CurrentDialog = NULL; |
| 200 | |
| 201 | return success; |
| 202 | } |
| 203 | |
| 204 | void MiniQtHelper::CloseCurrentDialog(bool success) |
| 205 | { |
nothing calls this directly
no test coverage detected