QElectroTech  0.70
Public Slots | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QETMainWindow Class Reference

#include <qetmainwindow.h>

Public Slots

void toggleFullScreen ()
 
void updateFullScreenAction ()
 
void checkToolbarsmenu ()
 

Public Member Functions

 QETMainWindow (QWidget *=nullptr, Qt::WindowFlags=nullptr)
 
 ~QETMainWindow () override
 

Protected Member Functions

void initCommonActions ()
 
void initCommonMenus ()
 
void insertMenu (QMenu *, QMenu *, bool=true)
 
QAction * actionForMenu (QMenu *)
 
bool event (QEvent *) override
 
void dragEnterEvent (QDragEnterEvent *e) override
 
void dropEvent (QDropEvent *e) override
 
virtual void firstActivation (QEvent *)
 

Protected Attributes

QAction * configure_action_
 Launch the QElectroTech configuration dialog. More...
 
QAction * fullscreen_action_
 Toggle full screen. More...
 
QAction * whatsthis_action_
 Toggle "What's this" mode. More...
 
QAction * about_qet_
 Launch the "About QElectroTech" dialog. More...
 
QAction * manual_online_
 Launch browser on QElectroTech online manual. More...
 
QAction * youtube_
 Launch browser on QElectroTech Youtube channel. More...
 
QAction * upgrade_
 Launch browser on QElectroTech Windows Nightly builds. More...
 
QAction * upgrade_M
 Launch browser on QElectroTech MAC_OS_X builds. More...
 
QAction * donate_
 Launch browser to donate link. More...
 
QAction * about_qt_
 launch the "About Qt" dialog More...
 
QMenu * settings_menu_
 Settings menu. More...
 
QMenu * help_menu_
 Help menu. More...
 
QMenu * display_toolbars_
 Show/hide toolbars/docks. More...
 
QHash< QMenu *, QAction * > menu_actions_
 Store actions retrieved when inserting menus. More...
 
bool first_activation_
 Used to detect whether the window is activated for the first time. More...
 

Detailed Description

This is the base class for the main top-level windows within QElectroTech.

Definition at line 26 of file qetmainwindow.h.

Constructor & Destructor Documentation

◆ QETMainWindow()

QETMainWindow::QETMainWindow ( QWidget *  widget = nullptr,
Qt::WindowFlags  flags = nullptr 
)

Constructor

Definition at line 34 of file qetmainwindow.cpp.

References initCommonActions(), and initCommonMenus().

◆ ~QETMainWindow()

QETMainWindow::~QETMainWindow ( )
override

Destructor

Definition at line 48 of file qetmainwindow.cpp.

Member Function Documentation

◆ actionForMenu()

QAction * QETMainWindow::actionForMenu ( QMenu *  menu)
protected
Returns
the action returned when inserting menu

Definition at line 187 of file qetmainwindow.cpp.

References menu_actions_.

Referenced by insertMenu().

◆ checkToolbarsmenu

void QETMainWindow::checkToolbarsmenu ( )
slot

Check whether a sub menu dedicated to docks and toolbars can be inserted on top of the settings menu.

Definition at line 219 of file qetmainwindow.cpp.

References QET::Icons::ConfigureToolbars, display_toolbars_, fullscreen_action_, insertMenu(), settings_menu_, and QET::Icons::tr.

Referenced by initCommonMenus().

◆ dragEnterEvent()

void QETMainWindow::dragEnterEvent ( QDragEnterEvent *  e)
overrideprotected

Accept or refuse drag'n drop events depending on the dropped mime type; especially, accepts only URLs to local files that we could open.

Parameters
ele QDragEnterEvent correspondant au drag'n drop tente

Definition at line 255 of file qetmainwindow.cpp.

References QETApp::handledFiles().

◆ dropEvent()

void QETMainWindow::dropEvent ( QDropEvent *  e)
overrideprotected

Handle drops accepted on main windows; more specifically, open dropped files as long as they are handled by QElectrotech.

Parameters
ethe QDropEvent describing the current drag'n drop

Definition at line 268 of file qetmainwindow.cpp.

References QETApp::handledFiles(), and QETApp::instance().

◆ event()

bool QETMainWindow::event ( QEvent *  e)
overrideprotected

◆ firstActivation()

void QETMainWindow::firstActivation ( QEvent *  )
protectedvirtual

Base implementation of firstActivation (does nothing).

Reimplemented in QETElementEditor, and QETTitleBlockTemplateEditor.

Definition at line 246 of file qetmainwindow.cpp.

Referenced by event().

◆ initCommonActions()

void QETMainWindow::initCommonActions ( )
protected

◆ initCommonMenus()

void QETMainWindow::initCommonMenus ( )
protected

◆ insertMenu()

void QETMainWindow::insertMenu ( QMenu *  before,
QMenu *  menu,
bool  customize = true 
)
protected

Add menu before before. Unless customize is false, this method also enables some common settings on the inserted menu.

Definition at line 172 of file qetmainwindow.cpp.

References actionForMenu(), and menu_actions_.

Referenced by checkToolbarsmenu(), initCommonMenus(), QETTitleBlockTemplateEditor::initMenus(), QETDiagramEditor::setUpMenu(), and QETElementEditor::setupMenus().

◆ toggleFullScreen

void QETMainWindow::toggleFullScreen ( )
slot

Toggle the window from/to full screen.

Definition at line 194 of file qetmainwindow.cpp.

Referenced by initCommonActions().

◆ updateFullScreenAction

void QETMainWindow::updateFullScreenAction ( )
slot

Update the look of the full screen action according to the current state of the window.

Definition at line 202 of file qetmainwindow.cpp.

References fullscreen_action_, QET::Icons::FullScreenEnter, QET::Icons::FullScreenExit, and QET::Icons::tr.

Referenced by event(), and initCommonActions().

Member Data Documentation

◆ about_qet_

QAction* QETMainWindow::about_qet_
protected

Launch the "About QElectroTech" dialog.

Definition at line 58 of file qetmainwindow.h.

Referenced by initCommonActions(), and initCommonMenus().

◆ about_qt_

QAction* QETMainWindow::about_qt_
protected

launch the "About Qt" dialog

Definition at line 64 of file qetmainwindow.h.

Referenced by initCommonActions(), and initCommonMenus().

◆ configure_action_

QAction* QETMainWindow::configure_action_
protected

Launch the QElectroTech configuration dialog.

Definition at line 55 of file qetmainwindow.h.

Referenced by initCommonActions(), and initCommonMenus().

◆ display_toolbars_

QMenu* QETMainWindow::display_toolbars_
protected

Show/hide toolbars/docks.

Definition at line 67 of file qetmainwindow.h.

Referenced by checkToolbarsmenu().

◆ donate_

QAction* QETMainWindow::donate_
protected

Launch browser to donate link.

Definition at line 63 of file qetmainwindow.h.

Referenced by initCommonActions(), and initCommonMenus().

◆ first_activation_

bool QETMainWindow::first_activation_
protected

Used to detect whether the window is activated for the first time.

Definition at line 69 of file qetmainwindow.h.

Referenced by event().

◆ fullscreen_action_

QAction* QETMainWindow::fullscreen_action_
protected

Toggle full screen.

Definition at line 56 of file qetmainwindow.h.

Referenced by checkToolbarsmenu(), initCommonActions(), initCommonMenus(), and updateFullScreenAction().

◆ help_menu_

QMenu* QETMainWindow::help_menu_
protected

Help menu.

Definition at line 66 of file qetmainwindow.h.

Referenced by initCommonMenus(), and QETDiagramEditor::setUpMenu().

◆ manual_online_

QAction* QETMainWindow::manual_online_
protected

Launch browser on QElectroTech online manual.

Definition at line 59 of file qetmainwindow.h.

Referenced by initCommonActions(), and initCommonMenus().

◆ menu_actions_

QHash<QMenu *, QAction *> QETMainWindow::menu_actions_
protected

Store actions retrieved when inserting menus.

Definition at line 68 of file qetmainwindow.h.

Referenced by actionForMenu(), and insertMenu().

◆ settings_menu_

QMenu* QETMainWindow::settings_menu_
protected

◆ upgrade_

QAction* QETMainWindow::upgrade_
protected

Launch browser on QElectroTech Windows Nightly builds.

Definition at line 61 of file qetmainwindow.h.

Referenced by initCommonActions(), and initCommonMenus().

◆ upgrade_M

QAction* QETMainWindow::upgrade_M
protected

Launch browser on QElectroTech MAC_OS_X builds.

Definition at line 62 of file qetmainwindow.h.

Referenced by initCommonActions(), and initCommonMenus().

◆ whatsthis_action_

QAction* QETMainWindow::whatsthis_action_
protected

Toggle "What's this" mode.

Definition at line 57 of file qetmainwindow.h.

Referenced by initCommonActions(), and initCommonMenus().

◆ youtube_

QAction* QETMainWindow::youtube_
protected

Launch browser on QElectroTech Youtube channel.

Definition at line 60 of file qetmainwindow.h.

Referenced by initCommonActions(), and initCommonMenus().


The documentation for this class was generated from the following files: