0

This is a follow-up question of Making an editable flowchart in Qt/C++.

I want to add a QGraphicsItem to a QGraphicsGridLayout in a way that the item takes up its own spot in the grid and then automatically centers in its 'cell'. I am using QGraphicsView and QGraphicsScene, and drag-and-drop to any location works, but it's looking messy, and could prove to be problematic in future development.

What do I have to do so the item snaps to the grid and centers in its cell?

PS: I have taken a look at http://qt-project.org/doc/qt-4.8/graphicsview-basicgraphicslayouts.html as an example but this didn't help me to solve my problem.

Also, it'd be ideal to have this layout and its data be savable to a text file, etc. I'm assuming a 2D array would be the best way to do this. Should I somehow make the QGraphicsGridLayout based on that array, or is there a better solution?

Community
  • 1
  • 1
mhag
  • 85
  • 2
  • 6
  • I've rewrote some passages to make them easier to read. To increase the chances of getting an answer, you should add a small example of your current implementation, and maybe a screenshot of what the result looks like now and a sketch of how you want it to look like instead. – Tim Meyer Aug 15 '14 at 06:46
  • Concerning the save to file thing, I recommend creating a separate question, posts in Stackoverflow should only have one question in them. – Tim Meyer Aug 15 '14 at 06:52

0 Answers0