DEAR HALA, I ALREADY DID THE FIRST TWO TUTORIALS OF THIS SERIES AND UPON CORRECTING MY MISTAKES AND WATCHING A COUPLE OF OTHERS THAT YOU POSTED IN YOUR WONDERFUL SERIES OF TUTORAILS ON PYQT5, EVERYTHING IS NOW WORKING PERFECTLY WELL. I CAN NOT THANK YOU ENOUGH FOR ALL YOUR HARD WORK AND EXPLANATIONS. I AM LOOKING FORWARD TO THE LAS VIDEO OF THIS 3 PART SERIES AND I HAVE LEARNT A LOT FROM YOU! AGAIN, MY PROFUSE THANKS FOR ALL YOUR WORK!
A few people are inquiring about validation on the username. Here is how I resolved that in the sample code from this video: Note that my db name and some of my object names might be different. def loginfunction(self): user = self.usernamefield.text() password = self.passwordfield.text() if len(user) == 0 or len(password) == 0: self.outputlabel.setText("Please fill out all fields") else: conn = sqlite3.connect("userdb.db") cur = conn.cursor() query = 'SELECT COUNT(*) FROM users WHERE username = \''+user+"\'" cur.execute(query) result_usercount = cur.fetchone()[0] if result_usercount > 0: query = 'SELECT password FROM users WHERE username = \''+user+"\'" cur.execute(query) result_pass = cur.fetchone()[0] if result_pass == password: print("Successfully logged in") self.outputlabel.setText("") else: self.outputlabel.setText("Invalid username or password") else: self.outputlabel.setText("Invalid username or password")
Nice explanation 💯🔥 One correction: you have not checked if the username exists in the database or not, so if you enter wrong username the application closes without giving any error message
if wrong password is typed it does what it supposed BUT if wrong username was typed it crashed and comes with error message main.py", line 38, in loginfunction result_pass = cur.fetchone()[0] TypeError: 'NoneType' object is not subscriptable
Thank you for this. I have been playing around with the code, converting the UI files to PY files and importing them without UIC. SQLite crashes when I try to create a login that already exists. But that's no big deal. I'll add a conditional for that. Thanks again.
Hello. Nice content! But I have a problem: if i put a wrong user name I get a message : result_pass = cur.fetchone()[0] TypeError: 'NoneType' object is not subscriptable
Great expanation ,I am getting stuck when setting up password on login screen after clicking the login button I get an error C:\Users\Gorefield\Documents\Software Dev\Sales\main.py:19: DeprecationWarning: sipPyTypeDict() is deprecated, the extension module should use sipPyTypeDictRef() instead class LoginScreen(QDialog):
Thank you for the video. When I am running this I get a error saying "Name Error: name 'widget' is not defined from "gotologin", when I click the login button from the welcomeScreen. Can you help me how this can be resolved? And also when I run it without that part, the program opens but closes immediately. Could you also help me with this?
when i run the code after the validation, it just closes and doesn't print out "logged in successfully" even if it is the correct username and password. Do you have any idea what could be wrong?
same happend, i think some line should check whether username does exist or not first, as if username does not exist the [0] index cannot go with null type items as per error
hey, did you solve your problem ? i solve mine by adding some lines of codes using try except: try: for row in rows: if passwordtext==row : self.cams = MyApp() self.cams.show() self.close()
else: self.checking.setText('Invalid Usernamed or Password') except: self.checking.setText('Invalid Usernamed or Password')
Hi, I am getting the following error when i try to attach the login.ui page : "AttributeError: 'WelcomeScreen' object has no attribute 'login'". Any idea why?
I don't know if it is apropriate to say that, but I'm gonna say it anyway. To me her sound is music, she is very fluent and oh my God this subtle Arabic accent drives me crazy. if it too much, I apologize in advance. Nevertheless, she presents very useful tutorials that any programmer could benifit.
I had the same problem, when the username and pass is the same, all ok, but when it's not, application stop working, and shows me an message like: result_pass = cur.fetchone()[0] TypeError: 'NoneType' object is not subscriptable
I just can't resist but are you that same TikTok girl who complains about her teacher while on zoom class but gets caught cause she forgot to turn off the mic!?Please tell me you are that girl cause it's literally the same voice!🤣
Timestamps for reference -
00:30 - Objective
2:07 - SQLite database
2:52 - login username password validation demonstration
4:00 - Null input validation demonstration
4:32 - Creating Welcome screen in Qt Designer
4:40 - Login screen in Qt Designer
8:29 - Transparent Line Edit box
9:52 - press login event (Welcome screen)
11:21 - Calling login UI
13:17 - Go to login screen when Login button is pressed
15:40 - Hide password using *****
16:52 - Event to press login
19:12 - label for error message if wrong password
20:38 - if username and password is empty display error
22:00 - retrieving password from stored database, using SQLite
24:41 - check if entered username and password matches with stored ones
26:29 - How to clear error message if successfully logged in
26:45 - Recap
27:34 - Aim of next video (create account)
Very complicated and steep learning curve for PYQT. The effort of Hala is great. Thank you.
DEAR HALA, I ALREADY DID THE FIRST TWO TUTORIALS OF THIS SERIES AND UPON CORRECTING MY MISTAKES AND WATCHING A COUPLE OF OTHERS THAT YOU POSTED IN YOUR WONDERFUL SERIES OF TUTORAILS ON PYQT5, EVERYTHING IS NOW WORKING PERFECTLY WELL. I CAN NOT THANK YOU ENOUGH FOR ALL YOUR HARD WORK AND EXPLANATIONS. I AM LOOKING FORWARD TO THE LAS VIDEO OF THIS 3 PART SERIES AND I HAVE LEARNT A LOT FROM YOU! AGAIN, MY PROFUSE THANKS FOR ALL YOUR WORK!
can you send your code?
A few people are inquiring about validation on the username. Here is how I resolved that in the sample code from this video:
Note that my db name and some of my object names might be different.
def loginfunction(self):
user = self.usernamefield.text()
password = self.passwordfield.text()
if len(user) == 0 or len(password) == 0:
self.outputlabel.setText("Please fill out all fields")
else:
conn = sqlite3.connect("userdb.db")
cur = conn.cursor()
query = 'SELECT COUNT(*) FROM users WHERE username = \''+user+"\'"
cur.execute(query)
result_usercount = cur.fetchone()[0]
if result_usercount > 0:
query = 'SELECT password FROM users WHERE username = \''+user+"\'"
cur.execute(query)
result_pass = cur.fetchone()[0]
if result_pass == password:
print("Successfully logged in")
self.outputlabel.setText("")
else:
self.outputlabel.setText("Invalid username or password")
else:
self.outputlabel.setText("Invalid username or password")
when I run this, nothing happens; it just closes. Do you have any idea why?
I have changed all object names appropriately
@@TP-mv6en The code works, your indent is probably wrong. Make sure you copy it exactly as written.
Thanks
In line 16,addWidget i am getting error that argument 1 has unexpected type 'sip.wrappertype'. How to solve it?
Nice explanation 💯🔥
One correction: you have not checked if the username exists in the database or not, so if you enter wrong username the application closes without giving any error message
What is the solution for this?
Be aware if you want to make a real login system. You need to have some sort of encryption to keep the passwords safe! (I meant for the viewers :D)
how would you go about doing that?
how do u do dat
@@gagankarnati643 bro might be cooked, asking for help with everything 💀
Absolutely splendid content and explanation. Please keep it up, thank you
if wrong password is typed it does what it supposed BUT if wrong username was typed it crashed and comes with error message
main.py", line 38, in loginfunction
result_pass = cur.fetchone()[0]
TypeError: 'NoneType' object is not subscriptable
but on maximizing window, the login screen is not scaling up. why?
Thank you for this. I have been playing around with the code, converting the UI files to PY files and importing them without UIC. SQLite crashes when I try to create a login that already exists. But that's no big deal. I'll add a conditional for that. Thanks again.
please 🙏 how can I find the part 4 of this tutorial, where you created the fill profile module?
thanks 🙏 for the nice teaching
Does it matter if we choose MainWindow or Widget instead of QDialog when we create a new file in QT Designer?
why i get name 'widget' is not defined? please help
i already do like in the video but when input username and password correctly the label still error. help!!!!🤔
The only thing that makes this GUI modern is the nice gradient!
Been waiting for this, thank you very much. keep educating us.....
"TypeError: 'NoneType' object is not subscriptable" why do I get something like this?
Very practical and very useful tutorial. Thank you for the efforts and for the sharing
how to Change QPushButton icon when pressing the same button (toggle) in qt designer?
Hello. Nice content! But I have a problem: if i put a wrong user name I get a message : result_pass = cur.fetchone()[0]
TypeError: 'NoneType' object is not subscriptable
what is the rgba code of the background color of the window?
Great expanation ,I am getting stuck when setting up password on login screen after clicking the login button I get an error C:\Users\Gorefield\Documents\Software Dev\Sales\main.py:19: DeprecationWarning: sipPyTypeDict() is deprecated, the extension module should use sipPyTypeDictRef() instead
class LoginScreen(QDialog):
Thank you for the video. When I am running this I get a error saying "Name Error: name 'widget' is not defined from "gotologin", when I click the login button from the welcomeScreen. Can you help me how this can be resolved? And also when I run it without that part, the program opens but closes immediately. Could you also help me with this?
did u get this? how did u fix it?
Great explanation! Thank you for sharing
My god, your voice is so lovely. And nice tutorial ofc!
when i run the code after the validation, it just closes and doesn't print out "logged in successfully" even if it is the correct username and password. Do you have any idea what could be wrong?
did u fix this?
@@gagankarnati643 nah but I'll try again and I'll let you know if I'm successful
Hi there !!!
if you put an user that doesnt exist in DB, it returns a NONETYPE error. How to fix it? thx a lot ! =)
same happend, i think some line should check whether username does exist or not first, as if username does not exist the [0] index cannot go with null type items as per error
Did you fix it
hey, did you solve your problem ? i solve mine by adding some lines of codes using try except:
try:
for row in rows:
if passwordtext==row :
self.cams = MyApp()
self.cams.show()
self.close()
else:
self.checking.setText('Invalid Usernamed or Password')
except:
self.checking.setText('Invalid Usernamed or Password')
@@ahmaddalain7994 see my comment below
@@kareng4120 see my comment below
Hi, I am getting the following error when i try to attach the login.ui page : "AttributeError: 'WelcomeScreen' object has no attribute 'login'". Any idea why?
I am also getting the same error. Were you able to resolve it?
thanks for the tutorial, I have a question, how do you create the table login_info in the db inside the code?
did u get how to do it?
I don't know if it is apropriate to say that, but I'm gonna say it anyway. To me her sound is music, she is very fluent and oh my God this subtle Arabic accent drives me crazy.
if it too much, I apologize in advance.
Nevertheless, she presents very useful tutorials that any programmer could benifit.
Thanks for really excellent tutorial, you are the best
thanks for the video. excellent stuff
Is someone having the problem, when the password doesn't with the database, the code stop working?
I had the same problem, when the username and pass is the same, all ok, but when it's not, application stop working, and shows me an message like: result_pass = cur.fetchone()[0] TypeError: 'NoneType' object is not subscriptable
yeah i had the same provlem
@@ivantito2119 you could probably just use result_pass[0] for the if statement and then remove [0] from cur.fetchone()[0] maybe
thanks for the good content keep it going
u shud be a teacher you have an academic way of explaining
Very Good Thanks lot
LENG STYL (the voice)
I just can't resist but are you that same TikTok girl who complains about her teacher while on zoom class but gets caught cause she forgot to turn off the mic!?Please tell me you are that girl cause it's literally the same voice!🤣
Sorry, not me! 😬 Do share if you find it though, i’m curious haha
Great video
very good
thankyou
beautiful girl, thanks for your videos!!! Greetings from Russia
أعجبني.
🎉