QElectroTech  0.70
masterelement.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2019 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 MASTERELEMENT_H
19 #define MASTERELEMENT_H
20 
21 #include "element.h"
22 
23 class CrossRefItem;
24 
31 class MasterElement : public Element
32 {
33  Q_OBJECT
34 
35  public:
36  explicit MasterElement(const ElementsLocation &, QGraphicsItem * = nullptr, int * = nullptr);
37  ~MasterElement() override;
38 
39  void linkToElement (Element *elmt) override;
40  void unlinkAllElements () override;
41  void unlinkElement (Element *elmt) override;
42  void initLink (QETProject *project) override;
43  QRectF XrefBoundingRect() const;
44 
45  protected:
46  QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
47 
48  private:
49  void xrefPropertiesChanged();
50  void aboutDeleteXref ();
51 
52  private:
54  bool m_first_scene_change = true;
55 };
56 
57 #endif // MASTERELEMENT_H
The CrossRefItem class This clas provide an item, for show the cross reference, like the contacts lin...
Definition: crossrefitem.h:40
CrossRefItem * m_Xref_item
Definition: masterelement.h:53
The MasterElement class This class is a custom element, with extended behavior to be a master element...
Definition: masterelement.h:31
bool m_first_scene_change
Definition: masterelement.h:54
void unlinkElement(Element *elmt) override
MasterElement::unlinkElement Unlink the given elmt in parametre.
MasterElement(const ElementsLocation &, QGraphicsItem *=nullptr, int *=nullptr)
MasterElement::MasterElement Default constructor.
void linkToElement(Element *elmt) override
MasterElement::linkToElement Link this master to another element For this class element must be a sla...
void xrefPropertiesChanged()
~MasterElement() override
MasterElement::~MasterElement default destructor.
void initLink(QETProject *project) override
MasterElement::initLink.
QVariant itemChange(GraphicsItemChange change, const QVariant &value) override
QRectF XrefBoundingRect() const
MasterElement::XrefBoundingRect.
void unlinkAllElements() override
MasterElement::unlinkAllElements Unlink all of the element in the QList connected_elements.
void aboutDeleteXref()
MasterElement::aboutDeleteXref Check if Xref item must be displayed, if not, delete it...