def fedit(data, title="<STR_LIT>", comment="<STR_LIT>", icon=None, parent=None, apply=None,<EOL>ok=True, cancel=True, result='<STR_LIT:list>', outfile=None, type='<STR_LIT>',<EOL>scrollbar=False, background_color=None, widget_color=None):
<EOL>test_travis = os.environ.get('<STR_LIT>', None)<EOL>if test_travis is not None:<EOL><INDENT>app = QApplication.instance()<EOL>if app is None:<EOL><INDENT>app = QApplication([])<EOL><DEDENT>timer = QTimer(app)<EOL>timer.timeout.connect(app.quit)<EOL>timer.start(<NUM_LIT:1000>)<EOL><DEDENT>elif QApplication.startingUp():<EOL><INDENT>_app = QApplication([])<EOL>translator_qt = QTranslator()<EOL>translator_qt.load('<STR_LIT>' + QLocale.system().name(),<EOL>QLibraryInfo.location(QLibraryInfo.TranslationsPath))<EOL>_app.installTranslator(translator_qt)<EOL><DEDENT>serial = ['<STR_LIT:list>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL>if result not in serial:<EOL><INDENT>print("<STR_LIT>" %<EOL>(result, '<STR_LIT:U+002CU+0020>'.join(serial)), file=sys.stderr)<EOL>result = '<STR_LIT:list>'<EOL><DEDENT>layouts = ['<STR_LIT>', '<STR_LIT>']<EOL>if type not in layouts:<EOL><INDENT>print("<STR_LIT>" %<EOL>(type, '<STR_LIT:U+002CU+0020>'.join(layouts)), file=sys.stderr)<EOL>type = '<STR_LIT>'<EOL><DEDENT>dialog = FormDialog(data, title, comment, icon, parent, apply, ok, cancel,<EOL>result, outfile, type, scrollbar, background_color,<EOL>widget_color)<EOL>if dialog.exec_():<EOL><INDENT>return dialog.get()<EOL><DEDENT>
Create form dialog and return result
(if Cancel button is pressed, return None)

:param tuple data: datalist, datagroup (see below)
:param str title: form title
:param str comment: header comment
:param QIcon icon: dialog box icon
:param QWidget parent: parent widget
:param str ok: customized ok button label
:param str cancel: customized cancel button label
:param tuple apply: (label, function) customized button label and callback
:param function apply: function taking two arguments (result, widgets)
:param str result: result serialization ('list', 'dict', 'OrderedDict',
                                         'JSON' or 'XML')
:param str outfile: write result to the file outfile.[py|json|xml]
:param str type: layout type ('form' or 'questions')
:param bool scrollbar: vertical scrollbar
:param str background_color: color of the background
:param str widget_color: color of the widgets

:return: Serialized result (data type depends on `result` parameter)

datalist: list/tuple of (field_name, field_value)
datagroup: list/tuple of (datalist *or* datagroup, title, comment)

Tips:
  * one field for each member of a datalist
  * one tab for each member of a top-level datagroup
  * one page (of a multipage widget, each page can be selected with a 
    combo box) for each member of a datagroup inside a datagroup

Supported types for field_value:
  - int, float, str, unicode, bool
  - colors: in Qt-compatible text form, i.e. in hex format or name (red,...)
            (automatically detected from a string)
  - list/tuple:
      * the first element will be the selected index (or value)
      * the other elements can be couples (key, value) or only values