SOFA API  1df67014
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

◆ baseLink

core::objectmodel::BaseLink* sofa::gui::qt::LinkWidget::baseLink
protected

◆ counter

int sofa::gui::qt::LinkWidget::counter
protected

◆ dirty

bool sofa::gui::qt::LinkWidget::dirty
protected

Constructor details

◆ LinkWidget()

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

◆ ~LinkWidget()

sofa::gui::qt::LinkWidget::~LinkWidget ( )
inlineoverride

Function details

◆ CreateLinkWidget()

LinkWidget * sofa::gui::qt::LinkWidget::CreateLinkWidget ( const LinkWidget::CreatorArgument dwarg)
static

◆ createWidgets()

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.

◆ getBaseLink() [1/2]

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

◆ getBaseLink() [2/2]

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

BaseLink pointer accessor function.

◆ isDirty()

bool sofa::gui::qt::LinkWidget::isDirty ( )
inline

◆ LinkBeingChanged

void sofa::gui::qt::LinkWidget::LinkBeingChanged ( )
signal

◆ LinkOwnerDirty

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

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

◆ numColumnWidget()

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

Helper method for colum.

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

◆ readFromLink()

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.

◆ setLink()

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

◆ setWidgetDirty [1/2]

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.

◆ setWidgetDirty [2/2]

void sofa::gui::qt::LinkWidget::setWidgetDirty ( bool  b)
inlineslot

◆ sizeWidget()

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

Helper method to give a size.

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

◆ updateLinkValue

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

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

◆ updateVisibility()

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

◆ updateWidgetValue

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.

◆ WidgetDirty

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.

◆ writeToLink()

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.