Advertisement
Chl_Snt

temp

Apr 17th, 2024
511
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.19 KB | None | 0 0
  1. import sys
  2. import PyQt5
  3. from PyQt5.QtGui import QFont
  4. from PyQt5.QtWidgets import *
  5. from PyQt5.QtWidgets import QMainWindow, QLineEdit, QPushButton
  6.  
  7.  
  8. class MainWindow(QMainWindow):
  9.     def __init__(self):
  10.         super().__init__()
  11.         self.setWindowTitle("TaskManager")
  12.         self.setGeometry(100, 100, 1200, 300)
  13.  
  14.         self.centralwidget = QWidget(self)
  15.         self.setCentralWidget(self.centralwidget)
  16.  
  17.         self.layout = QHBoxLayout(self)
  18.         self.centralwidget.setLayout(self.layout)
  19.  
  20.         self.setup_first()
  21.         self.setup_second()
  22.         self.setup_third()
  23.  
  24.     def setup_first(self):
  25.         inner_layout = QVBoxLayout()
  26.         self.layout.addLayout(inner_layout)
  27.         inner_layout.setSpacing(1)
  28.  
  29.         self.title_input = QLineEdit("Введи заголовок", self)
  30.         inner_layout.addWidget(self.title_input)
  31.         self.desc_input = QLineEdit("Введи описание", self)
  32.         inner_layout.addWidget(self.desc_input)
  33.         self.imp_input = QLineEdit("Введи индекс важности", self)
  34.         inner_layout.addWidget(self.imp_input)
  35.  
  36.         self.add_button = QPushButton("Добавить задачу", self)
  37.         inner_layout.addWidget(self.add_button)
  38.  
  39.     def setup_second(self):
  40.         self.show_button = QPushButton("Просмотреть\nзадачи", self)
  41.         # self.show_button.setMinimumHeight(250)
  42.         self.show_button.setFont(QFont("Arial", 18))
  43.         self.layout.addWidget(self.show_button)
  44.  
  45.     def setup_third(self):
  46.         inner_layout = QVBoxLayout(self)
  47.         self.done_title_input = QLineEdit(self)
  48.         # self.done_title_input.setMinimumHeight(25)
  49.         self.done_title_input.setPlaceholderText("Введите заголовок задачи, которую хотите отметить как завершенную")
  50.         self.done_button = QPushButton("Отметить", self)
  51.  
  52.         inner_layout.addWidget(self.done_title_input)
  53.         inner_layout.addWidget(self.done_button)
  54.         self.layout.addLayout(inner_layout)
  55.  
  56.  
  57.  
  58. if __name__ == '__main__':
  59.     app = QApplication(sys.argv)
  60.     w = MainWindow()
  61.  
  62.     w.show()
  63.     sys.exit(app.exec_())
  64.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement