- import sys
- from PySide6.QtWidgets import (QApplication, QMainWindow, QWidget, QVBoxLayout,
- QHBoxLayout, QLabel, QLineEdit, QPushButton,
- QComboBox, QSpacerItem, QSizePolicy)
- class MainWindow(QMainWindow):
- def __init__(self):
- super().__init__()
- # Central widget and layout
- central_widget = QWidget()
- self.setCentralWidget(central_widget)
- main_layout = QVBoxLayout(central_widget)
- # Horizontal layout for class selection, inputs, and button
- horizontal_layout = QHBoxLayout()
- # Class selection (Wybierz klasę)
- class_selection_label = QLabel("Wybierz klasę:")
- class_selection_combo = QComboBox()
- class_selection_combo.addItems(["2TD", "2TP", "3TF", "3TP"])
- class_selection_layout = QVBoxLayout()
- class_selection_layout.addWidget(class_selection_label)
- class_selection_layout.addWidget(class_selection_combo)
- # Middle layout for inputs
- inputs_layout = QVBoxLayout()
- # Name input (Podaj nazwisko)
- name_input_label = QLabel("Podaj nazwisko:")
- name_input_edit = QLineEdit()
- inputs_layout.addWidget(name_input_label)
- inputs_layout.addWidget(name_input_edit)
- # Password input (Podaj hasło)
- password_input_label = QLabel("Podaj hasło:")
- password_input_edit = QLineEdit()
- password_input_edit.setEchoMode(QLineEdit.Password)
- inputs_layout.addWidget(password_input_label)
- inputs_layout.addWidget(password_input_edit)
- # Button (DALEJ)
- submit_button = QPushButton("DALEJ")
- submit_button.setStyleSheet("font-weight: bold;") # Bold font for the button
- button_layout = QVBoxLayout()
- button_layout.addWidget(submit_button)
- button_layout.addItem(QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)) # Add space below button
- # Add class selection, inputs, and button to the horizontal layout
- horizontal_layout.addLayout(class_selection_layout)
- horizontal_layout.addLayout(inputs_layout)
- horizontal_layout.addLayout(button_layout)
- # Add the horizontal layout to the main layout
- main_layout.addLayout(horizontal_layout)
- # Set window title and size
- self.setWindowTitle("Belka Tytułowa")
- self.resize(600, 200) # Adjust the size as needed to match the design
- if __name__ == '__main__':
- app = QApplication(sys.argv)
- window = MainWindow()
- window.show()
- sys.exit(app.exec())