OMNotebook: IAEX::CellGroup Class Reference

- Main Page
- Classes
- Files
- Related Pages
- Examples

- Class List
- Class Hierarchy
- Class Members

# IAEX::CellGroup Class Reference

CellGroup implements the functionality to be a Cell and contain a lot of subcells. More...

Inheritance diagram for IAEX::CellGroup:

List of all members.

## Public Slots
virtual void | setStyle (CellStyle style)
| Set the cells style. If the cell is closed, set style on the first child (the cell thats displayed).
void | setClosed (const bool closed)
| This function hides/shows the content of a groupcell.
## Public Member Functions
| CellGroup (QWidget *parent=0)
| The class constructor.
virtual | ~CellGroup ()
| The class destructor.
virtual void | accept (Visitor &v)
| Decides if a visitor is allowed to visit the object.
virtual void | addChild (Cell *newCell)
virtual void | removeChild (Cell *aCell)
| Removes a cell from a cellgroup. But does not delete the cell!
int | height ()
| calculates the height of the cellgroup.
CellStyle * | style ()
| Return the cells style. If the cell is closed, style is returned from the first child (the cell thats displayed). If the cell is opened this function returns a new CellStyle with the name 'cellgroup';.
void | closeChildCells ()
| hide() or show() the child cells of the groupcell, depending on the state of the groupcell (opened or closed). This must be done because otherwise qt layout will compress all child and display them in the smaller height set went the groupcell is closed.
bool | isClosed () const
bool | isEditable ()
| Function for telling if the user is allowed to change the text settings for the text inside the cell. User isn't allowed to change the text settings for cellgroups so this function always return false.
## Protected Slots
void | adjustHeight ()
## Protected Member Functions
void | mouseDoubleClickEvent (QMouseEvent *event)
| open and close the groupcell when double click on the treeview

## Detailed Description

CellGroup implements the functionality to be a Cell and contain a lot of subcells.

Author:
  Ingemar Axelsson and Anders Fernström

Todo:
  Reimplement as a composite instead. That is much much cleaner. Also look at CellWorkspace and rename CellContainer to CellDocument. CellWorkspace should dissappear.(Ingemar Axelsson)

Todo:
  Analyse class and find out what is different from the Cell class. Is it possible that cell and cellgroup should be integrated as one class? It should be easy to convert from a cell to a cellgroup. (Ingemar Axelsson)

## Constructor & Destructor Documentation

IAEX::CellGroup::CellGroup | ( | QWidget * | parent = `0` | ) |

| The class constructor. Author: Ingemar Axelsson

IAEX::CellGroup::~CellGroup | ( |  | ) | `[virtual]`

| The class destructor. Author: Ingemar Axelsson

## Member Function Documentation

void IAEX::CellGroup::accept | ( | Visitor & | v | ) | `[virtual]`

| Decides if a visitor is allowed to visit the object. Traverses the structure in preorder. Todo: Could the traversing order be decided in the visitor instead without to much dirt added to the code class? This is definitly not important.(Ingemar Axelsson) Todo: Implement an Iterator for the cell structure. This could be nice.(Ingemar Axelsson) Reimplemented from IAEX::Cell.

void IAEX::CellGroup::addChild | ( | Cell * | newCell | ) | `[virtual]`

| Todo: Try to get rid of the dependency of the doc() member. One way should be to use the cursor when opening a document. Use the cursors add functionality. Then this could be removed. The dependency should only be in the cursor then.(Ingemar Axelsson) Reimplemented from IAEX::Cell.

void IAEX::CellGroup::adjustHeight | ( |  | ) | `[protected, slot]`

| Author: Ingemar Axelsson

void IAEX::CellGroup::closeChildCells | ( |  | ) |

| hide() or show() the child cells of the groupcell, depending on the state of the groupcell (opened or closed). This must be done because otherwise qt layout will compress all child and display them in the smaller height set went the groupcell is closed. Author: Anders Fernström Date: 2005-11-30

int IAEX::CellGroup::height | ( |  | ) |

| calculates the height of the cellgroup. Author: Ingemar Axelsson Calculates the height of the cellgroup. The calculated height depends on the state of the group. Is the group closed then the height is just the first cell otherwise the height is a sum of the height of all cells. Returns: height of cellgroup. Bug: HeightVisitor does not return correct height value. I do not know why, so I implemented another way to traverse subcells and asking for heights.

bool IAEX::CellGroup::isClosed | ( |  | ) | const`[virtual]`

| Author: Ingemar Axelsson Reimplemented from IAEX::Cell.

bool IAEX::CellGroup::isEditable | ( |  | ) | `[virtual]`

| Function for telling if the user is allowed to change the text settings for the text inside the cell. User isn't allowed to change the text settings for cellgroups so this function always return false. Author: Anders Fernström Date: 2005-10-28 Returns: False Implements IAEX::Cell.

void IAEX::CellGroup::mouseDoubleClickEvent | ( | QMouseEvent * | event | ) | `[protected]`

| open and close the groupcell when double click on the treeview Author: Ingemar Axelsson (and Anders Fernström) Date: 2005-11-30 (update) 2005-11-30 AF, added the call to 'closeChildCells()' Todo: Should this be moved to treeview?(Ingemar Axelsson)

void IAEX::CellGroup::setClosed | ( | const bool | closed | ) | `[virtual, slot]`

  | This function hides/shows the content of a groupcell. Author: Ingemar Axelsson This member hides/shows the content of a cellgroup. The height of the cellgroup is calculated depending on wich case it is. Parameters:
  | closed | tells if the cells should be visible or hidden.
Todo: Add some signals when this happens. It can be possible that someone will do some fun stuff when a cell is closing.(Ingemar Axelsson) Todo: reimplement with removing and adding to the layout instead.(Ingemar Axelsson) Bug: This function could create a segmentation fault in some special cases. Try to find them. Reimplemented from IAEX::Cell.

void IAEX::CellGroup::setStyle | ( | CellStyle | style | ) | `[virtual, slot]`

  | Set the cells style. If the cell is closed, set style on the first child (the cell thats displayed). Author: Ingemar Axelsson and Anders Fernström Date: 2005-10-28 (update) 2005-10-28, changes style from QString to CellStyle /AF Parameters:
  | style | The cell style that is to be applyed to the cell
Reimplemented from IAEX::Cell.

CellStyle * IAEX::CellGroup::style | ( |  | ) | `[virtual]`

| Return the cells style. If the cell is closed, style is returned from the first child (the cell thats displayed). If the cell is opened this function returns a new CellStyle with the name 'cellgroup';. Author: Ingemar Axelsson and Anders Fernström Date: 2005-10-28 (update) 2005-10-28, changes style from QString to CellStyle /AF Returns: The cells style Reimplemented from IAEX::Cell.

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

- C:/OpenModelica/OMNotebookQT4 v2/OMNotebookQT4/cellgroup.h
- C:/OpenModelica/OMNotebookQT4 v2/OMNotebookQT4/cellgroup.cpp