from PyQt5 import QtCore, QtGui, QtWidgets
import sqlite3
import sys
import numpy as np
from PyQt5.QtWidgets import QWidget, QLabel, QPushButton, QLineEdit, QApplication
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(593, 593)
Dialog.setStyleSheet("background-color: rgb(164, 204, 255);")
self.pushButton_2 = QtWidgets.QPushButton(Dialog)
self.pushButton_2.setGeometry(QtCore.QRect(340, 290, 151, 61))
self.pushButton_2.setStyleSheet("background-color: rgb(255, 85, 0);\n"
"font: 10pt \"MS Shell Dlg 2\";")
self.pushButton_2.setObjectName("pushButton_2")
self.pushButton_3 = QtWidgets.QPushButton(Dialog)
self.pushButton_3.setGeometry(QtCore.QRect(120, 290, 151, 61))
self.pushButton_3.setStyleSheet("background-color: rgb(0, 255, 0);\n"
"font: 10pt \"MS Shell Dlg 2\";")
self.pushButton_3.setObjectName("pushButton_3")
self.label = QtWidgets.QLabel(Dialog)
self.label.setGeometry(QtCore.QRect(170, 30, 261, 21))
self.label.setStyleSheet("font: 16pt \"MS Shell Dlg 2\";")
self.label.setObjectName("label")
self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)
self.click()
def retranslateUi(self, Dialog):
_translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
self.pushButton_2.setText(_translate("Dialog", "РОДИТЕЛЬ"))
self.pushButton_3.setText(_translate("Dialog", "УЧИТЕЛЬ"))
self.label.setText(_translate("Dialog", "ЭЛЕКТРОННЫЙ ДНЕВНИК"))
def click(self):
self.pushButton_3.clicked.connect(self.tisher)
self.pushButton_2.clicked.connect(self.family)
def tisher(self):
self.Dia = QtWidgets.QMainWindow()
self.exe = Ui()
self.exe.setup(Dia)
self.Dia.show()
self.exe.show()
def family(self):
print(111111)
class Ui(object):
def setup(self, Dia):
Dia.setObjectName("Dia")
Dia.resize(538, 489)
Dia.setStyleSheet("background-color: rgb(210, 255, 246);")
self.pushButtonq = QtWidgets.QPushButton(Dia)
self.pushButtonq.setGeometry(QtCore.QRect(80, 160, 361, 61))
self.pushButtonq.setStyleSheet("font: 12pt \"MS Shell Dlg 2\";\n"
"background-color: rgb(0, 255, 0);\n"
"font: 16pt \"MS Shell Dlg 2\";")
self.pushButtonq.setObjectName("pushButton")
self.pushButton_2q = QtWidgets.QPushButton(Dia)
self.pushButton_2q.setGeometry(QtCore.QRect(60, 260, 411, 61))
self.pushButton_2q.setStyleSheet("font: 16pt \"MS Shell Dlg 2\";\n"
"background-color: rgb(255, 85, 0);")
self.pushButton_2q.setObjectName("pushButton_2")
self.labelq = QtWidgets.QLabel(Dia)
self.labelq.setGeometry(QtCore.QRect(130, 20, 281, 31))
self.labelq.setStyleSheet("font: 16pt \"MS Shell Dlg 2\";")
self.labelq.setObjectName("label")
self.label_2q = QtWidgets.QLabel(Dia)
self.label_2q.setGeometry(QtCore.QRect(150, 60, 281, 31))
self.label_2q.setStyleSheet("font: 16pt \"MS Shell Dlg 2\";")
self.label_2q.setObjectName("label_2")
self.label_3q = QtWidgets.QLabel(Dia)
self.label_3q.setGeometry(QtCore.QRect(180, 440, 281, 31))
self.label_3q.setStyleSheet("font: 16pt \"MS Shell Dlg 2\";")
self.label_3q.setObjectName("label_3")
self.retranslateUi(Dia)
QtCore.QMetaObject.connectSlotsByName(Dia)
def retranslateUi(self, Dia):
_translate = QtCore.QCoreApplication.translate
Dia.setWindowTitle(_translate("Dia", "Dia"))
self.pushButtonq.setText(_translate("Dia", "ВОЙТИ"))
self.pushButton_2q.setText(_translate("Dia", "РЕГИСТРАЦИЯ"))
self.labelq.setText(_translate("Dia", "ПОЖАЛУЙСТА ВОЙДИТЕ,"))
self.label_2q.setText(_translate("Dia", "ИЛИ ЗАРЕГИСТРИРУЙТЕСЬ"))
self.label_3q.setText(_translate("Dia", "ДНЕВНИК_РФ"))
if __name__ == '__main__':
app = QtWidgets.QApplication(sys.argv)
Dialog = QtWidgets.QMainWindow()
ex = Ui_Dialog()
ex.setupUi(Dialog)
Dialog.show()
sys.exit(app.exec_())
вылетает с какой ошибкой?
Я не понимаю как правильно вызвать класс Ui
Так же как и Ui_Dialog
?)
А, только тут странновато что эти классы сами не являются окнами/виджетами.
Обычно как-то так делают: Multiple windows in PyQt5
я использовал Qt Designer и мне надо подключить второе окно