QElectroTech  0.8-dev
Public Member Functions | Private Slots | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
SearchAndReplaceWidget Class Reference

#include <searchandreplacewidget.h>

Inherits QWidget.

Collaboration diagram for SearchAndReplaceWidget:
Collaboration graph

Public Member Functions

 SearchAndReplaceWidget (QWidget *parent=nullptr)
 SearchAndReplaceWidget::SearchAndReplaceWidget Constructor. More...
 
 ~SearchAndReplaceWidget () override
 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 Slots

void on_m_quit_button_clicked ()
 SearchAndReplaceWidget::on_m_quit_button_clicked. More...
 
void on_m_advanced_pb_toggled (bool checked)
 
void on_m_tree_widget_itemDoubleClicked (QTreeWidgetItem *item, int column)
 
void on_m_reload_pb_clicked ()
 
void on_m_tree_widget_currentItemChanged (QTreeWidgetItem *current, QTreeWidgetItem *previous)
 
void on_m_next_pb_clicked ()
 
void on_m_previous_pb_clicked ()
 
void on_m_folio_pb_clicked ()
 
void on_m_replace_pb_clicked ()
 SearchAndReplaceWidget::on_m_replace_pb_clicked Replace the current selection. More...
 
void on_m_replace_all_pb_clicked ()
 SearchAndReplaceWidget::on_m_replace_all_pb_clicked Replace all checked item. More...
 
void on_m_element_pb_clicked ()
 
void on_m_mode_cb_currentIndexChanged (int index)
 SearchAndReplaceWidget::on_m_mode_cb_currentIndexChanged Update the search when user change mode. More...
 
void on_m_case_sensitive_cb_stateChanged (int arg1)
 SearchAndReplaceWidget::on_m_case_sensitive_cb_stateChanged Update the search when change the case sensitive. More...
 
void on_m_conductor_pb_clicked ()
 SearchAndReplaceWidget::on_m_conductor_pb_clicked Open a dialog to edit the condutor properties. More...
 
void on_m_advanced_replace_pb_clicked ()
 SearchAndReplaceWidget::on_m_advanced_replace_pb_clicked Open the advanced editor. More...
 

Private Member Functions

void setUpTreeItems ()
 SearchAndReplaceWidget::setUpTreeItems Set up the main tree widget items. More...
 
void setHideAdvanced (bool hide)
 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 element. More...
 
void search ()
 SearchAndReplaceWidget::search Start the search. More...
 
void setVisibleAllParents (QTreeWidgetItem *item, bool expend_parent=true)
 SearchAndReplaceWidget::setVisibleAllParents Set visible all parents of item 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
 
QETDiagramEditorm_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< Elementm_highlighted_element
 
QPointer< QGraphicsObject > m_last_selected
 
QHash< QTreeWidgetItem *, QPointer< Diagram > > m_diagram_hash
 
SearchAndReplaceWorker m_worker
 
QWidgetAnimationm_vertical_animation
 
QWidgetAnimationm_horizontal_animation
 

Constructor & Destructor Documentation

◆ SearchAndReplaceWidget()

SearchAndReplaceWidget::SearchAndReplaceWidget ( QWidget *  parent = nullptr)
explicit

SearchAndReplaceWidget::SearchAndReplaceWidget Constructor.

Parameters
parent
Here is the call graph for this function:

◆ ~SearchAndReplaceWidget()

SearchAndReplaceWidget::~SearchAndReplaceWidget ( )
override

Member Function Documentation

◆ activateNextChecked()

void SearchAndReplaceWidget::activateNextChecked ( )
private

SearchAndReplaceWidget::activateNextChecked Activate the next checked (and visible) item.

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

◆ addElement()

void SearchAndReplaceWidget::addElement ( Element element)
private

SearchAndReplaceWidget::addElement Add a tree widget item for element.

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

◆ clear()

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).

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

◆ event()

bool SearchAndReplaceWidget::event ( QEvent *  event)
override

