forked from nedrysoft/regex101
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RegExAboutDialog.h
93 lines (84 loc) · 3.32 KB
/
RegExAboutDialog.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*
* Copyright (C) 2020 Adrian Carpenter
*
* This file is part of a regex101.com offline application.
*
* https://github.com/fizzyade/regex101
*
* =====================================================================
* The regex101 web content is owned and used with permission from
* Firas Dib at regex101.com. This application is an unofficial
* tool to provide an offline application version of the website.
* =====================================================================
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef REGEXABOUTDIALOG_H
#define REGEXABOUTDIALOG_H
#include <QDialog>
#include <QPixmap>
namespace Nedrysoft {
/**
* @brief RegExAboutDialog class
*
* @details A dialog box that shows details about the application.
*/
class RegExAboutDialog :
public QDialog
{
private:
Q_OBJECT
public:
/**
* @brief Constructs an about dialog.
*
* @param[in] parent is the the owner of the dialog.
*/
explicit RegExAboutDialog(QWidget *parent = nullptr);
/**
* @brief Destroys the dialog.
*/
~RegExAboutDialog();
protected:
/**
* @brief Handles events for the dialog box.
*
* @details To allow the dialog box to be dismissed easily, event processing at a more
* granular level needs to occur.
*
* @param[in] event contains information about the event being processed.
* @returns true if the event was handled; otherwise, false.
*/
virtual bool event(QEvent *event) override;
/**
* @brief Handles focus out events.
*
* @details If the about dialog loses focus, this function is called to dismiss the dialog.
*
* @param[in] event contains information about the focus event.
*/
virtual void focusOutEvent(QFocusEvent *event) override;
/**
* @brief Renders the dialog.
*
* @details Calls QDialog::paintEvent and then draws version information over the top in the correct place.
*
* @param[in] event contains information about the paint event.
*/
virtual void paintEvent(QPaintEvent *paintEvent) override;
private:
QPixmap m_backgroundPixmap; //! the background image used for the about dialog
};
}
#endif // REGEXABOUTDIALOG_H