aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-05-31 16:36:34 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2018-05-31 21:29:29 +0300
commit9611e92cf0d90e4ce1eaf3c3adbaac0f78f4c884 (patch)
tree94b5034fe3ce9afbb0b6d082df40dfcb22f2e619 /desktop-widgets
parent294c3bcfd1c43da9cc5db3d51fd2f3b23c50ac4b (diff)
downloadsubsurface-9611e92cf0d90e4ce1eaf3c3adbaac0f78f4c884.tar.gz
Desktop: Derive UserManual from QDialog
In commit d21d42b69117aae04b68ecc9cc2139e034bde146 helpView was made a child-object of MainWindow, which is Qt's idiomatic way of having helpView deleted with MainWindow. As an unintended consequence, the helpView didn't show. The reason is that UserManual derives directly from QObject. In contrast, UserSurvey derives from QDialog and is correctly shown. Therefore also derive UserManual from QDialog. Reported-by: Willem Ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/mainwindow.cpp2
-rw-r--r--desktop-widgets/mainwindow.h2
-rw-r--r--desktop-widgets/usermanual.cpp2
-rw-r--r--desktop-widgets/usermanual.h3
4 files changed, 7 insertions, 2 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index 94c319a4b..087ccc228 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -100,7 +100,9 @@ extern "C" void showErrorFromC(char *buf)
MainWindow::MainWindow() : QMainWindow(),
actionNextDive(0),
actionPreviousDive(0),
+#ifndef NO_USERMANUAL
helpView(0),
+#endif
state(VIEWALL),
survey(0)
{
diff --git a/desktop-widgets/mainwindow.h b/desktop-widgets/mainwindow.h
index 3a9848f62..00ddd86b7 100644
--- a/desktop-widgets/mainwindow.h
+++ b/desktop-widgets/mainwindow.h
@@ -191,7 +191,9 @@ private:
Ui::MainWindow ui;
QAction *actionNextDive;
QAction *actionPreviousDive;
+#ifndef NO_USERMANUAL
UserManual *helpView;
+#endif
CurrentState state;
CurrentState stateBeforeEdit;
QString filter_open();
diff --git a/desktop-widgets/usermanual.cpp b/desktop-widgets/usermanual.cpp
index 69000dd54..83bffb521 100644
--- a/desktop-widgets/usermanual.cpp
+++ b/desktop-widgets/usermanual.cpp
@@ -56,7 +56,7 @@ MyQWebEngineView::MyQWebEngineView(QWidget* parent)
}
#endif
-UserManual::UserManual(QWidget *parent) : QWidget(parent)
+UserManual::UserManual(QWidget *parent) : QDialog(parent)
{
QShortcut *closeKey = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this);
connect(closeKey, SIGNAL(activated()), this, SLOT(close()));
diff --git a/desktop-widgets/usermanual.h b/desktop-widgets/usermanual.h
index c9ae66323..e005fb0fe 100644
--- a/desktop-widgets/usermanual.h
+++ b/desktop-widgets/usermanual.h
@@ -8,6 +8,7 @@
#else
#include <QWebView>
#endif
+#include <QDialog>
#include "ui_searchbar.h"
class SearchBar : public QWidget{
@@ -47,7 +48,7 @@ public:
#endif
-class UserManual : public QWidget {
+class UserManual : public QDialog {
Q_OBJECT
public: