Slicer  5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
List of all members | Public Types | Properties | Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes
qMRMLTextWidget Class Reference

#include <Modules/Loadable/Texts/Widgets/qMRMLTextWidget.h>

Inheritance diagram for qMRMLTextWidget:
Inheritance graph
[legend]
Collaboration diagram for qMRMLTextWidget:
Collaboration graph
[legend]

Public Types

typedef qSlicerWidget Superclass
 

Properties

bool autoSave
 
bool editing
 
bool readOnly
 
bool wordWrap
 

Public Slots

void cancelEdits ()
 Finish editing, discarding all changes. More...
 
void saveEdits ()
 Finish editing, saving edited contents to the text node. More...
 
void setAutoSave (bool autoSave)
 
void setMRMLNode (vtkMRMLNode *textNode)
 
void setMRMLScene (vtkMRMLScene *scene) override
 Reimplemented from qSlicerWidget. More...
 
void setMRMLTextNode (vtkMRMLTextNode *textNode)
 
void setReadOnly (bool readOnly)
 
void setWordWrap (bool wordWrap)
 
void startEdits ()
 Start editing mode. More...
 
- Public Slots inherited from qSlicerWidget
void setMRMLScene (vtkMRMLScene *scene) override
 

Signals

bool autoSaveChanged (bool)
 This signal is emitted if the autoSave property is changed. More...
 
void editingChanged (bool)
 This signal is emitted when the user starts/stops the widget edit mode. More...
 
void mrmlNodeChanged (vtkMRMLNode *)
 
void readOnlyChanged (bool)
 This signal is emitted if the read only property is changed. More...
 
void updateMRMLFromWidgetFinished ()
 
void updateMRMLFromWidgetRequested ()
 
void updateWidgetFromMRMLFinished ()
 
void updateWidgetFromMRMLRequested ()
 
- Signals inherited from qSlicerWidget
void mrmlSceneChanged (vtkMRMLScene *)
 

Public Member Functions

bool isAutoSave ()
 
bool isEditing ()
 Returns true if the text box is in edit mode. More...
 
bool isReadOnly ()
 
Q_INVOKABLE vtkMRMLNodemrmlNode () const
 
Q_INVOKABLE vtkMRMLTextNodemrmlTextNode () const
 Get the text node. More...
 
 qMRMLTextWidget (QWidget *parent=nullptr)
 
Q_INVOKABLE QTextEdit * textEditWidget ()
 Returns the internal text editor widget to allow low-level access and customization. More...
 
bool wordWrap ()
 
 ~qMRMLTextWidget () override
 
- Public Member Functions inherited from qSlicerWidget
vtkSlicerApplicationLogicappLogic () const
 
vtkMRMLAbstractLogicmoduleLogic (const QString &moduleName) const
 
 qSlicerWidget (QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags())
 
 ~qSlicerWidget () override
 
- Public Member Functions inherited from qSlicerObject
vtkMRMLScenemrmlScene () const
 Return a pointer on the MRML scene. More...
 
 qSlicerObject ()
 
virtual void setMRMLScene (vtkMRMLScene *)
 Set the current MRML scene to the widget. More...
 
virtual ~qSlicerObject ()
 

Protected Slots

void onTextEditChanged ()
 Method invoked when the contents of the text edit is changed. More...
 
void onTextNodeContentsModified ()
 Method invoked when the contents of the text node is modified. More...
 
void updateMRMLFromWidget ()
 Update the MRML node to reflect the currently state of the GUI. More...
 
void updateWidgetFromMRML ()
 Update the GUI to reflect the currently selected text node. More...
 

Protected Member Functions

virtual void setup ()
 

Protected Attributes

bool AutoSave {false}
 
QScopedPointer< qMRMLTextWidgetPrivate > d_ptr
 
bool ReadOnly {false}
 
- Protected Attributes inherited from qSlicerWidget
QScopedPointer< qSlicerWidgetPrivate > d_ptr
 
- Protected Attributes inherited from qSlicerObject
QScopedPointer< qSlicerObjectPrivate > d_ptr
 

Detailed Description

Definition at line 37 of file qMRMLTextWidget.h.

Member Typedef Documentation

◆ Superclass

Definition at line 42 of file qMRMLTextWidget.h.

Property Documentation

◆ autoSave

bool qMRMLTextWidget::autoSave
readwrite

Definition at line 46 of file qMRMLTextWidget.h.

◆ editing

bool qMRMLTextWidget::editing
read

Definition at line 46 of file qMRMLTextWidget.h.

◆ readOnly

bool qMRMLTextWidget::readOnly
readwrite

Definition at line 47 of file qMRMLTextWidget.h.

◆ wordWrap

bool qMRMLTextWidget::wordWrap
readwrite

Definition at line 48 of file qMRMLTextWidget.h.

Constructor & Destructor Documentation

◆ qMRMLTextWidget()

qMRMLTextWidget::qMRMLTextWidget ( QWidget *  parent = nullptr)

◆ ~qMRMLTextWidget()

qMRMLTextWidget::~qMRMLTextWidget ( )
override

Member Function Documentation

◆ autoSaveChanged

bool qMRMLTextWidget::autoSaveChanged ( bool  )
signal

This signal is emitted if the autoSave property is changed.

◆ cancelEdits

void qMRMLTextWidget::cancelEdits ( )
slot

Finish editing, discarding all changes.

◆ editingChanged

void qMRMLTextWidget::editingChanged ( bool  )
signal

This signal is emitted when the user starts/stops the widget edit mode.

◆ isAutoSave()

bool qMRMLTextWidget::isAutoSave ( )

