title screen

This commit is contained in:
Вадим Силаев 2022-11-19 18:05:48 +03:00
parent da8b60f3db
commit 8cf80919ed

View File

@ -0,0 +1,56 @@
import sys
import random
from PySide6 import QtCore, QtWidgets, QtGui
from win32api import GetSystemMetrics
class MyWidget(QtWidgets.QWidget):
def __init__(self):
super().__init__()
self.q = QtGui.QScreen.availableGeometry(QtWidgets.QApplication.primaryScreen())
self.button = QtWidgets.QPushButton(self)
self.button.setGeometry(QtCore.QRect(20, 20, 40, 40))
self.button.setText("Esc")
self.text = QtWidgets.QLabel(self)
self.text.setText("<html><head/><body><p align=\"center\"><span style=\" font-size:12pt; font-weight:600;\">Лабораторная работа 3.5.1</span></p><p align=\"center\"><span style=\" font-size:11pt;\">Исследование плазмы газового разряда</span></p></body></html>")
self.text.setGeometry(QtCore.QRect(self.q.width() // 4, self.q.height() // 2 - 40, 300, 80))
self.vline = QtWidgets.QFrame(self)
self.vline.setFrameShape(QtWidgets.QFrame.VLine)
self.vline.setGeometry(QtCore.QRect(2 * self.q.width() // 3, 0, 10, self.q.height() + 40))
self.hline = QtWidgets.QFrame(self)
self.hline.setFrameShape(QtWidgets.QFrame.HLine)
self.hline.setGeometry(QtCore.QRect(2 * self.q.width() // 3 + 5, self.q.height() // 2, self.q.width() // 3, 40))
self.label1 = QtWidgets.QLabel(self)
self.label1.setText(
"<html><head/><body><p align=\"center\"><span style=\" font-size:10pt; font-weight:600;\">ЧАСТЬ I</span></p><p align=\"center\"><span style=\" font-size:10pt;\">Вольт-амперная характеристика газового разряда</span></p></body></html>")
self.label1.setGeometry(QtCore.QRect(5 * self.q.width() // 6 - 150, self.q.height() // 4 - 40, 300, 80))
self.label2 = QtWidgets.QLabel(self)
self.label2.setText(
"<html><head/><body><p align=\"center\"><span style=\" font-size:10pt; font-weight:600;\"> ЧАСТЬ II</span></p><p align=\"center\"><span style=\" font-size:10pt;\">Зондовые характеристики плазмы</span></p></body></html>")
self.label2.setGeometry(QtCore.QRect(5 * self.q.width() // 6 - 150, 3 * self.q.height() // 4 - 40, 300, 80))
self.button1 = QtWidgets.QPushButton(self)
self.button1.setGeometry(QtCore.QRect(5 * self.q.width() // 6 - 40, self.q.height() // 4 + 80, 80, 40))
self.button1.setText("Начать")
self.button2 = QtWidgets.QPushButton(self)
self.button2.setGeometry(QtCore.QRect(5 * self.q.width() // 6 - 40, 3 * self.q.height() // 4 + 80, 80, 40))
self.button2.setText("Начать")
#self.layout = QtWidgets.QVBoxLayout(self)
#self.layout.addWidget(self.text)
#self.layout.addWidget(self.button)
self.button.clicked.connect(self.esc)
@QtCore.Slot()
def esc(self):
self.close()
if __name__ == "__main__":
app = QtWidgets.QApplication([])
widget = MyWidget()
widget.showFullScreen()
sys.exit(app.exec())