SOFA API  99934cbc
Open source framework for multi-physics simuation
sofa::gui::qt::LinkWidget Class Referenceabstract

#include <LinkWidget.h>

Abstract Interface of a qwidget which allows to edit a link. More...

Inheritance diagram for sofa::gui::qt::LinkWidget:

Detailed Description

Abstract Interface of a qwidget which allows to edit a link.

Classes

struct  CreatorArgument
 

Protected Attributes

core::objectmodel::BaseLinkbaseLink
 
bool dirty
 
int counter
 

Public Member Functions

 LinkWidget (QWidget *parent, const char *, MyLink *l)
 
 ~LinkWidget () override
 
virtual void setLink (MyLink *d)
 
const core::objectmodel::BaseLinkgetBaseLink () const
 BaseLink pointer accessor function. More...
 
core::objectmodel::BaseLinkgetBaseLink ()
 
void updateVisibility ()
 
bool isDirty ()
 
virtual bool createWidgets ()=0
 
virtual unsigned int sizeWidget ()
 Helper method to give a size. More...
 
virtual unsigned int numColumnWidget ()
 Helper method for colum. More...
 

Static Public Member Functions

static LinkWidgetCreateLinkWidget (const LinkWidget::CreatorArgument &dwarg)
 

Protected Member Functions

virtual void readFromLink ()=0
 The implementation of this method tells how the widget reads the value of the link. More...
 
virtual void writeToLink ()=0
 

Signals

void WidgetDirty (bool)
 
void LinkOwnerDirty (bool)
 
void LinkBeingChanged ()
 

Public Slots

void updateLinkValue ()
 
void updateWidgetValue ()
 
void setWidgetDirty ()
 
void setWidgetDirty (bool b)
 

Attribute details

core::objectmodel::BaseLink* sofa::gui::qt::LinkWidget::baseLink
protected
int sofa::gui::qt::LinkWidget::counter
protected
bool sofa::gui::qt::LinkWidget::dirty
protected

Constructor details

sofa::gui::qt::LinkWidget::LinkWidget ( QWidget parent,
const char *  ,
MyLink l 
)
inline
sofa::gui::qt::LinkWidget::~LinkWidget ( )
inlineoverride

Function details

LinkWidget * sofa::gui::qt::LinkWidget::CreateLinkWidget ( const LinkWidget::CreatorArgument dwarg)
static
virtual bool sofa::gui::qt::LinkWidget::createWidgets ( )
pure virtual

The implementation of this method holds the widget creation and the signal / slot connections.

Implemented in sofa::gui::qt::QLinkSimpleEdit.

const core::objectmodel::BaseLink* sofa::gui::qt::LinkWidget::getBaseLink ( ) const
inline

BaseLink pointer accessor function.

core::objectmodel::BaseLink* sofa::gui::qt::LinkWidget::getBaseLink ( )
inline
bool sofa::gui::qt::LinkWidget::isDirty ( )
inline
void sofa::gui::qt::LinkWidget::LinkBeingChanged ( )
signal
void sofa::gui::qt::LinkWidget::LinkOwnerDirty ( bool  )
signal

Currently this signal is used to reflect the changes of the component name in the sofaListview.

virtual unsigned int sofa::gui::qt::LinkWidget::numColumnWidget ( )
inlinevirtual

Helper method for colum.

Reimplemented in sofa::gui::qt::QLinkSimpleEdit.

virtual void sofa::gui::qt::LinkWidget::readFromLink ( )
protectedpure virtual

The implementation of this method tells how the widget reads the value of the link.

Implemented in sofa::gui::qt::QLinkSimpleEdit.

virtual void sofa::gui::qt::LinkWidget::setLink ( MyLink d)
inlinevirtual
void sofa::gui::qt::LinkWidget::setWidgetDirty ( )
inlineslot

You call this slot anytime you want to specify that the widget value is out of sync with the underlying link value.

void sofa::gui::qt::LinkWidget::setWidgetDirty ( bool  b)
inlineslot
virtual unsigned int sofa::gui::qt::LinkWidget::sizeWidget ( )
inlinevirtual

Helper method to give a size.

Reimplemented in sofa::gui::qt::QLinkSimpleEdit.

void sofa::gui::qt::LinkWidget::updateLinkValue ( )
inlineslot

Checks that widget has been edited emit LinkOwnerDirty in case the name field has been modified

void sofa::gui::qt::LinkWidget::updateVisibility ( )
inline
void sofa::gui::qt::LinkWidget::updateWidgetValue ( )
inlineslot

First checks that the widget is not currently being edited checks that the link has changed since the last time the widget has read the link value. ultimately read the link value.

void sofa::gui::qt::LinkWidget::WidgetDirty ( bool  )
signal

Emitted each time setWidgetDirty is called. You can also emit it if you want to tell the widget value is out of sync with the underlying link value.

virtual void sofa::gui::qt::LinkWidget::writeToLink ( )
protectedpure virtual

The implementation of this methods needs to tell how the widget can write its value in the link

Implemented in sofa::gui::qt::QLinkSimpleEdit.