QElectroTech  0.70
Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
QETElementEditor Class Reference

#include <qetelementeditor.h>

Public Slots

void addLine ()
 QETElementEditor::addLine Set line creation interface to scene. More...
 
void addRect ()
 QETElementEditor::addRect Set rectangle creation interface to scene. More...
 
void addEllipse ()
 QETElementEditor::addEllipse Set ellipse creation interface to scene. More...
 
void addPolygon ()
 QETElementEditor::addPolygon Set polygon creation interface to scene. More...
 
void addArc ()
 QETElementEditor::addArc Set arc creation interface to scene. More...
 
void addText ()
 QETElementEditor::addText Set text creation interface to scene. More...
 
void addTerminal ()
 QETElementEditor::addTerminal Set terminal creation interface to scene. More...
 
void addDynamicTextField ()
 QETElementEditor::addDynamicTextField Set dynamic text field creation interface to scene. More...
 
void UncheckAddPrimitive ()
 QETElementEditor::UncheckAddPrimitive Uncheck all action related to primitive. More...
 
void slot_new ()
 
void slot_open ()
 
void slot_openDxf ()
 QETElementEditor::slot_openDxf. More...
 
void slot_openFile ()
 
void openRecentFile (const QString &)
 
void openElement (const QString &)
 
void slot_reload ()
 QETElementEditor::slot_reload Reload the element from the file or location. More...
 
bool slot_save ()
 QETElementEditor::slot_save Save the current editing element. If the filepath or location is unknow, use save_as instead. More...
 
bool slot_saveAs ()
 QETElementEditor::slot_saveAs Ask a location to user and save the current edited element to this location. More...
 
bool slot_saveAsFile ()
 QETElementEditor::slot_saveAsFile Ask a file to user and save the current edited element to this file. More...
 
void slot_setRubberBandToView ()
 
void slot_setNoDragToView ()
 
void slot_updateInformations ()
 
void slot_updateMenus ()
 
void slot_updateTitle ()
 
void slot_createPartsList ()
 
void slot_updatePartsList ()
 
void slot_updateSelectionFromPartsList ()
 
bool checkElement ()
 QETElementEditor::checkElement Do several check about element. If error is occurred return false. More...
 
void pasteFromFile ()
 
void pasteFromElement ()
 QETElementEditor::pasteFromElement Ask an element to user, copy the xml definition of the element to the clipboard and call ElementView::PasteInArea. More...
 
void updateCurrentPartEditor ()
 
- Public Slots inherited from QETMainWindow
void toggleFullScreen ()
 
void updateFullScreenAction ()
 
void checkToolbarsmenu ()
 

Signals

void saveToLocation (ElementsLocation loc)
 

Public Member Functions

 QETElementEditor (QWidget *=nullptr)
 
 ~QETElementEditor () override
 Destructeur. More...
 
void setNames (const NamesList &)
 
void setLocation (const ElementsLocation &)
 QETElementEditor::setLocation The new location to edit. More...
 
ElementsLocation location () const
 
void setFileName (const QString &)
 
QString fileName () const
 
void setReadOnly (bool)
 
bool isReadOnly () const
 
void fromFile (const QString &)
 
void fromLocation (const ElementsLocation &)
 QETElementEditor::fromLocation Location of the element to edit. More...
 
bool toFile (const QString &)
 QETElementEditor::toFile Save to file the drawed element. More...
 
bool toLocation (const ElementsLocation &location)
 QETElementEditor::toLocation Save the element to Location. More...
 
bool isEditing (const ElementsLocation &)
 
bool isEditing (const QString &)
 
ElementSceneelementScene () const
 
void readSettings ()
 QETElementEditor::readSettings Read settings. More...
 
void writeSettings ()
 QETElementEditor::writeSettings Write the settings. More...
 
void contextMenu (QPoint p, QList< QAction *> actions=QList< QAction *>())
 QETElementEditor::contextMenu Display a context menu, with all available action. More...
 
- Public Member Functions inherited from QETMainWindow
 QETMainWindow (QWidget *=nullptr, Qt::WindowFlags=nullptr)
 
 ~QETMainWindow () override
 

Static Public Member Functions

static QPointF pasteOffset ()
 
static QString getOpenElementFileName (QWidget *=nullptr, const QString &=QString())
 

Protected Member Functions

void closeEvent (QCloseEvent *) override
 
void firstActivation (QEvent *) override
 
- Protected Member Functions inherited from QETMainWindow
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
 

Private Member Functions

 QETElementEditor (const QETElementEditor &)
 
void setupActions ()
 QETElementEditor::setupActions Create action used in Element editor. More...
 
void setupMenus ()
 QETElementEditor::setupMenus. More...
 
void setupInterface ()
 QETElementEditor::setupInterface. More...
 
bool canClose ()
 
QWidget * clearToolsDock ()
 
void copyAndPasteXml (const QDomDocument &)
 

Private Attributes

bool read_only
 whether the editor is "read-only" More...
 
QMenu * file_menu
 menus More...
 
QMenu * edit_menu
 
QMenu * paste_from_menu
 
QMenu * display_menu
 