Returns true if text changes made in the widget must be immediately saved into the text node. If true, the text editor will propagate text changes to the vtkMRMLTextNode after each keypress. If false, the text editor will only update the node when "Save" is clicked, and changes from the text node will not be shown in the widget while the text is being edited. Save and Cancel buttons are only shown if auto-save is disabled.

See also
setAutoSave()

◆ isEditing()

bool qMRMLTextWidget::isEditing ( )

Returns true if the text box is in edit mode.

◆ isReadOnly()

bool qMRMLTextWidget::isReadOnly ( )

Returns true if the text editor is read only If read only is enabled, only the text edit will be shown, and the user will be unable to type in the text edit.

See also
setReadOnly()

◆ mrmlNode()

Q_INVOKABLE vtkMRMLNode* qMRMLTextWidget::mrmlNode ( ) const

◆ mrmlNodeChanged

void qMRMLTextWidget::mrmlNodeChanged ( vtkMRMLNode )
signal

This signal is emitted if the node changes

See also
setMRMLNode(), setMRMLTextNode(), mrmlNode(), mrmlTextNode()

◆ mrmlTextNode()

Q_INVOKABLE vtkMRMLTextNode* qMRMLTextWidget::mrmlTextNode ( ) const

Get the text node.

◆ onTextEditChanged

void qMRMLTextWidget::onTextEditChanged ( )
protectedslot

Method invoked when the contents of the text edit is changed.

◆ onTextNodeContentsModified

void qMRMLTextWidget::onTextNodeContentsModified ( )
protectedslot

Method invoked when the contents of the text node is modified.

◆ readOnlyChanged

void qMRMLTextWidget::readOnlyChanged ( bool  )
signal

This signal is emitted if the read only property is changed.

◆ saveEdits

void qMRMLTextWidget::saveEdits ( )
slot

Finish editing, saving edited contents to the text node.

◆ setAutoSave

void qMRMLTextWidget::setAutoSave ( bool  autoSave)
slot

Set the continuous update property of the text editor If true, the text editor will propagate the text to the vtkMRMLTextNode as it is modified, and vice versa. If false, the text editor will only update the node when "Save" is clicked, and changes from the vtkMRMLTextNode will not be propagated if the text is being edited. When auto update is enabled, only the text edit will be shown.

See also
isAutoSave()

◆ setMRMLNode

void qMRMLTextWidget::setMRMLNode ( vtkMRMLNode textNode)
slot

Utility function to simply connect signals/slots with Qt Designer

See also
mrmlNode()

◆ setMRMLScene

void qMRMLTextWidget::setMRMLScene ( vtkMRMLScene scene)
overrideslot

Reimplemented from qSlicerWidget.

◆ setMRMLTextNode

void qMRMLTextWidget::setMRMLTextNode ( vtkMRMLTextNode textNode)
slot

Set the currently observed text node

See also
mrmlTextNode()

◆ setReadOnly

void qMRMLTextWidget::setReadOnly ( bool  readOnly)
slot

Set the read only property of the text editor. If read only is enabled, only the text edit will be shown, and the user will be unable to edit the text.

See also
isReadOnly()

◆ setup()

virtual void qMRMLTextWidget::setup ( )
protectedvirtual

◆ setWordWrap

void qMRMLTextWidget::setWordWrap ( bool  wordWrap)
slot

Set the word wrap mode to be used by the text editor

See also
wordWrap()

◆ startEdits

void qMRMLTextWidget::startEdits ( )
slot

Start editing mode.

◆ textEditWidget()

Q_INVOKABLE QTextEdit* qMRMLTextWidget::textEditWidget ( )

Returns the internal text editor widget to allow low-level access and customization.

◆ updateMRMLFromWidget

void qMRMLTextWidget::updateMRMLFromWidget ( )
protectedslot

Update the MRML node to reflect the currently state of the GUI.

◆ updateMRMLFromWidgetFinished

void qMRMLTextWidget::updateMRMLFromWidgetFinished ( )
signal

This signal is emitted if updates to the MRML node from the widget have finished.

See also
updateMRMLFromWidgetRequested()

◆ updateMRMLFromWidgetRequested

void qMRMLTextWidget::updateMRMLFromWidgetRequested ( )
signal

This signal is emitted if updates to the MRML node from the widget have been requested.

See also
updateMRMLFromWidgetFinished()

◆ updateWidgetFromMRML

void qMRMLTextWidget::updateWidgetFromMRML ( )
protectedslot

Update the GUI to reflect the currently selected text node.

◆ updateWidgetFromMRMLFinished

void qMRMLTextWidget::updateWidgetFromMRMLFinished ( )
signal

This signal is emitted if updates to the widget from the MRML node have finished.

See also
updateWidgetFromMRMLRequested()

◆ updateWidgetFromMRMLRequested

void qMRMLTextWidget::updateWidgetFromMRMLRequested ( )
signal

This signal is emitted if updates to the widget from the MRML node have been requested.

See also
updateWidgetFromMRMLFinished()

◆ wordWrap()

bool qMRMLTextWidget::wordWrap ( )

Returns the word wrap mode used in the text editor

See also
setWordWrap()

Member Data Documentation

◆ AutoSave

bool qMRMLTextWidget::AutoSave {false}
protected

Definition at line 171 of file qMRMLTextWidget.h.

◆ d_ptr

QScopedPointer<qMRMLTextWidgetPrivate> qMRMLTextWidget::d_ptr
protected

Definition at line 161 of file qMRMLTextWidget.h.

◆ ReadOnly

bool qMRMLTextWidget::ReadOnly {false}
protected

Definition at line 172 of file qMRMLTextWidget.h.


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