##

VariablePillContainer Class Reference

A container for holding variable pills. More...

`#include <VariablePillContainer.hh>`

Inherits QWidget.

## Signals

void | VariableAdded (const unsigned int _id, const std::string &_name, const unsigned int _targetId)
| Qt signal emitted when a variable is added to the container. More...
void | VariableLabelChanged (const unsigned int _id, const std::string &_label)
| Qt signal emitted when a variable label has changed. More...
void | VariableMoved (const unsigned int _id, const unsigned int _targetId)
| Qt signal emitted when a variable is moved into the container. More...
void | VariableRemoved (const unsigned int _id, const unsigned int _targetId)
| Qt signal emitted when a variable is removed from the container. More...

## Public Member Functions

| VariablePillContainer (QWidget *_parent=nullptr)
| Constructor. More...
virtual | ~VariablePillContainer ()
| Destructor. More...
unsigned int | AddVariablePill (const std::string &_name, const unsigned int _targetId=VariablePill::EmptyVariable)
| Add a new variable pill to a multi-variable pill in the container. More...
void | AddVariablePill (VariablePill *_variable, const unsigned int _targetId=VariablePill::EmptyVariable)
| Add a variable pill to the container. More...
VariablePill * | GetVariablePill (const unsigned int _id) const
| Get a variable pill by id. More...
int | MaxSize () const
| Get the maximum number of variable pills this container can hold. More...
void | RemoveVariablePill (const unsigned int _id)
| Remove a variable pill from the container. More...
void | RemoveVariablePill (VariablePill *_variable)
| Remove a variable pill from the container. More...
void | SetMaxSize (const int _max)
| Set the maximum number of variable pills this container can hold. More...
void | SetSelected (VariablePill *_variable)
| Set the selected state of a variable pill. More...
void | SetText (const std::string &_text)
| Set the label text for this variable pill container. More...
void | SetVariablePillLabel (const unsigned int _id, const std::string &_text)
| Set the label text for a variable pill in this container. More...
std::string | Text () const
| Get the variable pill container's label text. More...
unsigned int | VariablePillCount () const
| Get the number of child variable pills. More...

## Protected Member Functions

void | dragEnterEvent (QDragEnterEvent *_evt)
| Used to accept drag enter events. More...
void | dropEvent (QDropEvent *_evt)
| Used to accept drop events. More...
virtual void | keyPressEvent (QKeyEvent *_event)
| Qt callback when a key is pressed. More...
void | mouseReleaseEvent (QMouseEvent *_event)
| Qt callback when the mouse is released. More...

## Detailed Description

A container for holding variable pills.

## Constructor & Destructor Documentation

## VariablePillContainer()

VariablePillContainer | ( | QWidget * | _parent = `nullptr` | ) |

explicit

Constructor.

Parameters

  [in] | _parent | Pointer to a parent widget

## ~VariablePillContainer()

virtual ~VariablePillContainer | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## AddVariablePill() [1/2]

unsigned int AddVariablePill | ( | const std::string & | _name,
|  | const unsigned int | _targetId = `VariablePill::EmptyVariable`
| ) |  |

Add a new variable pill to a multi-variable pill in the container.

Parameters

  [in] | _name | Name of variable pill to add.
  [in] | _targetId | Unqiue id of the variable pill to add to.

## AddVariablePill() [2/2]

void AddVariablePill | ( | VariablePill * | _variable,
|  | const unsigned int | _targetId = `VariablePill::EmptyVariable`
| ) |  |

Add a variable pill to the container.

Parameters

  [in] | _variable | Variable pill to add.
  [in] | _targetId | Unqiue id of the variable pill to add to.

## dragEnterEvent()

void dragEnterEvent | ( | QDragEnterEvent * | _evt | ) |

protected

Used to accept drag enter events.

Parameters

  [in] | _evt | The drag event.

## dropEvent()

void dropEvent | ( | QDropEvent * | _evt | ) |

protected

Used to accept drop events.

Parameters

  [in] | _evt | The drop event.

