summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/divelogimportdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/divelogimportdialog.cpp')
-rw-r--r--desktop-widgets/divelogimportdialog.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/desktop-widgets/divelogimportdialog.cpp b/desktop-widgets/divelogimportdialog.cpp
index 4d092bb8c..2068c3916 100644
--- a/desktop-widgets/divelogimportdialog.cpp
+++ b/desktop-widgets/divelogimportdialog.cpp
@@ -951,6 +951,22 @@ void DiveLogImportDialog::on_buttonBox_accepted()
MainWindow::instance()->refreshDisplay();
}
+// Since this is a non-modal dialog, the caller can't delete it at the call-site.
+// Therefore, hook into the accept() and reject() functions and schedule the object
+// for deletion with deleteLater(). Horrible, but absolutely the "Qt-way".
+// TODO: Think about making the dialog modal.
+void DiveLogImportDialog::accept()
+{
+ QDialog::accept();
+ deleteLater();
+}
+
+void DiveLogImportDialog::reject()
+{
+ QDialog::reject();
+ deleteLater();
+}
+
TagDragDelegate::TagDragDelegate(QObject *parent) : QStyledItemDelegate(parent)
{
}