использование правильного сигнала закрытия окна 151/head
authorfsb4000 <fsb4000@yandex.ru>
Tue, 10 Feb 2015 01:13:41 +0000 (07:13 +0600)
committerfsb4000 <fsb4000@yandex.ru>
Tue, 10 Feb 2015 01:13:41 +0000 (07:13 +0600)
Я ошибся, нет встроенного сигнала close() у QWidget :)

src/qt/transactiondescdialog.cpp
src/qt/transactiondescdialog.h
src/qt/transactionview.cpp

index c79792d..4c62e4b 100644 (file)
@@ -34,4 +34,10 @@ void TransactionDescDialog::keyPressEvent(QKeyEvent *event)
         close();
     }
 #endif
-}
\ No newline at end of file
+}
+
+void TransactionDescDialog::closeEvent(QCloseEvent *e)
+{
+    emit(stopExec());
+    QWidget::closeEvent(e);
+}
index 4d74821..3f39e41 100644 (file)
@@ -16,6 +16,7 @@ class TransactionDescDialog : public QWidget
     Q_OBJECT
 protected:
     void keyPressEvent(QKeyEvent *);
+    void closeEvent(QCloseEvent *e);
 
 public:
     explicit TransactionDescDialog(const QModelIndex &idx, QWidget *parent = 0);
@@ -23,6 +24,9 @@ public:
 
 private:
     Ui::TransactionDescDialog *ui;
+
+signals:
+    void stopExec();
 };
 
 #endif // TRANSACTIONDESCDIALOG_H
index 45abb74..321d587 100644 (file)
@@ -421,7 +421,7 @@ void TransactionView::showDetails()
 
         // This loop will wait for the window is closed
         QEventLoop loop;
-        connect(&dlg, SIGNAL(close()), &loop, SLOT(quit()));
+        connect(&dlg, SIGNAL(stopExec()), &loop, SLOT(quit()));
         loop.exec();
     }
 }