SearchAndReplaceWidget::event Reimplemented to clear the the lines edit and hide the advanced widgets, when this widget become hidden.

Parameters
event
Returns
Here is the call graph for this function:

◆ fillItemsList()

void SearchAndReplaceWidget::fillItemsList ( )
private

SearchAndReplaceWidget::fillItemsList Fill the tree.

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

◆ itemChanged()

void SearchAndReplaceWidget::itemChanged ( QTreeWidgetItem *  item,
int  column 
)
private

SearchAndReplaceWidget::itemChanged Reimplemented from QTreeWidget. Use to update the check state of items.

Parameters
item
column
Here is the call graph for this function:
Here is the caller graph for this function:

◆ nextItem()

QTreeWidgetItem * SearchAndReplaceWidget::nextItem ( QTreeWidgetItem *  item = nullptr,
QTreeWidgetItemIterator::IteratorFlag  flags = QTreeWidgetItemIterator::All 
) const
private

SearchAndReplaceWidget::nextItem.

Parameters
item: find the next item from item, if item is nullptr, start the search for the root of the tree
flags
Returns
the next item according to flag or nullptr if there is not a next item
Here is the caller graph for this function:

◆ on_m_advanced_pb_toggled

void SearchAndReplaceWidget::on_m_advanced_pb_toggled ( bool  checked)
privateslot
Here is the call graph for this function:

◆ on_m_advanced_replace_pb_clicked

void SearchAndReplaceWidget::on_m_advanced_replace_pb_clicked ( )
privateslot

SearchAndReplaceWidget::on_m_advanced_replace_pb_clicked Open the advanced editor.

Here is the call graph for this function:

◆ on_m_case_sensitive_cb_stateChanged

void SearchAndReplaceWidget::on_m_case_sensitive_cb_stateChanged ( int  arg1)
privateslot

SearchAndReplaceWidget::on_m_case_sensitive_cb_stateChanged Update the search when change the case sensitive.

Parameters
arg1
Here is the call graph for this function:

◆ on_m_conductor_pb_clicked

void SearchAndReplaceWidget::on_m_conductor_pb_clicked ( )
privateslot

SearchAndReplaceWidget::on_m_conductor_pb_clicked Open a dialog to edit the condutor properties.

Here is the call graph for this function:

◆ on_m_element_pb_clicked

void SearchAndReplaceWidget::on_m_element_pb_clicked ( )
privateslot
Here is the call graph for this function:

◆ on_m_folio_pb_clicked

void SearchAndReplaceWidget::on_m_folio_pb_clicked ( )
privateslot
Here is the call graph for this function:

◆ on_m_mode_cb_currentIndexChanged

void SearchAndReplaceWidget::on_m_mode_cb_currentIndexChanged ( int  index)
privateslot

SearchAndReplaceWidget::on_m_mode_cb_currentIndexChanged Update the search when user change mode.

Parameters
index
Here is the call graph for this function:

◆ on_m_next_pb_clicked

void SearchAndReplaceWidget::on_m_next_pb_clicked ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_m_previous_pb_clicked

void SearchAndReplaceWidget::on_m_previous_pb_clicked ( )
privateslot
Here is the call graph for this function:

◆ on_m_quit_button_clicked

void SearchAndReplaceWidget::on_m_quit_button_clicked ( )
privateslot

◆ on_m_reload_pb_clicked

void SearchAndReplaceWidget::on_m_reload_pb_clicked ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_m_replace_all_pb_clicked

void SearchAndReplaceWidget::on_m_replace_all_pb_clicked ( )
privateslot

SearchAndReplaceWidget::on_m_replace_all_pb_clicked Replace all checked item.

Here is the call graph for this function:

◆ on_m_replace_pb_clicked

void SearchAndReplaceWidget::on_m_replace_pb_clicked ( )
privateslot

SearchAndReplaceWidget::on_m_replace_pb_clicked Replace the current selection.

Here is the call graph for this function:

◆ on_m_tree_widget_currentItemChanged