QMenu * tools_menu
 
ElementViewm_view
 view widget for the editing scene More...
 
ElementScenem_elmt_scene
 editing scene More...
 
QDockWidget * m_tools_dock
 container for widgets dedicated to primitive edition More...
 
QStackedWidget * m_tools_dock_stack
 Stack of widgets for tools_dock. More...
 
QLabel * m_default_informations
 label displayed when several primitives are selected More...
 
QHash< QString, ElementItemEditor * > m_editors
 Hash associating primitive names with their matching edition widget. More...
 
QDockWidget * m_undo_dock
 container for the undo list More...
 
QDockWidget * m_parts_dock
 Container for the list of existing primitives. More...
 
QListWidget * m_parts_list
 List of primitives. More...
 
QAction * new_element
 actions for the "file" menu More...
 
QAction * open
 
QAction * open_dxf
 
QAction * open_file
 
QAction * save
 
QAction * save_as
 
QAction * save_as_file
 
QAction * reload
 
QAction * quit
 
QAction * selectall
 actions for the "edit" menu More...
 
QAction * deselectall
 
QAction * inv_select
 
QAction * cut
 
QAction * copy
 
QAction * paste
 
QAction * paste_in_area
 
QAction * paste_from_file
 
QAction * paste_from_elmt
 
QAction * undo
 
QAction * redo
 
QAction * edit_delete
 
QAction * edit_size_hs
 
QAction * edit_names
 
QAction * edit_author
 
QAction * m_edit_properties
 
QToolBar * parts_toolbar
 toolbars More...
 
QToolBar * main_toolbar
 
QToolBar * view_toolbar
 
QToolBar * depth_toolbar
 
QToolBar * element_toolbar
 
QActionGroup * parts
 Action group. More...
 
QActionGroup * m_zoom_ag
 
QActionGroup * m_depth_action_group
 
QString min_title
 minimum window title More...
 
QString filename_
 filename of the currently edited element More...
 
ElementsLocation location_
 location of the currently edited element More...
 
bool opened_from_file
 whether the currently edited element comes from a file or a location More...
 

Additional Inherited Members

- Protected Attributes inherited from QETMainWindow
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 class represents an element editor, allowing users to draw, change and configure a particular electrical element.

Definition at line 33 of file qetelementeditor.h.

Constructor & Destructor Documentation

◆ QETElementEditor() [1/2]

QETElementEditor::QETElementEditor ( QWidget *  parent = nullptr)

Constructeur

Parameters
parentQWidget parent

Definition at line 71 of file qetelementeditor.cpp.

References min_title, QET::Icons::QETLogo, readSettings(), setupActions(), setupInterface(), setupMenus(), and slot_updateMenus().

◆ ~QETElementEditor()

QETElementEditor::~QETElementEditor ( )
override

Destructeur.

Definition at line 97 of file qetelementeditor.cpp.

References clearToolsDock(), and m_editors.

◆ QETElementEditor() [2/2]

QETElementEditor::QETElementEditor ( const QETElementEditor )
private

Member Function Documentation

◆ addArc

void QETElementEditor::addArc ( )
slot

QETElementEditor::addArc Set arc creation interface to scene.

Definition at line 996 of file qetelementeditor.cpp.

References m_elmt_scene.

Referenced by setupActions().

◆ addDynamicTextField

void QETElementEditor::addDynamicTextField ( )
slot

QETElementEditor::addDynamicTextField Set dynamic text field creation interface to scene.

Definition at line 1020 of file qetelementeditor.cpp.

References m_elmt_scene, and ElementScene::setEventInterface().

Referenced by setupActions().

◆ addEllipse

void QETElementEditor::addEllipse ( )
slot

QETElementEditor::addEllipse Set ellipse creation interface to scene.

Definition at line 980 of file qetelementeditor.cpp.

References m_elmt_scene.

Referenced by setupActions().

◆ addLine

void QETElementEditor::addLine ( )
slot

QETElementEditor::addLine Set line creation interface to scene.

Definition at line 964 of file qetelementeditor.cpp.

References m_elmt_scene.

Referenced by setupActions().

◆ addPolygon

void QETElementEditor::addPolygon ( )
slot

QETElementEditor::addPolygon Set polygon creation interface to scene.

Definition at line 988 of file qetelementeditor.cpp.

References m_elmt_scene.

Referenced by setupActions().

◆ addRect

void QETElementEditor::addRect ( )
slot

QETElementEditor::addRect Set rectangle creation interface to scene.

Definition at line 972 of file qetelementeditor.cpp.

References m_elmt_scene.

Referenced by setupActions().

◆ addTerminal

void QETElementEditor::addTerminal ( )
slot

QETElementEditor::addTerminal Set terminal creation interface to scene.

Definition at line 1012 of file qetelementeditor.cpp.

References m_elmt_scene.

Referenced by setupActions().

◆ addText

void QETElementEditor::addText ( )
slot

QETElementEditor::addText Set text creation interface to scene.

Definition at line 1004 of file qetelementeditor.cpp.

References m_elmt_scene.

Referenced by setupActions().

◆ canClose()

bool QETElementEditor::canClose ( )
private
Returns
true si l'element peut etre ferme. Un element peut etre ferme s'il ne comporte aucune modification. Si l'element comporte des modifications, la question est posee a l'utilisateur.

Definition at line 1265 of file qetelementeditor.cpp.

References QET::Icons::Cancel, m_elmt_scene, QET::QetMessageBox::question(), slot_save(), and QET::Icons::tr.

Referenced by closeEvent().

◆ checkElement

bool QETElementEditor::checkElement ( )
slot

QETElementEditor::checkElement Do several check about element. If error is occurred return false.

Warning #1: Element haven't got terminal (except for report, because report must have one terminal and this checking is do below)

Check folio report element

Error folio report must have only one terminal

Definition at line 713 of file qetelementeditor.cpp.

References QET::QetMessageBox::critical(), m_elmt_scene, QET::Icons::tr, and QET::QetMessageBox::warning().

Referenced by slot_save(), slot_saveAs(), and slot_saveAsFile().

◆ clearToolsDock()

QWidget * QETElementEditor::clearToolsDock ( )
private

Enleve et cache le widget affiche par le dock permettant d'editer les parties.

Returns
le widget enleve, ou 0 s'il n'y avait pas de widget a enlever

Definition at line 1294 of file qetelementeditor.cpp.

References m_tools_dock_stack.

Referenced by slot_updateInformations(), and ~QETElementEditor().

◆ closeEvent()

void QETElementEditor::closeEvent ( QCloseEvent *  qce)
overrideprotected

Permet de quitter l'editeur lors de la fermeture de la fenetre principale

Parameters
qceLe QCloseEvent correspondant a l'evenement de fermeture

Definition at line 1331 of file qetelementeditor.cpp.

References canClose(), m_elmt_scene, and writeSettings().

◆ contextMenu()

void QETElementEditor::contextMenu ( QPoint  p,
QList< QAction *>  actions = QList<QAction*>() 
)

QETElementEditor::contextMenu Display a context menu, with all available action.

Parameters
p,thepos of the menu, in screen coordinate
actions,alist of actions who can be prepended to the context menu.

Definition at line 432 of file qetelementeditor.cpp.

References copy, cut, deselectall, edit_delete, inv_select, m_depth_action_group, paste, paste_from_menu, paste_in_area, redo, selectall, and undo.

Referenced by PartPolygon::contextMenuEvent().

◆ copyAndPasteXml()

void QETElementEditor::copyAndPasteXml ( const QDomDocument &  xml_document)
private

Exporte le document XML xml_document vers le presse-papier puis declenche son collage dans l'editeur courant, avec selection de la zone de collage

Parameters
xml_documentDocument XML a copier/coller
See also
ElementView::pasteInArea

Definition at line 1311 of file qetelementeditor.cpp.

References m_view.

Referenced by pasteFromElement(), and pasteFromFile().

◆ elementScene()

ElementScene * QETElementEditor::elementScene ( ) const
inline
Returns
the editing scene

Definition at line 183 of file qetelementeditor.h.

References m_elmt_scene.

Referenced by DynamicTextFieldEditor::fillInfoComboBox(), and setupActions().

◆ fileName()

QString QETElementEditor::fileName ( ) const
inline
Returns
the filename of the currently edited element

Definition at line 176 of file qetelementeditor.h.

References filename_.

◆ firstActivation()

void QETElementEditor::firstActivation ( QEvent *  event)
overrideprotectedvirtual

Executed the first time the window editor is displayed.

Reimplemented from QETMainWindow.

Definition at line 1343 of file qetelementeditor.cpp.

References QETMainWindow::event(), and m_view.

◆ fromFile()

void QETElementEditor::fromFile ( const QString &  filepath)

Charge un fichier

Parameters
filepathChemin du fichier a charger

Definition at line 796 of file qetelementeditor.cpp.

References QET::QetMessageBox::critical(), QETApp::elementsRecentFiles(), m_elmt_scene, setFileName(), setReadOnly(), slot_createPartsList(), slot_updateMenus(), QET::Icons::tr, and QET::QetMessageBox::warning().

Referenced by slot_reload().

◆ fromLocation()

void QETElementEditor::fromLocation ( const ElementsLocation location)

◆ getOpenElementFileName()

QString QETElementEditor::getOpenElementFileName ( QWidget *  parent = nullptr,
const QString &  initial_dir = QString() 
)
static

Demande a l'utilisateur d'ouvrir un fichier sense etre un element.

Parameters
parentQWidget parent du dialogue d'ouverture de fichier
initial_dirRepertoire a afficher initialement - si une chaine vide est fournie, QETApp::customElementsDir() sera utilise.
Returns
Le chemin du fichier choisi ou une chaine vide si l'utilisateur a clique sur le bouton "Annuler".
See also
QETApp::customElementsDir()

Definition at line 1468 of file qetelementeditor.cpp.

References QETApp::customElementsDir(), and QET::Icons::tr.

Referenced by pasteFromFile(), and slot_openFile().

◆ isEditing() [1/2]

bool QETElementEditor::isEditing ( const ElementsLocation provided_location)
Parameters
provided_locationEmplacement d'un element
Returns
true si cet editeur est en train d'editer l'element dont l'emplacement est location, false sinon

Definition at line 905 of file qetelementeditor.cpp.

References QET::compareCanonicalFilePaths(), filename_, location_, opened_from_file, QETApp::realPath(), and ElementsLocation::toString().

◆ isEditing() [2/2]

bool QETElementEditor::isEditing ( const QString &  provided_filepath)
Parameters
provided_filepathChemin d'un element sur un filesystem
Returns
true si cet editeur est en train d'editer l'element dont le chemin est filepath, false sinon

Definition at line 923 of file qetelementeditor.cpp.

References QET::compareCanonicalFilePaths(), filename_, location_, opened_from_file, QETApp::realPath(), and ElementsLocation::toString().

◆ isReadOnly()

bool QETElementEditor::isReadOnly ( ) const
Returns
true si l'editeur d'element est en mode lecture seule

Definition at line 956 of file qetelementeditor.cpp.

References read_only.

Referenced by setFileName(), and slot_updateTitle().

◆ location()

ElementsLocation QETElementEditor::location ( ) const
inline
Returns
the location of the currently edited element

Definition at line 169 of file qetelementeditor.h.

References location_.

Referenced by fromLocation(), pasteFromElement(), slot_open(), slot_saveAs(), and toLocation().

◆ openElement

void QETElementEditor::openElement ( const QString &  filepath)
slot

Ouvre un fichier element dans un nouvel editeur Cette methode ne controle pas si le fichier est deja ouvert

Parameters
filepathFichier a ouvrir
See also
fromFile
QETApp::openElementFiles

Definition at line 1103 of file qetelementeditor.cpp.

References QET::QetMessageBox::critical(), QETApp::instance(), and QET::Icons::tr.

Referenced by openRecentFile(), and slot_openFile().

◆ openRecentFile

void QETElementEditor::openRecentFile ( const QString &  filepath)
slot

Slot utilise pour ouvrir un fichier recent. Transfere filepath au slot openElement seulement si cet editeur est actif

Parameters
filepathFichier a ouvrir
See also
openElement

Definition at line 1071 of file qetelementeditor.cpp.

References openElement().

Referenced by setupMenus().

◆ pasteFromElement

void QETElementEditor::pasteFromElement ( )
slot

QETElementEditor::pasteFromElement Ask an element to user, copy the xml definition of the element to the clipboard and call ElementView::PasteInArea.

Definition at line 1565 of file qetelementeditor.cpp.

References copyAndPasteXml(), QET::QetMessageBox::critical(), ElementsLocation::exist(), ElementDialog::getOpenElementLocation(), ElementsLocation::isElement(), ElementsLocation::isNull(), location(), QET::Icons::tr, and ElementsLocation::xml().

Referenced by setupActions().

◆ pasteFromFile

void QETElementEditor::pasteFromFile ( )
slot

Demande un fichier a l'utilisateur, l'ouvre en tant que fichier element, met son contenu dans le presse-papiers, et appelle ElementView::PasteInArea

Definition at line 1535 of file qetelementeditor.cpp.

References copyAndPasteXml(), QET::QetMessageBox::critical(), getOpenElementFileName(), and QET::Icons::tr.

Referenced by setupActions().

◆ pasteOffset()

