From 804f933fa12bbb635cdca9cca0df4d2fc4a38c7e Mon Sep 17 00:00:00 2001 From: En Yi Date: Sat, 21 Jul 2018 21:06:41 +0800 Subject: [PATCH] Document main --- main.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 7418dec..71c968a 100644 --- a/main.py +++ b/main.py @@ -1,5 +1,6 @@ -# TODO: Add a scribble function -# TODO: Add keyboard support +""" +This is the main module to be run. Contains the program itself. +""" from PyQt5.QtGui import QPainter, QBrush from PyQt5.Qt import QApplication @@ -12,8 +13,7 @@ from graphic_components import board class SudokuWindow(QGraphicsView): """ - The main window that shows the graphical components. - Contains the Sudoku Board and the Menu Board. + The main window that shows the Sudoku Board and the Menu Board. """ def __init__(self): @@ -50,6 +50,9 @@ class SudokuWindow(QGraphicsView): self.menuboard.diff_display.difficultySelected.connect(self.gameboard.new_game) def resizeEvent(self, event): + """ + Reimplemented from QGraphicsView. Resize and maintain the board aspect ratio. + """ self.fitInView(self.scene.sceneRect(), Qt.KeepAspectRatio) super().resizeEvent(event)