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

An expandable field editor is encapsulating a widget that can be initially hidden and can be shown by clicking on an expand button. More...

#include <ExpandableFieldEditor.h>

Public Slots

void expandButtonClicked (bool checked)
 called when the ">" button is clicked (shows/hides the inner widget)

Public Member Functions

virtual void appendRowTo (QGridLayout *layout)
 Append this widget to the given grid layout As ExpandableFieldEditor don't have any label, the widget is spanned over 2 columns.
 ExpandableFieldEditor (CamiTKExtensionModelPresenter *presenter, QWidget *innerWidget, VariantDataModel &dataModel, const QString &label="Advanced", bool compact=false, bool expandedAtInitialization=false)
virtual QWidget * getWidget () override
 Build the advanced widget that encapsulate the innerWidget.
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).

Protected Attributes

bool compact
QHBoxLayout * expandableWidgetTitleLayout
 The layout that has the expand button and label. In subclass AdvandedPlusFieldEditor a "+" is added at the left.
QPushButton * expandButton
 the expand button (">")
bool expandedAtInitialization
QWidget * innerWidget
 the advanced/hidden inner widget
QString label
 The title label (left to the ">" button).
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)

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.

Detailed Description

An expandable field editor is encapsulating a widget that can be initially hidden and can be shown by clicking on an expand button.

Its role is to simplify the appearance of the GUI to present a relatively smaller number of fields to edit.

Constructor & Destructor Documentation

◆ ExpandableFieldEditor()

ExpandableFieldEditor::ExpandableFieldEditor ( CamiTKExtensionModelPresenter * presenter,
QWidget * innerWidget,
VariantDataModel & dataModel,
const QString & label = "Advanced",
bool compact = false,
bool expandedAtInitialization = false )

Member Function Documentation

◆ appendRowTo()

void ExpandableFieldEditor::appendRowTo ( QGridLayout * layout)
virtual

◆ expandButtonClicked

void ExpandableFieldEditor::expandButtonClicked ( bool checked)
slot

called when the ">" button is clicked (shows/hides the inner widget)

References expandButton, innerWidget, and FieldEditor::myWidget.

Referenced by getWidget(), and CamiTKPropertyListFieldEditor::plusButtonClicked().

◆ getWidget()

QWidget * ExpandableFieldEditor::getWidget ( )
overridevirtual

Member Data Documentation

◆ compact

bool ExpandableFieldEditor::compact
protected

◆ expandableWidgetTitleLayout

QHBoxLayout* ExpandableFieldEditor::expandableWidgetTitleLayout
protected

The layout that has the expand button and label. In subclass AdvandedPlusFieldEditor a "+" is added at the left.

Referenced by CamiTKPropertyListFieldEditor::getWidget(), and getWidget().

◆ expandButton

QPushButton* ExpandableFieldEditor::expandButton
protected

the expand button (">")

Referenced by expandButtonClicked(), and getWidget().

◆ expandedAtInitialization

bool ExpandableFieldEditor::expandedAtInitialization
protected

◆ innerWidget

QWidget* ExpandableFieldEditor::innerWidget
protected

◆ label

QString ExpandableFieldEditor::label
protected

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