#include <graph_scene.h>
GraphScene inherits QGraphicsScene and is used to render all nodes and edges as a graph
- See Also
- http://qt-project.org/doc/qt-4.8/qgraphicsscene.html
GraphScene::GraphScene |
( |
GraphModel * |
graph, |
|
|
QObject * |
parent = 0 |
|
) |
| |
Constructor for the GraphScene
- Parameters
-
graph | The model to be used by the graph |
parent | The parent QGraphicsView for this GraphScene, default is null |
GraphScene::~GraphScene |
( |
| ) |
|
|
virtual |
NodeWidget * GraphScene::add_node_widget |
( |
QModelIndex |
item_index | ) |
|
Add a widget belonging to a specific itemindex
- Parameters
-
item_index | The index of the item to be added |
- Returns
- A reference to the widget for the newly added index
void GraphScene::del_node_widget |
( |
QModelIndex |
item_index | ) |
|
Remove a specifc widget belonging to a specific itemindex
- Parameters
-
item_index | The index of the item to be removed |
std::vector< std::string > GraphScene::get_names_of_all_nodes |
( |
| ) |
|
The names of all nodes added to the scene
- Returns
- A vector of all the names of the nodes added to the scene
NodeWidget * GraphScene::get_node_widget |
( |
std::string |
item_name | ) |
|
Get the widget belonging to a specific node
- Parameters
-
item_name | The name of the widget |
- Returns
- A reference to the widget for the requested node
NodeWidget * GraphScene::get_node_widget |
( |
QString |
item_name | ) |
|
Get the widget belonging to a specific item
- Parameters
-
item_name | The name of the item |
- Returns
- A reference to the widget for the requested item
NodeWidget * GraphScene::get_node_widget |
( |
QModelIndex |
item_index | ) |
|
Get the widget belonging to a specific itemindex
- Parameters
-
item_index | The index of the item |
- Returns
- A reference to the widget for the requested item
int GraphScene::nodes |
( |
| ) |
|
The number of nodes added to the scene
- Returns
- The number of nodes added to the scene
void GraphScene::populateScene |
( |
| ) |
|
Method for populating the GraphScene with items(rendering them) from the model set for the GraphScene
void GraphScene::set_color_column |
( |
int |
color | ) |
|
Set the index for the color column for the nodes
- Parameters
-
color | The color column index for the nodes |
Set the model to be used for the GraphScene
- Parameters
-
void GraphScene::set_node_label_column |
( |
int |
column_idx | ) |
|
Set index for the label column for the node
- Parameters
-
column_idx | The label column for the node |
void GraphScene::set_xy_columns |
( |
int |
x_idx, |
|
|
int |
y_idx |
|
) |
| |
Set the indexes for the the x and y columns for the nodes
- Parameters
-
x_idx | The x column index for the nodes |
y_idx | The y column index for the nodes |
The documentation for this class was generated from the following files: