QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
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.

Public Member Functions

 MasterPropertiesWidget (Element *elmt, QWidget *parent=nullptr)
 MasterPropertiesWidget::MasterPropertiesWidget Default constructor.
 ~MasterPropertiesWidget () override
 MasterPropertiesWidget::~MasterPropertiesWidget Destructor.
void setElement (Element *element) override
 MasterPropertiesWidget::setElement Set the element to be edited.
void apply () override
 MasterPropertiesWidget::apply If link between 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.
void reset () override
 MasterPropertiesWidget::reset Reset current widget, clear eveything and rebuild widget.
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.
QString title () const override
 title
bool setLiveEdit (bool live_edit) override
 MasterPropertiesWidget::setLiveEdit.
Public Member Functions inherited from AbstractElementPropertiesEditorWidget
 AbstractElementPropertiesEditorWidget (QWidget *parent=nullptr)
Public Member Functions inherited from PropertiesEditorWidget
 PropertiesEditorWidget (QWidget *parent=nullptr)
 PropertiesEditorWidget::PropertiesEditorWidget Constructor.
virtual void updateUi ()
bool isLiveEdit () const
 PropertiesEditorWidget::isLiveEdit.

Private Slots

void headerCustomContextMenuRequested (const QPoint &pos)
 MasterPropertiesWidget::headerCustomContextMenuRequested.
void on_link_button_clicked ()
 MasterPropertiesWidget::on_link_button_clicked Moves the current item from the free_list to the linked_list, provided the master's slave limit has not been reached.
void on_unlink_button_clicked ()
 MasterPropertiesWidget::on_unlink_button_clicked move current item in linked_list to free_list.
void showElementFromTWI (QTreeWidgetItem *qtwi, int column)
 MasterPropertiesWidget::showElementFromTWI Show the element corresponding to the given QTreeWidgetItem.
void showedElementWasDeleted ()
 MasterPropertiesWidget::showedElementWasDeleted Set to nullptr the current showed element when he was deleted.
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.
void customContextMenu (const QPoint &pos, int i=0)
 MasterPropertiesWidget::customContextMenu Display a context menu.
void plcPasteFromClipboard ()
 MasterPropertiesWidget::plcPasteFromClipboard Paste IO data from clipboard.
void setCellFromValue (int row, int col, const QString &val)
 MasterPropertiesWidget::setCellFromValue Set a single table cell value, respecting the column widget type.
void plcAddRow ()
 MasterPropertiesWidget::plcAddRow Add a new empty row to the PLC IO table.
void plcRemoveRow ()
 MasterPropertiesWidget::plcRemoveRow Remove selected rows from the PLC IO table.
void plcMoveRowUp ()
 MasterPropertiesWidget::plcMoveRowUp Move selected row up.
void plcMoveRowDown ()
 MasterPropertiesWidget::plcMoveRowDown Move selected row down.
void plcIOCellChanged (int row, int column)
 MasterPropertiesWidget::plcIOCellChanged Called when a cell in the PLC IO table changes.
void plcUpdateDisplaySettings ()
 MasterPropertiesWidget::plcUpdateDisplaySettings Update the IO data from the table (display settings are managed by the editor only).
void plcShowTableContextMenu (const QPoint &pos)
 MasterPropertiesWidget::plcShowTableContextMenu Show context menu for the PLC IO table.

Private Attributes

Ui::MasterPropertiesWidget * ui
QHash< QTreeWidgetItem *, Element * > m_qtwi_hash
QMap< Element *, int > m_pending_group_indices
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
QWidget * m_plc_widget = nullptr
QTableWidget * m_plc_table = nullptr
QCheckBox * m_plc_break_checkboxes [4] = {nullptr, nullptr, nullptr, nullptr}
QSpinBox * m_plc_break_spinboxes [4] = {nullptr, nullptr, nullptr, nullptr}
QSpinBox * m_plc_row_height_spinbox = nullptr
QList< QCheckBox * > m_plc_col_visibility_checkboxes
QList< QSpinBox * > m_plc_col_width_spinboxes
bool m_plc_updating = false

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:
Here is the caller graph for this function:

