def _custom_input_dialog(self, ui, title, label, text_echo_mode=QLineEdit.Normal, input_mode=QInputDialog.TextInput): dlg = QInputDialog(ui) dlg.setTextEchoMode(text_echo_mode) dlg.setInputMode(input_mode) dlg.setWindowTitle(title) dlg.setLabelText(label) dlg.resize(250, 100) result = dlg.exec_() text = dlg.textValue() return (text, result)