feat: добавлено окно "О программе" (with Kitty) (#14)

Это окно обязательное, вместе с гифкой

---------

Co-authored-by: Maxim Slipenko <no-reply@maxim.slipenko.com>
This commit is contained in:
MisterMLiL 2023-09-26 16:03:28 +03:00 committed by GitHub
parent be853a81aa
commit b105228d3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 141 additions and 12 deletions

21
statapp/about_window.py Normal file
View File

@ -0,0 +1,21 @@
from PySide6.QtGui import QMovie
from PySide6.QtWidgets import QMainWindow
from statapp.ui.ui_about_window import Ui_AboutWindow
class AboutWindow(QMainWindow):
pixmap = None
def __init__(self):
super().__init__()
self.ui = Ui_AboutWindow()
self.ui.setupUi(self)
image_path = 'statapp\\images\\sticker.gif'
movie = QMovie(image_path)
self.ui.labelgif.setMovie(movie)
movie.start()
self.pixmap = movie
self.setFixedSize(self.size())

View File

@ -1,6 +1,7 @@
from PySide6.QtCore import Slot from PySide6.QtCore import Slot
from PySide6.QtWidgets import QMainWindow from PySide6.QtWidgets import QMainWindow
from statapp.about_window import AboutWindow
from statapp.ui.ui_main_window import Ui_MainWindow from statapp.ui.ui_main_window import Ui_MainWindow
@ -10,3 +11,8 @@ class MainWindow(QMainWindow):
self.ui = Ui_MainWindow() self.ui = Ui_MainWindow()
self.ui.setupUi(self) self.ui.setupUi(self)
@Slot()
def on_aboutmenuaction_triggered(self):
global about_window
about_window = AboutWindow()
about_window.show()

View File

@ -9,8 +9,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>878</width> <width>476</width>
<height>727</height> <height>543</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -23,8 +23,8 @@
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0"> <item row="0" column="0">
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="1" column="1"> <item row="4" column="1">
<widget class="QLabel" name="labelbasegigamen"> <widget class="QLabel" name="labelowner">
<property name="font"> <property name="font">
<font> <font>
<pointsize>14</pointsize> <pointsize>14</pointsize>
@ -37,7 +37,7 @@
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>Теоретический фундамент: Дмитрюк Т. Г.</string> <string>Донецкий Национальный Технический Университет</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
@ -65,8 +65,8 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="1" column="1">
<widget class="QLabel" name="labelowner"> <widget class="QLabel" name="labelbasegigamen">
<property name="font"> <property name="font">
<font> <font>
<pointsize>14</pointsize> <pointsize>14</pointsize>
@ -79,7 +79,7 @@
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>Донецкий Национальный Технический Университет</string> <string>Теоретический фундамент: Дмитрюк Т. Г.</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
@ -87,7 +87,19 @@
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="2" column="1">
<widget class="QLabel" name="labelowner_2"> <widget class="QLabel" name="labelgif">
<property name="minimumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>500</width>
<height>600</height>
</size>
</property>
<property name="font"> <property name="font">
<font> <font>
<pointsize>14</pointsize> <pointsize>14</pointsize>
@ -99,12 +111,12 @@
<kerning>true</kerning> <kerning>true</kerning>
</font> </font>
</property> </property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
<property name="pixmap">
<pixmap>../images/sticker.gif</pixmap>
</property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>

90
statapp/ui/ui_about_window.py generated Normal file
View File

@ -0,0 +1,90 @@
# -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'about_window.ui'
##
## Created by: Qt User Interface Compiler version 6.5.2
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
QMetaObject, QObject, QPoint, QRect,
QSize, QTime, QUrl, Qt)
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
QFont, QFontDatabase, QGradient, QIcon,
QImage, QKeySequence, QLinearGradient, QPainter,
QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QFrame, QGridLayout, QLabel,
QMainWindow, QSizePolicy, QWidget)
class Ui_AboutWindow(object):
def setupUi(self, AboutWindow):
if not AboutWindow.objectName():
AboutWindow.setObjectName(u"AboutWindow")
AboutWindow.setEnabled(True)
AboutWindow.resize(476, 543)
AboutWindow.setAutoFillBackground(False)
self.centralwidget = QWidget(AboutWindow)
self.centralwidget.setObjectName(u"centralwidget")
self.gridLayout_2 = QGridLayout(self.centralwidget)
self.gridLayout_2.setObjectName(u"gridLayout_2")
self.gridLayout = QGridLayout()
self.gridLayout.setObjectName(u"gridLayout")
self.labelowner = QLabel(self.centralwidget)
self.labelowner.setObjectName(u"labelowner")
font = QFont()
font.setPointSize(14)
font.setBold(False)
font.setItalic(False)
font.setUnderline(False)
font.setStrikeOut(False)
font.setKerning(True)
font.setStyleStrategy(QFont.PreferDefault)
self.labelowner.setFont(font)
self.labelowner.setAlignment(Qt.AlignCenter)
self.gridLayout.addWidget(self.labelowner, 4, 1, 1, 1)
self.labeldevelopers = QLabel(self.centralwidget)
self.labeldevelopers.setObjectName(u"labeldevelopers")
self.labeldevelopers.setFont(font)
self.labeldevelopers.setAlignment(Qt.AlignCenter)
self.gridLayout.addWidget(self.labeldevelopers, 0, 1, 1, 1)
self.labelbasegigamen = QLabel(self.centralwidget)
self.labelbasegigamen.setObjectName(u"labelbasegigamen")
self.labelbasegigamen.setFont(font)
self.labelbasegigamen.setAlignment(Qt.AlignCenter)
self.gridLayout.addWidget(self.labelbasegigamen, 1, 1, 1, 1)
self.labelgif = QLabel(self.centralwidget)
self.labelgif.setObjectName(u"labelgif")
self.labelgif.setMinimumSize(QSize(50, 50))
self.labelgif.setMaximumSize(QSize(500, 600))
self.labelgif.setFont(font)
self.labelgif.setFrameShape(QFrame.NoFrame)
self.labelgif.setAlignment(Qt.AlignCenter)
self.gridLayout.addWidget(self.labelgif, 2, 1, 1, 1)
self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1)
AboutWindow.setCentralWidget(self.centralwidget)
self.retranslateUi(AboutWindow)
QMetaObject.connectSlotsByName(AboutWindow)
# setupUi
def retranslateUi(self, AboutWindow):
AboutWindow.setWindowTitle(QCoreApplication.translate("AboutWindow", u"\u041e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0435", None))
self.labelowner.setText(QCoreApplication.translate("AboutWindow", u"\u0414\u043e\u043d\u0435\u0446\u043a\u0438\u0439 \u041d\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0423\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442", None))
self.labeldevelopers.setText(QCoreApplication.translate("AboutWindow", u"\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438: \u0421\u043b\u0438\u043f\u0435\u043d\u043a\u043e \u041c., \u041b\u0430\u0437\u0443\u0440\u0435\u043d\u043a\u043e \u0415.", None))
self.labelbasegigamen.setText(QCoreApplication.translate("AboutWindow", u"\u0422\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442: \u0414\u043c\u0438\u0442\u0440\u044e\u043a \u0422. \u0413.", None))
self.labelgif.setText("")
# retranslateUi