MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / __init__

Method __init__

lib/matplotlib/backends/qt_editor/_formlayout.py:421–465  ·  view source on GitHub ↗
(self, data, title="", comment="",
                 icon=None, parent=None, apply=None)

Source from the content-addressed store, hash-verified

419class FormDialog(QtWidgets.QDialog):
420 """Form Dialog"""
421 def __init__(self, data, title="", comment="",
422 icon=None, parent=None, apply=None):
423 super().__init__(parent)
424
425 self.apply_callback = apply
426
427 # Form
428 if isinstance(data[0][0], (list, tuple)):
429 self.formwidget = FormTabWidget(data, comment=comment,
430 parent=self)
431 elif len(data[0]) == 3:
432 self.formwidget = FormComboWidget(data, comment=comment,
433 parent=self)
434 else:
435 self.formwidget = FormWidget(data, comment=comment,
436 parent=self)
437 layout = QtWidgets.QVBoxLayout()
438 layout.addWidget(self.formwidget)
439
440 self.float_fields = []
441 self.formwidget.setup()
442
443 # Button box
444 self.bbox = bbox = QtWidgets.QDialogButtonBox(
445 QtWidgets.QDialogButtonBox.StandardButton(
446 _to_int(QtWidgets.QDialogButtonBox.StandardButton.Ok) |
447 _to_int(QtWidgets.QDialogButtonBox.StandardButton.Cancel)
448 ))
449 self.formwidget.update_buttons.connect(self.update_buttons)
450 if self.apply_callback is not None:
451 apply_btn = bbox.addButton(
452 QtWidgets.QDialogButtonBox.StandardButton.Apply)
453 apply_btn.clicked.connect(self.apply)
454
455 bbox.accepted.connect(self.accept)
456 bbox.rejected.connect(self.reject)
457 layout.addWidget(bbox)
458
459 self.setLayout(layout)
460
461 self.setWindowTitle(title)
462 if not isinstance(icon, QtGui.QIcon):
463 icon = QtWidgets.QWidget().style().standardIcon(
464 QtWidgets.QStyle.SP_MessageBoxQuestion)
465 self.setWindowIcon(icon)
466
467 def register_float_field(self, field):
468 self.float_fields.append(field)

Callers

nothing calls this directly

Calls 7

FormTabWidgetClass · 0.85
FormComboWidgetClass · 0.85
FormWidgetClass · 0.85
_to_intFunction · 0.85
__init__Method · 0.45
setupMethod · 0.45
connectMethod · 0.45

Tested by

no test coverage detected