From ce05b61076a2280654157510cabac2db9af746e9 Mon Sep 17 00:00:00 2001 From: Zerumarex Date: Sat, 14 Feb 2026 21:25:47 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B8=D1=82=D1=8C=20oo?= =?UTF-8?q?p-exam/timer.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- oop-exam/timer.py | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 oop-exam/timer.py diff --git a/oop-exam/timer.py b/oop-exam/timer.py deleted file mode 100644 index a5e4931..0000000 --- a/oop-exam/timer.py +++ /dev/null @@ -1,43 +0,0 @@ -import sys -from PyQt6.QtWidgets import QApplication, QWidget, QLabel, QPushButton, QVBoxLayout -from PyQt6.QtCore import QTimer - -class SimpleTimer(QWidget): - def __init__(self): - super().__init__() - self.setWindowTitle("Таймер") - - self.label = QLabel("0") - self.seconds = 0 - - self.start_button = QPushButton("Старт") - self.start_button.clicked.connect(self.start_timer) - - self.stop_button = QPushButton("Стоп") - self.stop_button.clicked.connect(self.stop_timer) - - layout = QVBoxLayout() - layout.addWidget(self.label) - layout.addWidget(self.start_button) - layout.addWidget(self.stop_button) - self.setLayout(layout) - - self.timer = QTimer() - self.timer.timeout.connect(self.update_time) # вызывается каждый тик - self.timer.setInterval(1000) # 1000 мс = 1 секунда - - def start_timer(self): - self.timer.start() - - def stop_timer(self): - self.timer.stop() - - def update_time(self): - self.seconds += 1 - self.label.setText(str(self.seconds)) - -if __name__ == "__main__": - app = QApplication(sys.argv) - timer = SimpleTimer() - timer.show() - sys.exit(app.exec()) \ No newline at end of file