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

Function fedit

lib/matplotlib/backends/qt_editor/_formlayout.py:499–538  ·  view source on GitHub ↗

Create form dialog data: datalist, datagroup title: str comment: str icon: QIcon instance parent: parent QWidget apply: apply callback (function) datalist: list/tuple of (field_name, field_value) datagroup: list/tuple of (datalist *or* datagroup, title, comment

(data, title="", comment="", icon=None, parent=None, apply=None)

Source from the content-addressed store, hash-verified

497
498
499def fedit(data, title="", comment="", icon=None, parent=None, apply=None):
500 """
501 Create form dialog
502
503 data: datalist, datagroup
504 title: str
505 comment: str
506 icon: QIcon instance
507 parent: parent QWidget
508 apply: apply callback (function)
509
510 datalist: list/tuple of (field_name, field_value)
511 datagroup: list/tuple of (datalist *or* datagroup, title, comment)
512
513 -> one field for each member of a datalist
514 -> one tab for each member of a top-level datagroup
515 -> one page (of a multipage widget, each page can be selected with a combo
516 box) for each member of a datagroup inside a datagroup
517
518 Supported types for field_value:
519 - int, float, str, bool
520 - colors: in Qt-compatible text form, i.e. in hex format or name
521 (red, ...) (automatically detected from a string)
522 - list/tuple:
523 * the first element will be the selected index (or value)
524 * the other elements can be couples (key, value) or only values
525 """
526
527 # Create a QApplication instance if no instance currently exists
528 # (e.g., if the module is used directly from the interpreter)
529 if QtWidgets.QApplication.startingUp():
530 _app = QtWidgets.QApplication([])
531 dialog = FormDialog(data, title, comment, icon, parent, apply)
532
533 if parent is not None:
534 if hasattr(parent, "_fedit_dialog"):
535 parent._fedit_dialog.close()
536 parent._fedit_dialog = dialog
537
538 dialog.show()
539
540
541if __name__ == "__main__":

Callers 1

_formlayout.pyFile · 0.85

Calls 3

FormDialogClass · 0.85
closeMethod · 0.45
showMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…