add something

This commit is contained in:
Tan, Kian-ting 2016-03-29 08:02:32 +08:00
parent f28b353c5e
commit 756093b8a7

8
__main__.py Executable file → Normal file
View file

@ -84,7 +84,13 @@ class MainWindow(QtGui.QMainWindow, ui.Ui_MainWindow):
self.lineEdit.returnPressed.connect(self.input_characters)
self.pushButton.clicked.connect(self.input_characters)
def input_characters(self):
print("Hello world")
characters = self.lineEdit.text()
chinese_char_pattern = QtCore.QRegExp("[\x{4e00}-\x{9fa5}]+")
validator = QtGui.QRegExpValidator( chinese_char_pattern, characters)
if validator.validare():
print (characters)
else:
print("error")
#TODO: validate, and return result
def main():