QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
SearchAndReplaceWorker Class Reference

The SearchAndReplaceWorker class This class is the worker use to change properties when use the search and replace function of QET. More...

#include <searchandreplaceworker.h>

Collaboration diagram for SearchAndReplaceWorker:
Collaboration graph

Public Member Functions

 SearchAndReplaceWorker ()
 
void replaceDiagram (QList< Diagram * > diagram_list)
 SearchAndReplaceWorker::replaceDiagram Replace all properties of each diagram in diagram_list, by the current titleblock properties of this worker.
 
void replaceDiagram (Diagram *diagram)
 
void replaceElement (QList< Element * > list)
 SearchAndReplaceWorker::replaceElement Replace all properties of each elements in list All element must belong to the same project, if not this function do nothing. All change are made through a undo command append to undo list of the project.
 
void replaceElement (Element *element)
 
void replaceIndiText (QList< IndependentTextItem * > list)
 SearchAndReplaceWorker::replaceIndiText Replace all displayed text of independent text of list Each must belong to the same project, if not this function do nothing.
 
void replaceIndiText (IndependentTextItem *text)
 
void replaceConductor (QList< Conductor * > list)
 SearchAndReplaceWorker::replaceConductor Replace all properties of each conductor in list All conductor must belong to the same project, if not this function do nothing. All change are made through a undo command append to undo list of the project.
 
void replaceConductor (Conductor *conductor)
 
void replaceAdvanced (QList< Diagram * > diagrams=QList< Diagram * >(), QList< Element * > elements=QList< Element * >(), QList< IndependentTextItem * > texts=QList< IndependentTextItem * >(), QList< Conductor * > conductors=QList< Conductor * >())
 SearchAndReplaceWorker::replaceAdvanced Apply the change of text according to the current advancedStruct All items in the 4 list must belong to the same QETProject, if not this function do nothing.
 

Static Public Member Functions

static QString eraseText ()
 
static QDate eraseDate ()
 
static void setupLineEdit (QLineEdit *l, QCheckBox *cb, QString str)
 SearchAndReplaceWorker::setupLineEdit With search and replace, when the variable to edit is a text, the editor is always the same no matter if it is for a folio, element or conductor. The editor is a QLineEdit to edit the text and checkbox to erase the text if checked. This function fill the editor, from the current string.
 
static ConductorProperties invalidConductorProperties ()
 
static ConductorProperties applyChange (const ConductorProperties &original, const ConductorProperties &change)
 SearchAndReplaceWorker::applyChange.
 
static QString applyChange (const QString &original, const QString &change)
 SearchAndReplaceWorker::applyChange.
 

Private Member Functions

TitleBlockProperties replaceAdvanced (Diagram *diagram)
 SearchAndReplaceWorker::replaceAdvanced.
 
DiagramContext replaceAdvanced (Element *element)
 SearchAndReplaceWorker::replaceAdvanced.
 
ConductorProperties replaceAdvanced (Conductor *conductor)
 SearchAndReplaceWorker::replaceAdvanced.
 

Private Attributes

TitleBlockProperties m_titleblock_properties
 
DiagramContext m_element_context
 
QString m_indi_text
 
ConductorProperties m_conductor_properties
 
advancedReplaceStruct m_advanced_struct
 

Friends

class SearchAndReplaceWidget
 

Detailed Description

The SearchAndReplaceWorker class This class is the worker use to change properties when use the search and replace function of QET.

Constructor & Destructor Documentation

◆ SearchAndReplaceWorker()

SearchAndReplaceWorker::SearchAndReplaceWorker ( )
Here is the call graph for this function:

Member Function Documentation

◆ applyChange() [1/2]

ConductorProperties SearchAndReplaceWorker::applyChange ( const ConductorProperties original,
const ConductorProperties change 
)
static

SearchAndReplaceWorker::applyChange.

Parameters
original: the original properties
change: the change properties, to be merged with original
Returns
a new conductor properties with the change applyed.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ applyChange() [2/2]

QString SearchAndReplaceWorker::applyChange ( const QString &  original,
const QString &  change 
)
static

SearchAndReplaceWorker::applyChange.

Parameters
original: the original string
change: the changed string:
Returns
the string to be use in the properties
Here is the call graph for this function:

◆ eraseDate()

static QDate SearchAndReplaceWorker::eraseDate ( )
inlinestatic
Here is the caller graph for this function:

◆ eraseText()

static QString SearchAndReplaceWorker::eraseText ( )
inlinestatic
Here is the caller graph for this function:

◆ invalidConductorProperties()

ConductorProperties SearchAndReplaceWorker::invalidConductorProperties ( )
static
Here is the caller graph for this function:

◆ replaceAdvanced() [1/4]

ConductorProperties SearchAndReplaceWorker::replaceAdvanced ( Conductor conductor)
private

SearchAndReplaceWorker::replaceAdvanced.

Parameters
conductor
Returns
the conductor properties with the change applied, according to the state of m_advanced_struct

◆ replaceAdvanced() [2/4]

TitleBlockProperties SearchAndReplaceWorker::replaceAdvanced ( Diagram diagram)
private

SearchAndReplaceWorker::replaceAdvanced.

Parameters
diagram
Returns
the titleblock properties with the change applied, according to the state of m_advanced_struct
Here is the call graph for this function:

◆ replaceAdvanced() [3/4]

DiagramContext SearchAndReplaceWorker::replaceAdvanced ( Element element)
private

SearchAndReplaceWorker::replaceAdvanced.

Parameters
element
Returns
The diagram context with the change applied, according to the state of m_advanced_struct
Here is the call graph for this function:

◆ replaceAdvanced() [4/4]

void SearchAndReplaceWorker::replaceAdvanced ( QList< Diagram * >  diagrams = QList<Diagram *>(),
QList< Element * >  elements = QList<Element *>(),
QList< IndependentTextItem * >  texts = QList<IndependentTextItem *>(),
QList< Conductor * >  conductors = QList<Conductor *>() 
)

SearchAndReplaceWorker::replaceAdvanced Apply the change of text according to the current advancedStruct All items in the 4 list must belong to the same QETProject, if not this function do nothing.

Parameters
diagrams:
elements:
texts:
conductors:
Here is the call graph for this function:
Here is the caller graph for this function:

◆ replaceConductor() [1/2]

void SearchAndReplaceWorker::replaceConductor ( Conductor conductor)
Here is the call graph for this function:

◆ replaceConductor() [2/2]

void SearchAndReplaceWorker::replaceConductor ( QList< Conductor * >  list)

SearchAndReplaceWorker::replaceConductor Replace all properties of each conductor in list All conductor must belong to the same project, if not this function do nothing. All change are made through a undo command append to undo list of the project.

Parameters
list
Here is the call graph for this function:
Here is the caller graph for this function:

◆ replaceDiagram() [1/2]

void SearchAndReplaceWorker::replaceDiagram ( Diagram diagram)
Here is the call graph for this function:

◆ replaceDiagram() [2/2]

void SearchAndReplaceWorker::replaceDiagram ( QList< Diagram * >  diagram_list)

SearchAndReplaceWorker::replaceDiagram Replace all properties of each diagram in diagram_list, by the current titleblock properties of this worker.

Parameters
diagram_list: list of diagram to be changed, all diagrams must belong to the same project;
Here is the call graph for this function:
Here is the caller graph for this function:

◆ replaceElement() [1/2]

void SearchAndReplaceWorker::replaceElement ( Element element)
Here is the call graph for this function:

◆ replaceElement() [2/2]

void SearchAndReplaceWorker::replaceElement ( QList< Element * >  list)

SearchAndReplaceWorker::replaceElement Replace all properties of each elements in list All element must belong to the same project, if not this function do nothing. All change are made through a undo command append to undo list of the project.

Parameters
list
Here is the call graph for this function:
Here is the caller graph for this function:

◆ replaceIndiText() [1/2]

void SearchAndReplaceWorker::replaceIndiText ( IndependentTextItem text)
Here is the call graph for this function:

◆ replaceIndiText() [2/2]

void SearchAndReplaceWorker::replaceIndiText ( QList< IndependentTextItem * >  list)

SearchAndReplaceWorker::replaceIndiText Replace all displayed text of independent text of list Each must belong to the same project, if not this function do nothing.

Parameters
list
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setupLineEdit()

void SearchAndReplaceWorker::setupLineEdit ( QLineEdit *  l,
QCheckBox *  cb,
QString  str 
)
static

SearchAndReplaceWorker::setupLineEdit With search and replace, when the variable to edit is a text, the editor is always the same no matter if it is for a folio, element or conductor. The editor is a QLineEdit to edit the text and checkbox to erase the text if checked. This function fill the editor, from the current string.

Parameters
l
cb
str
Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ SearchAndReplaceWidget

friend class SearchAndReplaceWidget
friend

Member Data Documentation

◆ m_advanced_struct

advancedReplaceStruct SearchAndReplaceWorker::m_advanced_struct
private

◆ m_conductor_properties

ConductorProperties SearchAndReplaceWorker::m_conductor_properties
private

◆ m_element_context

DiagramContext SearchAndReplaceWorker::m_element_context
private

◆ m_indi_text

QString SearchAndReplaceWorker::m_indi_text
private

◆ m_titleblock_properties

TitleBlockProperties SearchAndReplaceWorker::m_titleblock_properties
private

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