QElectroTech  0.70
Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
ElementInfoWidget Class Reference

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

#include <elementinfowidget.h>

Public Member Functions

 ElementInfoWidget (Element *elmt, QWidget *parent=nullptr)
 ElementInfoWidget::ElementInfoWidget Constructor. More...
 
 ~ElementInfoWidget () override
 ElementInfoWidget::~ElementInfoWidget Destructor. More...
 
void setElement (Element *element) override
 ElementInfoWidget::setElement Set to be the edited element. More...
 
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. More...
 
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;. More...
 
QString title () const override
 PropertiesEditorWidget::title. More...
 
bool setLiveEdit (bool live_edit) override
 ElementInfoWidget::setLiveEdit. More...
 
void updateUi () override
 ElementInfoWidget::updateUi fill information fetch in m_element_info to the corresponding line edit. More...
 
DiagramContext currentInfo () const
 ElementInfoWidget::currentInfo. 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 ()
 
bool isLiveEdit () const
 PropertiesEditorWidget::isLiveEdit. More...
 

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. More...
 
void enableLiveEdit () override
 ElementInfoWidget::enableLiveEdit Enable the live edit mode. More...
 
void disableLiveEdit () override
 ElementInfoWidget::disableLiveEdit disable the live edit mode. More...
 

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. More...
 
void elementInfoChange ()
 ElementInfoWidget::elementInfoChange This slot is called when m_element::elementInformation change. More...
 

Private Member Functions

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

Private Attributes

Ui::ElementInfoWidget * ui
 
QList< ElementInfoPartWidget * > m_eipw_list
 
bool m_first_activation
 

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.

Definition at line 38 of file elementinfowidget.h.

Constructor & Destructor Documentation

◆ ElementInfoWidget()

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

ElementInfoWidget::ElementInfoWidget Constructor.

Parameters
elmtelement to edit information
parentparent widget

Definition at line 32 of file elementinfowidget.cpp.

References buildInterface(), setElement(), and ui.

◆ ~ElementInfoWidget()

ElementInfoWidget::~ElementInfoWidget ( )
override

ElementInfoWidget::~ElementInfoWidget Destructor.

Definition at line 46 of file elementinfowidget.cpp.

References m_eipw_list, and ui.

Member Function Documentation

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

Definition at line 91 of file elementinfowidget.cpp.

References associatedUndo(), and AbstractElementPropertiesEditorWidget::m_element.

Referenced by disableLiveEdit(), and enableLiveEdit().

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

Definition at line 104 of file elementinfowidget.cpp.

References currentInfo(), and AbstractElementPropertiesEditorWidget::m_element.

Referenced by apply().

◆ buildInterface()

void ElementInfoWidget::buildInterface ( )
private

◆ currentInfo()

DiagramContext ElementInfoWidget::currentInfo ( ) const

ElementInfoWidget::currentInfo.

Returns
the info currently edited

Definition at line 230 of file elementinfowidget.cpp.

References DiagramContext::addValue(), and m_eipw_list.

Referenced by associatedUndo(), and elementInfoChange().

◆ disableLiveEdit()

void ElementInfoWidget::disableLiveEdit ( )
overrideprotectedvirtual

ElementInfoWidget::disableLiveEdit disable the live edit mode.

Reimplemented from PropertiesEditorWidget.

Definition at line 168 of file elementinfowidget.cpp.

References apply(), m_eipw_list, and ElementInfoPartWidget::textChanged().

Referenced by setLiveEdit(), and updateUi().

◆ elementInfoChange

void ElementInfoWidget::elementInfoChange ( )
privateslot

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

Definition at line 263 of file elementinfowidget.cpp.

References currentInfo(), AbstractElementPropertiesEditorWidget::m_element, and updateUi().

Referenced by setElement().

◆ enableLiveEdit()

void ElementInfoWidget::enableLiveEdit ( )
overrideprotectedvirtual

ElementInfoWidget::enableLiveEdit Enable the live edit mode.

Reimplemented from PropertiesEditorWidget.

Definition at line 158 of file elementinfowidget.cpp.

References apply(), m_eipw_list, and ElementInfoPartWidget::textChanged().

Referenced by setLiveEdit(), and updateUi().

◆ 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

Definition at line 141 of file elementinfowidget.cpp.

References firstActivated(), and m_first_activation.

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

Definition at line 255 of file elementinfowidget.cpp.

References m_eipw_list.

Referenced by event().

◆ infoPartWidgetForKey()

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

ElementInfoWidget::infoPartWidgetForKey.

Parameters
key
Returns
the ElementInfoPartWidget with key , if not found return nullptr;

Definition at line 194 of file elementinfowidget.cpp.

References ElementInfoPartWidget::key(), and m_eipw_list.

Referenced by setElement().

◆ setElement()

void ElementInfoWidget::setElement ( Element element)
overridevirtual

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

Definition at line 120 of file elementinfowidget.cpp.

References disableLiveEdit(), enableLiveEdit(), and PropertiesEditorWidget::m_live_edit.

◆ title()

QString ElementInfoWidget::title ( ) const
inlineoverridevirtual

PropertiesEditorWidget::title.

Returns
the title of this editor

Reimplemented from PropertiesEditorWidget.

Definition at line 50 of file elementinfowidget.h.

References QET::Icons::tr.

◆ updateUi()

void ElementInfoWidget::updateUi ( )
overridevirtual

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

Reimplemented from PropertiesEditorWidget.

Definition at line 210 of file elementinfowidget.cpp.

References disableLiveEdit(), enableLiveEdit(), m_eipw_list, AbstractElementPropertiesEditorWidget::m_element, and PropertiesEditorWidget::m_live_edit.

Referenced by elementInfoChange(), and setElement().

Member Data Documentation

◆ m_eipw_list

QList<ElementInfoPartWidget *> ElementInfoWidget::m_eipw_list
private

◆ m_first_activation

bool ElementInfoWidget::m_first_activation
private

Definition at line 73 of file elementinfowidget.h.

Referenced by event().

◆ ui

Ui::ElementInfoWidget* ElementInfoWidget::ui
private

Definition at line 71 of file elementinfowidget.h.

Referenced by buildInterface(), ElementInfoWidget(), and ~ElementInfoWidget().


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