#include <DataWidget.h>
Abstract Interface of a qwidget which allows to edit a data. More...
Abstract Interface of a qwidget which allows to edit a data.
Classes | |
struct | CreatorArgument |
Protected Attributes | |
core::objectmodel::BaseData * | baseData |
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 | |
DataWidget (QWidget *parent, const char *name, MyData *d) | |
~DataWidget () override | |
virtual void | setData (MyData *d) |
const core::objectmodel::BaseData * | getBaseData () const |
BaseData pointer accessor function. More... | |
core::objectmodel::BaseData * | getBaseData () |
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 bool | createWidgets ()=0 |
virtual void | setDataReadOnly (bool readOnly)=0 |
This method is called after createWidgets to configure whether the created widgets should be read-only. More... | |
virtual unsigned int | sizeWidget () |
Helper method to give a size. More... | |
virtual unsigned int | numColumnWidget () |
Helper method for column. More... | |
Static Public Member Functions | |
template<class T > | |
static T * | create (T *, const CreatorArgument &arg) |
static DataWidget * | CreateDataWidget (const DataWidget::CreatorArgument &dwarg) |
Protected Member Functions | |
virtual void | readFromData ()=0 |
The implementation of this method tells how the widget reads the value of the data. More... | |
virtual void | writeToData ()=0 |
Signals | |
void | WidgetDirty (bool) |
void | DataOwnerDirty (bool) |
void | dataValueChanged (QString dataValueString) |
Public Slots | |
void | updateDataValue () |
void | updateWidgetValue () |
void | setWidgetDirty (bool b=true) |
void | fillFromData () |
|
protected |
|
protected |
|
protected |
|
protected |
tell if DataWidget has been filled from Data true by default
|
protected |
bool to warn action is needed to fill Data, false by default
|
override |
|
inlinestatic |
|
static |
|
pure virtual |
The implementation of this method holds the widget creation and the signal / slot connections.
Implemented in sofa::gui::qt::QDataSimpleEdit, sofa::gui::qt::RadioDataWidget, sofa::gui::qt::SimpleDataWidget< T, Container >, sofa::gui::qt::SimpleDataWidget< T, graph_data_widget_container< T > >, sofa::gui::qt::SimpleDataWidget< T, table_data_widget_container< T, TABLE_NORMAL > >, sofa::gui::qt::rgbacolordatawidget_h::RGBAColorDataWidget, sofa::gui::qt::QPoissonRatioWidget, sofa::gui::qt::materialdatawidget_h::VectorMaterialDataWidget, sofa::gui::qt::materialdatawidget_h::MaterialDataWidget, sofa::gui::qt::GraphDataWidget_Linear< T >, sofa::gui::qt::GenericDataWidget< DATA, WIDGET >, sofa::gui::qt::DisplayFlagsDataWidget, and sofa::gui::qt::DataFileNameWidget.
|
signal |
Currently this signal is used to reflect the changes of the component name in the sofaListview.
|
signal |
|
slot |
slot to be called if DataWidget has not been filled at constructor and need to be filled at first call. Will turn toFill to true only if isFilled == false
|
inline |
|
inline |
BaseData pointer accessor function.
|
inline |
|
inline |
return if DataWidget as been filled
|
inlinevirtual |
Helper method for column.
Reimplemented in sofa::gui::qt::QDataSimpleEdit, sofa::gui::qt::TableDataWidget< T, FLAGS >, sofa::gui::qt::SimpleDataWidget< T, Container >, sofa::gui::qt::SimpleDataWidget< T, graph_data_widget_container< T > >, sofa::gui::qt::SimpleDataWidget< T, table_data_widget_container< T, TABLE_NORMAL > >, sofa::gui::qt::rgbacolordatawidget_h::RGBAColorDataWidget, sofa::gui::qt::materialdatawidget_h::VectorMaterialDataWidget, sofa::gui::qt::materialdatawidget_h::MaterialDataWidget, sofa::gui::qt::GraphDataWidget< T >, and sofa::gui::qt::DisplayFlagsDataWidget.
|
protectedpure virtual |
The implementation of this method tells how the widget reads the value of the data.
Implemented in sofa::gui::qt::QDataSimpleEdit, sofa::gui::qt::RadioDataWidget, sofa::gui::qt::SimpleDataWidget< T, Container >, sofa::gui::qt::SimpleDataWidget< T, graph_data_widget_container< T > >, sofa::gui::qt::SimpleDataWidget< T, table_data_widget_container< T, TABLE_NORMAL > >, sofa::gui::qt::rgbacolordatawidget_h::RGBAColorDataWidget, sofa::gui::qt::QPoissonRatioWidget, sofa::gui::qt::materialdatawidget_h::VectorMaterialDataWidget, sofa::gui::qt::materialdatawidget_h::MaterialDataWidget, sofa::gui::qt::GenericDataWidget< DATA, WIDGET >, sofa::gui::qt::DisplayFlagsDataWidget, and sofa::gui::qt::DataFileNameWidget.
|
virtual |
|
pure virtual |
This method is called after createWidgets to configure whether the created widgets should be read-only.
Implemented in sofa::gui::qt::QDataSimpleEdit, sofa::gui::qt::RadioDataWidget, sofa::gui::qt::SimpleDataWidget< T, Container >, sofa::gui::qt::SimpleDataWidget< T, graph_data_widget_container< T > >, sofa::gui::qt::SimpleDataWidget< T, table_data_widget_container< T, TABLE_NORMAL > >, sofa::gui::qt::rgbacolordatawidget_h::RGBAColorDataWidget, sofa::gui::qt::QPoissonRatioWidget, sofa::gui::qt::materialdatawidget_h::VectorMaterialDataWidget, sofa::gui::qt::materialdatawidget_h::MaterialDataWidget, sofa::gui::qt::GenericDataWidget< DATA, WIDGET >, sofa::gui::qt::DisplayFlagsDataWidget, and sofa::gui::qt::DataFileNameWidget.
|
inline |
method to warn if Data has not been filled at constructor.
|
slot |
You call this slot anytime you want to specify that the widget value is out of sync with the underlying data value.
|
inlinevirtual |
Helper method to give a size.
Reimplemented in sofa::gui::qt::QDataSimpleEdit, sofa::gui::qt::TableDataWidget< T, FLAGS >, sofa::gui::qt::GraphDataWidget< T >, and sofa::gui::qt::DisplayFlagsDataWidget.
|
slot |
Checks that widget has been edited emit DataOwnerDirty in case the name field has been modified
void sofa::gui::qt::DataWidget::updateVisibility | ( | ) |
|
slot |
First checks that the widget is not currently being edited checks that the data has changed since the last time the widget has read the data value. ultimately read the data value.
|
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 data value.
|
protectedpure virtual |
The implementation of this methods needs to tell how the widget can write its value in the data
Implemented in sofa::gui::qt::QDataSimpleEdit, sofa::gui::qt::RadioDataWidget, sofa::gui::qt::SimpleDataWidget< T, Container >, sofa::gui::qt::SimpleDataWidget< T, graph_data_widget_container< T > >, sofa::gui::qt::SimpleDataWidget< T, table_data_widget_container< T, TABLE_NORMAL > >, sofa::gui::qt::rgbacolordatawidget_h::RGBAColorDataWidget, sofa::gui::qt::QPoissonRatioWidget, sofa::gui::qt::materialdatawidget_h::VectorMaterialDataWidget, sofa::gui::qt::materialdatawidget_h::MaterialDataWidget, sofa::gui::qt::GenericDataWidget< DATA, WIDGET >, sofa::gui::qt::DisplayFlagsDataWidget, and sofa::gui::qt::DataFileNameWidget.