Computer Assisted Medical Intervention Tool Kit version 6.0
 
Loading...
Searching...
No Matches
FieldEditor Class Referenceabstract

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

VariantDataModeldataModel
 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)
 
CamiTKExtensionModelPresenterpresenter
 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)
 

Detailed Description

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:

  • a name (displayed as the label)
  • a description (displayed as tooltip/whatsthat)

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...).

Constructor & Destructor Documentation

◆ FieldEditor()

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,.

See also
appendRowTo).

References description, myGridLayout, myWidget, name, presenter, and rowLabel.

◆ ~FieldEditor()

FieldEditor::~FieldEditor ( )
virtual

Destructor (delete myWidget)

References myWidget.

Member Function Documentation

◆ appendRowTo()

void FieldEditor::appendRowTo ( QGridLayout *  layout,
bool  canBeDeleted = false 
)
virtual

Adds a row at the end of the given layout with two columns:

  • first column contains the name of the field
  • second column contains the widget If hasDeleteButton is true, an extra delete button is added next to the label. When the delete button is clicked, the entire added row will be deleted removing the edited data model.

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:

◆ deleteButtonClicked

void FieldEditor::deleteButtonClicked ( )
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:

◆ getWidget()

virtual QWidget * FieldEditor::getWidget ( )
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:

◆ setEnabled()

void FieldEditor::setEnabled ( bool  isEnabled)

Is the widget and labels currently enabled.

References myWidget, and rowLabel.

◆ valueChanged

void FieldEditor::valueChanged ( VariantDataModel changedDataModel)
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:

Member Data Documentation

◆ dataModel

◆ description

◆ myGridLayout

QGridLayout* FieldEditor::myGridLayout
protected

◆ myWidget

◆ name

QString FieldEditor::name
protected

◆ presenter

◆ rowLabel

QLabel* FieldEditor::rowLabel
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().


The documentation for this class was generated from the following files: