Advertisement
clown1337

Untitled

May 22nd, 2024
726
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.28 KB | None | 0 0
  1. import sys
  2. from PyQt5.QtWidgets import QApplication, QMainWindow, QVBoxLayout, QWidget, QGridLayout
  3. from PyQt5.QtCore import Qt
  4. from window import TypingFilter
  5. from Text import DisplayText
  6. from Keyboard import Keyboard
  7. from Englelvls import english_levels_2, english_levels_1
  8. from Input import Input
  9.  
  10. class MainWindow(QMainWindow):
  11.     def __init__(self):
  12.         super().__init__()
  13.         self.setWindowTitle("Typing Trainer")
  14.         # self.setFixedSize(600, 400)
  15.  
  16.         self.display_text = DisplayText(self)
  17.         self.typing_filter = TypingFilter(self.display_text, self)
  18.         self.typing_filter.set_level_text(english_levels_1[0])
  19.  
  20.  
  21.         keyboard = Keyboard()
  22.         input = Input()
  23.         input.input.textEdited.connect(keyboard.highlightButton)
  24.         main_layout = QGridLayout()
  25.         main_layout.addWidget(self.display_text, 0, 0)
  26.         main_layout.addWidget(self.typing_filter, 1, 0)
  27.         main_layout.addWidget(input, 2, 0)
  28.         main_layout.addWidget(keyboard, 3, 0, alignment=Qt.AlignCenter)
  29.         container = QWidget()
  30.         container.setLayout(main_layout)
  31.         self.setCentralWidget(container)
  32.  
  33. if __name__ == "__main__":
  34.     app = QApplication(sys.argv)
  35.     window = MainWindow()
  36.     window.show()
  37.     sys.exit(app.exec_())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement