SeExpr

Public Member Functions | Public Attributes | Private Attributes | Static Private Attributes | List of all members
ExprCompletionModel Class Reference

`#include <ExprCompletionModel.h>`

Inheritance diagram for ExprCompletionModel:

## Public Member Functions
void | clearFunctions ()
void | addFunction (const QString &function, const QString &docString)
void | clearVariables ()
void | addVariable (const QString &str, const QString &comment)
void | syncExtras (const ExprCompletionModel &otherModel)
| ExprCompletionModel (QObject *parent=0)
QModelIndex | index (int row, int column, const QModelIndex &) const
QModelIndex | parent (const QModelIndex &) const
int | rowCount (const QModelIndex &parent=QModelIndex()) const
int | columnCount (const QModelIndex &parent) const
QString | getFirstLine (const std::string &all) const
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
QString | getDocString (const QString &s)

## Public Attributes
std::vector< QString > | local_variables

## Private Attributes
std::vector< QString > | functions
std::vector< QString > | functions_comment
std::map< QString, int > | functionNameToFunction
std::vector< QString > | variables
std::vector< QString > | variables_comment

## Static Private Attributes
static std::vector< QString > | builtins

## Detailed Description

Definition at line 30 of file ExprCompletionModel.h.

## Constructor & Destructor Documentation

## ◆ ExprCompletionModel()

ExprCompletionModel::ExprCompletionModel | ( | QObject * | parent = `0` | ) |

Definition at line 28 of file ExprCompletionModel.cpp.

References builtins, and SeExpr2::ExprFunc::getFunctionNames().

## Member Function Documentation

## ◆ addFunction()

void ExprCompletionModel::addFunction | ( | const QString & | function,
|  | const QString & | docString
| ) |  |

Definition at line 52 of file ExprCompletionModel.cpp.

References functionNameToFunction, functions, and functions_comment.

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

## ◆ addVariable()

void ExprCompletionModel::addVariable | ( | const QString & | str,
|  | const QString & | comment
| ) |  |

Definition at line 41 of file ExprCompletionModel.cpp.

References variables, and variables_comment.

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

## ◆ clearFunctions()

void ExprCompletionModel::clearFunctions | ( |  | ) |

Definition at line 46 of file ExprCompletionModel.cpp.

References functionNameToFunction, functions, and functions_comment.

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

## ◆ clearVariables()

void ExprCompletionModel::clearVariables | ( |  | ) |

Definition at line 36 of file ExprCompletionModel.cpp.

References variables, and variables_comment.

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

## ◆ columnCount()

int ExprCompletionModel::columnCount | ( | const QModelIndex & | parent | ) | const
| inline

Definition at line 56 of file ExprCompletionModel.h.

References parent().

## ◆ data()

QVariant ExprCompletionModel::data | ( | const QModelIndex & | index,
|  | int | role = `Qt::DisplayRole`
| ) |  | const

Definition at line 66 of file ExprCompletionModel.cpp.

References builtins, functions, functions_comment, SeExpr2::ExprFunc::getDocString(), getFirstLine(), index(), local_variables, variables, and variables_comment.

## ◆ getDocString()

QString ExprCompletionModel::getDocString | ( | const QString & | s | ) |

Definition at line 125 of file ExprCompletionModel.cpp.

References functionNameToFunction, functions_comment, and SeExpr2::ExprFunc::getDocString().

Referenced by ExprTextEdit::keyPressEvent(), and ExprShortTextEdit::keyPressEvent().

## ◆ getFirstLine()

QString ExprCompletionModel::getFirstLine | ( | const std::string & | all | ) | const
| inline

Definition at line 61 of file ExprCompletionModel.h.

Referenced by data().

## ◆ headerData()

QVariant ExprCompletionModel::headerData | ( | int | section,
|  | Qt::Orientation | orientation,
|  | int | role = `Qt::DisplayRole`
| ) |  | const
| inline

Definition at line 71 of file ExprCompletionModel.h.

## ◆ index()

QModelIndex ExprCompletionModel::index | ( | int | row,
|  | int | column,
|  | const QModelIndex & |
| ) |  | const
| inline

Definition at line 46 of file ExprCompletionModel.h.

Referenced by data().

## ◆ parent()

QModelIndex ExprCompletionModel::parent | ( | const QModelIndex & |  | ) | const
| inline

Definition at line 48 of file ExprCompletionModel.h.

Referenced by columnCount(), and rowCount().

## ◆ rowCount()

int ExprCompletionModel::rowCount | ( | const QModelIndex & | parent = `QModelIndex()` | ) | const
| inline

Definition at line 50 of file ExprCompletionModel.h.

References builtins, functions, local_variables, parent(), and variables.

## ◆ syncExtras()

void ExprCompletionModel::syncExtras | ( | const ExprCompletionModel & | otherModel | ) |

Definition at line 58 of file ExprCompletionModel.cpp.

References functionNameToFunction, functions, functions_comment, variables, and variables_comment.

Referenced by ExprEditor::replaceExtras().

## Member Data Documentation

## ◆ builtins

std::vector< QString > ExprCompletionModel::builtins
| static private

Definition at line 88 of file ExprCompletionModel.h.

Referenced by data(), ExprCompletionModel(), and rowCount().

## ◆ functionNameToFunction

std::map<QString, int> ExprCompletionModel::functionNameToFunction
| private

Definition at line 90 of file ExprCompletionModel.h.

Referenced by addFunction(), clearFunctions(), getDocString(), and syncExtras().

## ◆ functions

std::vector<QString> ExprCompletionModel::functions
| private

Definition at line 89 of file ExprCompletionModel.h.

Referenced by addFunction(), clearFunctions(), data(), rowCount(), and syncExtras().

## ◆ functions_comment

std::vector<QString> ExprCompletionModel::functions_comment
| private

Definition at line 89 of file ExprCompletionModel.h.

Referenced by addFunction(), clearFunctions(), data(), getDocString(), and syncExtras().

## ◆ local_variables

std::vector<QString> ExprCompletionModel::local_variables

Definition at line 83 of file ExprCompletionModel.h.

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

## ◆ variables

std::vector<QString> ExprCompletionModel::variables
| private

Definition at line 91 of file ExprCompletionModel.h.

Referenced by addVariable(), clearVariables(), data(), rowCount(), and syncExtras().

## ◆ variables_comment

std::vector<QString> ExprCompletionModel::variables_comment
| private

Definition at line 91 of file ExprCompletionModel.h.

Referenced by addVariable(), clearVariables(), data(), and syncExtras().

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

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