Is it possible to auto add dashes to PyQt5 Line Edit while the user enters the data, for example if the user wants to enter 123456789012345
, while the user enters it should be entered like 12345-67890-12345
. Also if the user enters -
at the right position it should be accepted in. This was fairly achievable in tkinter
, using re
(question here), but I think it might be able to do the same with Qt
too.
if __name__ == '__main__':
app = QApplication(sys.argv)
le = QLineEdit()
le.show()
sys.exit(app.exec_())
Ps: I have designed the GUI inside of Qt Designer.