QPointF QETElementEditor::pasteOffset ( )
static
Returns
les decalages horizontaux et verticaux (sous la forme d'un point) a utiliser lors d'un copier/coller avec decalage.

Definition at line 1454 of file qetelementeditor.cpp.

Referenced by ElementView::pasteWithOffset().

◆ readSettings()

void QETElementEditor::readSettings ( )

QETElementEditor::readSettings Read settings.

Definition at line 1423 of file qetelementeditor.cpp.

References m_elmt_scene.

Referenced by QETElementEditor().

◆ saveToLocation

void QETElementEditor::saveToLocation ( ElementsLocation  loc)
signal

◆ setFileName()

void QETElementEditor::setFileName ( const QString &  fn)
Parameters
fnLe nouveau nom de fichier de l'element edite

Definition at line 125 of file qetelementeditor.cpp.

References filename_, isReadOnly(), opened_from_file, setReadOnly(), and slot_updateTitle().

Referenced by fromFile(), and slot_saveAsFile().

◆ setLocation()

void QETElementEditor::setLocation ( const ElementsLocation el)

QETElementEditor::setLocation The new location to edit.

Parameters
el

Definition at line 114 of file qetelementeditor.cpp.

References ElementsLocation::isWritable(), location_, opened_from_file, setReadOnly(), and slot_updateTitle().

Referenced by fromLocation(), and slot_saveAs().

◆ setNames()

void QETElementEditor::setNames ( const NamesList nameslist)
inline
Parameters
nameslistthe new list of names for the currently edited element

Definition at line 162 of file qetelementeditor.h.

References m_elmt_scene.

◆ setReadOnly()

void QETElementEditor::setReadOnly ( bool  ro)

specifie si l'editeur d'element doit etre en mode lecture seule

Parameters
rotrue pour activer le mode lecture seule, false pour le desactiver

Definition at line 944 of file qetelementeditor.cpp.

References m_view, read_only, QET::Icons::ro, and slot_updateMenus().

Referenced by fromFile(), fromLocation(), setFileName(), and setLocation().

◆ setupActions()

void QETElementEditor::setupActions ( )
private

QETElementEditor::setupActions Create action used in Element editor.

Definition at line 140 of file qetelementeditor.cpp.

References addArc(), addDynamicTextField(), addEllipse(), addLine(), addPolygon(), addRect(), addTerminal(), addText(), QET::Icons::ApplicationExit, copy, cut, depth_toolbar, QET::depthActionGroup(), deselectall, QET::Icons::DocumentNew, QET::Icons::DocumentSave, QET::Icons::DocumentSaveAs, edit_author, edit_delete, edit_names, QET::Icons::EditCopy, QET::Icons::EditCut, QET::Icons::EditDelete, QET::Icons::EditPaste, QET::Icons::EditRedo, QET::Icons::EditSelectAll, QET::Icons::EditSelectInvert, QET::Icons::EditSelectNone, QET::Icons::EditUndo, QET::Icons::Element, element_toolbar, QET::Icons::ElementEdit, elementScene(), QET::Icons::FolderOpen, inv_select, m_depth_action_group, m_edit_properties, m_elmt_scene, m_view, m_zoom_ag, main_toolbar, QET::Icons::Names, new_element, open, open_dxf, open_file, QET::Icons::PartArc, QET::Icons::PartEllipse, QET::Icons::PartLine, QET::Icons::PartPolygon, QET::Icons::PartRectangle, parts, parts_toolbar, QET::Icons::PartText, QET::Icons::PartTextField, paste, paste_from_elmt, paste_from_file, paste_in_area, pasteFromElement(), pasteFromFile(), quit, redo, reload, QET::Icons::RunDxf, save, save_as, save_as_file, selectall, slot_new(), slot_open(), slot_openDxf(), slot_openFile(), slot_reload(), slot_save(), slot_saveAs(), slot_saveAsFile(), slot_updateInformations(), slot_updateMenus(), slot_updatePartsList(), slot_updateTitle(), QET::Icons::Terminal, QET::Icons::tr, UncheckAddPrimitive(), undo, ElementScene::undoStack(), QET::Icons::UserInformations, view_toolbar, QET::Icons::ViewRefresh, QET::Icons::XmlTextFile, QET::Icons::ZoomFitBest, QET::Icons::ZoomIn, QET::Icons::ZoomOriginal, and QET::Icons::ZoomOut.

Referenced by QETElementEditor().

◆ setupInterface()

void QETElementEditor::setupInterface ( )
private

◆ setupMenus()

void QETElementEditor::setupMenus ( )
private

◆ slot_createPartsList

void QETElementEditor::slot_createPartsList ( )
slot

Remplit la liste des parties

Definition at line 1351 of file qetelementeditor.cpp.

References m_elmt_scene, m_parts_list, QET_MAX_PARTS_IN_ELEMENT_EDITOR_LIST, and QET::Icons::tr.

Referenced by fromFile(), fromLocation(), setupInterface(), and slot_updatePartsList().

◆ slot_new

void QETElementEditor::slot_new ( )
slot

Lance l'assistant de creation d'un nouvel element.

Definition at line 1035 of file qetelementeditor.cpp.

Referenced by setupActions().

◆ slot_open

void QETElementEditor::slot_open ( )
slot

◆ slot_openDxf

void QETElementEditor::slot_openDxf ( )
slot

QETElementEditor::slot_openDxf.

Definition at line 1081 of file qetelementeditor.cpp.

Referenced by setupActions().

◆ slot_openFile

void QETElementEditor::slot_openFile ( )
slot

Ouvre un fichier Demande un fichier a l'utilisateur et ouvre ce fichier

Definition at line 1054 of file qetelementeditor.cpp.

References QETApp::customElementsDir(), filename_, getOpenElementFileName(), and openElement().

Referenced by setupActions().

◆ slot_reload

void QETElementEditor::slot_reload ( )
slot

◆ slot_save

bool QETElementEditor::slot_save ( )
slot

QETElementEditor::slot_save Save the current editing element. If the filepath or location is unknow, use save_as instead.

Returns
true if save with success

Definition at line 1151 of file qetelementeditor.cpp.

References checkElement(), QET::QetMessageBox::critical(), filename_, ElementsLocation::isNull(), location_, m_elmt_scene, opened_from_file, saveToLocation(), slot_saveAs(), slot_saveAsFile(), toFile(), toLocation(), and QET::Icons::tr.

Referenced by canClose(), and setupActions().

◆ slot_saveAs

bool QETElementEditor::slot_saveAs ( )
slot

QETElementEditor::slot_saveAs Ask a location to user and save the current edited element to this location.

Returns
true if save with success

Definition at line 1192 of file qetelementeditor.cpp.

References checkElement(), QET::QetMessageBox::critical(), ElementDialog::getSaveElementLocation(), ElementsLocation::isNull(), location(), m_elmt_scene, saveToLocation(), setLocation(), toLocation(), QET::Icons::tr, and ElementScene::undoStack().

Referenced by setupActions(), and slot_save().

◆ slot_saveAsFile

bool QETElementEditor::slot_saveAsFile ( )
slot

QETElementEditor::slot_saveAsFile Ask a file to user and save the current edited element to this file.

Returns
true if save with success

Definition at line 1221 of file qetelementeditor.cpp.

References checkElement(), QET::QetMessageBox::critical(), QETApp::customElementsDir(), QETApp::elementsRecentFiles(), filename_, m_elmt_scene, setFileName(), toFile(), and QET::Icons::tr.

Referenced by setupActions(), and slot_save().

◆ slot_setNoDragToView

void QETElementEditor::slot_setNoDragToView ( )
slot

Passe l'editeur d'element en mode immobile (utilise pour la lecture seule)

Definition at line 601 of file qetelementeditor.cpp.

References m_view.

Referenced by ESEventInterface::init().

◆ slot_setRubberBandToView

void QETElementEditor::slot_setRubberBandToView ( )
slot

Passe l'editeur d'element en mode selection : le pointeur deplace les elements selectionnes et il est possible d'utiliser un rectangle de selection.

Definition at line 594 of file qetelementeditor.cpp.

References m_view.

Referenced by setupInterface(), and ESEventInterface::~ESEventInterface().

◆ slot_updateInformations

void QETElementEditor::slot_updateInformations ( )
slot

Met a jour la zone d'information et d'edition des primitives. Si plusieurs primitives sont selectionnees, seule leur quantite est affichee. Sinon, un widget d'edition approprie est mis en place.

Definition at line 610 of file qetelementeditor.cpp.

References clearToolsDock(), StyleEditor::isStyleEditable(), m_default_informations, m_editors, m_elmt_scene, m_tools_dock_stack, ElementItemEditor::setPart(), and QET::Icons::tr.

Referenced by setupActions(), setupInterface(), and slot_updateSelectionFromPartsList().

◆ slot_updateMenus

void QETElementEditor::slot_updateMenus ( )
slot

◆ slot_updatePartsList

void QETElementEditor::slot_updatePartsList ( )
slot

Met a jour la selection dans la liste des parties

Definition at line 1381 of file qetelementeditor.cpp.

References m_elmt_scene, m_parts_list, QET_MAX_PARTS_IN_ELEMENT_EDITOR_LIST, and slot_createPartsList().

Referenced by setupActions(), and setupInterface().

◆ slot_updateSelectionFromPartsList

void QETElementEditor::slot_updateSelectionFromPartsList ( )
slot

Met a jour la selection des parties de l'element a partir de la liste des parties

Definition at line 1403 of file qetelementeditor.cpp.

References m_elmt_scene, m_parts_list, slot_updateInformations(), and slot_updateMenus().

Referenced by setupInterface().

◆ slot_updateTitle

void QETElementEditor::slot_updateTitle ( )
slot

Met a jour le titre de la fenetre

Definition at line 502 of file qetelementeditor.cpp.

References filename_, ElementsLocation::isNull(), isReadOnly(), location_, m_elmt_scene, min_title, and QET::Icons::tr.

Referenced by setFileName(), setLocation(), and setupActions().

◆ toFile()

bool QETElementEditor::toFile ( const QString &  fn)

QETElementEditor::toFile Save to file the drawed element.

Parameters
fn: path of the file
Returns
: true if succesfully save.

Definition at line 859 of file qetelementeditor.cpp.

References ElementScene::clearEventInterface(), m_elmt_scene, ElementScene::toXml(), QET::Icons::tr, UncheckAddPrimitive(), QET::QetMessageBox::warning(), and QET::writeXmlFile().

Referenced by slot_save(), and slot_saveAsFile().

◆ toLocation()

bool QETElementEditor::toLocation ( const ElementsLocation location)

QETElementEditor::toLocation Save the element to Location.

Parameters
location: location where we must save the current element
Returns
true if succesfully saved

Definition at line 884 of file qetelementeditor.cpp.

References ElementScene::clearEventInterface(), QET::QetMessageBox::critical(), location(), m_elmt_scene, ElementsLocation::setXml(), ElementScene::toXml(), QET::Icons::tr, and UncheckAddPrimitive().

Referenced by slot_save(), and slot_saveAs().

◆ UncheckAddPrimitive

void QETElementEditor::UncheckAddPrimitive ( )
slot

QETElementEditor::UncheckAddPrimitive Uncheck all action related to primitive.

Definition at line 1028 of file qetelementeditor.cpp.

References parts.

Referenced by setupActions(), toFile(), and toLocation().

◆ updateCurrentPartEditor

void QETElementEditor::updateCurrentPartEditor ( )
slot

Met a jour l'editeur de primitive actuellement visible. Si aucun editeur de primitive n'est visible, ce slot ne fait rien.

Definition at line 1599 of file qetelementeditor.cpp.

References m_tools_dock_stack.

◆ writeSettings()

void QETElementEditor::writeSettings ( )

QETElementEditor::writeSettings Write the settings.

Definition at line 1443 of file qetelementeditor.cpp.

Referenced by closeEvent().

Member Data Documentation

◆ copy

QAction * QETElementEditor::copy
private

Definition at line 74 of file qetelementeditor.h.

Referenced by contextMenu(), setupActions(), setupMenus(), and slot_updateMenus().

◆ cut

QAction* QETElementEditor::cut
private

Definition at line 74 of file qetelementeditor.h.

Referenced by contextMenu(), setupActions(), setupMenus(), and slot_updateMenus().

◆ depth_toolbar

QToolBar * QETElementEditor::depth_toolbar
private

Definition at line 78 of file qetelementeditor.h.

Referenced by setupActions().

◆ deselectall

QAction * QETElementEditor::deselectall
private

Definition at line 73 of file qetelementeditor.h.

Referenced by contextMenu(), setupActions(), setupMenus(), and slot_updateMenus().

◆ display_menu

QMenu * QETElementEditor::display_menu
private

Definition at line 51 of file qetelementeditor.h.

Referenced by setupMenus().

◆ edit_author

QAction * QETElementEditor::edit_author
private

Definition at line 76 of file qetelementeditor.h.

Referenced by setupActions(), and setupMenus().

◆ edit_delete

QAction* QETElementEditor::edit_delete
private

Definition at line 76 of file qetelementeditor.h.

Referenced by contextMenu(), setupActions(), setupMenus(), and slot_updateMenus().

◆ edit_menu

QMenu * QETElementEditor::edit_menu
private

Definition at line 51 of file qetelementeditor.h.

Referenced by setupMenus().

◆ edit_names

QAction * QETElementEditor::edit_names
private

Definition at line 76 of file qetelementeditor.h.

Referenced by setupActions(), and setupMenus().

◆ edit_size_hs

QAction * QETElementEditor::edit_size_hs
private

Definition at line 76 of file qetelementeditor.h.

◆ element_toolbar

QToolBar * QETElementEditor::element_toolbar
private

Definition at line 78 of file qetelementeditor.h.

Referenced by setupActions().

◆ file_menu

QMenu* QETElementEditor::file_menu
private

menus

Definition at line 51 of file qetelementeditor.h.

Referenced by setupMenus().

◆ filename_

QString QETElementEditor::filename_
private

filename of the currently edited element

Definition at line 84 of file qetelementeditor.h.

Referenced by fileName(), isEditing(), setFileName(), slot_openFile(), slot_reload(), slot_save(), slot_saveAsFile(), and slot_updateTitle().

◆ inv_select

QAction * QETElementEditor::inv_select
private

Definition at line 73 of file qetelementeditor.h.

Referenced by contextMenu(), setupActions(), setupMenus(), and slot_updateMenus().

◆ location_

ElementsLocation QETElementEditor::location_
private

location of the currently edited element

Definition at line 86 of file qetelementeditor.h.

Referenced by isEditing(), location(), setLocation(), slot_reload(), slot_save(), and slot_updateTitle().

◆ m_default_informations

QLabel* QETElementEditor::m_default_informations
private

label displayed when several primitives are selected

Definition at line 61 of file qetelementeditor.h.

Referenced by setupInterface(), and slot_updateInformations().

◆ m_depth_action_group

QActionGroup * QETElementEditor::m_depth_action_group
private

Definition at line 80 of file qetelementeditor.h.

Referenced by contextMenu(), setupActions(), setupMenus(), and slot_updateMenus().

◆ m_edit_properties

QAction * QETElementEditor::m_edit_properties
private

Definition at line 76 of file qetelementeditor.h.

Referenced by setupActions(), and setupMenus().

◆ m_editors

QHash<QString, ElementItemEditor *> QETElementEditor::m_editors
private

Hash associating primitive names with their matching edition widget.

Definition at line 63 of file qetelementeditor.h.

Referenced by setupInterface(), slot_updateInformations(), and ~QETElementEditor().

◆ m_elmt_scene

ElementScene* QETElementEditor::m_elmt_scene
private

◆ m_parts_dock

QDockWidget* QETElementEditor::m_parts_dock
private

Container for the list of existing primitives.

Definition at line 67 of file qetelementeditor.h.

Referenced by setupInterface().

◆ m_parts_list

QListWidget* QETElementEditor::m_parts_list
private

◆ m_tools_dock

QDockWidget* QETElementEditor::m_tools_dock
private

container for widgets dedicated to primitive edition

Definition at line 57 of file qetelementeditor.h.

Referenced by setupInterface().

◆ m_tools_dock_stack

QStackedWidget* QETElementEditor::m_tools_dock_stack
private

Stack of widgets for tools_dock.

Definition at line 59 of file qetelementeditor.h.

Referenced by clearToolsDock(), setupInterface(), slot_updateInformations(), and updateCurrentPartEditor().

◆ m_undo_dock

QDockWidget* QETElementEditor::m_undo_dock
private

container for the undo list

Definition at line 65 of file qetelementeditor.h.

Referenced by setupInterface().

◆ m_view

ElementView* QETElementEditor::m_view
private

view widget for the editing scene

Definition at line 53 of file qetelementeditor.h.

Referenced by copyAndPasteXml(), firstActivation(), setReadOnly(), setupActions(), setupInterface(), slot_setNoDragToView(), and slot_setRubberBandToView().

◆ m_zoom_ag

QActionGroup * QETElementEditor::m_zoom_ag
private

Definition at line 80 of file qetelementeditor.h.

Referenced by setupActions(), and setupMenus().

◆ main_toolbar

QToolBar * QETElementEditor::main_toolbar
private

Definition at line 78 of file qetelementeditor.h.

Referenced by setupActions().

◆ min_title

QString QETElementEditor::min_title
private

minimum window title

Definition at line 82 of file qetelementeditor.h.

Referenced by QETElementEditor(), and slot_updateTitle().

◆ new_element

QAction* QETElementEditor::new_element
private

actions for the "file" menu

Definition at line 71 of file qetelementeditor.h.

Referenced by setupActions(), and setupMenus().

◆ open

QAction * QETElementEditor::open
private

Definition at line 71 of file qetelementeditor.h.

Referenced by setupActions(), and setupMenus().

◆ open_dxf

QAction * QETElementEditor::open_dxf
private

Definition at line 71 of file qetelementeditor.h.

Referenced by setupActions(), and setupMenus().

◆ open_file

QAction * QETElementEditor::open_file
private

Definition at line 71 of file qetelementeditor.h.

Referenced by setupActions(), and setupMenus().

◆ opened_from_file

bool QETElementEditor::opened_from_file
private

whether the currently edited element comes from a file or a location

Definition at line 88 of file qetelementeditor.h.

Referenced by isEditing(), setFileName(), setLocation(), slot_reload(), and slot_save().

◆ parts

QActionGroup* QETElementEditor::parts
private

Action group.

Definition at line 80 of file qetelementeditor.h.

Referenced by setupActions(), slot_updateMenus(), and UncheckAddPrimitive().

◆ parts_toolbar

QToolBar* QETElementEditor::parts_toolbar
private

toolbars

Definition at line 78 of file qetelementeditor.h.

Referenced by setupActions().

◆ paste

QAction * QETElementEditor::paste
private

Definition at line 74 of file qetelementeditor.h.

Referenced by contextMenu(), setupActions(), setupMenus(), and slot_updateMenus().

◆ paste_from_elmt

QAction * QETElementEditor::paste_from_elmt
private

Definition at line 74 of file qetelementeditor.h.

Referenced by setupActions(), setupMenus(), and slot_updateMenus().

◆ paste_from_file

QAction * QETElementEditor::paste_from_file
private

Definition at line 74 of file qetelementeditor.h.

Referenced by setupActions(), setupMenus(), and slot_updateMenus().

◆ paste_from_menu

QMenu * QETElementEditor::paste_from_menu
private

Definition at line 51 of file qetelementeditor.h.

Referenced by contextMenu(), and setupMenus().

◆ paste_in_area

QAction * QETElementEditor::paste_in_area
private

Definition at line 74 of file qetelementeditor.h.

Referenced by contextMenu(), setupActions(), setupMenus(), and slot_updateMenus().

◆ quit

QAction * QETElementEditor::quit
private

Definition at line 71 of file qetelementeditor.h.

Referenced by setupActions(), and setupMenus().

◆ read_only

bool QETElementEditor::read_only
private

whether the editor is "read-only"

Definition at line 49 of file qetelementeditor.h.

Referenced by isReadOnly(), setReadOnly(), and slot_updateMenus().

◆ redo

QAction * QETElementEditor::redo
private

Definition at line 75 of file qetelementeditor.h.

Referenced by contextMenu(), setupActions(), setupMenus(), and slot_updateMenus().

◆ reload

QAction * QETElementEditor::reload
private

Definition at line 71 of file qetelementeditor.h.

Referenced by setupActions(), and setupMenus().

◆ save

QAction * QETElementEditor::save
private

Definition at line 71 of file qetelementeditor.h.

Referenced by setupActions(), setupMenus(), and slot_updateMenus().

◆ save_as

QAction * QETElementEditor::save_as
private

Definition at line 71 of file qetelementeditor.h.

Referenced by setupActions(), and setupMenus().

◆ save_as_file

QAction * QETElementEditor::save_as_file
private

Definition at line 71 of file qetelementeditor.h.

Referenced by setupActions(), and setupMenus().

◆ selectall

QAction* QETElementEditor::selectall
private

actions for the "edit" menu

Definition at line 73 of file qetelementeditor.h.

Referenced by contextMenu(), setupActions(), setupMenus(), and slot_updateMenus().

◆ tools_menu

QMenu * QETElementEditor::tools_menu
private

Definition at line 51 of file qetelementeditor.h.

Referenced by setupMenus().

◆ undo

QAction* QETElementEditor::undo
private

Definition at line 75 of file qetelementeditor.h.

Referenced by contextMenu(), setupActions(), setupMenus(), and slot_updateMenus().

◆ view_toolbar

QToolBar * QETElementEditor::view_toolbar
private

Definition at line 78 of file qetelementeditor.h.

Referenced by setupActions().


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