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

The MasterPropertiesWidget class This class is a widget for make link between a master element with several slave element. This class embenddedthe undo/redo command when apply new connection. More...

#include <masterpropertieswidget.h>

Inheritance diagram for MasterPropertiesWidget:
Inheritance graph
Collaboration diagram for MasterPropertiesWidget:
Collaboration graph

Public Slots

void updateUi () override
 MasterPropertiesWidget::updateUi Build the interface of the widget. More...
 

Public Member Functions

 MasterPropertiesWidget (Element *elmt, QWidget *parent=nullptr)
 MasterPropertiesWidget::MasterPropertiesWidget Default constructor. More...
 
 ~MasterPropertiesWidget () override
 MasterPropertiesWidget::~MasterPropertiesWidget Destructor. More...
 
void setElement (Element *element) override
 MasterPropertiesWidget::setElement Set the element to be edited. More...
 
void apply () override
 MasterPropertiesWidget::apply If link betwen edited element and other change, apply the change with a QUndoCommand (got with method associatedUndo) pushed to the stack of element project. Return true if link change, else false. More...
 
void reset () override
 MasterPropertiesWidget::reset Reset curent widget, clear eveything and rebuild widget. More...
 
QUndoCommand * associatedUndo () const override
 MasterPropertiesWidget::associatedUndo If link between the edited element and other change, return a QUndoCommand with this change. If no change return nullptr. More...
 
QString title () const override
 title More...
 
bool setLiveEdit (bool live_edit) override
 MasterPropertiesWidget::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 updateUi ()
 
bool isLiveEdit () const
 PropertiesEditorWidget::isLiveEdit. More...
 

Private Slots

void headerCustomContextMenuRequested (const QPoint &pos)
 MasterPropertiesWidget::headerCustomContextMenuRequested. More...
 
void on_link_button_clicked ()
 MasterPropertiesWidget::on_link_button_clicked move curent item in the free_list to linked_list. More...
 
void on_unlink_button_clicked ()
 MasterPropertiesWidget::on_unlink_button_clicked move curent item in linked_list to free_list. More...
 
void showElementFromTWI (QTreeWidgetItem *qtwi, int column)
 MasterPropertiesWidget::showElementFromTWI Show the element corresponding to the given QTreeWidgetItem. More...
 
void showedElementWasDeleted ()
 MasterPropertiesWidget::showedElementWasDeleted Set to nullptr the current showed element when he was deleted. More...
 
void diagramWasdeletedFromProject ()
 MasterPropertiesWidget::diagramWasdeletedFromProject 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 customContextMenu (const QPoint &pos, int i=0)
 MasterPropertiesWidget::customContextMenu Display a context menu. More...
 

Private Attributes

Ui::MasterPropertiesWidget * ui
 
QHash< QTreeWidgetItem *, Element * > m_qtwi_hash
 
QTreeWidgetItem * m_qtwi_at_context_menu = nullptr
 
QPointer< Elementm_showed_element
 
QETProjectm_project
 
QMenu * m_context_menu
 
QAction * m_link_action
 
QAction * m_unlink_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 MasterPropertiesWidget class This class is a widget for make link between a master element with several slave element. This class embenddedthe undo/redo command when apply new connection.

Constructor & Destructor Documentation

◆ MasterPropertiesWidget()

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

MasterPropertiesWidget::MasterPropertiesWidget Default constructor.

Parameters
elmt
parent
Here is the call graph for this function:

◆ ~MasterPropertiesWidget()

MasterPropertiesWidget::~MasterPropertiesWidget ( )
override

Member Function Documentation

◆ apply()

void MasterPropertiesWidget::apply ( )
overridevirtual

MasterPropertiesWidget::apply If link betwen edited element and other change, apply the change with a QUndoCommand (got with method associatedUndo) pushed to the stack of element project. Return true if link change, else false.

Note
is void no Return ???

Reimplemented from PropertiesEditorWidget.

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

◆ associatedUndo()

QUndoCommand * MasterPropertiesWidget::associatedUndo ( ) const
overridevirtual

