-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwelcome_widget.py
54 lines (42 loc) · 1.78 KB
/
welcome_widget.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
from PyQt6.QtWidgets import QLabel, QPushButton, QVBoxLayout, QLineEdit, QWidget, QComboBox, QFormLayout, QHBoxLayout
from PyQt6.QtCore import Qt, pyqtSignal
from PyQt6.QtGui import QFont
class WelcomeWidget(QWidget):
start_pressed = pyqtSignal()
def __init__(self):
super().__init__()
# Setup ui
headerLabel = QLabel("<b>Hybparc-GUI: Start</b>")
largeFont = headerLabel.font()
largeFont.setPointSize(48)
largeFont.setBold(True)
headerLabel.setAlignment(Qt.AlignmentFlag.AlignCenter)
headerLabel.setFont(largeFont)
mediumFont = QFont()
mediumFont.setPointSize(28)
self.m_lineEditName = QLineEdit()
self.m_lineEditName.setMinimumWidth(300)
self.m_lineEditName.setFont(mediumFont)
textLabel = QLabel('Willkommen zur EKG-Selbstlerneinheit mit automatischer Auswertung.')
textLabel.setTextFormat(Qt.TextFormat.RichText)
font = textLabel.font()
font.setPointSize(32)
textLabel.setFont(font)
startButton = QPushButton("Starten")
startButton.clicked.connect(self.emit_start_pressed)
startButton.setShortcut(Qt.Key.Key_Return)
startButton.setFont(mediumFont)
startButton.setMaximumWidth(150)
verticalLayout = QVBoxLayout()
verticalLayout.addStretch()
verticalLayout.addWidget(textLabel)
verticalLayout.addWidget(startButton)
verticalLayout.setAlignment(startButton, Qt.AlignmentFlag.AlignHCenter)
verticalLayout.addStretch()
mainLayout = QHBoxLayout()
mainLayout.addStretch()
mainLayout.addLayout(verticalLayout)
mainLayout.addStretch()
self.setLayout(mainLayout)
def emit_start_pressed(self):
self.start_pressed.emit()