I am making a pyqt program to register and authorize a user. I want to have a start window with buttons that, when clicked, will open either an authorization window or a registration window. But when I import the registration module, for example, the registration window opens instead of the main window. Can you please tell me where I made a mistake?
Main module:
from PyQt5 import QtWidgets, QtCore
from start import Ui_Form #py file with start window ui properties
import registration #registration module
class StartWindow(QtWidgets.QMainWindow):
def __init__(self):
super(StartWindow, self).__init__()
self.ui = Ui_Form()
self.ui.setupUi(self)
self.ui.RegButton.clicked.connect(reg_clicked())
self.openreg=registration.mywindow(self)
#self.ui.AuthButton.clicked.connect()
def reg_clicked(self):
self.openreg.show()
app = QtWidgets.QApplication([])
application = StartWindow()
application.show()
sys.exit(app.exec())
Part of registration module:
from PyQt5 import QtWidgets, QtCore
import record_proc
from reg import Ui_Reg
class mywindow(QtWidgets.QMainWindow):
number_of_samples=1
def __init__(self):
super(mywindow, self).__init__()
self.ui = Ui_Reg()
self.ui.setupUi(self)
self.ui.RecordButton.clicked.connect(self.Recording)
self.ui.AuthButton.clicked.connect(self.Register)
self.ui.CheckLogin.clicked.connect(self.CheckLogin)
app2 = QtWidgets.QApplication([])
application2 = mywindow()
application2.show()
sys.exit(app2.exec())