QElectroTech  0.8-dev
elementspanelwidget.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 ELEMENTS_PANEL_WIDGET_H
19 #define ELEMENTS_PANEL_WIDGET_H
20 
21 #include "elementspanel.h"
22 
29 class ElementsPanelWidget : public QWidget {
30  Q_OBJECT
31 
32  // constructors, destructor
33  public:
34  ElementsPanelWidget(QWidget * = nullptr);
35  ~ElementsPanelWidget() override;
36 
37  private:
39 
40  // attributes
41  private:
44  QAction *prj_activate,
55  QAction *tbt_add, *tbt_edit, *tbt_remove;
56  QMenu *context_menu;
57  QLineEdit *filter_textfield;
58 
59  // methods
60  public:
61  inline ElementsPanel &elementsPanel() const;
62 
63  signals:
76 
77  public slots:
80  void reloadAndFilter();
81  void activateProject();
82  void closeProject();
83  void editProjectProperties();
84  void editDiagramProperties();
85  void newDiagram();
86  void deleteDiagram();
87  void moveDiagramUp();
88  void moveDiagramDown();
89  void moveDiagramUpTop();
90  void moveDiagramUpx10();
91  void moveDiagramDownx10();
92  void addTitleBlockTemplate();
95  void updateButtons();
96  void handleContextMenu(const QPoint &);
97  void filterEdited(const QString &);
98 
99  protected:
100  void keyPressEvent (QKeyEvent *e) override;
101 
102  private:
104 };
105 
111  return(*elements_panel);
112 }
113 
114 #endif
ElementsPanelWidget::requestForProject
void requestForProject(QETProject *)
QET::Icons::GoTop
QIcon GoTop
Definition: qeticons.cpp:108
QET::Project
@ Project
Definition: qet.h:109
ElementsPanelWidget::prj_close
QAction * prj_close
Definition: elementspanelwidget.h:45
QET::Icons::IC_CopyFile
QIcon IC_CopyFile
Definition: qeticons.cpp:40
QET::TitleBlockTemplatesCollection
@ TitleBlockTemplatesCollection
Definition: qet.h:106
ElementsPanelWidget::ElementsPanelWidget
ElementsPanelWidget(QWidget *=nullptr)
Definition: elementspanelwidget.cpp:41
ElementsPanelWidget::keyPressEvent
void keyPressEvent(QKeyEvent *e) override
Definition: elementspanelwidget.cpp:409
ElementsPanelWidget::editDiagramProperties
void editDiagramProperties()
Definition: elementspanelwidget.cpp:192
ElementsPanelWidget::requestForProjectClosing
void requestForProjectClosing(QETProject *)
ElementsPanelWidget::moveDiagramUpTop
void moveDiagramUpTop()
Definition: elementspanelwidget.cpp:219
ElementsPanelWidget::prj_activate
QAction * prj_activate
Definition: elementspanelwidget.h:44
ElementsPanelWidget::prj_move_diagram_down
QAction * prj_move_diagram_down
Definition: elementspanelwidget.h:52
ElementsPanelWidget::requestForDiagramMoveUp
void requestForDiagramMoveUp(Diagram *)
ElementsPanelWidget::tbt_edit
QAction * tbt_edit
Definition: elementspanelwidget.h:55
ElementsPanelWidget::requestForProjectPropertiesEdition
void requestForProjectPropertiesEdition(QETProject *)
TitleBlockTemplateDeleter::exec
bool exec()
Definition: templatedeleter.cpp:44
QET::RegularFilter
@ RegularFilter
Definition: qet.h:118
ElementsPanelWidget::prj_prop_diagram
QAction * prj_prop_diagram
Definition: elementspanelwidget.h:47
ElementsPanelWidget::reloadAndFilter
void reloadAndFilter()
Definition: elementspanelwidget.cpp:153
ElementsPanelWidget::openDirectoryForSelectedItem
void openDirectoryForSelectedItem()
Definition: elementspanelwidget.cpp:127
ElementsPanelWidget::addTitleBlockTemplate
void addTitleBlockTemplate()
Definition: elementspanelwidget.cpp:267
ElementsPanelWidget::previous_filter_
QString previous_filter_
Definition: elementspanelwidget.h:103
ElementsPanelWidget::copyPathForSelectedItem
void copyPathForSelectedItem()
Definition: elementspanelwidget.cpp:140
ElementsPanelWidget::prj_move_diagram_downx10
QAction * prj_move_diagram_downx10
Definition: elementspanelwidget.h:54
elementspanelwidget.h
QET::Icons::DialogInformation
QIcon DialogInformation
Definition: qeticons.cpp:47
ElementsPanelWidget::requestForDiagramMoveUpx10
void requestForDiagramMoveUpx10(Diagram *)
ElementsPanelWidget::closeProject
void closeProject()
Definition: elementspanelwidget.cpp:174
QET::Icons::DocumentClose
QIcon DocumentClose
Definition: qeticons.cpp:49
QET::Diagram
@ Diagram
Definition: qet.h:108
ElementsPanelWidget::handleContextMenu
void handleContextMenu(const QPoint &)
Definition: elementspanelwidget.cpp:346
qetapp.h
ElementsPanelWidget::prj_del_diagram
QAction * prj_del_diagram
Definition: elementspanelwidget.h:49
ElementsPanelWidget::requestForDiagramMoveDownx10
void requestForDiagramMoveDownx10(Diagram *)
qetelementeditor.h
QET::TitleBlockTemplate
@ TitleBlockTemplate
Definition: qet.h:105
ElementsPanelWidget::updateButtons
void updateButtons()
Definition: elementspanelwidget.cpp:306
ElementsPanelWidget::requestForDiagramMoveUpTop
void requestForDiagramMoveUpTop(Diagram *)
ElementsPanelWidget::filterEdited
void filterEdited(const QString &)
Definition: elementspanelwidget.cpp:392
Diagram
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition: diagram.h:56
QET::Icons::GoUp
QIcon GoUp
Definition: qeticons.cpp:109
qeticons.h
ElementsPanelWidget::elementsPanel
ElementsPanel & elementsPanel() const
ElementsPanelWidget::elementsPanel.
Definition: elementspanelwidget.h:110
ElementsPanelWidget::activateProject
void activateProject()
Definition: elementspanelwidget.cpp:165
QET::Icons::ProjectFile
QIcon ProjectFile
Definition: qeticons.cpp:147
ElementsPanelWidget::prj_move_diagram_up
QAction * prj_move_diagram_up
Definition: elementspanelwidget.h:50
ElementsPanelWidget::elements_panel
ElementsPanel * elements_panel
Definition: elementspanelwidget.h:42
TitleBlockTemplateLocation::isReadOnly
bool isReadOnly() const
Definition: templatelocation.cpp:156
QET::Icons::FolderOpen
QIcon FolderOpen
Definition: qeticons.cpp:99
ElementsPanelWidget::editTitleBlockTemplate
void editTitleBlockTemplate()
Definition: elementspanelwidget.cpp:281
TitleBlockTemplateLocation
Definition: templatelocation.h:29
ElementsPanelWidget::tbt_add
QAction * tbt_add
Definition: elementspanelwidget.h:55
ElementsPanelWidget::open_directory
QAction * open_directory
Definition: elementspanelwidget.h:43
elementscategoryeditor.h
ElementsPanelWidget::requestForNewDiagram
void requestForNewDiagram(QETProject *)
ElementsPanelWidget::prj_edit_prop
QAction * prj_edit_prop
Definition: elementspanelwidget.h:46
qetproject.h
ElementsPanelWidget::moveDiagramUp
void moveDiagramUp()
Definition: elementspanelwidget.cpp:230
ElementsPanelWidget::requestForDiagramDeletion
void requestForDiagramDeletion(Diagram *)
QETApp::instance
static QETApp * instance()
QETApp::instance.
Definition: qetapp.cpp:153
QETProject
Definition: qetproject.h:51
ElementsPanelWidget::~ElementsPanelWidget
~ElementsPanelWidget() override
Definition: elementspanelwidget.cpp:120
QET::EndFilter
@ EndFilter
Definition: qet.h:119
ElementsPanelWidget::editProjectProperties
void editProjectProperties()
Definition: elementspanelwidget.cpp:183
TitleBlockTemplateLocation::parentCollection
TitleBlockTemplatesCollection * parentCollection() const
Definition: templatelocation.cpp:57
TitleBlockTemplateDeleter
Definition: templatedeleter.h:26
ElementsPanel
Definition: elementspanel.h:34
QET::Icons::DiagramAdd
QIcon DiagramAdd
Definition: qeticons.cpp:42
ElementsPanelWidget::copy_path
QAction * copy_path
Definition: elementspanelwidget.h:43
ElementsPanelWidget::filter_textfield
QLineEdit * filter_textfield
Definition: elementspanelwidget.h:57
ElementsPanelWidget::moveDiagramDownx10
void moveDiagramDownx10()
Definition: elementspanelwidget.cpp:257
ElementsPanelWidget::moveDiagramUpx10
void moveDiagramUpx10()
Definition: elementspanelwidget.cpp:248
ElementsPanelWidget::requestForDiagramMoveDown
void requestForDiagramMoveDown(Diagram *)
QET::Icons::GoDownDouble
QIcon GoDownDouble
Definition: qeticons.cpp:107
templatedeleter.h
ElementsPanelWidget::prj_move_diagram_top
QAction * prj_move_diagram_top
Definition: elementspanelwidget.h:51
QET::Icons::GoDown
QIcon GoDown
Definition: qeticons.cpp:106
ElementsPanelWidget::removeTitleBlockTemplate
void removeTitleBlockTemplate()
Definition: elementspanelwidget.cpp:293
QET::Icons::GoUpDouble
QIcon GoUpDouble
Definition: qeticons.cpp:110
elementspanel.h
ElementsPanelWidget
The ElementsPanelWidget class This class embeds an elements panel under a toolbar providing various a...
Definition: elementspanelwidget.h:29
ElementsPanelWidget::requestForDiagramPropertiesEdition
void requestForDiagramPropertiesEdition(Diagram *)
ElementsPanelWidget::prj_move_diagram_upx10
QAction * prj_move_diagram_upx10
Definition: elementspanelwidget.h:53
QET::BeginFilter
@ BeginFilter
Definition: qet.h:117
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
QET::Icons::TitleBlock
QIcon TitleBlock
Definition: qeticons.cpp:165
ElementsPanelWidget::tbt_remove
QAction * tbt_remove
Definition: elementspanelwidget.h:55
ElementsPanelWidget::ElementsPanelWidget
ElementsPanelWidget(const ElementsPanelWidget &)
ElementsPanelWidget::requestForDiagram
void requestForDiagram(Diagram *)
QET::Icons::DiagramDelete
QIcon DiagramDelete
Definition: qeticons.cpp:45
ElementsPanelWidget::context_menu
QMenu * context_menu
Definition: elementspanelwidget.h:56
ElementsPanelWidget::newDiagram
void newDiagram()
Definition: elementspanelwidget.cpp:201
diagram.h
ElementsPanelWidget::deleteDiagram
void deleteDiagram()
Definition: elementspanelwidget.cpp:210
ElementsPanelWidget::moveDiagramDown
void moveDiagramDown()
Definition: elementspanelwidget.cpp:239
ElementsPanelWidget::prj_add_diagram
QAction * prj_add_diagram
Definition: elementspanelwidget.h:48