KSeExpr 6.0.0.0
|
#include <ExprControlCollection.h>
Public Slots | |
void | linkColorInput (QColor color) |
Signals | |
void | controlChanged (int id) |
Notification that a specific control was changed. | |
void | linkColorOutput (QColor color) |
Gives information about when a link color was changed. | |
void | insertString (const QString &controlString) |
Public Member Functions | |
ExprControlCollection (QWidget *parent=nullptr, bool showAddButton=true) | |
~ExprControlCollection () override | |
void | updateText (int id, QString &text) |
Request new text, given taking into account control id's new values. | |
bool | rebuildControls (const QString &expressionText, std::vector< QString > &variables) |
Rebuild the controls given the new expressionText. Return any local variables found. | |
int | numControls () |
Number of controls. | |
void | showEditor (int idx) |
Private Slots | |
void | addControlDialog () |
When a user clicks "Add new variable" button. | |
void | singleControlChanged (int id) |
Notification when by a control whenever it is edited. | |
void | linkColorLink (int id) |
Notification by a control that a new color link is desired. | |
void | linkColorEdited (int id, QColor color) |
Notification by a control that a color is edited (when it is linked) | |
Private Attributes | |
int | _linkedId {} |
int | count {} |
bool | showAddButton {} |
EditableExpression * | editableExpression {nullptr} |
std::vector< ExprControl * > | _controls |
QVBoxLayout * | controlLayout |
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 24 of file ExprControlCollection.h.
ExprControlCollection::ExprControlCollection | ( | QWidget * | parent = nullptr , |
bool | showAddButton = true |
||
) |
Definition at line 19 of file ExprControlCollection.cpp.
References addControlDialog(), controlLayout, and showAddButton.
|
override |
Definition at line 38 of file ExprControlCollection.cpp.
References editableExpression.
|
privateslot |
When a user clicks "Add new variable" button.
Definition at line 40 of file ExprControlCollection.cpp.
References KSeExpr::Utils::atof(), count, and insertString().
Referenced by ExprControlCollection().
|
signal |
Notification that a specific control was changed.
Referenced by rebuildControls(), and singleControlChanged().
|
signal |
Emitted to request that a new widget string should be added to the expression i.e. after "Add new variable" was used
Referenced by addControlDialog().
|
privateslot |
Notification by a control that a color is edited (when it is linked)
Definition at line 189 of file ExprControlCollection.cpp.
References _linkedId, and linkColorOutput().
Referenced by rebuildControls().
|
slot |
Notification from outside that a linked color widget was changed and should be forwarded to any linked controls
Definition at line 193 of file ExprControlCollection.cpp.
|
privateslot |
Notification by a control that a new color link is desired.
Definition at line 182 of file ExprControlCollection.cpp.
References _controls, and _linkedId.
Referenced by rebuildControls().
|
signal |
Gives information about when a link color was changed.
Referenced by linkColorEdited().
|
inline |
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 103 of file ExprControlCollection.cpp.
References _controls, _linkedId, controlChanged(), controlLayout, EditableExpression::controlsMatch(), dbgSeExpr, editableExpression, EditableExpression::getVariables(), linkColorEdited(), linkColorLink(), EditableExpression::setExpr(), showAddButton, singleControlChanged(), EditableExpression::size(), and EditableExpression::updateString().
Referenced by ExprEditor::rebuildControls().
void ExprControlCollection::showEditor | ( | int | idx | ) |
Definition at line 178 of file ExprControlCollection.cpp.
|
privateslot |
Notification when by a control whenever it is edited.
Definition at line 203 of file ExprControlCollection.cpp.
References controlChanged().
Referenced by rebuildControls().
void ExprControlCollection::updateText | ( | int | id, |
QString & | text | ||
) |
Request new text, given taking into account control id's new values.
Definition at line 199 of file ExprControlCollection.cpp.
References editableExpression, and EditableExpression::getEditedExpr().
Referenced by ExprEditor::controlChanged().
|
private |
Definition at line 41 of file ExprControlCollection.h.
Referenced by linkColorInput(), linkColorLink(), numControls(), and rebuildControls().
|
private |
Definition at line 28 of file ExprControlCollection.h.
Referenced by linkColorEdited(), linkColorInput(), linkColorLink(), and rebuildControls().
|
private |
Definition at line 42 of file ExprControlCollection.h.
Referenced by ExprControlCollection(), and rebuildControls().
|
private |
Definition at line 29 of file ExprControlCollection.h.
Referenced by addControlDialog().
|
private |
Definition at line 33 of file ExprControlCollection.h.
Referenced by rebuildControls(), updateText(), and ~ExprControlCollection().
|
private |
Definition at line 30 of file ExprControlCollection.h.
Referenced by ExprControlCollection(), and rebuildControls().