## GetVariablePill()

VariablePill* GetVariablePill | ( | const unsigned int | _id | ) | const

Get a variable pill by id.

Parameters

  [in] | _id | Variable pill id

Returns
  Variable pill with the specified id.

## keyPressEvent()

virtual void keyPressEvent | ( | QKeyEvent * | _event | ) |

protected virtual

Qt callback when a key is pressed.

Parameters

  [in] | _event | Qt key event.

## MaxSize()

int MaxSize | ( |  | ) | const

Get the maximum number of variable pills this container can hold.

Returns
  Maximum number of variable pills. -1 means unlimited.

## mouseReleaseEvent()

void mouseReleaseEvent | ( | QMouseEvent * | _event | ) |

protected

Qt callback when the mouse is released.

Parameters

  [in] | _event | Qt mouse event.

## RemoveVariablePill() [1/2]

void RemoveVariablePill | ( | const unsigned int | _id | ) |

Remove a variable pill from the container.

Parameters

  [in] | _id | Unique id of the variable pill to remove.

## RemoveVariablePill() [2/2]

void RemoveVariablePill | ( | VariablePill * | _variable | ) |

Remove a variable pill from the container.

Parameters

  [in] | _variable | Variable pill to remove.

## SetMaxSize()

void SetMaxSize | ( | const int | _max | ) |

Set the maximum number of variable pills this container can hold.

Parameters

  [in] | _max | Maximum number of variable pills. -1 means unlimited.

## SetSelected()

void SetSelected | ( | VariablePill * | _variable | ) |

Set the selected state of a variable pill.

Parameters

  [in] | _variable | Variable pill to set the selected state.

## SetText()

void SetText | ( | const std::string & | _text | ) |

Set the label text for this variable pill container.

Parameters

  [in] | _text | Text to set the label to.

## SetVariablePillLabel()

void SetVariablePillLabel | ( | const unsigned int | _id,
|  | const std::string & | _text
| ) |  |

Set the label text for a variable pill in this container.

Parameters

  [in] | _id | Unique id of the variable pill.
  [in] | _text | Text to set the variable pill label to.

## Text()

std::string Text | ( |  | ) | const

Get the variable pill container's label text.

Returns
  Container label.

## VariableAdded

void VariableAdded | ( | const unsigned int | _id,
|  | const std::string & | _name,
|  | const unsigned int | _targetId
| ) |  |

signal

Qt signal emitted when a variable is added to the container.

Parameters

  [in] | _id | Unique id of the variable pill.
  [in] | _name | Name of variable pill added.
  [in] | _targetId | Unique id of the target variable pill that this variable is added to. VariablePill::EmptyVariable if it is added to a container and not a variable pill.

## VariableLabelChanged

void VariableLabelChanged | ( | const unsigned int | _id,
|  | const std::string & | _label
| ) |  |

signal

Qt signal emitted when a variable label has changed.

Parameters

  [in] | _id | Unique id of the variable pill.
  [in] | _label | New variable label.

## VariableMoved

void VariableMoved | ( | const unsigned int | _id,
|  | const unsigned int | _targetId
| ) |  |

signal

Qt signal emitted when a variable is moved into the container.

Parameters

  [in] | _id | Unique id of the variable pill.
  [in] | _targetId | Unique id of the target variable pill that this variable has moved to. VariablePill::EmptyVariable if it moved to a container and not a variable pill.

## VariablePillCount()

unsigned int VariablePillCount | ( |  | ) | const

Get the number of child variable pills.

Returns
  Number of child variable pills.

## VariableRemoved

void VariableRemoved | ( | const unsigned int | _id,
|  | const unsigned int | _targetId
| ) |  |

signal

Qt signal emitted when a variable is removed from the container.

Parameters

  [in] | _id | Unique id of the variable pill.
  [in] | _targetId | Unique id of the target variable pill that this variable is removed from. VariablePill::EmptyVariable if it is removed from a container and not a variable pill.

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

- VariablePillContainer.hh