GobChartsWidget  1.0
Signals | Public Member Functions | List of all members
GobChartsGraphItems Class Reference

Manages associations between graph items and model indices. More...

#include <gobchartsgraphitems.h>

Inheritance diagram for GobChartsGraphItems:
GobChartsNoCopy

Signals

void lastDebugLogMsg (QString)
 Broadcast debug messages.
 

Public Member Functions

 GobChartsGraphItems (QObject *parent=0)
 Constructor.
 
virtual ~GobChartsGraphItems ()
 Destructor.
 
void addItemsToScene (QGraphicsScene *scene)
 Adds all the mapped QGraphicsItem's to "scene".
 
void removeItemsFromScene (QGraphicsScene *scene)
 Removes all the mapped QGraphicsItem's from "scene".
 
void setSelected (int categoryRow)
 Manipulates the QGraphicsItem corresponding to the given category row (if mapped and found) by changing it's opacity.
 
void clearSelection ()
 Clears the current selection.
 
void addItem (const QModelIndex &valueIndex, QGraphicsItem *item, const QString &legendText)
 Adds a QModelIndex/QGraphicsItem pair to the map.
 
void deleteItems ()
 Delete all the mapped QGraphicsItem's and clear the map.
 
QModelIndex getModelIndex (QGraphicsItem *item) const
 Returns the model index corresponding to "item".
 
QModelIndex getModelIndex (const QString &text) const
 Returns the model index of the item with legend "text".
 
QRectF getItemRectF (const QModelIndex &index) const
 Returns the rectangle of the graphics item corresponding to "index".
 
QRectF getItemRectF (const QString &text) const
 Returns the rectangle of the graphics item corresponding to the legend with text "text".
 
QString getItemLegend (QGraphicsItem *item) const
 Returns the legend text associated with the graphics item.
 
void setDebugLoggingOn (bool logging)
 Turn debug logging "on" or "off" (default "off").
 

Detailed Description

Manages associations between graph items and model indices.

GobChartsGraphItems is a container class that manages associations between graph items (QGraphicsItem's) and their respective indices (QModelIndex's). The class furthermore provides the functionality to add or remove the mapped items to or from a QGraphicsScene and to highlight items currently selected in the view by changing the item's opacity to create the visual distinction.

Definition at line 42 of file gobchartsgraphitems.h.

Member Function Documentation

void GobChartsGraphItems::addItem ( const QModelIndex &  valueIndex,
QGraphicsItem *  item,
const QString &  legendText 
)

Adds a QModelIndex/QGraphicsItem pair to the map.

This function furthermore ensures that the added item can be retrieved based on its corresponding legend text.

See Also
deleteItems()

Definition at line 128 of file gobchartsgraphitems.cpp.

void GobChartsGraphItems::addItemsToScene ( QGraphicsScene *  scene)

Adds all the mapped QGraphicsItem's to "scene".

See Also
removeItemsFromScene()

Definition at line 54 of file gobchartsgraphitems.cpp.

void GobChartsGraphItems::clearSelection ( )

Clears the current selection.

This function will return all the graphic items to their original opacity.

Definition at line 115 of file gobchartsgraphitems.cpp.

void GobChartsGraphItems::deleteItems ( )

Delete all the mapped QGraphicsItem's and clear the map.

See Also
addItem()

Definition at line 139 of file gobchartsgraphitems.cpp.

QString GobChartsGraphItems::getItemLegend ( QGraphicsItem *  item) const

Returns the legend text associated with the graphics item.

Definition at line 216 of file gobchartsgraphitems.cpp.

QRectF GobChartsGraphItems::getItemRectF ( const QModelIndex &  index) const

Returns the rectangle of the graphics item corresponding to "index".

Definition at line 184 of file gobchartsgraphitems.cpp.

QRectF GobChartsGraphItems::getItemRectF ( const QString &  text) const

Returns the rectangle of the graphics item corresponding to the legend with text "text".

Definition at line 200 of file gobchartsgraphitems.cpp.

QModelIndex GobChartsGraphItems::getModelIndex ( QGraphicsItem *  item) const

Returns the model index corresponding to "item".

Definition at line 156 of file gobchartsgraphitems.cpp.

QModelIndex GobChartsGraphItems::getModelIndex ( const QString &  text) const

Returns the model index of the item with legend "text".

Definition at line 170 of file gobchartsgraphitems.cpp.

void GobChartsGraphItems::lastDebugLogMsg ( QString  )
signal

Broadcast debug messages.

This signal broadcasts the last debug log message and will only be emitted when debug logging is turned "on".

See Also
setDebugLoggingOn()
void GobChartsGraphItems::removeItemsFromScene ( QGraphicsScene *  scene)

Removes all the mapped QGraphicsItem's from "scene".

See Also
addItemsToScene()

Definition at line 74 of file gobchartsgraphitems.cpp.

void GobChartsGraphItems::setDebugLoggingOn ( bool  logging)

Turn debug logging "on" or "off" (default "off").

See Also
lastDebugLogMsg()

Definition at line 228 of file gobchartsgraphitems.cpp.

void GobChartsGraphItems::setSelected ( int  categoryRow)

Manipulates the QGraphicsItem corresponding to the given category row (if mapped and found) by changing it's opacity.

When selected the first time, this function lessens the item's opacity (makes it more transparent), otherwise it resets the item to being completely opaque.

See Also
clearSelection()

Definition at line 94 of file gobchartsgraphitems.cpp.


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