void SearchAndReplaceWidget::on_m_tree_widget_currentItemChanged ( QTreeWidgetItem *  current,
QTreeWidgetItem *  previous 
)
privateslot
Here is the call graph for this function:

◆ on_m_tree_widget_itemDoubleClicked

void SearchAndReplaceWidget::on_m_tree_widget_itemDoubleClicked ( QTreeWidgetItem *  item,
int  column 
)
privateslot
Here is the caller graph for this function:

◆ previousItem()

QTreeWidgetItem * SearchAndReplaceWidget::previousItem ( QTreeWidgetItem *  item = nullptr,
QTreeWidgetItemIterator::IteratorFlag  flags = QTreeWidgetItemIterator::All 
) const
private

SearchAndReplaceWidget::previousItem.

Parameters
item: find the previous item from item, if item is nullptr, start the search for the root of the tree
flags
Returns
the previous item according to flag or nullptr if there is not a previous item
Here is the caller graph for this function:

◆ search()

void SearchAndReplaceWidget::search ( )
private

SearchAndReplaceWidget::search Start the search.

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

◆ searchTerms() [1/4]

QStringList SearchAndReplaceWidget::searchTerms ( Conductor conductor)
staticprivate

SearchAndReplaceWidget::searchTerms.

Parameters
conductor
Returns
all QString use as terms for search.

◆ searchTerms() [2/4]

QStringList SearchAndReplaceWidget::searchTerms ( Diagram diagram)
staticprivate

SearchAndReplaceWidget::searchTerms.

Parameters
diagram
Returns
All QStrings use as terms for search.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ searchTerms() [3/4]

QStringList SearchAndReplaceWidget::searchTerms ( Element element)
staticprivate

SearchAndReplaceWidget::searchTerms.

Parameters
element
Returns
All QString use as terms for search
Here is the call graph for this function:

◆ searchTerms() [4/4]

static QStringList SearchAndReplaceWidget::searchTerms ( QString  str)
staticprivate

◆ selectedConductor()

QList< Conductor * > SearchAndReplaceWidget::selectedConductor ( ) const
private

SearchAndReplaceWidget::selectedConductor.

Returns
The list of visible and selected conductor in the tree widget
Here is the caller graph for this function:

◆ selectedDiagram()

QList< Diagram * > SearchAndReplaceWidget::selectedDiagram ( ) const
private

SearchAndReplaceWidget::selectedDiagram.

Returns
The list of visible and selected diagram in the tree widget
Here is the caller graph for this function:

◆ selectedElement()

QList< Element * > SearchAndReplaceWidget::selectedElement ( ) const
private

SearchAndReplaceWidget::selectedElement.

Returns
The list of visible and selected element in the tree widget
Here is the caller graph for this function:

◆ selectedText()

QList< IndependentTextItem * > SearchAndReplaceWidget::selectedText ( ) const
private

SearchAndReplaceWidget::selectedText.

Returns
The list of visible and selected independant text in the tree widget
Here is the caller graph for this function:

◆ setChildCheckState()

void SearchAndReplaceWidget::setChildCheckState ( QTreeWidgetItem *  item,
Qt::CheckState  check,
bool  deep = true 
)
private

SearchAndReplaceWidget::setChildCheckState.

Parameters
item: Parent of the items to be evaluated
check: check state
deep: if true, we evaluate every subchilds.
Here is the caller graph for this function:

◆ setEditor()

void SearchAndReplaceWidget::setEditor ( QETDiagramEditor editor)

SearchAndReplaceWidget::setEditor Set the diagram editor of this widget.

Parameters
editor
Here is the caller graph for this function:

◆ setHideAdvanced()

void SearchAndReplaceWidget::setHideAdvanced ( bool  hide)
private

SearchAndReplaceWidget::setHideAdvanced Hide advanced widgets.

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

◆ setUpTreeItems()

void SearchAndReplaceWidget::setUpTreeItems ( )
private

SearchAndReplaceWidget::setUpTreeItems Set up the main tree widget items.

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

