From 756093b8a7948391cb9361b8cade98e536e806e0 Mon Sep 17 00:00:00 2001 From: "Chen, Chien-ting" Date: Tue, 29 Mar 2016 08:02:32 +0800 Subject: [PATCH] add something --- __main__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) mode change 100755 => 100644 __main__.py diff --git a/__main__.py b/__main__.py old mode 100755 new mode 100644 index 626c0c7..8602bcb --- a/__main__.py +++ b/__main__.py @@ -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():