SeExpr

Public Slots | Signals | Public Member Functions | Static Public Member Functions | Private Slots | Private Attributes | List of all members
ExprControlCollection Class Reference

`#include <ExprControlCollection.h>`

Inheritance diagram for ExprControlCollection:

## Public Slots
void | linkColorInput (QColor color)

## Signals
void | controlChanged (int id)
| Notification that a specific control was changed. More...
void | linkColorOutput (QColor color)
| Gives information about when a link color was changed. More...
void | insertString (const std::string &controlString)

## Public Member Functions
| ExprControlCollection (QWidget *parent=0, bool showAddButton=true)
| ~ExprControlCollection ()
void | updateText (const int id, QString &text)
| Request new text, given taking into account control id's new values. More...
bool | rebuildControls (const QString &expressionText, std::vector< QString > &variables)
| Rebuild the controls given the new expressionText. Return any local variables found. More...
int | numControls ()
| Number of controls. More...
void | showEditor (int idx)

## Static Public Member Functions
static void | setAnimCurveCallback (AnimCurveControl::AnimCurveCallback callback)
| Anim curve callback. More...

## Private Slots
void | addControlDialog ()
| When a user clicks "Add Widget" button. More...
void | singleControlChanged (int id)
| Notification when by a control whenever it is edited. More...
void | linkColorLink (int id)
| Notification by a control that a new color link is desired. More...
void | linkColorEdited (int id, QColor color)
| Notification by a control that a color is edited (when it is linked) More...

## Private Attributes
int | _linkedId
int | count
bool | showAddButton
EditableExpression * | editableExpression
std::vector< ExprControl * > | _controls
QVBoxLayout * | controlLayout

## Detailed Description

Widget that holds and manages controls for an Expression This is typically used by an ExprEditor or a ExprShortEdit widget This widget also is responsible for finding all user local variables (for use in autocomplete)

Definition at line 81 of file ExprControlCollection.h.

## Constructor & Destructor Documentation

## ◆ ExprControlCollection()

ExprControlCollection::ExprControlCollection | ( | QWidget * | parent = `0`,
|  | bool | showAddButton = `true`
| ) |  |

Definition at line 40 of file ExprControlCollection.cpp.

References addControlDialog(), controlLayout, and showAddButton.

## ◆ ~ExprControlCollection()

ExprControlCollection::~ExprControlCollection | ( |  | ) |

Definition at line 59 of file ExprControlCollection.cpp.

References editableExpression.

## Member Function Documentation

## ◆ addControlDialog

void ExprControlCollection::addControlDialog | ( |  | ) |
| private slot

When a user clicks "Add Widget" button.

Definition at line 266 of file ExprControlCollection.cpp.

References ExprAddDialog::animCurveLink, ExprAddDialog::animCurveLookup, ExprAddDialog::color, ExprAddDialog::colorCurveLookup, count, ExprAddDialog::curveLookup, ExprAddDialog::deepWaterLookup, ExprAddDialog::floatDefault, ExprAddDialog::floatMax, ExprAddDialog::floatMin, ExprAddDialog::initSwatch(), insertString(), ExprAddDialog::intDefault, ExprAddDialog::intMax, ExprAddDialog::intMin, ExprAddDialog::stringDefaultWidget, ExprAddDialog::stringNameWidget, ExprAddDialog::stringTypeWidget, ExprAddDialog::swatchLookup, ExprAddDialog::tabWidget, ExprAddDialog::variableName, ExprAddDialog::vectorDefault0, ExprAddDialog::vectorDefault1, ExprAddDialog::vectorDefault2, ExprAddDialog::vectorMax, and ExprAddDialog::vectorMin.

Referenced by ExprControlCollection().

## ◆ controlChanged

void ExprControlCollection::controlChanged | ( | int | id | ) |
| signal

Notification that a specific control was changed.

Referenced by rebuildControls(), and singleControlChanged().

## ◆ insertString

void ExprControlCollection::insertString | ( | const std::string & | controlString | ) |
| signal

Emitted to request that a new widget string should be added to the expression i.e. after "Add Widget" was used

Referenced by addControlDialog().

## ◆ linkColorEdited

void ExprControlCollection::linkColorEdited | ( | int | id,
|  | QColor | color
| ) |  |
| private slot

Notification by a control that a color is edited (when it is linked)

Definition at line 431 of file ExprControlCollection.cpp.

References _linkedId, and linkColorOutput().

Referenced by rebuildControls().

