From 71318eb774ca513a0e995423d54fdd0f1f44d051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D1=80=D0=BE=D1=81?= =?UTF-8?q?=D0=BA=D1=83=D1=80=D0=BD=D1=91=D0=B2?= Date: Mon, 4 Jan 2021 21:37:12 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B4=D0=B5=D0=BB=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BE=D0=B1=D1=8A=D0=B5=D0=BA=D1=82=D0=BE=D0=B2=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=20=D0=B7=D0=B0=D0=BA=D1=80=D1=8B=D1=82=D0=B8?= =?UTF-8?q?=D0=B8=20=D0=BE=D0=BA=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qtsgraph.cpp | 10 +++++++++- qtsgraph.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/qtsgraph.cpp b/qtsgraph.cpp index a3263ba..5d8bfd2 100644 --- a/qtsgraph.cpp +++ b/qtsgraph.cpp @@ -117,7 +117,7 @@ int QTSGraph::ReadKey() { if(!EventKeyPressed || IDPressedKey == -1) { - while(!KeyPressed()) + while(!KeyPressed() && this->isVisible()) Delay(100); } int t = IDPressedKey; @@ -211,3 +211,11 @@ void QTSGraph::keyPressEvent(QKeyEvent *event) // Нажатие Esc } } + +void QTSGraph::closeEvent(QCloseEvent *event) +{ + //Закрытие окна + delete ResetTimer; + delete StartTimer; + delete this; +} diff --git a/qtsgraph.h b/qtsgraph.h index 2485f1b..0463c34 100644 --- a/qtsgraph.h +++ b/qtsgraph.h @@ -130,4 +130,5 @@ protected: void paintEvent(QPaintEvent *event) override; void mousePressEvent(QMouseEvent *event) override; void keyPressEvent(QKeyEvent *event) override; + void closeEvent(QCloseEvent *event) override; };