Abstract class for field editor. More...
#include <FieldEditor.h>
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 dataModel, description, myGridLayout, myWidget, name, presenter, and rowLabel.
Referenced by CamiTKPropertyFieldEditor::addToGrid(), CamiTKPropertyFieldEditor::CamiTKPropertyFieldEditor(), ExpandableFieldEditor::ExpandableFieldEditor(), FileFieldEditor::FileFieldEditor(), ListFieldEditor::ListFieldEditor(), QtPropertyFieldEditor::QtPropertyFieldEditor(), and TextFieldEditor::TextFieldEditor().
|
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().
|
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, myGridLayout, myWidget, name, presenter, and rowLabel.
Referenced by appendRowTo(), and CamiTKPropertyFieldEditor::deleteButtonClicked().
|
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(), and appendRowTo().
| 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().
|
protected |
The edited data model (part of the presenter's full model).
Referenced by CamiTKPropertyFieldEditor::buildTypeDependentEditors(), CamiTKPropertyFieldEditor::CamiTKPropertyFieldEditor(), CamiTKPropertyListFieldEditor::CamiTKPropertyListFieldEditor(), deleteButtonClicked(), QtPropertyFieldEditor::editTextChanged(), ExpandableFieldEditor::ExpandableFieldEditor(), FieldEditor(), FileFieldEditor::FileFieldEditor(), CamiTKPropertyFieldEditor::getWidget(), ListFieldEditor::getWidget(), QtPropertyFieldEditor::getWidget(), TextFieldEditor::getWidget(), ListFieldEditor::ListFieldEditor(), CamiTKPropertyListFieldEditor::plusButtonClicked(), QtPropertyFieldEditor::QtPropertyFieldEditor(), TextFieldEditor::TextFieldEditor(), ListFieldEditor::updateModel(), QtPropertyFieldEditor::valueChangedInPropertyField(), and TextFieldEditor::valueChangedInTextEdit().
|
protected |
Description (displayed as tool tip / what's that).
Referenced by ExpandableFieldEditor::appendRowTo(), appendRowTo(), CamiTKPropertyFieldEditor::buildTypeDependentEditors(), CamiTKPropertyFieldEditor::CamiTKPropertyFieldEditor(), FieldEditor(), FileFieldEditor::FileFieldEditor(), ListFieldEditor::getWidget(), QtPropertyFieldEditor::getWidget(), TextFieldEditor::getWidget(), ListFieldEditor::ListFieldEditor(), QtPropertyFieldEditor::QtPropertyFieldEditor(), and TextFieldEditor::TextFieldEditor().
|
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(), CamiTKPropertyFieldEditor::CamiTKPropertyFieldEditor(), deleteButtonClicked(), FieldEditor(), FileFieldEditor::FileFieldEditor(), ListFieldEditor::getWidget(), ListFieldEditor::ListFieldEditor(), QtPropertyFieldEditor::QtPropertyFieldEditor(), TextFieldEditor::TextFieldEditor(), and QtPropertyFieldEditor::valueChangedInPropertyField().
|
protected |
The presenter that contains the full VariantDataModel.
Referenced by CamiTKPropertyFieldEditor::buildTypeDependentEditors(), CamiTKPropertyFieldEditor::CamiTKPropertyFieldEditor(), CamiTKPropertyListFieldEditor::CamiTKPropertyListFieldEditor(), deleteButtonClicked(), QtPropertyFieldEditor::editTextChanged(), ExpandableFieldEditor::ExpandableFieldEditor(), FieldEditor(), FileFieldEditor::FileFieldEditor(), CamiTKPropertyFieldEditor::getWidget(), ListFieldEditor::ListFieldEditor(), CamiTKPropertyListFieldEditor::plusButtonClicked(), QtPropertyFieldEditor::QtPropertyFieldEditor(), TextFieldEditor::TextFieldEditor(), 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().