## ◆ linkColorInput

void ExprControlCollection::linkColorInput | ( | QColor | color | ) |
| slot

Notification from outside that a linked color widget was changed and should be forwarded to any linked controls

Definition at line 435 of file ExprControlCollection.cpp.

References _controls, and _linkedId.

## ◆ linkColorLink

void ExprControlCollection::linkColorLink | ( | int | id | ) |
| private slot

Notification by a control that a new color link is desired.

Definition at line 424 of file ExprControlCollection.cpp.

References _controls, and _linkedId.

Referenced by rebuildControls().

## ◆ linkColorOutput

void ExprControlCollection::linkColorOutput | ( | QColor | color | ) |
| signal

Gives information about when a link color was changed.

Referenced by linkColorEdited().

## ◆ numControls()

int ExprControlCollection::numControls | ( |  | ) |
| inline

Number of controls.

Definition at line 107 of file ExprControlCollection.h.

References _controls.

Referenced by ExprShortEdit::rebuildControls().

## ◆ rebuildControls()

bool ExprControlCollection::rebuildControls | ( | const QString & | expressionText,
|  | std::vector< QString > & | variables
| ) |  |

Rebuild the controls given the new expressionText. Return any local variables found.

Definition at line 334 of file ExprControlCollection.cpp.

References _controls, _linkedId, controlChanged(), controlLayout, EditableExpression::controlsMatch(), editableExpression, EditableExpression::getVariables(), linkColorEdited(), linkColorLink(), EditableExpression::setExpr(), showAddButton, singleControlChanged(), EditableExpression::size(), EditableExpression::updateString(), variables, and x.

Referenced by ExprEditor::rebuildControls(), and ExprShortEdit::rebuildControls().

## ◆ setAnimCurveCallback()

static void ExprControlCollection::setAnimCurveCallback | ( | AnimCurveControl::AnimCurveCallback | callback | ) |
| inline static

Anim curve callback.

Definition at line 112 of file ExprControlCollection.h.

References AnimCurveControl::setAnimCurveCallback().

## ◆ showEditor()

void ExprControlCollection::showEditor | ( | int | idx | ) |

Definition at line 413 of file ExprControlCollection.cpp.

References _controls, and AnimCurveControl::editGraphClicked().

Referenced by ExprDialog::_showEditor().

## ◆ singleControlChanged

void ExprControlCollection::singleControlChanged | ( | int | id | ) |
| private slot

Notification when by a control whenever it is edited.

Definition at line 446 of file ExprControlCollection.cpp.

References controlChanged().

Referenced by rebuildControls().

## ◆ updateText()

void ExprControlCollection::updateText | ( | const int | id,
|  | QString & | text
| ) |  |

Request new text, given taking into account control id's new values.

Definition at line 441 of file ExprControlCollection.cpp.

References editableExpression, and EditableExpression::getEditedExpr().

Referenced by ExprEditor::controlChanged(), and ExprShortEdit::controlChanged().

## Member Data Documentation

## ◆ _controls

std::vector<ExprControl *> ExprControlCollection::_controls
| private

Definition at line 97 of file ExprControlCollection.h.

Referenced by linkColorInput(), linkColorLink(), numControls(), rebuildControls(), and showEditor().

## ◆ _linkedId

int ExprControlCollection::_linkedId
| private

Definition at line 82 of file ExprControlCollection.h.

Referenced by linkColorEdited(), linkColorInput(), linkColorLink(), and rebuildControls().

## ◆ controlLayout

QVBoxLayout* ExprControlCollection::controlLayout
| private

Definition at line 98 of file ExprControlCollection.h.

Referenced by ExprControlCollection(), and rebuildControls().

## ◆ count

int ExprControlCollection::count
| private

Definition at line 85 of file ExprControlCollection.h.

Referenced by addControlDialog().

## ◆ editableExpression

EditableExpression* ExprControlCollection::editableExpression
| private

Definition at line 89 of file ExprControlCollection.h.

Referenced by rebuildControls(), updateText(), and ~ExprControlCollection().

## ◆ showAddButton

bool ExprControlCollection::showAddButton
| private

Definition at line 86 of file ExprControlCollection.h.

Referenced by ExprControlCollection(), and rebuildControls().

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

- /build/seexpr/src/SeExpr/src/SeExpr2/UI/ExprControlCollection.h
- /build/seexpr/src/SeExpr/src/SeExpr2/UI/ExprControlCollection.cpp