QElectroTech  0.70
qetmainwindow.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2019 The QElectroTech Team
3  This file is part of QElectroTech.
4 
5  QElectroTech is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 2 of the License, or
8  (at your option) any later version.
9 
10  QElectroTech is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef QET_MAIN_WINDOW_H
19 #define QET_MAIN_WINDOW_H
20 #include <QMainWindow>
21 #include <QHash>
26 class QETMainWindow : public QMainWindow {
27  Q_OBJECT
28 
29  // constructor, destructor
30  public:
31  QETMainWindow(QWidget * = nullptr, Qt::WindowFlags = nullptr);
32  ~QETMainWindow() override;
33 
34  // methods
35  protected:
36  void initCommonActions();
37  void initCommonMenus();
38  void insertMenu(QMenu *, QMenu *, bool = true);
39  QAction *actionForMenu(QMenu *);
40 
41  protected:
42  bool event(QEvent *) override;
43  void dragEnterEvent(QDragEnterEvent *e) override;
44  void dropEvent(QDropEvent *e) override;
45  virtual void firstActivation(QEvent *);
46 
47  // slots
48  public slots:
49  void toggleFullScreen();
51  void checkToolbarsmenu();
52 
53  // attributes
54  protected:
55  QAction *configure_action_;
56  QAction *fullscreen_action_;
57  QAction *whatsthis_action_;
58  QAction *about_qet_;
59  QAction *manual_online_;
60  QAction *youtube_;
61  QAction *upgrade_;
62  QAction *upgrade_M;
63  QAction *donate_;
64  QAction *about_qt_;
65  QMenu *settings_menu_;
66  QMenu *help_menu_;
68  QHash<QMenu *, QAction *> menu_actions_;
70 };
71 #endif
void initCommonMenus()
void checkToolbarsmenu()
void initCommonActions()
virtual void firstActivation(QEvent *)
void toggleFullScreen()
void dragEnterEvent(QDragEnterEvent *e) override
QAction * about_qt_
launch the "About Qt" dialog
Definition: qetmainwindow.h:64
QMenu * settings_menu_
Settings menu.
Definition: qetmainwindow.h:65
QMenu * display_toolbars_
Show/hide toolbars/docks.
Definition: qetmainwindow.h:67
bool event(QEvent *) override
QAction * configure_action_
Launch the QElectroTech configuration dialog.
Definition: qetmainwindow.h:55
QAction * about_qet_
Launch the "About QElectroTech" dialog.
Definition: qetmainwindow.h:58
QMenu * help_menu_
Help menu.
Definition: qetmainwindow.h:66
QAction * manual_online_
Launch browser on QElectroTech online manual.
Definition: qetmainwindow.h:59
void dropEvent(QDropEvent *e) override
QAction * upgrade_
Launch browser on QElectroTech Windows Nightly builds.
Definition: qetmainwindow.h:61
~QETMainWindow() override
QAction * youtube_
Launch browser on QElectroTech Youtube channel.
Definition: qetmainwindow.h:60
bool first_activation_
Used to detect whether the window is activated for the first time.
Definition: qetmainwindow.h:69
QAction * fullscreen_action_
Toggle full screen.
Definition: qetmainwindow.h:56
QAction * actionForMenu(QMenu *)
QAction * whatsthis_action_
Toggle "What&#39;s this" mode.
Definition: qetmainwindow.h:57
void insertMenu(QMenu *, QMenu *, bool=true)
QAction * donate_
Launch browser to donate link.
Definition: qetmainwindow.h:63
QAction * upgrade_M
Launch browser on QElectroTech MAC_OS_X builds.
Definition: qetmainwindow.h:62
QETMainWindow(QWidget *=nullptr, Qt::WindowFlags=nullptr)
QHash< QMenu *, QAction * > menu_actions_
Store actions retrieved when inserting menus.
Definition: qetmainwindow.h:68
void updateFullScreenAction()