QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
masterpropertieswidget.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2024 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 MASTERPROPERTIESWIDGET_H
19#define MASTERPROPERTIESWIDGET_H
20
21#include <QWidget>
22#include <QHash>
23
25
26class Element;
27class QUndoCommand;
28class QETProject;
29class Diagram;
30class QTreeWidgetItem;
31class QMenu;
32class QAction;
33
34namespace Ui {
36}
37
45{
46 Q_OBJECT
47
48 public:
49 explicit MasterPropertiesWidget(Element *elmt,
50 QWidget *parent = nullptr);
51 ~MasterPropertiesWidget() override;
52
53 void setElement (Element *element) override;
54 void apply() override;
55 void reset() override;
56 QUndoCommand *associatedUndo () const override;
61 QString title() const override {
62 return tr("Référence croisée (maître)");}
63 bool setLiveEdit(bool live_edit) override;
64
65 public slots:
66 void updateUi() override;
67
68 private slots:
69 void headerCustomContextMenuRequested(const QPoint &pos);
72 void showElementFromTWI(QTreeWidgetItem *qtwi, int column);
75 void customContextMenu(const QPoint &pos, int i=0);
76
77 private:
78 Ui::MasterPropertiesWidget *ui;
79 QHash <QTreeWidgetItem *, Element *> m_qtwi_hash;
80 QTreeWidgetItem *m_qtwi_at_context_menu = nullptr;
81 QPointer <Element> m_showed_element;
84 QAction *m_link_action,
89};
90
91#endif // MASTERPROPERTIESWIDGET_H
The AbstractElementPropertiesEditorWidget class This class provide common method for all widget used ...
Definition abstractelementpropertieseditorwidget.h:32
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition diagram.h:56
Definition element.h:43
The MasterPropertiesWidget class This class is a widget for make link between a master element with s...
Definition masterpropertieswidget.h:45
QAction * m_show_qtwi
Definition masterpropertieswidget.h:86
QTreeWidgetItem * m_qtwi_at_context_menu
Definition masterpropertieswidget.h:80
QAction * m_unlink_action
Definition masterpropertieswidget.h:85
void reset() override
MasterPropertiesWidget::reset Reset current widget, clear eveything and rebuild widget.
Definition masterpropertieswidget.cpp:184
bool setLiveEdit(bool live_edit) override
MasterPropertiesWidget::setLiveEdit.
Definition masterpropertieswidget.cpp:237
QPointer< Element > m_showed_element
Definition masterpropertieswidget.h:81
QUndoCommand * associatedUndo() const override
MasterPropertiesWidget::associatedUndo If link between the edited element and other change,...
Definition masterpropertieswidget.cpp:200
void showedElementWasDeleted()
MasterPropertiesWidget::showedElementWasDeleted Set to nullptr the current showed element when he was...
Definition masterpropertieswidget.cpp:414
QAction * m_show_element
Definition masterpropertieswidget.h:87
QAction * m_save_header_state
Definition masterpropertieswidget.h:88
QString title() const override
title
Definition masterpropertieswidget.h:61
void on_link_button_clicked()
MasterPropertiesWidget::on_link_button_clicked move current item in the free_list to linked_list.
Definition masterpropertieswidget.cpp:351
void on_unlink_button_clicked()
MasterPropertiesWidget::on_unlink_button_clicked move current item in linked_list to free_list.
Definition masterpropertieswidget.cpp:370
void headerCustomContextMenuRequested(const QPoint &pos)
MasterPropertiesWidget::headerCustomContextMenuRequested.
Definition masterpropertieswidget.cpp:340
QAction * m_link_action
Definition masterpropertieswidget.h:84
void setElement(Element *element) override
MasterPropertiesWidget::setElement Set the element to be edited.
Definition masterpropertieswidget.cpp:128
void updateUi() override
MasterPropertiesWidget::updateUi Build the interface of the widget.
Definition masterpropertieswidget.cpp:247
void diagramWasdeletedFromProject()
MasterPropertiesWidget::diagramWasdeletedFromProject This slot is called when a diagram is removed fr...
Definition masterpropertieswidget.cpp:424
QMenu * m_context_menu
Definition masterpropertieswidget.h:83
~MasterPropertiesWidget() override
MasterPropertiesWidget::~MasterPropertiesWidget Destructor.
Definition masterpropertieswidget.cpp:112
Ui::MasterPropertiesWidget * ui
Definition masterpropertieswidget.h:78
QETProject * m_project
Definition masterpropertieswidget.h:82
void customContextMenu(const QPoint &pos, int i=0)
MasterPropertiesWidget::customContextMenu Display a context menu.
Definition masterpropertieswidget.cpp:439
void showElementFromTWI(QTreeWidgetItem *qtwi, int column)
MasterPropertiesWidget::showElementFromTWI Show the element corresponding to the given QTreeWidgetIte...
Definition masterpropertieswidget.cpp:391
void apply() override
MasterPropertiesWidget::apply If link between edited element and other change, apply the change with ...
Definition masterpropertieswidget.cpp:174
QHash< QTreeWidgetItem *, Element * > m_qtwi_hash
Definition masterpropertieswidget.h:79
Definition qetproject.h:62
Definition autonumberingdockwidget.h:26