Okay let us assume that your UI file (which you ought not be using for this very reason) has a QLineEdit object called MyLineEdit (which it would never have since that is not how it goes about referencing variables). Then you should simply be able to do the following (I have not tested this because I never use UI files as they are a waste of time and effort):
ui.MyLineEdit = ClassLineEdit()
You are thus replacing whatever object you created in the UI file with your own Class Object.
Also when using super( ) you need to do the following:
Next had you made your import statement more direct and to the point as such:
ui.MyLineEdit = ClassLineEdit()
You are thus replacing whatever object you created in the UI file with your own Class Object.
Also when using super( ) you need to do the following:
class lineEdit(QtWidgets.QLineEdit): def __init__(self, parent): super(lineEdit, self).__init__()Note you most likely have no reason to pass a handle to your Parent to the base QLineEdit so do not do so.
Next had you made your import statement more direct and to the point as such:
from PyQt5.QtWidgets import QLineEdityou could have done the following:
class NewLineEdit(QLineEdit): def __init__(self, parent): super(lineEdit, self).__init__()-- or not even use super and do this --
class NewLineEdit(QLineEdit): def __init__(self, parent): QLineEdit.__init__(self)And lastly are you even using the handle to the parent within your Line Edit objects or are you just passing it in unnecessarily -- if not needed we can simplify it as follows:
class NewLineEdit(QLineEdit): def __init__(self): QLineEdit.__init__(self)