MCPcopy Create free account
hub / github.com/baldurk/renderdoc / ShowWidgetAsDialog

Method ShowWidgetAsDialog

qrenderdoc/Code/MiniQtHelper.cpp:180–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178}
179
180bool 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
204void MiniQtHelper::CloseCurrentDialog(bool success)
205{

Callers

nothing calls this directly

Calls 6

windowFlagsMethod · 0.80
setWindowTitleMethod · 0.80
showFunction · 0.50
WidgetMethod · 0.45
GetMainWindowMethod · 0.45
setMarginMethod · 0.45

Tested by

no test coverage detected