У меня есть окно, которое нужно открыть по нажатию кнопки ок в pyqt5. У меня никак не выходит это сделать.
Вот код окна:
from PySide import QtCore, QtGui
class Ui_FirstWindow(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(191, 100)
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(9)
font.setWeight(75)
font.setBold(True)
Dialog.setFont(font)
Dialog.setStyleSheet("QDialog{\n"
"background: \"#363a45\";\n"
"}\n"
"QGroupBox{\n"
"color: \"#b4bbd4\";\n"
"font-weight: bold;\n"
"border-width: 1px;\n"
"border-radius: 1px;\n"
"border-color: black;\n"
"border-style: solid;\n"
"}\n"
"")
self.groupBox = QtGui.QGroupBox(Dialog)
self.groupBox.setGeometry(QtCore.QRect(-1, 9, 191, 31))
self.groupBox.setTitle("")
self.groupBox.setObjectName("groupBox")
self.label = QtGui.QLabel(self.groupBox)
self.label.setGeometry(QtCore.QRect(60, 5, 131, 21))
font = QtGui.QFont()
font.setFamily("Arial Black")
font.setPointSize(10)
font.setWeight(75)
font.setBold(True)
self.label.setFont(font)
self.label.setStyleSheet("color:white")
self.label.setObjectName("label")
self.label_2 = QtGui.QLabel(Dialog)
self.label_2.setGeometry(QtCore.QRect(30, 39, 131, 31))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(10)
font.setWeight(75)
font.setBold(True)
self.label_2.setFont(font)
self.label_2.setStyleSheet("color:white")
self.label_2.setObjectName("label_2")
self.label_3 = QtGui.QLabel(Dialog)
self.label_3.setGeometry(QtCore.QRect(50, 70, 121, 20))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(10)
font.setWeight(75)
font.setBold(True)
self.label_3.setFont(font)
self.label_3.setStyleSheet("color:white")
self.label_3.setObjectName("label_3")
self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)
def retranslateUi(self, Dialog):
Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "Dialog", None, QtGui.QApplication.UnicodeUTF8))
self.label.setText(QtGui.QApplication.translate("Dialog", "Ошибка!", None, QtGui.QApplication.UnicodeUTF8))
self.label_2.setText(QtGui.QApplication.translate("Dialog", "Формат телефона:", None, QtGui.QApplication.UnicodeUTF8))
self.label_3.setText(QtGui.QApplication.translate("Dialog", "7xxxxxxxxxx", None, QtGui.QApplication.UnicodeUTF8))
if __name__ == "__main__":
import sys
app = QtGui.QApplication(sys.argv)
Dialog = QtGui.QDialog()
ui = Ui_Dialog()
ui.setupUi(Dialog)
Dialog.show()
sys.exit(app.exec_())