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

The LinkSingleElementWidget class this class provide a widget to select an element to be linked to the element given in the constructor. The element given in constructor must be linked with only one other element (like report or slave element). This widget detect automaticaly the kind of element given in the constructor and search all element that can be linked with it. If the element is already linked, the widget ask user to unlink. This widget embedded the diagram command for undo/redo the action. More...

#include <linksingleelementwidget.h>

Inheritance diagram for LinkSingleElementWidget:
Inheritance graph
Collaboration diagram for LinkSingleElementWidget:
Collaboration graph

Public Slots

void updateUi () override
 LinkSingleElementWidget::updateUi Update the content of this widget. More...
 
void buildTree ()
 LinkSingleElementWidget::buildTree Build the content of the QTreeWidget. More...
 

Public Member Functions

 LinkSingleElementWidget (Element *elmt, QWidget *parent=nullptr)
 Methods. More...
 
 ~LinkSingleElementWidget () override
 LinkSingleElementWidget::~LinkSingleElementWidget Default destructor. More...
 
void setElement (Element *element) override
 LinkSingleElementWidget::setElement Set element to be the edited element. More...
 
void apply () override
 LinkSingleElementWidget::apply Apply the new property of the edited element by pushing the associated undo command to parent project undo stack. More...
 
QUndoCommand * associatedUndo () const override
 LinkSingleElementWidget::associatedUndo. More...
 
QString title () const override
 LinkSingleElementWidget::title. More...
 
bool setLiveEdit (bool live_edit) override
 LinkSingleElementWidget::setLiveEdit. More...
 
- Public Member Functions inherited from AbstractElementPropertiesEditorWidget
 AbstractElementPropertiesEditorWidget (QWidget *parent=nullptr)
 
- Public Member Functions inherited from PropertiesEditorWidget
 PropertiesEditorWidget (QWidget *parent=nullptr)
 PropertiesEditorWidget::PropertiesEditorWidget Constructor. More...
 
virtual void reset ()
 
virtual void updateUi ()
 
bool isLiveEdit () const
 PropertiesEditorWidget::isLiveEdit. More...
 

Private Slots

void diagramWasRemovedFromProject ()
 LinkSingleElementWidget::diagramWasRemovedFromProject This slot is called when a diagram is removed from the parent project of edited element to update the content of this widget. More...
 
void showedElementWasDeleted ()
 
void linkTriggered ()
 LinkSingleElementWidget::linkTriggered Action linkis triggered. More...
 
void hideButtons ()
 LinkSingleElementWidget::hideButtons Hide the button displayed when element is already linked. More...
 
void showButtons ()
 LinkSingleElementWidget::showButtons Show the button displayed when element is already linked. More...
 
void headerCustomContextMenuRequested (const QPoint &pos)
 
void on_m_unlink_pb_clicked ()
 
void on_m_tree_widget_itemDoubleClicked (QTreeWidgetItem *item, int column)
 LinkSingleElementWidget::on_m_tree_widget_itemDoubleClicked Highlight the element represented by item. More...
 
void on_m_tree_widget_customContextMenuRequested (const QPoint &pos)
 
void on_m_show_linked_pb_clicked ()
 
void on_m_show_this_pb_clicked ()
 
void on_m_search_field_textEdited (const QString &arg1)
 LinkSingleElementWidget::on_m_search_field_textEdited Search all items which match with arg1 and shows it, other items is hidden. If arg1 is empty, show all items. More...
 

Private Member Functions

QList< Element * > availableElements ()
 LinkSingleElementWidget::availableElements. More...
 
void setUpCompleter ()
 LinkSingleElementWidget::setUpCompleter Setup the completer of search_field. More...
 
void clearTreeWidget ()
 LinkSingleElementWidget::clearTreeWidget Clear the tree widget. Delete all QTreeWidget (in the tree widget and in the hash). Clear the hash. More...
 
void setUpHeaderLabels ()
 

Private Attributes

Ui::LinkSingleElementWidget * ui
 
bool m_unlink = false
 
Element::kind m_filter
 
QHash< QTreeWidgetItem *, Element * > m_qtwi_elmt_hash
 
