-
Notifications
You must be signed in to change notification settings - Fork 0
/
helpwidget.h
50 lines (38 loc) · 1.03 KB
/
helpwidget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// © Copyright (c) 2018 SqYtCO
#ifndef HELPWIDGET_H
#define HELPWIDGET_H
#include <QFrame>
#include <QGridLayout>
#include <QTextBrowser>
#include <QToolButton>
#include <QLabel>
// widget of help view
// it displays in dependence of the set language the file "help_XX.html"; XX=language
// signals: hide_help()
class HelpWidget : public QFrame
{
Q_OBJECT
// container of all components
QGridLayout main_layout;
// html display
QTextBrowser html_help;
// emit signal hide_help()
QToolButton hide;
// jump to anchor "index"
QToolButton show_index;
void init_gui();
public:
HelpWidget(QWidget* parent = nullptr);
// set all texts; if a QTranslator is installed, the installed texts will be loaded
void translate();
// enable the focus of all children and the widget
void enable_focus();
// disable the focus of all children and the widget
void disable_focus();
protected:
void mousePressEvent(QMouseEvent*) { }
signals:
// has to be connected to a slot which hides the help widget
void hide_help();
};
#endif // HELPWIDGET_H