enricong
4th May 2012, 16:36
I have a data table which includes coordinate values which correspond with associated properties.
I plan to have a QGraphicsScene where circles are drawn based on each coordinate value.
Then, I also wish to have a QTreeView/Widget next to it with a branch for each coordinate/circle.
When the user clicks on a specific circle, I would like the QTree to select the corresponding entry.
When the user clicks on the specific QTree item, I'd like the corresponding circle to be highlighted
I can think of two ways to do this:
1. as I read the table, and start drawing circles and populate the tree, link each coordinate - circle pair using signal/slots for each
2. create a data structure saving the pointer to the circles and tree items. Setup one signal/slot, passing an ID value, the lookup the pointers in the data structure.
I'd appreciate any other ideas on the best way to do this.
Thanks
I plan to have a QGraphicsScene where circles are drawn based on each coordinate value.
Then, I also wish to have a QTreeView/Widget next to it with a branch for each coordinate/circle.
When the user clicks on a specific circle, I would like the QTree to select the corresponding entry.
When the user clicks on the specific QTree item, I'd like the corresponding circle to be highlighted
I can think of two ways to do this:
1. as I read the table, and start drawing circles and populate the tree, link each coordinate - circle pair using signal/slots for each
2. create a data structure saving the pointer to the circles and tree items. Setup one signal/slot, passing an ID value, the lookup the pointers in the data structure.
I'd appreciate any other ideas on the best way to do this.
Thanks