QHash< QTreeWidgetItem *, QStringList > m_qtwi_strl_hash
 
QTreeWidgetItem * m_qtwi_at_context_menu = nullptr
 
QTreeWidgetItem * m_pending_qtwi = nullptr
 
Elementm_showed_element = nullptr
 
Elementm_element_to_link = nullptr
 
QMenu * m_context_menu
 
QAction * m_link_action
 
QAction * m_show_qtwi
 
QAction * m_show_element
 
QAction * m_save_header_state
 

Additional Inherited Members

- Protected Member Functions inherited from PropertiesEditorWidget
virtual void enableLiveEdit ()
 
virtual void disableLiveEdit ()
 
- Protected Attributes inherited from AbstractElementPropertiesEditorWidget
QPointer< Elementm_element
 
- Protected Attributes inherited from PropertiesEditorWidget
bool m_live_edit
 

Detailed Description

The LinkSingleElementWidget class this class provide a widget to select an element to be linked to the element given in the constructor. The element given in constructor must be linked with only one other element (like report or slave element). This widget detect automaticaly the kind of element given in the constructor and search all element that can be linked with it. If the element is already linked, the widget ask user to unlink. This widget embedded the diagram command for undo/redo the action.

Constructor & Destructor Documentation

◆ LinkSingleElementWidget()

LinkSingleElementWidget::LinkSingleElementWidget ( Element elmt,
QWidget *  parent = nullptr 
)
explicit

Methods.

LinkSingleElementWidget::LinkSingleElementWidget Default constructor.

Parameters
elmtthe edited element
parentthe parent widget
Here is the call graph for this function:

◆ ~LinkSingleElementWidget()

LinkSingleElementWidget::~LinkSingleElementWidget ( )
override

LinkSingleElementWidget::~LinkSingleElementWidget Default destructor.

Here is the call graph for this function:

Member Function Documentation

◆ apply()

void LinkSingleElementWidget::apply ( )
overridevirtual

LinkSingleElementWidget::apply Apply the new property of the edited element by pushing the associated undo command to parent project undo stack.

Reimplemented from PropertiesEditorWidget.

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

◆ associatedUndo()

QUndoCommand * LinkSingleElementWidget::associatedUndo ( ) const
overridevirtual

LinkSingleElementWidget::associatedUndo.

Returns
the undo command associated to the current edition if there isn't change, return nulptr

Reimplemented from PropertiesEditorWidget.

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

◆ availableElements()

QList< Element * > LinkSingleElementWidget::availableElements ( )
private

LinkSingleElementWidget::availableElements.

Returns
A QList with all available element to be linked with the edited element. This methode take care of the combo box "find in diagram"
Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildTree

void LinkSingleElementWidget::buildTree ( )
slot

LinkSingleElementWidget::buildTree Build the content of the QTreeWidget.

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

◆ clearTreeWidget()

void LinkSingleElementWidget::clearTreeWidget ( )
private

LinkSingleElementWidget::clearTreeWidget Clear the tree widget. Delete all QTreeWidget (in the tree widget and in the hash). Clear the hash.

Here is the caller graph for this function:

◆ diagramWasRemovedFromProject

void LinkSingleElementWidget::diagramWasRemovedFromProject ( )
privateslot

LinkSingleElementWidget::diagramWasRemovedFromProject This slot is called when a diagram is removed from the parent project of edited element to update the content of this widget.

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

◆ headerCustomContextMenuRequested

void LinkSingleElementWidget::headerCustomContextMenuRequested ( const QPoint &  pos)
privateslot
Here is the caller graph for this function:

◆ hideButtons

void LinkSingleElementWidget::hideButtons ( )
privateslot

LinkSingleElementWidget::hideButtons Hide the button displayed when element is already linked.

Here is the caller graph for this function:

◆ linkTriggered

void LinkSingleElementWidget::linkTriggered ( )
privateslot

LinkSingleElementWidget::linkTriggered Action linkis triggered.

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

◆ on_m_search_field_textEdited

void LinkSingleElementWidget::on_m_search_field_textEdited ( const QString &  arg1)
privateslot

LinkSingleElementWidget::on_m_search_field_textEdited Search all items which match with arg1 and shows it, other items is hidden. If arg1 is empty, show all items.

Parameters
arg1

◆ on_m_show_linked_pb_clicked

void LinkSingleElementWidget::on_m_show_linked_pb_clicked ( )
privateslot
Here is the call graph for this function:

◆ on_m_show_this_pb_clicked

void LinkSingleElementWidget::on_m_show_this_pb_clicked ( )
privateslot

◆ on_m_tree_widget_customContextMenuRequested

void LinkSingleElementWidget::on_m_tree_widget_customContextMenuRequested ( const QPoint &  pos)
privateslot

◆ on_m_tree_widget_itemDoubleClicked

void LinkSingleElementWidget::on_m_tree_widget_itemDoubleClicked ( QTreeWidgetItem *  item,
int  column 
)
privateslot

LinkSingleElementWidget::on_m_tree_widget_itemDoubleClicked Highlight the element represented by item.

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

◆ on_m_unlink_pb_clicked

void LinkSingleElementWidget::on_m_unlink_pb_clicked ( )
privateslot
Here is the call graph for this function:

◆ setElement()

void LinkSingleElementWidget::setElement ( Element element)
overridevirtual

LinkSingleElementWidget::setElement Set element to be the edited element.

Parameters
element

Implements AbstractElementPropertiesEditorWidget.

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

◆ setLiveEdit()

bool LinkSingleElementWidget::setLiveEdit ( bool  live_edit)
overridevirtual

LinkSingleElementWidget::setLiveEdit.

Parameters
live_edit
Returns

Reimplemented from PropertiesEditorWidget.

◆ setUpCompleter()

void LinkSingleElementWidget::setUpCompleter ( )
private

LinkSingleElementWidget::setUpCompleter Setup the completer of search_field.

Here is the caller graph for this function:

◆ setUpHeaderLabels()

void LinkSingleElementWidget::setUpHeaderLabels ( )
private
Here is the caller graph for this function:

◆ showButtons

void LinkSingleElementWidget::showButtons ( )
privateslot

LinkSingleElementWidget::showButtons Show the button displayed when element is already linked.

Here is the caller graph for this function:

◆ showedElementWasDeleted

void LinkSingleElementWidget::showedElementWasDeleted ( )
privateslot
Here is the caller graph for this function:

◆ title()

QString LinkSingleElementWidget::title ( ) const
overridevirtual

LinkSingleElementWidget::title.

Returns
the title used for this editor

Reimplemented from PropertiesEditorWidget.

◆ updateUi

void LinkSingleElementWidget::updateUi ( )
overrideslot

LinkSingleElementWidget::updateUi Update the content of this widget.

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

Member Data Documentation

◆ m_context_menu

QMenu* LinkSingleElementWidget::m_context_menu
private

◆ m_element_to_link

Element * LinkSingleElementWidget::m_element_to_link = nullptr
private

◆ m_filter

Element::kind LinkSingleElementWidget::m_filter
private

◆ m_link_action

QAction* LinkSingleElementWidget::m_link_action
private

◆ m_pending_qtwi

QTreeWidgetItem * LinkSingleElementWidget::m_pending_qtwi = nullptr
private

◆ m_qtwi_at_context_menu

QTreeWidgetItem* LinkSingleElementWidget::m_qtwi_at_context_menu = nullptr
private

◆ m_qtwi_elmt_hash

QHash<QTreeWidgetItem*, Element*> LinkSingleElementWidget::m_qtwi_elmt_hash
private

◆ m_qtwi_strl_hash

QHash<QTreeWidgetItem*, QStringList> LinkSingleElementWidget::m_qtwi_strl_hash
private

◆ m_save_header_state

QAction * LinkSingleElementWidget::m_save_header_state
private

◆ m_show_element

QAction * LinkSingleElementWidget::m_show_element
private

◆ m_show_qtwi

QAction * LinkSingleElementWidget::m_show_qtwi
private

◆ m_showed_element

Element* LinkSingleElementWidget::m_showed_element = nullptr
private

◆ m_unlink

bool LinkSingleElementWidget::m_unlink = false
private

◆ ui

Ui::LinkSingleElementWidget* LinkSingleElementWidget::ui
private

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