◆ ~MasterPropertiesWidget()

MasterPropertiesWidget::~MasterPropertiesWidget ( )
override

Member Function Documentation

◆ apply()

void MasterPropertiesWidget::apply ( )
overridevirtual

MasterPropertiesWidget::apply If link between 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 Moves the current item from the free_list to the linked_list, provided the master's slave limit has not been reached.

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 current item in linked_list to free_list.

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

◆ plcAddRow

void MasterPropertiesWidget::plcAddRow ( )
privateslot

MasterPropertiesWidget::plcAddRow Add a new empty row to the PLC IO table.

Here is the call graph for this function:

◆ plcIOCellChanged

void MasterPropertiesWidget::plcIOCellChanged ( int row,
int column )
privateslot

MasterPropertiesWidget::plcIOCellChanged Called when a cell in the PLC IO table changes.

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

◆ plcMoveRowDown

void MasterPropertiesWidget::plcMoveRowDown ( )
privateslot

MasterPropertiesWidget::plcMoveRowDown Move selected row down.

Here is the call graph for this function:

◆ plcMoveRowUp

void MasterPropertiesWidget::plcMoveRowUp ( )
privateslot

MasterPropertiesWidget::plcMoveRowUp Move selected row up.

Here is the call graph for this function:

◆ plcPasteFromClipboard

void MasterPropertiesWidget::plcPasteFromClipboard ( )
privateslot

MasterPropertiesWidget::plcPasteFromClipboard Paste IO data from clipboard.

Two modes:

  1. Single-column data (no tabs, e.g. copied vertically from A1:A6): Values are pasted vertically down the current column.
  2. Multi-column data (tab-separated, e.g. copied from a row in Excel): Each line becomes a separate IO row.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ plcRemoveRow

void MasterPropertiesWidget::plcRemoveRow ( )
privateslot

MasterPropertiesWidget::plcRemoveRow Remove selected rows from the PLC IO table.

Here is the call graph for this function:

◆ plcShowTableContextMenu

void MasterPropertiesWidget::plcShowTableContextMenu ( const QPoint & pos)
privateslot

MasterPropertiesWidget::plcShowTableContextMenu Show context menu for the PLC IO table.

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

◆ plcUpdateDisplaySettings

void MasterPropertiesWidget::plcUpdateDisplaySettings ( )
privateslot

MasterPropertiesWidget::plcUpdateDisplaySettings Update the IO data from the table (display settings are managed by the editor only).

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

◆ reset()

void MasterPropertiesWidget::reset ( )
overridevirtual

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

Reimplemented from PropertiesEditorWidget.

Here is the call graph for this function:

◆ setCellFromValue

void MasterPropertiesWidget::setCellFromValue ( int row,
int col,
const QString & val )
privateslot

MasterPropertiesWidget::setCellFromValue Set a single table cell value, respecting the column widget type.

Here is the call graph for this function:
Here is the caller 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_pending_group_indices

QMap<Element *, int> MasterPropertiesWidget::m_pending_group_indices
private

◆ m_plc_break_checkboxes

QCheckBox* MasterPropertiesWidget::m_plc_break_checkboxes[4] = {nullptr, nullptr, nullptr, nullptr}
private

◆ m_plc_break_spinboxes

QSpinBox* MasterPropertiesWidget::m_plc_break_spinboxes[4] = {nullptr, nullptr, nullptr, nullptr}
private

◆ m_plc_col_visibility_checkboxes

QList<QCheckBox *> MasterPropertiesWidget::m_plc_col_visibility_checkboxes
private

◆ m_plc_col_width_spinboxes

QList<QSpinBox *> MasterPropertiesWidget::m_plc_col_width_spinboxes
private

◆ m_plc_row_height_spinbox

QSpinBox* MasterPropertiesWidget::m_plc_row_height_spinbox = nullptr
private

◆ m_plc_table

QTableWidget* MasterPropertiesWidget::m_plc_table = nullptr
private

◆ m_plc_updating

bool MasterPropertiesWidget::m_plc_updating = false
private

◆ m_plc_widget

QWidget* MasterPropertiesWidget::m_plc_widget = nullptr
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: