SeExpr

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

`#include <ExprEditor.h>`

Inheritance diagram for ExprEditor:

## Public Slots
void | exprChanged ()
void | rebuildControls ()
void | controlChanged (int id)
void | nextError ()
void | selectError ()
void | sendApply ()
void | sendPreview ()
void | insertStr (const std::string &str)

## Signals
void | apply ()
void | preview ()

## Public Member Functions
| ExprEditor (QWidget *parent, ExprControlCollection *controls)
virtual | ~ExprEditor ()
std::string | getExpr ()
void | setExpr (const std::string &expression, const bool apply=false)
void | appendStr (const std::string &str)
void | addError (const int startPos, const int endPos, const std::string &error)
void | clearErrors ()
void | clearExtraCompleters ()
void | registerExtraFunction (const std::string &name, const std::string &docString)
void | registerExtraVariable (const std::string &name, const std::string &docString)
void | replaceExtras (const ExprCompletionModel &completer)
void | updateCompleter ()
void | updateStyle ()

## Private Attributes
ExprTextEdit * | exprTe
ExprControlCollection * | controls
QListWidget * | errorWidget
QTimer * | controlRebuildTimer
QTimer * | previewTimer
bool | _updatingText
int | errorHeight

## Detailed Description

Definition at line 94 of file ExprEditor.h.

## Constructor & Destructor Documentation

## ◆ ExprEditor()

ExprEditor::ExprEditor | ( | QWidget * | parent,
|  | ExprControlCollection * | controls
| ) |  |

Definition at line 92 of file ExprEditor.cpp.

References clearErrors(), controlChanged(), controlRebuildTimer, controls, errorWidget, exprChanged(), exprTe, insertStr(), nextError(), previewTimer, rebuildControls(), selectError(), sendApply(), and sendPreview().

## ◆ ~ExprEditor()

ExprEditor::~ExprEditor | ( |  | ) |
| virtual

Definition at line 85 of file ExprEditor.cpp.

References controlRebuildTimer, and previewTimer.

## Member Function Documentation

## ◆ addError()

void ExprEditor::addError | ( | const int | startPos,
|  | const int | endPos,
|  | const std::string & | error
| ) |  |

Definition at line 388 of file ExprEditor.cpp.

References errorHeight, and errorWidget.

Referenced by ExprDialog::applyExpression().

## ◆ appendStr()

void ExprEditor::appendStr | ( | const std::string & | str | ) |

Definition at line 386 of file ExprEditor.cpp.

References exprTe.

## ◆ apply

void ExprEditor::apply | ( |  | ) |
| signal

Referenced by sendApply(), and setExpr().

## ◆ clearErrors()

void ExprEditor::clearErrors | ( |  | ) |

Definition at line 411 of file ExprEditor.cpp.

References errorHeight, and errorWidget.

Referenced by ExprDialog::applyExpression(), ExprEditor(), and setExpr().

## ◆ clearExtraCompleters()

void ExprEditor::clearExtraCompleters | ( |  | ) |

Definition at line 417 of file ExprEditor.cpp.

References ExprCompletionModel::clearFunctions(), ExprCompletionModel::clearVariables(), ExprTextEdit::completionModel, and exprTe.

## ◆ controlChanged

void ExprEditor::controlChanged | ( | int | id | ) |
| slot

Definition at line 71 of file ExprEditor.cpp.

References _updatingText, controls, exprTe, previewTimer, and ExprControlCollection::updateText().

Referenced by ExprEditor().

## ◆ exprChanged

void ExprEditor::exprChanged | ( |  | ) |
| slot

Definition at line 157 of file ExprEditor.cpp.

References _updatingText, and controlRebuildTimer.

Referenced by ExprEditor().

## ◆ getExpr()

std::string ExprEditor::getExpr | ( |  | ) |

Definition at line 373 of file ExprEditor.cpp.

References exprTe.

Referenced by ExprDialog::applyExpression(), ExprDialog::getExpressionString(), ExprBrowser::saveExpression(), ExprBrowser::saveExpressionAs(), and ExprBrowser::saveLocalExpressionAs().

## ◆ insertStr

void ExprEditor::insertStr | ( | const std::string & | str | ) |
| slot

Definition at line 384 of file ExprEditor.cpp.

References exprTe.

Referenced by ExprEditor().

## ◆ nextError

void ExprEditor::nextError | ( |  | ) |
| slot

Definition at line 405 of file ExprEditor.cpp.

References errorWidget.

Referenced by ExprDialog::applyExpression(), and ExprEditor().

