Click here to Skip to main content
14,929,628 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
It is giving me attributeerror: 'MyQlineEdit' object has no attribute M1.Below is part of the code:
class MyQLineEdit(QLineEdit):

def focusOutEvent(self, e):
print(self.M1.text()) # here is the error
super(MyQLineEdit, self).focusOutEvent(e)


where self.M1=MyQLineEdit(Form)

What I have tried:

I tried to assign a global variable but it is giving me blank
Posted
Updated 3-May-21 4:48am
v2
Comments
Khaled121212 3-May-21 10:49am
   
I entered Mi by mistake instead of M1 in the question

1 solution

Python
print(self.M1.text()) # here is the error
super(MyQLineEdit, self).focusOutEvent(e)


where self.Mi=MyQLineEdit(Form)


Because M1 is not Mi.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900