Уделание объектов при закрытии окна

main
Артём Проскурнёв 4 years ago
parent 0daace619a
commit 71318eb774
  1. 10
      qtsgraph.cpp
  2. 1
      qtsgraph.h

@ -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;
}

@ -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;
};

Loading…
Cancel
Save