## ◆ preview

void ExprEditor::preview | ( |  | ) |
| signal

Referenced by sendPreview().

## ◆ rebuildControls

void ExprEditor::rebuildControls | ( |  | ) |
| slot

Definition at line 165 of file ExprEditor.cpp.

References ExprTextEdit::completer, ExprTextEdit::completionModel, controls, exprTe, ExprCompletionModel::local_variables, and ExprControlCollection::rebuildControls().

Referenced by ExprEditor().

## ◆ registerExtraFunction()

void ExprEditor::registerExtraFunction | ( | const std::string & | name,
|  | const std::string & | docString
| ) |  |

Definition at line 422 of file ExprEditor.cpp.

References ExprCompletionModel::addFunction(), ExprTextEdit::completionModel, and exprTe.

## ◆ registerExtraVariable()

void ExprEditor::registerExtraVariable | ( | const std::string & | name,
|  | const std::string & | docString
| ) |  |

Definition at line 426 of file ExprEditor.cpp.

References ExprCompletionModel::addVariable(), ExprTextEdit::completionModel, and exprTe.

## ◆ replaceExtras()

void ExprEditor::replaceExtras | ( | const ExprCompletionModel & | completer | ) |

Definition at line 430 of file ExprEditor.cpp.

References ExprTextEdit::completionModel, exprTe, and ExprCompletionModel::syncExtras().

Referenced by ExprShortEdit::showDetails().

## ◆ selectError

void ExprEditor::selectError | ( |  | ) |
| slot

Definition at line 141 of file ExprEditor.cpp.

References errorWidget, and exprTe.

Referenced by ExprEditor().

## ◆ sendApply

void ExprEditor::sendApply | ( |  | ) |
| slot

Definition at line 153 of file ExprEditor.cpp.

References apply().

Referenced by ExprEditor().

## ◆ sendPreview

void ExprEditor::sendPreview | ( |  | ) |
| slot

Definition at line 155 of file ExprEditor.cpp.

References preview().

Referenced by ExprEditor().

## ◆ setExpr()

void ExprEditor::setExpr | ( | const std::string & | expression,
|  | const bool | apply = `false`
| ) |  |

Definition at line 375 of file ExprEditor.cpp.

References apply(), clearErrors(), expression, and exprTe.

Referenced by ExprDialog::clearExpression(), ExprBrowser::handleSelection(), and ExprDialog::setExpressionString().

## ◆ updateCompleter()

void ExprEditor::updateCompleter | ( |  | ) |

Definition at line 432 of file ExprEditor.cpp.

References ExprTextEdit::completer, ExprTextEdit::completionModel, and exprTe.

## ◆ updateStyle()

void ExprEditor::updateStyle | ( |  | ) |

Definition at line 434 of file ExprEditor.cpp.

References exprTe, and ExprTextEdit::updateStyle().

## Member Data Documentation

## ◆ _updatingText

bool ExprEditor::_updatingText
| private

Definition at line 153 of file ExprEditor.h.

Referenced by controlChanged(), and exprChanged().

## ◆ controlRebuildTimer

QTimer* ExprEditor::controlRebuildTimer
| private

Definition at line 150 of file ExprEditor.h.

Referenced by exprChanged(), ExprEditor(), and ~ExprEditor().

## ◆ controls

ExprControlCollection* ExprEditor::controls
| private

Definition at line 147 of file ExprEditor.h.

Referenced by controlChanged(), ExprEditor(), and rebuildControls().

## ◆ errorHeight

int ExprEditor::errorHeight
| private

Definition at line 154 of file ExprEditor.h.

Referenced by addError(), and clearErrors().

## ◆ errorWidget

QListWidget* ExprEditor::errorWidget
| private

Definition at line 148 of file ExprEditor.h.

Referenced by addError(), clearErrors(), ExprEditor(), nextError(), and selectError().

## ◆ exprTe

ExprTextEdit* ExprEditor::exprTe
| private

Definition at line 146 of file ExprEditor.h.

Referenced by appendStr(), clearExtraCompleters(), controlChanged(), ExprEditor(), getExpr(), insertStr(), rebuildControls(), registerExtraFunction(), registerExtraVariable(), replaceExtras(), selectError(), setExpr(), updateCompleter(), and updateStyle().

## ◆ previewTimer

QTimer* ExprEditor::previewTimer
| private

Definition at line 151 of file ExprEditor.h.

Referenced by controlChanged(), ExprEditor(), and ~ExprEditor().

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

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