MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / PyModalDialog

Method PyModalDialog

Gui/PythonPanels.cpp:197–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195};
196
197PyModalDialog::PyModalDialog(Gui* gui,
198 StandardButtons defaultButtons)
199 : QDialog(gui)
200 , UserParamHolder()
201 , _imp( new PyModalDialogPrivate(gui) )
202{
203 appPTR->hideSplashScreen();
204
205 _imp->holder = new DialogParamHolder( QString(), gui->getApp(), this );
206 setHolder(_imp->holder);
207 _imp->holder->initializeKnobsPublic();
208 _imp->mainLayout = new QVBoxLayout(this);
209 _imp->mainLayout->setContentsMargins(0, 0, 0, 0);
210
211 _imp->centerContainer = new QWidget(this);
212 _imp->centerLayout = new QVBoxLayout(_imp->centerContainer);
213 _imp->centerLayout->setContentsMargins(0, 0, 0, 0);
214
215
216 _imp->panel = new DockablePanel(gui,
217 _imp->holder,
218 _imp->mainLayout,
219 DockablePanel::eHeaderModeNoHeader,
220 false,
221 QUndoStackPtr(),
222 QString(), QString(),
223 _imp->centerContainer);
224 _imp->panel->turnOffPages();
225 _imp->panel->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
226 _imp->centerLayout->insertWidget(0, _imp->panel);
227
228 _imp->mainLayout->addWidget(_imp->centerContainer);
229
230 if ( (defaultButtons & eStandardButtonNoButton) == 0 ) {
231 QDialogButtonBox::StandardButtons qbuttons;
232 if (defaultButtons & eStandardButtonOk) {
233 qbuttons |= QDialogButtonBox::Ok;
234 }
235 if (defaultButtons & eStandardButtonSave) {
236 qbuttons |= QDialogButtonBox::Save;
237 }
238 if (defaultButtons & eStandardButtonSaveAll) {
239 qbuttons |= QDialogButtonBox::SaveAll;
240 }
241 if (defaultButtons & eStandardButtonOpen) {
242 qbuttons |= QDialogButtonBox::Open;
243 }
244 if (defaultButtons & eStandardButtonYes) {
245 qbuttons |= QDialogButtonBox::Yes;
246 }
247 if (defaultButtons & eStandardButtonYesToAll) {
248 qbuttons |= QDialogButtonBox::YesToAll;
249 }
250 if (defaultButtons & eStandardButtonNo) {
251 qbuttons |= QDialogButtonBox::No;
252 }
253 if (defaultButtons & eStandardButtonNoToAll) {
254 qbuttons |= QDialogButtonBox::NoToAll;

Callers

nothing calls this directly

Calls 7

initializeKnobsPublicMethod · 0.80
turnOffPagesMethod · 0.80
insertWidgetMethod · 0.80
addWidgetMethod · 0.80
QStringClass · 0.50
hideSplashScreenMethod · 0.45
getAppMethod · 0.45

Tested by

no test coverage detected