QElectroTech
0.70
|
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 |
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.
SearchAndReplaceWorker::SearchAndReplaceWorker | ( | ) |
Definition at line 29 of file searchandreplaceworker.cpp.
References invalidConductorProperties(), and m_conductor_properties.
|
static |
SearchAndReplaceWorker::applyChange.
original | : the original properties |
change | : the change properties, to be merged with |
Definition at line 393 of file searchandreplaceworker.cpp.
References ConductorProperties::color, ConductorProperties::cond_size, ConductorProperties::horiz_rotate_text, ConductorProperties::m_bicolor, ConductorProperties::m_color_2, ConductorProperties::m_dash_size, ConductorProperties::m_formula, ConductorProperties::m_function, ConductorProperties::m_horizontal_alignment, ConductorProperties::m_show_text, ConductorProperties::m_tension_protocol, ConductorProperties::m_vertical_alignment, ConductorProperties::singleLineProperties, ConductorProperties::style, ConductorProperties::text, ConductorProperties::text_size, and ConductorProperties::verti_rotate_text.
Referenced by replaceConductor(), replaceDiagram(), and replaceElement().
|
static |
SearchAndReplaceWorker::applyChange.
original | : the original string |
change | : the changed string: |
Definition at line 426 of file searchandreplaceworker.cpp.
References eraseText().
|
inlinestatic |
Definition at line 67 of file searchandreplaceworker.h.
Referenced by replaceDiagram(), ReplaceFolioWidget::setTitleBlockProperties(), and ReplaceFolioWidget::titleBlockProperties().
|
inlinestatic |
Definition at line 66 of file searchandreplaceworker.h.
Referenced by applyChange(), ReplaceFolioWidget::on_m_author_cb_clicked(), ReplaceConductorDialog::on_m_erase_formula_cb_clicked(), ReplaceConductorDialog::on_m_erase_function_cb_clicked(), ReplaceConductorDialog::on_m_erase_tension_protocol_cb_clicked(), ReplaceConductorDialog::on_m_erase_text_cb_clicked(), ElementInfoPartWidget::on_m_erase_text_clicked(), ReplaceFolioWidget::on_m_file_cb_clicked(), ReplaceFolioWidget::on_m_folio_cb_clicked(), ReplaceFolioWidget::on_m_indice_cb_clicked(), ReplaceFolioWidget::on_m_loc_cb_clicked(), ReplaceFolioWidget::on_m_plant_cb_clicked(), ReplaceFolioWidget::on_m_title_cb_clicked(), and setupLineEdit().
|
static |
Definition at line 367 of file searchandreplaceworker.cpp.
References ConductorProperties::color, ConductorProperties::cond_size, ConductorProperties::horiz_rotate_text, ConductorProperties::m_color_2, ConductorProperties::m_dash_size, ConductorProperties::m_horizontal_alignment, ConductorProperties::m_vertical_alignment, ConductorProperties::style, ConductorProperties::text, ConductorProperties::text_size, and ConductorProperties::verti_rotate_text.
Referenced by SearchAndReplaceWidget::on_m_conductor_pb_clicked(), and SearchAndReplaceWorker().
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.
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().
|
private |
SearchAndReplaceWorker::replaceAdvanced.
diagram |
Definition at line 439 of file searchandreplaceworker.cpp.
References TitleBlockProperties::author, Diagram::border_and_titleblock, BorderTitleBlock::exportTitleBlock(), TitleBlockProperties::filename, TitleBlockProperties::folio, TitleBlockProperties::indexrev, TitleBlockProperties::locmach, m_advanced_struct, TitleBlockProperties::plant, advancedReplaceStruct::replace, advancedReplaceStruct::search, TitleBlockProperties::title, advancedReplaceStruct::what, and advancedReplaceStruct::who.
|
private |
SearchAndReplaceWorker::replaceAdvanced.
element |
Definition at line 465 of file searchandreplaceworker.cpp.
References DiagramContext::addValue(), DiagramContext::contains(), Element::elementInformations(), m_advanced_struct, advancedReplaceStruct::replace, advancedReplaceStruct::search, advancedReplaceStruct::what, and advancedReplaceStruct::who.
|
private |
SearchAndReplaceWorker::replaceAdvanced.
conductor |
Definition at line 490 of file searchandreplaceworker.cpp.
References m_advanced_struct, ConductorProperties::m_formula, ConductorProperties::m_function, ConductorProperties::m_tension_protocol, Conductor::properties, advancedReplaceStruct::replace, advancedReplaceStruct::search, ConductorProperties::text, advancedReplaceStruct::what, and advancedReplaceStruct::who.
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.
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().
void SearchAndReplaceWorker::replaceConductor | ( | Conductor * | conductor | ) |
Definition at line 227 of file searchandreplaceworker.cpp.
References replaceConductor().
void SearchAndReplaceWorker::replaceDiagram | ( | QList< Diagram *> | diagram_list | ) |
SearchAndReplaceWorker::replaceDiagram Replace all properties of each diagram in , by the current titleblock propertie of this worker.
diagram_list,list | of diagram to be changed, all diagrams must belong to the same project; |
Definition at line 40 of file searchandreplaceworker.cpp.
References DiagramContext::add(), applyChange(), TitleBlockProperties::author, TitleBlockProperties::context, TitleBlockProperties::date, eraseDate(), TitleBlockProperties::filename, TitleBlockProperties::folio, TitleBlockProperties::indexrev, TitleBlockProperties::locmach, m_titleblock_properties, TitleBlockProperties::plant, TitleBlockProperties::title, QET::Icons::tr, and QETProject::undoStack().
Referenced by SearchAndReplaceWidget::on_m_replace_all_pb_clicked(), SearchAndReplaceWidget::on_m_replace_pb_clicked(), and replaceDiagram().
void SearchAndReplaceWorker::replaceDiagram | ( | Diagram * | diagram | ) |
Definition at line 86 of file searchandreplaceworker.cpp.
References replaceDiagram().
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.
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().
void SearchAndReplaceWorker::replaceElement | ( | Element * | element | ) |
Definition at line 142 of file searchandreplaceworker.cpp.
References replaceElement().
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.
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().
void SearchAndReplaceWorker::replaceIndiText | ( | IndependentTextItem * | text | ) |
Definition at line 178 of file searchandreplaceworker.cpp.
References replaceIndiText().
|
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.
l | |
cb | |
str |
Definition at line 360 of file searchandreplaceworker.cpp.
References eraseText().
Referenced by ReplaceConductorDialog::setProperties(), ElementInfoPartWidget::setText(), and ReplaceFolioWidget::setTitleBlockProperties().
|
friend |
Definition at line 85 of file searchandreplaceworker.h.
|
private |
Definition at line 83 of file searchandreplaceworker.h.
Referenced by SearchAndReplaceWidget::on_m_advanced_replace_pb_clicked(), and replaceAdvanced().
|
private |
Definition at line 82 of file searchandreplaceworker.h.
Referenced by SearchAndReplaceWidget::on_m_conductor_pb_clicked(), replaceConductor(), and SearchAndReplaceWorker().
|
private |
Definition at line 80 of file searchandreplaceworker.h.
Referenced by SearchAndReplaceWidget::on_m_element_pb_clicked(), and replaceElement().
|
private |
Definition at line 81 of file searchandreplaceworker.h.
Referenced by SearchAndReplaceWidget::on_m_replace_all_pb_clicked(), SearchAndReplaceWidget::on_m_replace_pb_clicked(), and replaceIndiText().
|
private |
Definition at line 79 of file searchandreplaceworker.h.
Referenced by SearchAndReplaceWidget::on_m_folio_pb_clicked(), and replaceDiagram().