Abstract class for field editor. More...
#include <FieldEditor.h>
Inheritance diagram for FieldEditor:
Collaboration diagram for FieldEditor:Signals | |
| void | valueChanged (VariantDataModel &changedDataModel) |
| emitted when the edited value has changed (useful to synchronize other field editor depending of this editor current value) | |
Public Member Functions | |
| virtual void | appendRowTo (QGridLayout *layout, bool canBeDeleted=false) |
| Adds a row at the end of the given layout with two columns: | |
| FieldEditor (CamiTKExtensionModelPresenter *presenter, VariantDataModel &dataModel, const QString &name="", const QString &description="") | |
| Constructor Creates a field for the given data model inside the given presenter A name and description can be associated with the field (it will be used when the field is added to a gridlayout,. | |
| virtual QWidget * | getWidget ()=0 |
| Creates the editor widget (must be implemented in inheriting classes) | |
| void | setEnabled (bool isEnabled) |
| Is the widget and labels currently enabled. | |
| virtual | ~FieldEditor () |
| Destructor (delete myWidget) | |
Protected Slots | |
| virtual void | deleteButtonClicked () |
| Called when the (optional) delete button is called This will make user the user knows what she/he does If deletion is confirmed by the user, remove the data model. | |
Protected Attributes | |
| VariantDataModel & | dataModel |
| The edited data model (part of the presenter's full model) | |
| QString | description |
| Description (displayed as tool tip / what's that) | |
| QGridLayout * | myGridLayout |
| where the widget is added | |
| QWidget * | myWidget |
| The created widget (inheriting must use this to create their widgets) | |
| QString | name |
| Name of the field (displayed as a label) | |
| CamiTKExtensionModelPresenter * | presenter |
| The presenter that contains the full VariantDataModel. | |
| QLabel * | rowLabel |
| the row label widget (that contains the name of the row) the label text can be modified (see CamiTKPropertyFieldEditor.h for an example) | |
Abstract class for field editor.
A field editor should be included in a CamiTKExtensionModelPresenter and which role is to provide a GUI for a VariantDataModel (part of the CamiTKExtensionModel full model).
It has:
As an editor for one field, it should be appended to a gridlayout that contains all the other edited fields.
It must be subclassed to provide a specific widget to edit specific types of value (atomic value, textfield...).
| FieldEditor::FieldEditor | ( | CamiTKExtensionModelPresenter * | presenter, |
| VariantDataModel & | dataModel, | ||
| const QString & | name = "", |
||
| const QString & | description = "" |
||
| ) |
Constructor Creates a field for the given data model inside the given presenter A name and description can be associated with the field (it will be used when the field is added to a gridlayout,.
References description, myGridLayout, myWidget, name, presenter, and rowLabel.
|
virtual |
Destructor (delete myWidget)
References myWidget.
|
virtual |
Adds a row at the end of the given layout with two columns:
Reimplemented in CamiTKPropertyFieldEditor.
References deleteButtonClicked(), description, getWidget(), myGridLayout, name, and rowLabel.
Referenced by ActionTabPresenter::ActionTabPresenter(), CamiTKPropertyFieldEditor::appendRowTo(), CppActionTabPresenter::CppActionTabPresenter(), CppExtensionTabPresenter::CppExtensionTabPresenter(), ExtensionTabPresenter::ExtensionTabPresenter(), PythonActionTabPresenter::PythonActionTabPresenter(), and PythonExtensionTabPresenter::PythonExtensionTabPresenter().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protectedvirtualslot |
Called when the (optional) delete button is called This will make user the user knows what she/he does If deletion is confirmed by the user, remove the data model.
References dataModel, CamiTKExtensionModelPresenter::emitShowMessage(), CamiTKExtensionModelPresenter::modelUpdated(), myGridLayout, myWidget, name, presenter, VariantDataModel::remove(), and rowLabel.
Referenced by appendRowTo(), and CamiTKPropertyFieldEditor::deleteButtonClicked().
Here is the call graph for this function:
Here is the caller graph for this function:
|
pure virtual |
Creates the editor widget (must be implemented in inheriting classes)
Implemented in CamiTKPropertyFieldEditor, CamiTKPropertyListFieldEditor, ExpandableFieldEditor, FileFieldEditor, ListFieldEditor, QtPropertyFieldEditor, and TextFieldEditor.
Referenced by CamiTKPropertyFieldEditor::addToGrid(), appendRowTo(), and CamiTKPropertyFieldEditor::buildTypeDependentEditors().
Here is the caller graph for this function:| void FieldEditor::setEnabled | ( | bool | isEnabled | ) |
|
signal |
emitted when the edited value has changed (useful to synchronize other field editor depending of this editor current value)
Referenced by CamiTKPropertyFieldEditor::buildTypeDependentEditors(), QtPropertyFieldEditor::editTextChanged(), CamiTKPropertyFieldEditor::getWidget(), and QtPropertyFieldEditor::valueChangedInPropertyField().
Here is the caller graph for this function:
|
protected |
The edited data model (part of the presenter's full model)
Referenced by CamiTKPropertyFieldEditor::buildTypeDependentEditors(), deleteButtonClicked(), QtPropertyFieldEditor::editTextChanged(), CamiTKPropertyFieldEditor::getWidget(), ListFieldEditor::getWidget(), QtPropertyFieldEditor::getWidget(), TextFieldEditor::getWidget(), CamiTKPropertyListFieldEditor::plusButtonClicked(), QtPropertyFieldEditor::QtPropertyFieldEditor(), ListFieldEditor::updateModel(), QtPropertyFieldEditor::valueChangedInPropertyField(), and TextFieldEditor::valueChangedInTextEdit().
|
protected |
Description (displayed as tool tip / what's that)
Referenced by ExpandableFieldEditor::appendRowTo(), appendRowTo(), CamiTKPropertyFieldEditor::buildTypeDependentEditors(), FieldEditor(), ListFieldEditor::getWidget(), QtPropertyFieldEditor::getWidget(), and TextFieldEditor::getWidget().
|
protected |
where the widget is added
Referenced by ExpandableFieldEditor::appendRowTo(), appendRowTo(), deleteButtonClicked(), and FieldEditor().
|
protected |
The created widget (inheriting must use this to create their widgets)
Referenced by QtPropertyFieldEditor::currentIndexChanged(), deleteButtonClicked(), ExpandableFieldEditor::expandButtonClicked(), FieldEditor(), CamiTKPropertyFieldEditor::getWidget(), CamiTKPropertyListFieldEditor::getWidget(), ExpandableFieldEditor::getWidget(), FileFieldEditor::getWidget(), ListFieldEditor::getWidget(), QtPropertyFieldEditor::getWidget(), TextFieldEditor::getWidget(), setEnabled(), QtPropertyFieldEditor::valueChangedInPropertyField(), TextFieldEditor::valueChangedInTextEdit(), and ~FieldEditor().
|
protected |
Name of the field (displayed as a label)
Referenced by appendRowTo(), deleteButtonClicked(), FieldEditor(), ListFieldEditor::getWidget(), and QtPropertyFieldEditor::valueChangedInPropertyField().
|
protected |
The presenter that contains the full VariantDataModel.
Referenced by CamiTKPropertyFieldEditor::buildTypeDependentEditors(), deleteButtonClicked(), QtPropertyFieldEditor::editTextChanged(), FieldEditor(), CamiTKPropertyFieldEditor::getWidget(), CamiTKPropertyListFieldEditor::plusButtonClicked(), ListFieldEditor::updateModel(), QtPropertyFieldEditor::valueChangedInPropertyField(), and TextFieldEditor::valueChangedInTextEdit().
|
protected |
the row label widget (that contains the name of the row) the label text can be modified (see CamiTKPropertyFieldEditor.h for an example)
Referenced by CamiTKPropertyFieldEditor::appendRowTo(), appendRowTo(), deleteButtonClicked(), FieldEditor(), and setEnabled().