◆ setVisibleAllParents()

void SearchAndReplaceWidget::setVisibleAllParents ( QTreeWidgetItem *  item,
bool  expend_parent = true 
)
private

SearchAndReplaceWidget::setVisibleAllParents Set visible all parents of item until the invisible root item.

Parameters
item
expend_parent
Here is the caller graph for this function:

◆ updateNextPreviousButtons()

void SearchAndReplaceWidget::updateNextPreviousButtons ( )
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.

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

◆ updateParentCheckState()

void SearchAndReplaceWidget::updateParentCheckState ( QTreeWidgetItem *  item,
bool  all_parents = true 
)
private

SearchAndReplaceWidget::updateParentCheckState.

Parameters
item: a child item of the parent to be evaluated.
all_parents: if true, we evaluate every parents, until the root item.
Here is the caller graph for this function:

Member Data Documentation

◆ m_category_qtwi

QList<QTreeWidgetItem *> SearchAndReplaceWidget::m_category_qtwi
private

◆ m_conductor_hash

QHash<QTreeWidgetItem *, QPointer <Conductor> > SearchAndReplaceWidget::m_conductor_hash
private

◆ m_conductor_qtwi

QTreeWidgetItem * SearchAndReplaceWidget::m_conductor_qtwi = nullptr
private

◆ m_diagram_hash

QHash<QTreeWidgetItem *, QPointer <Diagram> > SearchAndReplaceWidget::m_diagram_hash
private

◆ m_editor

QETDiagramEditor* SearchAndReplaceWidget::m_editor
private

◆ m_element_hash

QHash<QTreeWidgetItem *, QPointer <Element> > SearchAndReplaceWidget::m_element_hash
private

◆ m_elements_qtwi

QTreeWidgetItem * SearchAndReplaceWidget::m_elements_qtwi = nullptr
private

◆ m_folio_qtwi

QTreeWidgetItem * SearchAndReplaceWidget::m_folio_qtwi = nullptr
private

◆ m_highlighted_element

QPointer<Element> SearchAndReplaceWidget::m_highlighted_element
private

◆ m_horizontal_animation

QWidgetAnimation* SearchAndReplaceWidget::m_horizontal_animation
private

◆ m_indi_text_qtwi

QTreeWidgetItem * SearchAndReplaceWidget::m_indi_text_qtwi = nullptr
private

◆ m_last_selected

QPointer<QGraphicsObject> SearchAndReplaceWidget::m_last_selected
private

◆ m_master_elmt_qtwi

QTreeWidgetItem * SearchAndReplaceWidget::m_master_elmt_qtwi = nullptr
private

◆ m_qtwi_elmts

QList<QTreeWidgetItem *> SearchAndReplaceWidget::m_qtwi_elmts
private

◆ m_report_elmt_qtwi

QTreeWidgetItem * SearchAndReplaceWidget::m_report_elmt_qtwi = nullptr
private

◆ m_root_qtwi

QTreeWidgetItem* SearchAndReplaceWidget::m_root_qtwi = nullptr
private

◆ m_simple_elmt_qtwi

QTreeWidgetItem * SearchAndReplaceWidget::m_simple_elmt_qtwi = nullptr
private

◆ m_slave_elmt_qtwi

QTreeWidgetItem * SearchAndReplaceWidget::m_slave_elmt_qtwi = nullptr
private

◆ m_terminal_elmt_qtwi

QTreeWidgetItem * SearchAndReplaceWidget::m_terminal_elmt_qtwi = nullptr
private

◆ m_text_hash

QHash<QTreeWidgetItem *, QPointer <IndependentTextItem> > SearchAndReplaceWidget::m_text_hash
private

◆ m_vertical_animation

QWidgetAnimation* SearchAndReplaceWidget::m_vertical_animation
private

◆ m_worker

SearchAndReplaceWorker SearchAndReplaceWidget::m_worker
private

◆ ui

Ui::SearchAndReplaceWidget* SearchAndReplaceWidget::ui
private

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