python textedit限制输入长度
闲话少说,直接上代码 def key_edit_change_handler(self): # print("change key...") max_length = 128 text = self.key_edit.toPlainText() text_hex = text.encode('ascii') current_len = len(text_hex) text_cursor