SOFA API  ca665544
Open source framework for multi-physics simuation
sofa::gui::qt::SimpleDataWidget< T, Container > Class Template Reference

#include <SimpleDataWidget.h>

This class manages the GUI of a BaseData, using the corresponding instance of data_widget_container. More...

Inheritance diagram for sofa::gui::qt::SimpleDataWidget< T, Container >:

Detailed Description

template<class T, class Container = data_widget_container<T>>
class sofa::gui::qt::SimpleDataWidget< T, Container >

This class manages the GUI of a BaseData, using the corresponding instance of data_widget_container.

Protected Attributes

Container container
 
- Protected Attributes inherited from sofa::gui::qt::TDataWidget< T >
MyTDataTdata { nullptr }
 
- Protected Attributes inherited from sofa::gui::qt::DataWidget
core::objectmodel::BaseDatabaseData
 
bool dirty
 
int counter
 
bool m_isFilled
 tell if DataWidget has been filled from Data true by default More...
 
bool m_toFill
 bool to warn action is needed to fill Data, false by default More...
 

Public Member Functions

 SimpleDataWidget (QWidget *parent, const char *name, MyTData *d)
 
virtual bool createWidgets ()
 
virtual void setDataReadOnly (bool readOnly)
 This method is called after createWidgets to configure whether the created widgets should be read-only. More...
 
virtual void readFromData ()
 The implementation of this method tells how the widget reads the value of the data. More...
 
virtual void setReadOnly (bool readOnly)
 
virtual void writeToData ()
 
virtual unsigned int numColumnWidget ()
 Helper method for column. More...
 
- Public Member Functions inherited from sofa::gui::qt::TDataWidget< T >
 TDataWidget (QWidget *parent, const char *name, core::objectmodel::BaseData *d, const T *object)
 
 TDataWidget (QWidget *parent, const char *name, MyTData *d)
 
sofa::core::objectmodel::Data< T > * getData ()
 
const sofa::core::objectmodel::Data< T > * getData () const
 
virtual void setData (MyTData *d)
 
virtual void setData (MyData *d)
 
- Public Member Functions inherited from sofa::gui::qt::DataWidget
 DataWidget (QWidget *parent, const char *name, MyData *d)
 
 ~DataWidget () override
 
virtual void setData (MyData *d)
 
const core::objectmodel::BaseDatagetBaseData () const
 BaseData pointer accessor function. More...
 
core::objectmodel::BaseDatagetBaseData ()
 
void updateVisibility ()
 
bool isDirty ()
 
bool isFilled ()
 return if DataWidget as been filled More...
 
void setFilled (bool value)
 method to warn if Data has not been filled at constructor. More...
 
virtual unsigned int sizeWidget ()
 Helper method to give a size. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from sofa::gui::qt::TDataWidget< T >
template<class RealObject >
static RealObject * create (RealObject *, CreatorArgument &arg)
 
- Static Public Member Functions inherited from sofa::gui::qt::DataWidget
template<class T >
static T * create (T *, const CreatorArgument &arg)
 
static DataWidgetCreateDataWidget (const DataWidget::CreatorArgument &dwarg)
 
- Signals inherited from sofa::gui::qt::DataWidget
void WidgetDirty (bool)
 
void DataOwnerDirty (bool)
 
void dataValueChanged (QString dataValueString)
 
- Public Slots inherited from sofa::gui::qt::DataWidget
void updateDataValue ()
 
void updateWidgetValue ()
 
void setWidgetDirty (bool b=true)
 
void fillFromData ()
 

Attribute details

◆ container

template<class T , class Container = data_widget_container<T>>
Container sofa::gui::qt::SimpleDataWidget< T, Container >::container
protected

Constructor details

◆ SimpleDataWidget()

template<class T , class Container = data_widget_container<T>>
sofa::gui::qt::SimpleDataWidget< T, Container >::SimpleDataWidget ( QWidget parent,
const char name,
MyTData d 
)
inline

Function details

◆ createWidgets()

template<class T , class Container = data_widget_container<T>>
virtual bool sofa::gui::qt::SimpleDataWidget< T, Container >::createWidgets ( )
inlinevirtual

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

Implements sofa::gui::qt::DataWidget.

Reimplemented in sofa::gui::qt::GraphDataWidget_Linear< T >.

◆ numColumnWidget()

template<class T , class Container = data_widget_container<T>>
virtual unsigned int sofa::gui::qt::SimpleDataWidget< T, Container >::numColumnWidget ( )
inlinevirtual

Helper method for column.

Reimplemented from sofa::gui::qt::DataWidget.

Reimplemented in sofa::gui::qt::TableDataWidget< T, FLAGS >, and sofa::gui::qt::GraphDataWidget< T >.

◆ readFromData()

template<class T , class Container = data_widget_container<T>>
virtual void sofa::gui::qt::SimpleDataWidget< T, Container >::readFromData ( )
inlinevirtual

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

Implements sofa::gui::qt::DataWidget.

◆ setDataReadOnly()

template<class T , class Container = data_widget_container<T>>
virtual void sofa::gui::qt::SimpleDataWidget< T, Container >::setDataReadOnly ( bool  readOnly)
inlinevirtual

This method is called after createWidgets to configure whether the created widgets should be read-only.

Implements sofa::gui::qt::DataWidget.

◆ setReadOnly()

template<class T , class Container = data_widget_container<T>>
virtual void sofa::gui::qt::SimpleDataWidget< T, Container >::setReadOnly ( bool  readOnly)
inlinevirtual

◆ writeToData()

template<class T , class Container = data_widget_container<T>>
virtual void sofa::gui::qt::SimpleDataWidget< T, Container >::writeToData ( )
inlinevirtual

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

Implements sofa::gui::qt::DataWidget.