| 39 | } |
| 40 | |
| 41 | void |
| 42 | Monitor::NodeGenerator::calcLayout(TreeNode *t, int w, int h) |
| 43 | { |
| 44 | static int xpos = 0; |
| 45 | static int ypos = 0; |
| 46 | |
| 47 | // reset width and height of scene |
| 48 | if (t == 0) { |
| 49 | return; |
| 50 | } |
| 51 | |
| 52 | QString text; |
| 53 | |
| 54 | if (isNodeValid(t, text)) { |
| 55 | |
| 56 | xpos = w * 100; |
| 57 | ypos += 50; |
| 58 | |
| 59 | // create nodes to figure out width and height of layout |
| 60 | Node node(text, xpos, ypos, t); |
| 61 | sceneWidth_ = xpos + node.boundingRect().width(); |
| 62 | sceneHeight_ = ypos + node.boundingRect().width(); |
| 63 | |
| 64 | ++w; |
| 65 | for (int i = 0; i < t->size(); ++i) { |
| 66 | calcLayout(t->operator[](i), w, ++h); |
| 67 | } |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | void |
| 72 | Monitor::NodeGenerator::findConnections(TreeNode * t) |
no test coverage detected