QElectroTech  0.8-dev
masterelement.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 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
Element::linkType
virtual kind linkType() const
Definition: element.h:159
MasterElement::unlinkElement
void unlinkElement(Element *elmt) override
MasterElement::unlinkElement Unlink the given elmt in parametre.
Definition: masterelement.cpp:88
MasterElement::MasterElement
MasterElement(const ElementsLocation &, QGraphicsItem *=nullptr, int *=nullptr)
MasterElement::MasterElement Default constructor.
Definition: masterelement.cpp:31
QetGraphicsItem::diagram
Diagram * diagram() const
Definition: qetgraphicsitem.cpp:40
MasterElement::m_first_scene_change
bool m_first_scene_change
Definition: masterelement.h:54
CrossRefItem::boundingRect
QRectF boundingRect() const override
CrossRefItem::boundingRect.
Definition: crossrefitem.cpp:129
Element::setHighlighted
virtual void setHighlighted(bool)
Definition: element.cpp:178
Element::linkToElement
virtual void linkToElement(Element *)
Definition: element.h:154
Element::linkedElementChanged
void linkedElementChanged()
Element::Slave
@ Slave
Definition: element.h:56
Diagram::project
QETProject * project() const
Diagram::project.
Definition: diagram.cpp:2326
MasterElement::itemChange
QVariant itemChange(GraphicsItemChange change, const QVariant &value) override
Definition: masterelement.cpp:126
Element::initLink
virtual void initLink(QETProject *)
Element::initLink Initialise the link between this element and other elements. This method can be cal...
Definition: element.cpp:1508
XRefProperties
The XRefProperties class this class store properties used by XrefItem.
Definition: xrefproperties.h:29
Element::kindInformations
DiagramContext kindInformations() const
Definition: element.h:100
crossrefitem.h
element.h
MasterElement::aboutDeleteXref
void aboutDeleteXref()
MasterElement::aboutDeleteXref Check if Xref item must be displayed, if not, delete it....
Definition: masterelement.cpp:162
Element::connected_elements
QList< Element * > connected_elements
Definition: element.h:200
Element
Definition: element.h:41
Element::isFree
bool isFree() const
Definition: element.h:230
MasterElement
The MasterElement class This class is a custom element, with extended behavior to be a master element...
Definition: masterelement.h:32
ElementsLocation
The ElementsLocation class This class represents the location, the location of an element or of a cat...
Definition: elementslocation.h:46
MasterElement::xrefPropertiesChanged
void xrefPropertiesChanged()
Definition: masterelement.cpp:136
QETProject
Definition: qetproject.h:51
MasterElement::linkToElement
void linkToElement(Element *elmt) override
MasterElement::linkToElement Link this master to another element For this class element must be a sla...
Definition: masterelement.cpp:51
masterelement.h
MasterElement::m_Xref_item
CrossRefItem * m_Xref_item
Definition: masterelement.h:53
XRefProperties::Bottom
@ Bottom
Definition: xrefproperties.h:39
MasterElement::~MasterElement
~MasterElement() override
MasterElement::~MasterElement default destructor.
Definition: masterelement.cpp:41
QETProject::XRefPropertiesChanged
void XRefPropertiesChanged()
MasterElement::unlinkAllElements
void unlinkAllElements() override
MasterElement::unlinkAllElements Unlink all of the element in the QList connected_elements.
Definition: masterelement.cpp:72
dynamicelementtextitem.h
MasterElement::XrefBoundingRect
QRectF XrefBoundingRect() const
MasterElement::XrefBoundingRect.
Definition: masterelement.cpp:118
XRefProperties::snapTo
SnapTo snapTo() const
Definition: xrefproperties.h:62
MasterElement::initLink
void initLink(QETProject *project) override
MasterElement::initLink.
Definition: masterelement.cpp:108
QETProject::defaultXRefProperties
XRefProperties defaultXRefProperties(const QString &type) const
Definition: qetproject.h:106
diagram.h
CrossRefItem
The CrossRefItem class This clas provide an item, for show the cross reference, like the contacts lin...
Definition: crossrefitem.h:47