18 |
18 |
19 class UMLDialog(QMainWindow): |
19 class UMLDialog(QMainWindow): |
20 """ |
20 """ |
21 Class implementing a dialog showing UML like diagrams. |
21 Class implementing a dialog showing UML like diagrams. |
22 """ |
22 """ |
23 def __init__(self, diagramName="Unnamed", parent=None, name=None): |
23 def __init__(self, buildFunction=None, diagramName="Unnamed", parent=None, name=None): |
24 """ |
24 """ |
25 Constructor |
25 Constructor |
26 |
26 |
|
27 @param buildFunction function to build the diagram contents (function) |
|
28 @param diagramName name of the diagram (string) |
27 @param parent parent widget of the view (QWidget) |
29 @param parent parent widget of the view (QWidget) |
28 @param name name of the view widget (string) |
30 @param name name of the view widget (string) |
29 """ |
31 """ |
30 super().__init__(parent) |
32 super().__init__(parent) |
31 |
33 |
32 if not name: |
34 if not name: |
33 self.setObjectName("UMLDialog") |
35 self.setObjectName("UMLDialog") |
34 else: |
36 else: |
35 self.setObjectName(name) |
37 self.setObjectName(name) |
36 |
38 |
|
39 self.buildFunction = buildFunction |
37 self.scene = QGraphicsScene(0.0, 0.0, 800.0, 600.0) |
40 self.scene = QGraphicsScene(0.0, 0.0, 800.0, 600.0) |
38 self.umlView = UMLGraphicsView(self.scene, diagramName, self, "umlView") |
41 self.umlView = UMLGraphicsView(self.scene, diagramName, self, "umlView") |
39 |
42 |
40 self.closeAct = \ |
43 self.closeAct = \ |
41 QAction(UI.PixmapCache.getIcon("close.png"), |
44 QAction(UI.PixmapCache.getIcon("close.png"), |