Desktop: Derive UserManual from QDialog

In commit d21d42b691 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>
This commit is contained in:
Berthold Stoeger 2018-05-31 16:36:34 +02:00 committed by Lubomir I. Ivanov
parent 294c3bcfd1
commit 9611e92cf0
4 changed files with 7 additions and 2 deletions

View file

@ -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)
{

View file

@ -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();

View file

@ -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()));

View file

@ -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: