QElectroTech
0.70
|
#include <searchandreplacewidget.h>
Public Member Functions | |
SearchAndReplaceWidget (QWidget *parent=nullptr) | |
SearchAndReplaceWidget::SearchAndReplaceWidget Constructor. More... | |
~SearchAndReplaceWidget () | |
SearchAndReplaceWidget::~SearchAndReplaceWidget Destructor. More... | |
bool | event (QEvent *event) override |
SearchAndReplaceWidget::event Reimplemented to clear the the lines edit and hide the advanced widgets, when this widget become hidden. More... | |
void | clear () |
SearchAndReplaceWidget::clear Clear the content of the search and replace line edit Clear all tree items in the tree widget (except the category items). More... | |
void | setEditor (QETDiagramEditor *editor) |
SearchAndReplaceWidget::setEditor Set the diagram editor of this widget. More... | |
Private Member Functions | |
void | setUpTreeItems () |
SearchAndReplaceWidget::setUpTreeItems Set up the main tree widget items. More... | |
void | setHideAdvanced (bool hide) const |
SearchAndReplaceWidget::setHideAdvanced Hide advanced widgets. More... | |
void | fillItemsList () |
SearchAndReplaceWidget::fillItemsList Fill the tree. More... | |
void | addElement (Element *element) |
SearchAndReplaceWidget::addElement Add a tree widget item for . More... | |
void | search () |
SearchAndReplaceWidget::search Start the search. More... | |
void | setVisibleAllParents (QTreeWidgetItem *item, bool expend_parent=true) |
SearchAndReplaceWidget::setVisibleAllParents Set visible all parents of until the invisible root item. More... | |
QTreeWidgetItem * | nextItem (QTreeWidgetItem *item=nullptr, QTreeWidgetItemIterator::IteratorFlag flags=QTreeWidgetItemIterator::All) const |
SearchAndReplaceWidget::nextItem. More... | |
QTreeWidgetItem * | previousItem (QTreeWidgetItem *item=nullptr, QTreeWidgetItemIterator::IteratorFlag flags=QTreeWidgetItemIterator::All) const |
SearchAndReplaceWidget::previousItem. More... | |
void | updateNextPreviousButtons () |
SearchAndReplaceWidget::updateNextPreviousButtons According to the current item, if there is a next or a previous item, we enable/disable the buttons next/previous item. More... | |
void | itemChanged (QTreeWidgetItem *item, int column) |
SearchAndReplaceWidget::itemChanged Reimplemented from QTreeWidget. Use to update the check state of items. More... | |
void | setChildCheckState (QTreeWidgetItem *item, Qt::CheckState check, bool deep=true) |
SearchAndReplaceWidget::setChildCheckState. More... | |
void | updateParentCheckState (QTreeWidgetItem *item, bool all_parents=true) |
SearchAndReplaceWidget::updateParentCheckState. More... | |
void | activateNextChecked () |
SearchAndReplaceWidget::activateNextChecked Activate the next checked (and visible) item. More... | |
QList< Diagram * > | selectedDiagram () const |
SearchAndReplaceWidget::selectedDiagram. More... | |
QList< Element * > | selectedElement () const |
SearchAndReplaceWidget::selectedElement. More... | |
QList< Conductor * > | selectedConductor () const |
SearchAndReplaceWidget::selectedConductor. More... | |
QList< IndependentTextItem * > | selectedText () const |
SearchAndReplaceWidget::selectedText. More... | |
Static Private Member Functions | |
static QStringList | searchTerms (Diagram *diagram) |
SearchAndReplaceWidget::searchTerms. More... | |
static QStringList | searchTerms (Element *element) |
SearchAndReplaceWidget::searchTerms. More... | |
static QStringList | searchTerms (Conductor *conductor) |
SearchAndReplaceWidget::searchTerms. More... | |
static QStringList | searchTerms (QString str) |
Private Attributes | |
Ui::SearchAndReplaceWidget * | ui |
QETDiagramEditor * | m_editor |
QTreeWidgetItem * | m_root_qtwi = nullptr |
QTreeWidgetItem * | m_folio_qtwi = nullptr |
QTreeWidgetItem * | m_indi_text_qtwi = nullptr |
QTreeWidgetItem * | m_elements_qtwi = nullptr |
QTreeWidgetItem * | m_simple_elmt_qtwi = nullptr |
QTreeWidgetItem * | m_master_elmt_qtwi = nullptr |
QTreeWidgetItem * | m_slave_elmt_qtwi = nullptr |
QTreeWidgetItem * | m_report_elmt_qtwi = nullptr |
QTreeWidgetItem * | m_terminal_elmt_qtwi = nullptr |
QTreeWidgetItem * | m_conductor_qtwi = nullptr |
QList< QTreeWidgetItem * > | m_qtwi_elmts |
QList< QTreeWidgetItem * > | m_category_qtwi |
QHash< QTreeWidgetItem *, QPointer< Element > > | m_element_hash |
QHash< QTreeWidgetItem *, QPointer< IndependentTextItem > > | m_text_hash |
QHash< QTreeWidgetItem *, QPointer< Conductor > > | m_conductor_hash |
QPointer< Element > | m_highlighted_element |
QPointer< QGraphicsObject > | m_last_selected |
QHash< QTreeWidgetItem *, QPointer< Diagram > > | m_diagram_hash |
SearchAndReplaceWorker | m_worker |
Definition at line 36 of file searchandreplacewidget.h.
|
explicit |
SearchAndReplaceWidget::SearchAndReplaceWidget Constructor.
parent |
Definition at line 42 of file searchandreplacewidget.cpp.
References search(), setHideAdvanced(), setUpTreeItems(), and ui.
SearchAndReplaceWidget::~SearchAndReplaceWidget | ( | ) |
SearchAndReplaceWidget::~SearchAndReplaceWidget Destructor.
Definition at line 57 of file searchandreplacewidget.cpp.
References ui.
|
private |
SearchAndReplaceWidget::activateNextChecked Activate the next checked (and visible) item.
Definition at line 625 of file searchandreplacewidget.cpp.
References on_m_next_pb_clicked(), and ui.
Referenced by on_m_replace_pb_clicked().
|
private |
SearchAndReplaceWidget::addElement Add a tree widget item for .
element |
Definition at line 306 of file searchandreplacewidget.cpp.
References Element::elementInformations(), Element::linkType(), m_element_hash, m_elements_qtwi, m_master_elmt_qtwi, m_report_elmt_qtwi, m_simple_elmt_qtwi, m_slave_elmt_qtwi, m_terminal_elmt_qtwi, Element::Master, Element::NextReport, Element::PreviousReport, searchTerms(), Element::Simple, Element::Slave, Element::Terminale, QET::Icons::tr, and DiagramContext::value().
Referenced by fillItemsList().
void SearchAndReplaceWidget::clear | ( | ) |
SearchAndReplaceWidget::clear Clear the content of the search and replace line edit Clear all tree items in the tree widget (except the category items).
Definition at line 95 of file searchandreplacewidget.cpp.
References itemChanged(), m_category_qtwi, m_conductor_hash, m_diagram_hash, m_element_hash, m_text_hash, ui, and updateNextPreviousButtons().
Referenced by event(), and on_m_reload_pb_clicked().
|
override |
SearchAndReplaceWidget::event Reimplemented to clear the the lines edit and hide the advanced widgets, when this widget become hidden.
event |
Definition at line 68 of file searchandreplacewidget.cpp.
References clear(), fillItemsList(), QET::Icons::Hide, m_highlighted_element, m_root_qtwi, setHideAdvanced(), and ui.
|
private |
SearchAndReplaceWidget::fillItemsList Fill the tree.
Definition at line 227 of file searchandreplacewidget.cpp.
References addElement(), QETDiagramEditor::currentProject(), QETProject::diagrams(), itemChanged(), m_conductor_hash, m_conductor_qtwi, m_diagram_hash, m_editor, m_element_hash, DiagramContent::m_elements, m_folio_qtwi, m_indi_text_qtwi, DiagramContent::m_potential_conductors, m_qtwi_elmts, DiagramContent::m_text_fields, m_text_hash, on_m_reload_pb_clicked(), Conductor::properties, searchTerms(), ConductorProperties::text, ui, and updateNextPreviousButtons().
Referenced by event(), and on_m_reload_pb_clicked().
|
private |
SearchAndReplaceWidget::itemChanged Reimplemented from QTreeWidget. Use to update the check state of items.
item | |
column |
Definition at line 548 of file searchandreplacewidget.cpp.
References setChildCheckState(), ui, and updateParentCheckState().
Referenced by clear(), and fillItemsList().
|
private |
SearchAndReplaceWidget::nextItem.
item | : find the next item from , if is nullptr, start the search for the root of the tree |
flags |
Definition at line 441 of file searchandreplacewidget.cpp.
References QET::Icons::it, m_root_qtwi, and ui.
Referenced by on_m_next_pb_clicked(), and updateNextPreviousButtons().
|
privateslot |
Definition at line 807 of file searchandreplacewidget.cpp.
References setHideAdvanced().
|
privateslot |
SearchAndReplaceWidget::on_m_advanced_replace_pb_clicked Open the advanced editor.
Definition at line 1190 of file searchandreplacewidget.cpp.
References replaceAdvancedDialog::advancedStruct(), SearchAndReplaceWorker::m_advanced_struct, m_worker, QET::Icons::tr, and ui.
|
privateslot |
SearchAndReplaceWidget::on_m_case_sensitive_cb_stateChanged Update the search when change the case sensitive.
arg1 |
Definition at line 1151 of file searchandreplacewidget.cpp.
References search().
|
privateslot |
SearchAndReplaceWidget::on_m_conductor_pb_clicked Open a dialog to edit the condutor properties.
Definition at line 1161 of file searchandreplacewidget.cpp.
References SearchAndReplaceWorker::invalidConductorProperties(), SearchAndReplaceWorker::m_conductor_properties, m_worker, ReplaceConductorDialog::properties(), QET::Icons::tr, and ui.
|
privateslot |
Definition at line 1110 of file searchandreplacewidget.cpp.
References ReplaceElementDialog::context(), SearchAndReplaceWorker::m_element_context, m_worker, QET::Icons::tr, and ui.
|
privateslot |
Definition at line 959 of file searchandreplacewidget.cpp.
References SearchAndReplaceWorker::m_titleblock_properties, m_worker, ReplaceFolioDialog::setTitleBlockProperties(), ReplaceFolioDialog::titleBlockProperties(), QET::Icons::tr, and ui.
|
privateslot |
SearchAndReplaceWidget::on_m_mode_cb_currentIndexChanged Update the search when user change mode.
index |
Definition at line 1140 of file searchandreplacewidget.cpp.
References search().
|
privateslot |
Definition at line 915 of file searchandreplacewidget.cpp.
References m_category_qtwi, nextItem(), on_m_tree_widget_itemDoubleClicked(), and ui.
Referenced by activateNextChecked(), on_m_previous_pb_clicked(), and search().
|
privateslot |
Definition at line 934 of file searchandreplacewidget.cpp.
References m_category_qtwi, on_m_next_pb_clicked(), on_m_tree_widget_itemDoubleClicked(), previousItem(), and ui.
|
privateslot |
Definition at line 803 of file searchandreplacewidget.cpp.
|
privateslot |
Definition at line 845 of file searchandreplacewidget.cpp.
References clear(), fillItemsList(), m_highlighted_element, m_last_selected, m_root_qtwi, and ui.
Referenced by fillItemsList(), and on_m_replace_all_pb_clicked().
|
privateslot |
SearchAndReplaceWidget::on_m_replace_all_pb_clicked Replace all checked item.
Definition at line 1081 of file searchandreplacewidget.cpp.
References SearchAndReplaceWorker::m_indi_text, m_worker, on_m_reload_pb_clicked(), SearchAndReplaceWorker::replaceAdvanced(), SearchAndReplaceWorker::replaceConductor(), SearchAndReplaceWorker::replaceDiagram(), SearchAndReplaceWorker::replaceElement(), SearchAndReplaceWorker::replaceIndiText(), search(), selectedConductor(), selectedDiagram(), selectedElement(), selectedText(), QET::Icons::tr, and ui.
|
privateslot |
SearchAndReplaceWidget::on_m_replace_pb_clicked Replace the current selection.
Definition at line 989 of file searchandreplacewidget.cpp.
References activateNextChecked(), m_category_qtwi, m_conductor_hash, m_diagram_hash, m_element_hash, SearchAndReplaceWorker::m_indi_text, m_text_hash, m_worker, SearchAndReplaceWorker::replaceAdvanced(), SearchAndReplaceWorker::replaceConductor(), SearchAndReplaceWorker::replaceDiagram(), SearchAndReplaceWorker::replaceElement(), SearchAndReplaceWorker::replaceIndiText(), QET::Icons::tr, and ui.
|
privateslot |
Definition at line 864 of file searchandreplacewidget.cpp.
References m_category_qtwi, m_conductor_hash, m_element_hash, m_highlighted_element, m_last_selected, m_text_hash, ui, and updateNextPreviousButtons().
|
privateslot |
Definition at line 811 of file searchandreplacewidget.cpp.
References m_conductor_hash, m_diagram_hash, m_element_hash, and m_text_hash.
Referenced by on_m_next_pb_clicked(), and on_m_previous_pb_clicked().
|
private |
SearchAndReplaceWidget::previousItem.
item | : find the previous item from , if is nullptr, start the search for the root of the tree |
flags |
Definition at line 470 of file searchandreplacewidget.cpp.
References QET::Icons::it, m_root_qtwi, and ui.
Referenced by on_m_previous_pb_clicked(), and updateNextPreviousButtons().
|
private |
SearchAndReplaceWidget::search Start the search.
Definition at line 350 of file searchandreplacewidget.cpp.
References QET::Icons::it, m_category_qtwi, m_conductor_hash, m_diagram_hash, m_element_hash, m_root_qtwi, m_text_hash, on_m_next_pb_clicked(), setVisibleAllParents(), and ui.
Referenced by on_m_case_sensitive_cb_stateChanged(), on_m_mode_cb_currentIndexChanged(), on_m_replace_all_pb_clicked(), and SearchAndReplaceWidget().
|
staticprivate |
SearchAndReplaceWidget::searchTerms.
diagram |
Definition at line 730 of file searchandreplacewidget.cpp.
References TitleBlockProperties::author, Diagram::border_and_titleblock, TitleBlockProperties::context, TitleBlockProperties::date, BorderTitleBlock::exportTitleBlock(), TitleBlockProperties::filename, TitleBlockProperties::folio, TitleBlockProperties::indexrev, DiagramContext::keys(), TitleBlockProperties::locmach, TitleBlockProperties::plant, TitleBlockProperties::title, and DiagramContext::value().
Referenced by addElement(), and fillItemsList().
|
staticprivate |
SearchAndReplaceWidget::searchTerms.
element |
Definition at line 754 of file searchandreplacewidget.cpp.
References DynamicElementTextItem::CompositeText, Element::dynamicTextItems(), QETApp::elementInfoKeys(), Element::elementInformations(), Element::textGroups(), DynamicElementTextItem::UserText, and DiagramContext::value().
|
staticprivate |
SearchAndReplaceWidget::searchTerms.
conductor |
Definition at line 791 of file searchandreplacewidget.cpp.
References ConductorProperties::m_function, ConductorProperties::m_tension_protocol, Conductor::properties, and ConductorProperties::text.
|
staticprivate |
|
private |
SearchAndReplaceWidget::selectedConductor.
Definition at line 685 of file searchandreplacewidget.cpp.
References m_conductor_hash.
Referenced by on_m_replace_all_pb_clicked().
|
private |
SearchAndReplaceWidget::selectedDiagram.
Definition at line 641 of file searchandreplacewidget.cpp.
References m_diagram_hash.
Referenced by on_m_replace_all_pb_clicked().
|
private |
SearchAndReplaceWidget::selectedElement.
Definition at line 663 of file searchandreplacewidget.cpp.
References m_element_hash.
Referenced by on_m_replace_all_pb_clicked().
|
private |
SearchAndReplaceWidget::selectedText.
Definition at line 707 of file searchandreplacewidget.cpp.
References m_text_hash.
Referenced by on_m_replace_all_pb_clicked().
|
private |
SearchAndReplaceWidget::setChildCheckState.
item | : Parent of the items to be evaluated |
check | : check state |
deep | : if true, we evaluate every subchilds. |
Definition at line 565 of file searchandreplacewidget.cpp.
Referenced by itemChanged().
void SearchAndReplaceWidget::setEditor | ( | QETDiagramEditor * | editor | ) |
SearchAndReplaceWidget::setEditor Set the diagram editor of this widget.
editor |
Definition at line 128 of file searchandreplacewidget.cpp.
References m_editor.
Referenced by QETDiagramEditor::QETDiagramEditor().
|
private |
SearchAndReplaceWidget::setHideAdvanced Hide advanced widgets.
hide |
Definition at line 207 of file searchandreplacewidget.cpp.
References ui.
Referenced by event(), on_m_advanced_pb_toggled(), and SearchAndReplaceWidget().
|
private |
SearchAndReplaceWidget::setUpTreeItems Set up the main tree widget items.
Definition at line 136 of file searchandreplacewidget.cpp.
References QET::Icons::Conductor, QET::Icons::Diagram, QET::Icons::Element, QET::Icons::ElementMaster, QET::Icons::ElementSlave, QET::Icons::ElementTerminal, QET::Icons::FolioXrefComing, m_category_qtwi, m_conductor_qtwi, m_elements_qtwi, m_folio_qtwi, m_indi_text_qtwi, m_master_elmt_qtwi, m_qtwi_elmts, m_report_elmt_qtwi, m_root_qtwi, m_simple_elmt_qtwi, m_slave_elmt_qtwi, m_terminal_elmt_qtwi, QET::Icons::PartText, QET::Icons::ProjectProperties, QET::Icons::tr, ui, and updateNextPreviousButtons().
Referenced by SearchAndReplaceWidget().
|
private |
SearchAndReplaceWidget::setVisibleAllParents Set visible all parents of until the invisible root item.
item | |
expend_parent |
Definition at line 424 of file searchandreplacewidget.cpp.
Referenced by search().
|
private |
SearchAndReplaceWidget::updateNextPreviousButtons According to the current item, if there is a next or a previous item, we enable/disable the buttons next/previous item.
Definition at line 498 of file searchandreplacewidget.cpp.
References m_category_qtwi, nextItem(), previousItem(), and ui.
Referenced by clear(), fillItemsList(), on_m_tree_widget_currentItemChanged(), and setUpTreeItems().
|
private |
SearchAndReplaceWidget::updateParentCheckState.
item | : a child item of the parent to be evaluated. |
all_parents | : if true, we evaluate every parents, until the root item. |
Definition at line 581 of file searchandreplacewidget.cpp.
Referenced by itemChanged().
|
private |
Definition at line 104 of file searchandreplacewidget.h.
Referenced by clear(), on_m_next_pb_clicked(), on_m_previous_pb_clicked(), on_m_replace_pb_clicked(), on_m_tree_widget_currentItemChanged(), search(), setUpTreeItems(), and updateNextPreviousButtons().
|
private |
Definition at line 107 of file searchandreplacewidget.h.
Referenced by clear(), fillItemsList(), on_m_replace_pb_clicked(), on_m_tree_widget_currentItemChanged(), on_m_tree_widget_itemDoubleClicked(), search(), and selectedConductor().
|
private |
Definition at line 102 of file searchandreplacewidget.h.
Referenced by fillItemsList(), and setUpTreeItems().
|
private |
Definition at line 110 of file searchandreplacewidget.h.
Referenced by clear(), fillItemsList(), on_m_replace_pb_clicked(), on_m_tree_widget_itemDoubleClicked(), search(), and selectedDiagram().
|
private |
Definition at line 92 of file searchandreplacewidget.h.
Referenced by fillItemsList(), and setEditor().
|
private |
Definition at line 105 of file searchandreplacewidget.h.
Referenced by addElement(), clear(), fillItemsList(), on_m_replace_pb_clicked(), on_m_tree_widget_currentItemChanged(), on_m_tree_widget_itemDoubleClicked(), search(), and selectedElement().
|
private |
Definition at line 96 of file searchandreplacewidget.h.
Referenced by addElement(), and setUpTreeItems().
|
private |
Definition at line 94 of file searchandreplacewidget.h.
Referenced by fillItemsList(), and setUpTreeItems().
|
private |
Definition at line 108 of file searchandreplacewidget.h.
Referenced by event(), on_m_reload_pb_clicked(), and on_m_tree_widget_currentItemChanged().
|
private |
Definition at line 95 of file searchandreplacewidget.h.
Referenced by fillItemsList(), and setUpTreeItems().
|
private |
Definition at line 109 of file searchandreplacewidget.h.
Referenced by on_m_reload_pb_clicked(), and on_m_tree_widget_currentItemChanged().
|
private |
Definition at line 98 of file searchandreplacewidget.h.
Referenced by addElement(), and setUpTreeItems().
|
private |
Definition at line 103 of file searchandreplacewidget.h.
Referenced by fillItemsList(), and setUpTreeItems().
|
private |
Definition at line 100 of file searchandreplacewidget.h.
Referenced by addElement(), and setUpTreeItems().
|
private |
Definition at line 93 of file searchandreplacewidget.h.
Referenced by event(), nextItem(), on_m_reload_pb_clicked(), previousItem(), search(), and setUpTreeItems().
|
private |
Definition at line 97 of file searchandreplacewidget.h.
Referenced by addElement(), and setUpTreeItems().
|
private |
Definition at line 99 of file searchandreplacewidget.h.
Referenced by addElement(), and setUpTreeItems().
|
private |
Definition at line 101 of file searchandreplacewidget.h.
Referenced by addElement(), and setUpTreeItems().
|
private |
Definition at line 106 of file searchandreplacewidget.h.
Referenced by clear(), fillItemsList(), on_m_replace_pb_clicked(), on_m_tree_widget_currentItemChanged(), on_m_tree_widget_itemDoubleClicked(), search(), and selectedText().
|
private |
Definition at line 111 of file searchandreplacewidget.h.
Referenced by on_m_advanced_replace_pb_clicked(), on_m_conductor_pb_clicked(), on_m_element_pb_clicked(), on_m_folio_pb_clicked(), on_m_replace_all_pb_clicked(), and on_m_replace_pb_clicked().
|
private |
Definition at line 91 of file searchandreplacewidget.h.
Referenced by activateNextChecked(), clear(), event(), fillItemsList(), itemChanged(), nextItem(), on_m_advanced_replace_pb_clicked(), on_m_conductor_pb_clicked(), on_m_element_pb_clicked(), on_m_folio_pb_clicked(), on_m_next_pb_clicked(), on_m_previous_pb_clicked(), on_m_reload_pb_clicked(), on_m_replace_all_pb_clicked(), on_m_replace_pb_clicked(), on_m_tree_widget_currentItemChanged(), previousItem(), search(), SearchAndReplaceWidget(), setHideAdvanced(), setUpTreeItems(), updateNextPreviousButtons(), and ~SearchAndReplaceWidget().