MasterPropertiesWidget::associatedUndo If link between the edited element and other change, return a QUndoCommand with this change. If no change return nullptr.

Returns

Reimplemented from PropertiesEditorWidget.

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

◆ customContextMenu

void MasterPropertiesWidget::customContextMenu ( const QPoint &  pos,
int  i = 0 
)
privateslot

MasterPropertiesWidget::customContextMenu Display a context menu.

Parameters
pos
i: the tree widget where the context menu was requested.

◆ diagramWasdeletedFromProject

void MasterPropertiesWidget::diagramWasdeletedFromProject ( )
privateslot

MasterPropertiesWidget::diagramWasdeletedFromProject 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 MasterPropertiesWidget::headerCustomContextMenuRequested ( const QPoint &  pos)
privateslot

MasterPropertiesWidget::headerCustomContextMenuRequested.

Parameters
pos
Here is the caller graph for this function:

◆ on_link_button_clicked

void MasterPropertiesWidget::on_link_button_clicked ( )
privateslot

MasterPropertiesWidget::on_link_button_clicked move curent item in the free_list to linked_list.

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

◆ on_unlink_button_clicked

void MasterPropertiesWidget::on_unlink_button_clicked ( )
privateslot

MasterPropertiesWidget::on_unlink_button_clicked move curent item in linked_list to free_list.

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

◆ reset()

void MasterPropertiesWidget::reset ( )
overridevirtual

MasterPropertiesWidget::reset Reset curent widget, clear eveything and rebuild widget.

Reimplemented from PropertiesEditorWidget.

Here is the call graph for this function:

◆ setElement()

void MasterPropertiesWidget::setElement ( Element element)
overridevirtual

MasterPropertiesWidget::setElement Set the element to be edited.

Parameters
element

Implements AbstractElementPropertiesEditorWidget.

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

◆ setLiveEdit()

bool MasterPropertiesWidget::setLiveEdit ( bool  live_edit)
overridevirtual

MasterPropertiesWidget::setLiveEdit.

Parameters
live_edit= true : live edit is enable else false : live edit is disable.
Returns
always true because live edit is handled by this editor widget

Reimplemented from PropertiesEditorWidget.

◆ showedElementWasDeleted

void MasterPropertiesWidget::showedElementWasDeleted ( )
privateslot

MasterPropertiesWidget::showedElementWasDeleted Set to nullptr the current showed element when he was deleted.

Here is the caller graph for this function:

◆ showElementFromTWI

void MasterPropertiesWidget::showElementFromTWI ( QTreeWidgetItem *  qtwi,
int  column 
)
privateslot

MasterPropertiesWidget::showElementFromTWI Show the element corresponding to the given QTreeWidgetItem.

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

◆ title()

QString MasterPropertiesWidget::title ( ) const
inlineoverridevirtual

title

Returns
QString title

Reimplemented from PropertiesEditorWidget.

◆ updateUi

void MasterPropertiesWidget::updateUi ( )
overrideslot

MasterPropertiesWidget::updateUi Build the interface of the widget.

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

Member Data Documentation

◆ m_context_menu

QMenu* MasterPropertiesWidget::m_context_menu
private

◆ m_link_action

QAction* MasterPropertiesWidget::m_link_action
private

◆ m_project

QETProject* MasterPropertiesWidget::m_project
private

◆ m_qtwi_at_context_menu

QTreeWidgetItem* MasterPropertiesWidget::m_qtwi_at_context_menu = nullptr
private

◆ m_qtwi_hash

QHash<QTreeWidgetItem *, Element *> MasterPropertiesWidget::m_qtwi_hash
private

◆ m_save_header_state

QAction * MasterPropertiesWidget::m_save_header_state
private

◆ m_show_element

QAction * MasterPropertiesWidget::m_show_element
private

◆ m_show_qtwi

QAction * MasterPropertiesWidget::m_show_qtwi
private

◆ m_showed_element

QPointer<Element> MasterPropertiesWidget::m_showed_element
private

◆ m_unlink_action

QAction * MasterPropertiesWidget::m_unlink_action
private

◆ ui

Ui::MasterPropertiesWidget* MasterPropertiesWidget::ui
private

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