Add selectable Qt GUI Styles
[novacoin.git] / src / qt / transactiondescdialog.cpp
index e37b71e..4c62e4b 100644 (file)
@@ -5,9 +5,10 @@
 #include "dialogwindowflags.h"
 
 #include <QModelIndex>
+#include <QKeyEvent>
 
 TransactionDescDialog::TransactionDescDialog(const QModelIndex &idx, QWidget *parent) :
-    QDialog(parent, DIALOGWINDOWHINTS),
+    QWidget(parent, DIALOGWINDOWHINTS),
     ui(new Ui::TransactionDescDialog)
 {
     ui->setupUi(this);
@@ -19,3 +20,24 @@ TransactionDescDialog::~TransactionDescDialog()
 {
     delete ui;
 }
+
+void TransactionDescDialog::keyPressEvent(QKeyEvent *event)
+{
+#ifdef ANDROID
+    if(event->key() == Qt::Key_Back)
+    {
+        close();
+    }
+#else
+    if(event->key() == Qt::Key_Escape)
+    {
+        close();
+    }
+#endif
+}
+
+void TransactionDescDialog::closeEvent(QCloseEvent *e)
+{
+    emit(stopExec());
+    QWidget::closeEvent(e);
+}