Изменение базового класса окна About
[novacoin.git] / src / qt / aboutdialog.cpp
index 7c6a42e..a66287d 100644 (file)
@@ -7,8 +7,10 @@
 
 #include "version.h"
 
+#include <QKeyEvent>
+
 AboutDialog::AboutDialog(QWidget *parent) :
-    QDialog(parent, DIALOGWINDOWHINTS),
+    QWidget(parent, DIALOGWINDOWHINTS),
     ui(new Ui::AboutDialog)
 {
     ui->setupUi(this);
@@ -31,3 +33,18 @@ void AboutDialog::on_buttonBox_accepted()
 {
     close();
 }
+
+void AboutDialog::keyPressEvent(QKeyEvent *event)
+{
+#ifdef ANDROID
+    if(event->key() == Qt::Key_Back)
+    {
+        close();
+    }
+#else
+    if(event->key() == Qt::Key_Escape)
+    {
+        close();
+    }
+#endif
+}
\ No newline at end of file