From 97b16d18564bcf3da60ecd779e59d4a0f6517d1b Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Fri, 11 Sep 2020 00:06:27 +0200 Subject: [PATCH] Add custom close dialog --- ui_close_dialog.py | 52 +++++++++++++++++++++++++++++++++++++++ ui_close_dialog.ui | 61 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 ui_close_dialog.py create mode 100644 ui_close_dialog.ui diff --git a/ui_close_dialog.py b/ui_close_dialog.py new file mode 100644 index 0000000..52c2187 --- /dev/null +++ b/ui_close_dialog.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'ui_close_dialog.ui' +# +# Created by: PyQt5 UI code generator 5.15.0 +# +# WARNING: Any manual changes made to this file will be lost when pyuic5 is +# run again. Do not edit this file unless you know what you are doing. + + +from PyQt5 import QtCore, QtGui, QtWidgets + + +class Ui_CloseDialog(object): + def setupUi(self, CloseDialog): + CloseDialog.setObjectName("CloseDialog") + CloseDialog.setWindowModality(QtCore.Qt.ApplicationModal) + CloseDialog.resize(313, 75) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(CloseDialog.sizePolicy().hasHeightForWidth()) + CloseDialog.setSizePolicy(sizePolicy) + self.verticalLayout = QtWidgets.QVBoxLayout(CloseDialog) + self.verticalLayout.setObjectName("verticalLayout") + self.t_close = QtWidgets.QLabel(CloseDialog) + self.t_close.setObjectName("t_close") + self.verticalLayout.addWidget(self.t_close) + self.l_buttons = QtWidgets.QHBoxLayout() + self.l_buttons.setObjectName("l_buttons") + self.b_yes = QtWidgets.QPushButton(CloseDialog) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.b_yes.sizePolicy().hasHeightForWidth()) + self.b_yes.setSizePolicy(sizePolicy) + self.b_yes.setObjectName("b_yes") + self.l_buttons.addWidget(self.b_yes) + self.b_no = QtWidgets.QPushButton(CloseDialog) + self.b_no.setObjectName("b_no") + self.l_buttons.addWidget(self.b_no) + self.verticalLayout.addLayout(self.l_buttons) + + self.retranslateUi(CloseDialog) + QtCore.QMetaObject.connectSlotsByName(CloseDialog) + + def retranslateUi(self, CloseDialog): + _translate = QtCore.QCoreApplication.translate + CloseDialog.setWindowTitle(_translate("CloseDialog", "Programm schließen")) + self.t_close.setText(_translate("CloseDialog", "Soll das Programm wirklich geschlossen werden?")) + self.b_yes.setText(_translate("CloseDialog", "Ja")) + self.b_no.setText(_translate("CloseDialog", "Nein")) diff --git a/ui_close_dialog.ui b/ui_close_dialog.ui new file mode 100644 index 0000000..e28c378 --- /dev/null +++ b/ui_close_dialog.ui @@ -0,0 +1,61 @@ + + + CloseDialog + + + Qt::ApplicationModal + + + + 0 + 0 + 313 + 75 + + + + + 0 + 0 + + + + Programm schließen + + + + + + Soll das Programm wirklich geschlossen werden? + + + + + + + + + + 0 + 0 + + + + Ja + + + + + + + Nein + + + + + + + + + +