Vuo  0.9.1
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | List of all members
VuoInputEditorWithLineEditList Class Referenceabstract

Description

A base class for input editors that display a series of line edits (text fields).

Public Member Functions

 VuoInputEditorWithLineEditList (bool allowAddingAndRemovingRows=false, int lineEditWidth=100)
 Creates an input editor whose show function displays a series of line edits.
 
bool supportsTabbingBetweenPorts (void)
 Since this input editor supports tabbing, always returns true.
 
- Public Member Functions inherited from VuoInputEditorWithDialog
json_object * show (QPoint portLeftCenter, json_object *originalValue, json_object *details, map< QString, json_object * > portNamesAndValues)
 Displays a frameless dialog.
 

Protected Member Functions

virtual void setUpDialog (QDialog &dialog, json_object *originalValue, json_object *details)
 Adds the line edits and associated widgets to the dialog, and populates the line edits with the dialog's initial value.
 
virtual QLayout * setUpRow (QDialog &dialog, QLineEdit *lineEdit)
 Creates and returns a layout containing lineEdit and any associated widgets.
 
virtual void tearDownRow (QLayout *rowLayout)
 Performs any cleanup necessary before the line edit and associated widgets are removed from the dialog and deallocated.
 
QLayout * getRowAtIndex (int index)
 Returns the line edit and associated widgets in the row that is currently at the given index.
 
void addWidgetToDialog (QWidget *widget)
 Adds the widget at the bottom of the dialog.
 
void removeWidgetFromDialog (QWidget *widget)
 Removes the widget from the dialog.
 
json_object * getAcceptedValue (void)
 Returns the current value in the line edits.
 
QList< QString > getLineEditTexts (void)
 Returns the current text in the line edits.
 
bool eventFilter (QObject *object, QEvent *event)
 Handles tabbing past the last widget or reverse-tabbing past the first widget in the tab order.
 
virtual QList< QString > convertToLineEditListFormat (json_object *value)=0
 Returns the text that should appear in each of the line edits to represent value.
 
virtual json_object * convertFromLineEditListFormat (const QList< QString > &lineEditTexts)=0
 Returns the value represented when the given text appears in the line edits.
 
- Protected Member Functions inherited from VuoInputEditorWithDialog
QDialog * getDialog (void)
 Returns a pointer to the dialog displayed by show().
 
- Protected Member Functions inherited from VuoInputEditor
QFont getDefaultFont (void)
 Returns the font that input editors are recommended to use.
 

Additional Inherited Members

- Signals inherited from VuoInputEditor
void valueChanged (json_object *newValue)
 An input editor can emit this signal to inform the Vuo Editor that the value has been edited.
 
void tabbedPastLastWidget ()
 If supportsTabbingBetweenPorts() returns true, an input editor should emit this signal when the Tab key is pressed while the last widget in the input editor's tab order has focus.
 
void tabbedBackwardPastFirstWidget ()
 If supportsTabbingBetweenPorts() returns true, an input editor should emit this signal when the Shift-Tab key combination is pressed while the first widget in the input editor's tab order has focus.
 

Constructor & Destructor Documentation

VuoInputEditorWithLineEditList::VuoInputEditorWithLineEditList ( bool  allowAddingAndRemovingRows = false,
int  lineEditWidth = 100 
)

Creates an input editor whose show function displays a series of line edits.

Member Function Documentation

void VuoInputEditorWithLineEditList::addWidgetToDialog ( QWidget *  widget)
protected

Adds the widget at the bottom of the dialog.

virtual json_object* VuoInputEditorWithLineEditList::convertFromLineEditListFormat ( const QList< QString > &  lineEditTexts)
protectedpure virtual

Returns the value represented when the given text appears in the line edits.

virtual QList<QString> VuoInputEditorWithLineEditList::convertToLineEditListFormat ( json_object *  value)
protectedpure virtual

Returns the text that should appear in each of the line edits to represent value.

bool VuoInputEditorWithLineEditList::eventFilter ( QObject *  object,
QEvent *  event 
)
protected

Handles tabbing past the last widget or reverse-tabbing past the first widget in the tab order.

json_object * VuoInputEditorWithLineEditList::getAcceptedValue ( void  )
protectedvirtual

Returns the current value in the line edits.

Implements VuoInputEditorWithDialog.

QList< QString > VuoInputEditorWithLineEditList::getLineEditTexts ( void  )
protected

Returns the current text in the line edits.

QLayout * VuoInputEditorWithLineEditList::getRowAtIndex ( int  index)
protected

Returns the line edit and associated widgets in the row that is currently at the given index.

Parameters
indexThe row index, numbered from 0.
Returns
The layout that was returned by setUpRow() when the row was added.
void VuoInputEditorWithLineEditList::removeWidgetFromDialog ( QWidget *  widget)
protected

Removes the widget from the dialog.

Parameters
widgetA widget previously passed to addWidgetToDialog().
void VuoInputEditorWithLineEditList::setUpDialog ( QDialog &  dialog,
json_object *  originalValue,
json_object *  details 
)
protectedvirtual

Adds the line edits and associated widgets to the dialog, and populates the line edits with the dialog's initial value.

Implements VuoInputEditorWithDialog.

QLayout * VuoInputEditorWithLineEditList::setUpRow ( QDialog &  dialog,
QLineEdit *  lineEdit 
)
protectedvirtual

Creates and returns a layout containing lineEdit and any associated widgets.

The default implementation of this function optionally adds a remove button to the row. Override this function to customize the widgets associated with each line edit.

bool VuoInputEditorWithLineEditList::supportsTabbingBetweenPorts ( void  )
virtual

Since this input editor supports tabbing, always returns true.

Reimplemented from VuoInputEditor.

void VuoInputEditorWithLineEditList::tearDownRow ( QLayout *  rowLayout)
protectedvirtual

Performs any cleanup necessary before the line edit and associated widgets are removed from the dialog and deallocated.

The default implementation of this function does nothing.

Parameters
rowLayoutThe layout that was returned by setUpRow() when the row was added.

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