Computer Assisted Medical Intervention Tool Kit version 6.0
 
Loading...
Searching...
No Matches
TextFieldEditor Class Reference

FieldEditor for long/multiline string. More...

#include <TextFieldEditor.h>

+ Inheritance diagram for TextFieldEditor:
+ Collaboration diagram for TextFieldEditor:

Public Slots

void valueChangedInTextEdit ()
 called when the text has changed (get the plain text string and inform the presenter of the change)
 

Public Member Functions

virtual QWidget * getWidget () override
 Build a QTextEdit and sets syntax highlighting according to the optionally given language (.
 
void setLanguage (const QString &language)
 set the language for the text field Supported languages are: json, cpp and cmake
 
void setPlaceHolderText (const QString &placeHolderText)
 set the displayed text when the field value is empty
 
 TextFieldEditor (CamiTKExtensionModelPresenter *presenter, VariantDataModel &dataModel, const QString &name="", const QString &description="")
 Constructor.
 
- Public Member Functions inherited from FieldEditor
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,.
 
void setEnabled (bool isEnabled)
 Is the widget and labels currently enabled.
 
virtual ~FieldEditor ()
 Destructor (delete myWidget)
 

Additional Inherited Members

- Signals inherited from FieldEditor
void valueChanged (VariantDataModel &changedDataModel)
 emitted when the edited value has changed (useful to synchronize other field editor depending of this editor current value)
 
- Protected Slots inherited from FieldEditor
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 inherited from FieldEditor
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

FieldEditor for long/multiline string.

Provides a widget to edit a string in a text area with (optional) language syntax highlighting

Currently supported languages are:

  • JSON
  • C++
  • CMake

Constructor & Destructor Documentation

◆ TextFieldEditor()

TextFieldEditor::TextFieldEditor ( CamiTKExtensionModelPresenter presenter,
VariantDataModel dataModel,
const QString &  name = "",
const QString &  description = "" 
)

Constructor.

Member Function Documentation

◆ getWidget()

QWidget * TextFieldEditor::getWidget ( )
overridevirtual

Build a QTextEdit and sets syntax highlighting according to the optionally given language (.

See also
setLanguage)

Implements FieldEditor.

References FieldEditor::dataModel, FieldEditor::description, FieldEditor::myWidget, and valueChangedInTextEdit().

+ Here is the call graph for this function:

◆ setLanguage()

void TextFieldEditor::setLanguage ( const QString &  language)

set the language for the text field Supported languages are: json, cpp and cmake

Referenced by CppActionTabPresenter::CppActionTabPresenter(), and CppExtensionTabPresenter::CppExtensionTabPresenter().

+ Here is the caller graph for this function:

◆ setPlaceHolderText()

void TextFieldEditor::setPlaceHolderText ( const QString &  placeHolderText)

set the displayed text when the field value is empty

◆ valueChangedInTextEdit

void TextFieldEditor::valueChangedInTextEdit ( )
slot

called when the text has changed (get the plain text string and inform the presenter of the change)

References FieldEditor::dataModel, CamiTKExtensionModelPresenter::modelUpdated(), FieldEditor::myWidget, and FieldEditor::presenter.

Referenced by getWidget().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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