Shows parameters editor modal form.

    Arguments:
       obj: object to extract attribute values from, or a dict-like
       attrs: list of attribute names
       title:
       toolTips:

def show_edit_form(obj, attrs=None, title="", toolTips=None):
    """Shows parameters editor modal form.

    Arguments:
       obj: object to extract attribute values from, or a dict-like
       attrs: list of attribute names
       title:
       toolTips:
    """

    if attrs is None:
        if hasattr(obj, "keys"):
            attrs = list(obj.keys())
        else:
            raise RuntimeError("attrs is None and cannot determine it from obj")

    specs = []
    for i, name in enumerate(attrs):
        # Tries as attribute, then as key
        try:
            value = obj.__getattribute__(name)
        except AttributeError:
            value = obj[name]

        if value is None:
            value = ""  # None becomes str

        dict_ = {"value": value}

        if toolTips is not None:
            dict_["toolTip"] = toolTips[i]
            dict_["tooltip"] = toolTips[i]

        specs.append((name, dict_))
    form = XParametersEditor(specs=specs, title=title)
    r = form.exec_()
    return r, form