Self.msg = (self, 'Message', 'User added successfully', ) Self.msg = (self, 'Message', 'Not enough characters!', ) ![]() nnect(erEdit, QtCore.SIGNAL("textchanged()"), self.validText) def newUser(self): #This method adds a new user into the login database and displays a pop up window confirming the entryĬ.execute("INSERT INTO logins(usernames, passwords)VALUES(?,?)", ((), ())) #sql query inserts entries from line edit and pass edit into database I understand that I only created one SIGNAL but this was just for testing. The SQL input works just fine but for some reason the input validation does not. I also created a signal for the QlineEdits that connects to a method that validates the text. I have a method in my register user class that adds a user into a sqlite database. ![]() I've been reading through the Class reference and it looks like the preferred way to do text validation would be through the QRegularExpression class but that seems excessive for some simple input validation. This is my first GUI application and first time working with the PyQt4 framework. I'm having a little trouble understanding input validation with PyQt4.
0 Comments
Leave a Reply. |