Commit 0f129533 authored by Sylvain Thery's avatar Sylvain Thery Committed by Pierre Kraemer

confirm quit with ESC

parent ca9a842c
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <QKeyEvent> #include <QKeyEvent>
#include <QMouseEvent> #include <QMouseEvent>
#include <QWheelEvent> #include <QWheelEvent>
#include <QMessageBox>
namespace CGoGN namespace CGoGN
{ {
...@@ -510,6 +511,17 @@ void View::keyPressEvent(QKeyEvent* event) ...@@ -510,6 +511,17 @@ void View::keyPressEvent(QKeyEvent* event)
{ {
foreach(PluginInteraction* plugin, l_plugins) foreach(PluginInteraction* plugin, l_plugins)
plugin->keyPress(this, event); plugin->keyPress(this, event);
if (event->key() == Qt::Key_Escape)
{
QMessageBox msgBox;
msgBox.setText("Really quit SCHNApps ?");
msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
msgBox.setDefaultButton(QMessageBox::Ok);
if (msgBox.exec() == QMessageBox::Ok)
exit(0);
}
else
QGLViewer::keyPressEvent(event); QGLViewer::keyPressEvent(event);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment