def _get_name(widget: QTextEdit, *, ispath: bool = False) -> str: """Return the file name of widget.""" text = widget.text() place_text = widget.placeholderText() if ispath: return text if isdir(text) else place_text return ''.join(x for x in text if x.isalnum() or x in "._- ") or place_text