QElectroTech  0.70
Public Member Functions | Private Attributes | List of all members
ElementProvider Class Reference

#include <elementprovider.h>

Public Member Functions

 ElementProvider (QETProject *prj, Diagram *diagram=nullptr)
 ElementProvider::ElementProvider Constructor. More...
 
 ElementProvider (Diagram *diag)
 ElementProvider::ElementProvider Constructor. More...
 
QList< Element * > freeElement (const int filter) const
 ElementProvider::FreeElement Search and return the asked element corresponding with the given filter All returned element are free, ie element aren't connected with another element. More...
 
QList< Element * > fromUuids (QList< QUuid >) const
 ElementProvider::fromUuids. More...
 
QList< Element * > find (const int filter) const
 ElementProvider::find Search and return the asked element corresponding with the given filter. More...
 

Private Attributes

QList< Diagram * > diag_list
 

Detailed Description

this class can search in the given diagram or project some kind of element like 'folio report' or 'master' and return it. We can get element element with specific status like 'free'.

Definition at line 34 of file elementprovider.h.

Constructor & Destructor Documentation

◆ ElementProvider() [1/2]

ElementProvider::ElementProvider ( QETProject prj,
Diagram diagram = nullptr 
)

ElementProvider::ElementProvider Constructor.

Parameters
prjthe project where we must find element
diagramthe diagram to exclude from the search

Definition at line 28 of file elementprovider.cpp.

References diag_list, and QETProject::diagrams().

◆ ElementProvider() [2/2]

ElementProvider::ElementProvider ( Diagram diag)

ElementProvider::ElementProvider Constructor.

Parameters
diagDiagram to search

Definition at line 38 of file elementprovider.cpp.

References diag_list.

Member Function Documentation

◆ find()

QList< Element * > ElementProvider::find ( const int  filter) const

ElementProvider::find Search and return the asked element corresponding with the given filter.

Parameters
filterthe filter for search element (You can find all filter with the #define in Element.h)

Definition at line 93 of file elementprovider.cpp.

References diag_list, Diagram::elements(), and Element::linkType().

Referenced by nomenclature::getNomenclature().

◆ freeElement()

QList< Element * > ElementProvider::freeElement ( const int  filter) const

ElementProvider::FreeElement Search and return the asked element corresponding with the given filter All returned element are free, ie element aren't connected with another element.

Parameters
filterthe filter for search element (You can find all filter with the #define in Element.h)
Returns

Definition at line 51 of file elementprovider.cpp.

References diag_list, Diagram::elements(), Element::isFree(), and Element::linkType().

Referenced by LinkSingleElementWidget::availableElements(), nomenclature::getNomenclature(), and MasterPropertiesWidget::updateUi().

◆ fromUuids()

QList< Element * > ElementProvider::fromUuids ( QList< QUuid >  uuid_list) const

ElementProvider::fromUuids.

Parameters
uuid_listlist of uuid must be found
Returns
all elements with uuid corresponding to uuid in

Definition at line 72 of file elementprovider.cpp.

References diag_list, Diagram::elements(), and Element::uuid().

Referenced by Element::initLink().

Member Data Documentation

◆ diag_list

QList<Diagram *> ElementProvider::diag_list
private

Definition at line 44 of file elementprovider.h.

Referenced by ElementProvider(), find(), freeElement(), and fromUuids().


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