Здравствуйте, я новичок в языках программирования и не могу найти ошибку, помогите пожалуйста.
Вот сама ошибка:
File”Finance.py”, line 42, in __init__
self.ui.textBrowser.setText(text1)
NameError: name ‘text1’ is not defined
import sys
from DELETE_WND import *
from Add_Wnd import *
from HFD import *
from PyQt5 import QtCore, QtGui, QtWidgets
class DELETEWINDOW(QtWidgets.QMainWindow):
def __init__(self, parent=None):
QtWidgets.QWidget.__init__(self, parent)
self.ui = Ui_DEL_WND()
self.ui.setupUi(self)
class ADDWINDOW(QtWidgets.QMainWindow):
def __init__(self, parent=None):
QtWidgets.QWidget.__init__(self, parent)
self.ui = Ui_ADD_WINDOW()
self.ui.setupUi(self)
self.ui.lineEdit.setMaxLength(10)
self.ui.lineEdit_2.setMaxLength(10)
self.ui.lineEdit_3.setMaxLength(10)
self.ui.pushButton.clicked.connect(self.button)
def button(self):
text1 = self.ui.lineEdit.text()
text2 = self.ui.lineEdit_2.text()
text3 = self.ui.lineEdit_3.text()
class MyWin(QtWidgets.QMainWindow):
def __init__(self, parent=None):
QtWidgets.QWidget.__init__(self, parent)
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.ui.ADD_BTN.clicked.connect(self.ADD)
self.ui.DELETE_BTN.clicked.connect(self.DELETE)
self.ui.textBrowser.setText(text1)
self.ui.textBrowser_2.setText(text2)
self.ui.textBrowser_3.setText(text3)
def ADD(self):
dialog = ADDWINDOW(self)
dialog.show()
def DELETE(self):
dialog = DELETEWINDOW(self)
dialog.show()
if __name__ == "__main__":
app = QtWidgets.QApplication(sys.argv)
myapp = MyWin()
myapp.show()
sys.exit(app.exec_())