QElectroTech  0.70
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>

Public Member Functions

 SearchAndReplaceWorker ()
 
void replaceDiagram (QList< Diagram *> diagram_list)
 SearchAndReplaceWorker::replaceDiagram Replace all properties of each diagram in , by the current titleblock propertie of this worker. More...
 
void replaceDiagram (Diagram *diagram)
 
void replaceElement (QList< Element *> list)
 SearchAndReplaceWorker::replaceElement Replace all properties of each elements in 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. More...
 
void replaceElement (Element *element)
 
void replaceIndiText (QList< IndependentTextItem *> list)
 SearchAndReplaceWorker::replaceIndiText Replace all displayed text of independent text of Each must belong to the same project, if not this function do nothing. More...
 
void replaceIndiText (IndependentTextItem *text)
 
void replaceConductor (QList< Conductor *> list)
 SearchAndReplaceWorker::replaceConductor Replace all properties of each conductor in 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. More...
 
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. More...
 

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. More...
 
static ConductorProperties invalidConductorProperties ()
 
static ConductorProperties applyChange (const ConductorProperties &original, const ConductorProperties &change)
 SearchAndReplaceWorker::applyChange. More...
 
static QString applyChange (const QString &original, const QString &change)
 SearchAndReplaceWorker::applyChange. More...
 

Private Member Functions

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

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.

Definition at line 50 of file searchandreplaceworker.h.

Constructor & Destructor Documentation

◆ SearchAndReplaceWorker()

SearchAndReplaceWorker::SearchAndReplaceWorker ( )

Member Function Documentation

◆ applyChange() [1/2]

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

◆ 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

Definition at line 426 of file searchandreplaceworker.cpp.

References eraseText().

◆ eraseDate()

static QDate SearchAndReplaceWorker::eraseDate ( )
inlinestatic

◆ eraseText()

static QString SearchAndReplaceWorker::eraseText ( )
inlinestatic

◆ invalidConductorProperties()

ConductorProperties SearchAndReplaceWorker::invalidConductorProperties ( )
static

◆ replaceAdvanced() [1/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
d
e
t
c

Definition at line 244 of file searchandreplaceworker.cpp.

References m_advanced_struct, advancedReplaceStruct::replace, advancedReplaceStruct::search, QET::Icons::tr, QETProject::undoStack(), and advancedReplaceStruct::who.

Referenced by SearchAndReplaceWidget::on_m_replace_all_pb_clicked(), and SearchAndReplaceWidget::on_m_replace_pb_clicked().

◆ replaceAdvanced() [2/4]

TitleBlockProperties SearchAndReplaceWorker::replaceAdvanced ( Diagram diagram)
private

◆ replaceAdvanced() [3/4]

DiagramContext SearchAndReplaceWorker::replaceAdvanced ( Element element)
private

◆ replaceAdvanced() [4/4]

ConductorProperties SearchAndReplaceWorker::replaceAdvanced ( Conductor conductor)
private

◆ replaceConductor() [1/2]

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

SearchAndReplaceWorker::replaceConductor Replace all properties of each conductor in 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

Definition at line 192 of file searchandreplaceworker.cpp.

References applyChange(), m_conductor_properties, QET::Icons::tr, and QETProject::undoStack().

Referenced by SearchAndReplaceWidget::on_m_replace_all_pb_clicked(), SearchAndReplaceWidget::on_m_replace_pb_clicked(), and replaceConductor().

◆ replaceConductor() [2/2]

void SearchAndReplaceWorker::replaceConductor ( Conductor conductor)

Definition at line 227 of file searchandreplaceworker.cpp.

References replaceConductor().

◆ replaceDiagram() [1/2]

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

◆ replaceDiagram() [2/2]

void SearchAndReplaceWorker::replaceDiagram ( Diagram diagram)

Definition at line 86 of file searchandreplaceworker.cpp.

References replaceDiagram().

◆ replaceElement() [1/2]

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

SearchAndReplaceWorker::replaceElement Replace all properties of each elements in 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

Definition at line 100 of file searchandreplaceworker.cpp.

References DiagramContext::addValue(), applyChange(), QETApp::elementInfoKeys(), m_element_context, Element::Master, Element::Simple, Element::Terminale, QET::Icons::tr, QETProject::undoStack(), and DiagramContext::value().

Referenced by SearchAndReplaceWidget::on_m_replace_all_pb_clicked(), SearchAndReplaceWidget::on_m_replace_pb_clicked(), and replaceElement().

◆ replaceElement() [2/2]

void SearchAndReplaceWorker::replaceElement ( Element element)

Definition at line 142 of file searchandreplaceworker.cpp.

References replaceElement().

◆ replaceIndiText() [1/2]

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

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

Parameters
list

Definition at line 155 of file searchandreplaceworker.cpp.

References m_indi_text, QET::Icons::tr, and QETProject::undoStack().

Referenced by SearchAndReplaceWidget::on_m_replace_all_pb_clicked(), SearchAndReplaceWidget::on_m_replace_pb_clicked(), and replaceIndiText().

◆ replaceIndiText() [2/2]

void SearchAndReplaceWorker::replaceIndiText ( IndependentTextItem text)

Definition at line 178 of file searchandreplaceworker.cpp.

References replaceIndiText().

◆ 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

Definition at line 360 of file searchandreplaceworker.cpp.

References eraseText().

Referenced by ReplaceConductorDialog::setProperties(), ElementInfoPartWidget::setText(), and ReplaceFolioWidget::setTitleBlockProperties().

Friends And Related Function Documentation

◆ SearchAndReplaceWidget

friend class SearchAndReplaceWidget
friend

Definition at line 85 of file searchandreplaceworker.h.

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: