QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
ElementInfoWidget Class Reference

The ElementInfoWidget class this class is a widget to edit an element informations. More...

#include <elementinfowidget.h>

Inheritance diagram for ElementInfoWidget:
Inheritance graph
Collaboration diagram for ElementInfoWidget:
Collaboration graph

Public Member Functions

 ElementInfoWidget (Element *elmt, QWidget *parent=nullptr)
 ElementInfoWidget::ElementInfoWidget Constructor.
 ~ElementInfoWidget () override
 ElementInfoWidget::~ElementInfoWidget Destructor.
void setElement (Element *element) override
 ElementInfoWidget::setElement Set element to be the edited element.
void apply () override
 ElementInfoWidget::apply Apply the new information with a new undo command (got with method associatedUndo) pushed to the stack of element project.
QUndoCommand * associatedUndo () const override
 ElementInfoWidget::associatedUndo If the edited info is different of the actual element info, return a QUndoCommand with the change. If no change return nullptr;.
QString title () const override
 PropertiesEditorWidget::title.
bool setLiveEdit (bool live_edit) override
 ElementInfoWidget::setLiveEdit.
void updateUi () override
 ElementInfoWidget::updateUi fill information fetch in m_element_info to the corresponding line edit.
DiagramContext currentInfo () const
 ElementInfoWidget::currentInfo.
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 reset ()
bool isLiveEdit () const
 PropertiesEditorWidget::isLiveEdit.

Protected Member Functions

bool event (QEvent *event) override
 ElementInfoWidget::event Reimplemented from QWidget::event Only give focus to the first line edit at first activation. After send the event to QWidget.
void enableLiveEdit () override
 ElementInfoWidget::enableLiveEdit Enable the live edit mode.
void disableLiveEdit () override
 ElementInfoWidget::disableLiveEdit disable the live edit mode.

Private Slots

void firstActivated ()
 ElementInfoWidget::firstActivated Slot activated when this widget is show. Set the focus to the first line edit provided by this widget.
void elementInfoChange ()
 ElementInfoWidget::elementInfoChange This slot is called when m_element::elementInformation change.
void addCustomProperty (const QString &key=QString(), const QString &value=QString())
 ElementInfoWidget::addCustomProperty Append a new user-defined key/value row to the widget.
void removeCustomProperty (CustomElementInfoPartWidget *widget)
 ElementInfoWidget::removeCustomProperty Remove a user-defined key/value row.

Private Member Functions

void buildInterface ()
 ElementInfoWidget::buildInterface Build the widget.
ElementInfoPartWidgetinfoPartWidgetForKey (const QString &key) const
 ElementInfoWidget::infoPartWidgetForKey.
QStringList predefinedKeys () const
 ElementInfoWidget::predefinedKeys.

Private Attributes

Ui::ElementInfoWidget * ui
QList< ElementInfoPartWidget * > m_eipw_list
QList< CustomElementInfoPartWidget * > m_custom_eipw_list
QPushButton * m_add_custom_property_btn = nullptr
QCheckBox * m_potential_isolating_cb = nullptr
QCheckBox * m_exclude_from_bom_cb = nullptr
bool m_first_activation
bool m_ui_builded = false

Additional Inherited Members

Protected Attributes inherited from AbstractElementPropertiesEditorWidget
QPointer< Elementm_element
Protected Attributes inherited from PropertiesEditorWidget
bool m_live_edit

Detailed Description

The ElementInfoWidget class this class is a widget to edit an element informations.

Constructor & Destructor Documentation

◆ ElementInfoWidget()

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

ElementInfoWidget::ElementInfoWidget Constructor.

Parameters
elmtelement to edit information
parentparent widget
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~ElementInfoWidget()

ElementInfoWidget::~ElementInfoWidget ( )
override

Member Function Documentation

◆ addCustomProperty

void ElementInfoWidget::addCustomProperty ( const QString & key = QString(),
const QString & value = QString() )
privateslot

ElementInfoWidget::addCustomProperty Append a new user-defined key/value row to the widget.

Parameters
keyinitial key, left empty for a freshly added row
valueinitial value
Here is the call graph for this function:
Here is the caller graph for this function:

◆ apply()

void ElementInfoWidget::apply ( )
overridevirtual

ElementInfoWidget::apply Apply the new information with a new undo command (got with method associatedUndo) pushed to the stack of element project.

Reimplemented from PropertiesEditorWidget.

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

◆ associatedUndo()

QUndoCommand * ElementInfoWidget::associatedUndo ( ) const
overridevirtual

ElementInfoWidget::associatedUndo If the edited info is different of the actual element info, return a QUndoCommand with the 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:

◆ buildInterface()

void ElementInfoWidget::buildInterface ( )
private

ElementInfoWidget::buildInterface Build the widget.

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

◆ currentInfo()

DiagramContext ElementInfoWidget::currentInfo ( ) const

ElementInfoWidget::currentInfo.

Returns
the info currently edited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ disableLiveEdit()

void ElementInfoWidget::disableLiveEdit ( )
overrideprotectedvirtual

ElementInfoWidget::disableLiveEdit disable the live edit mode.

Reimplemented from PropertiesEditorWidget.

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

◆ elementInfoChange

void ElementInfoWidget::elementInfoChange ( )
privateslot

ElementInfoWidget::elementInfoChange This slot is called when m_element::elementInformation change.

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

◆ enableLiveEdit()

void ElementInfoWidget::enableLiveEdit ( )
overrideprotectedvirtual

ElementInfoWidget::enableLiveEdit Enable the live edit mode.

Reimplemented from PropertiesEditorWidget.

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

◆ event()

bool ElementInfoWidget::event ( QEvent * event)
overrideprotected

ElementInfoWidget::event Reimplemented from QWidget::event Only give focus to the first line edit at first activation. After send the event to QWidget.

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

◆ firstActivated

void ElementInfoWidget::firstActivated ( )
privateslot

ElementInfoWidget::firstActivated Slot activated when this widget is show. Set the focus to the first line edit provided by this widget.

Here is the caller graph for this function:

◆ infoPartWidgetForKey()

ElementInfoPartWidget * ElementInfoWidget::infoPartWidgetForKey ( const QString & key) const
private

ElementInfoWidget::infoPartWidgetForKey.

Parameters
key
Returns
the ElementInfoPartWidget with key key, if not found return nullptr;
Here is the caller graph for this function:

◆ predefinedKeys()

QStringList ElementInfoWidget::predefinedKeys ( ) const
private

ElementInfoWidget::predefinedKeys.

Returns
every key this widget already exposes a dedicated row for, whether through ElementInfoPartWidget (the ~40 ELMT_* keys) or one of the standalone checkboxes. Anything present in the element's informations but absent from this list is a user-defined custom property.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeCustomProperty

void ElementInfoWidget::removeCustomProperty ( CustomElementInfoPartWidget * widget)
privateslot

ElementInfoWidget::removeCustomProperty Remove a user-defined key/value row.

Parameters
widgetthe row to remove
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setElement()

void ElementInfoWidget::setElement ( Element * element)
overridevirtual

ElementInfoWidget::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 ElementInfoWidget::setLiveEdit ( bool live_edit)
overridevirtual

ElementInfoWidget::setLiveEdit.

Parameters
live_edittrue : enable the live edit mode, false disable
Returns
always true;

Reimplemented from PropertiesEditorWidget.

Here is the call graph for this function:

◆ title()

QString ElementInfoWidget::title ( ) const
inlineoverridevirtual

PropertiesEditorWidget::title.

Returns
the title of this editor

Reimplemented from PropertiesEditorWidget.

◆ updateUi()

void ElementInfoWidget::updateUi ( )
overridevirtual

ElementInfoWidget::updateUi fill information fetch in m_element_info to the corresponding line edit.

Reimplemented from PropertiesEditorWidget.

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

Member Data Documentation

◆ m_add_custom_property_btn

QPushButton* ElementInfoWidget::m_add_custom_property_btn = nullptr
private

◆ m_custom_eipw_list

QList<CustomElementInfoPartWidget *> ElementInfoWidget::m_custom_eipw_list
private

◆ m_eipw_list

QList<ElementInfoPartWidget *> ElementInfoWidget::m_eipw_list
private

◆ m_exclude_from_bom_cb

QCheckBox* ElementInfoWidget::m_exclude_from_bom_cb = nullptr
private

◆ m_first_activation

bool ElementInfoWidget::m_first_activation
private

◆ m_potential_isolating_cb

QCheckBox* ElementInfoWidget::m_potential_isolating_cb = nullptr
private

◆ m_ui_builded

bool ElementInfoWidget::m_ui_builded = false
private

◆ ui

Ui::ElementInfoWidget* ElementInfoWidget::ui
private

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