QElectroTech  0.8-dev
qetmainwindow.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2020 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 = Qt::Widget);
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
QET::Icons::QETDownload
QIcon QETDownload
Definition: qeticons.cpp:213
QETMainWindow::dragEnterEvent
void dragEnterEvent(QDragEnterEvent *e) override
Definition: qetmainwindow.cpp:255
QET::Icons::Configure
QIcon Configure
Definition: qeticons.cpp:38
QETMainWindow::menu_actions_
QHash< QMenu *, QAction * > menu_actions_
Store actions retrieved when inserting menus.
Definition: qetmainwindow.h:68
QETApp
The QETApp class This class represents the QElectroTech application.
Definition: qetapp.h:55
QETMainWindow
Definition: qetmainwindow.h:26
QETMainWindow::display_toolbars_
QMenu * display_toolbars_
Show/hide toolbars/docks.
Definition: qetmainwindow.h:67
QETMainWindow::upgrade_M
QAction * upgrade_M
Launch browser on QElectroTech MAC_OS_X builds.
Definition: qetmainwindow.h:62
QET::Icons::QETVideo
QIcon QETVideo
Definition: qeticons.cpp:214
qetmainwindow.h
QETMainWindow::updateFullScreenAction
void updateFullScreenAction()
Definition: qetmainwindow.cpp:202
QETMainWindow::configure_action_
QAction * configure_action_
Launch the QElectroTech configuration dialog.
Definition: qetmainwindow.h:55
QET::Icons::FullScreenEnter
QIcon FullScreenEnter
Definition: qeticons.cpp:103
projectview.h
QETApp::diagramEditors
static QList< QETDiagramEditor * > diagramEditors()
QETApp::diagramEditors.
Definition: qetapp.cpp:1214
QETMainWindow::dropEvent
void dropEvent(QDropEvent *e) override
Definition: qetmainwindow.cpp:268
QETApp::configureQET
void configureQET()
QETApp::configureQET Allows the user to configure QET by launching an appropriate dialog.
Definition: qetapp.cpp:1744
QET::Icons::QETDonate
QIcon QETDonate
Definition: qeticons.cpp:212
QETMainWindow::first_activation_
bool first_activation_
Used to detect whether the window is activated for the first time.
Definition: qetmainwindow.h:69
QETMainWindow::event
bool event(QEvent *) override
Definition: qetmainwindow.cpp:233
QETMainWindow::manual_online_
QAction * manual_online_
Launch browser on QElectroTech online manual.
Definition: qetmainwindow.h:59
QETMainWindow::help_menu_
QMenu * help_menu_
Help menu.
Definition: qetmainwindow.h:66
QETMainWindow::about_qet_
QAction * about_qet_
Launch the "About QElectroTech" dialog.
Definition: qetmainwindow.h:58
qetapp.h
QETMainWindow::donate_
QAction * donate_
Launch browser to donate link.
Definition: qetmainwindow.h:63
QETMainWindow::insertMenu
void insertMenu(QMenu *, QMenu *, bool=true)
Definition: qetmainwindow.cpp:172
QETArguments
Definition: qetarguments.h:26
QETMainWindow::youtube_
QAction * youtube_
Launch browser on QElectroTech Youtube channel.
Definition: qetmainwindow.h:60
qeticons.h
QETMainWindow::QETMainWindow
QETMainWindow(QWidget *=nullptr, Qt::WindowFlags=Qt::Widget)
Definition: qetmainwindow.cpp:34
QETMainWindow::fullscreen_action_
QAction * fullscreen_action_
Toggle full screen.
Definition: qetmainwindow.h:56
QETMainWindow::~QETMainWindow
~QETMainWindow() override
Definition: qetmainwindow.cpp:48
QET::Icons::FullScreenExit
QIcon FullScreenExit
Definition: qeticons.cpp:104
QETMainWindow::actionForMenu
QAction * actionForMenu(QMenu *)
Definition: qetmainwindow.cpp:187
QET::Icons::QETLogo
QIcon QETLogo
Definition: qeticons.cpp:151
QET::Icons::ConfigureToolbars
QIcon ConfigureToolbars
Definition: qeticons.cpp:39
QETMainWindow::whatsthis_action_
QAction * whatsthis_action_
Toggle "What's this" mode.
Definition: qetmainwindow.h:57
QETMainWindow::settings_menu_
QMenu * settings_menu_
Settings menu.
Definition: qetmainwindow.h:65
QETApp::instance
static QETApp * instance()
QETApp::instance.
Definition: qetapp.cpp:153
QETMainWindow::initCommonMenus
void initCommonMenus()
Definition: qetmainwindow.cpp:134
QETMainWindow::initCommonActions
void initCommonActions()
Definition: qetmainwindow.cpp:54
QETDiagramEditor
Definition: qetdiagrameditor.h:51
QETApp::handledFiles
static QStringList handledFiles(const QList< QUrl > &)
QETApp::handledFiles.
Definition: qetapp.cpp:914
QETMainWindow::checkToolbarsmenu
void checkToolbarsmenu()
Definition: qetmainwindow.cpp:219
QET::Icons::QETManual
QIcon QETManual
Definition: qeticons.cpp:211
qetdiagrameditor.h
QET::Icons::QtLogo
QIcon QtLogo
Definition: qeticons.cpp:153
QETMainWindow::upgrade_
QAction * upgrade_
Launch browser on QElectroTech Windows Nightly builds.
Definition: qetmainwindow.h:61
QETMainWindow::about_qt_
QAction * about_qt_
launch the "About Qt" dialog
Definition: qetmainwindow.h:64
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
QETMainWindow::toggleFullScreen
void toggleFullScreen()
Definition: qetmainwindow.cpp:194
QETMainWindow::firstActivation
virtual void firstActivation(QEvent *)
Definition: qetmainwindow.cpp:246