示例#1
0
 def __init__(self, parent=None, label=""):
     logging.debug(__name__ + ": __init__")
     BoxDecayView.__init__(self, parent)
     self._connections = {}
     self._colors = [Qt.red, Qt.green, Qt.blue, Qt.cyan, Qt.magenta]
     self._colorIndex = 0
     PointToPointConnection.CONNECTION_THICKNESS = 2
     self.setSortBeforeArranging(False)
     self._highlightedObjects = []
     self._highlightedWidgets = []
示例#2
0
 def __init__(self, parent=None, label=""):
     logging.debug(__name__ + ": __init__")
     BoxDecayView.__init__(self, parent)
     self._connections = {}
     self._colors = [Qt.red, Qt.green, Qt.blue, Qt.cyan, Qt.magenta]
     self._colorIndex = 0
     PointToPointConnection.CONNECTION_THICKNESS = 2
     self.setSortBeforeArranging(False)
     self._highlightedObjects = []
     self._highlightedWidgets = []
示例#3
0
    def testExample(self):
        logging.debug(self.__class__.__name__ + ': testExample()')
        self.app = QApplication(sys.argv)
        self.window = QMainWindow()
        self.window.setWindowTitle("test BoxDecayView")
        self.window.resize(300, 300)
        self.app.setActiveWindow(self.window)
        self.window.show()
        self.scrollArea = ZoomableScrollArea(self.window)
        self.window.setCentralWidget(self.scrollArea)
        self.boxDecayView = BoxDecayView()
        self.scrollArea.setWidget(self.boxDecayView)
        accessor = TestDataAccessor()
        self.boxDecayView.setDataAccessor(accessor)
        self.boxDecayView.setDataObjects(accessor.topLevelObjects())
        self.boxDecayView.setBoxContentScript("str(object.Label)")
        self.boxDecayView.updateContent()
        for w in self.boxDecayView.children():
            if hasattr(w, "setDragable"):
                w.setDragable(True, True)

        if not hasattr(unittest, "NO_GUI_TEST"):
            self.app.exec_()
示例#4
0
class BoxDecayViewTestCase(unittest.TestCase):
    def testExample(self):
        logging.debug(self.__class__.__name__ + ': testExample()')
        self.app = QApplication(sys.argv)
        self.window = QMainWindow()
        self.window.setWindowTitle("test BoxDecayView")
        self.window.resize(300,300)
        self.app.setActiveWindow(self.window)
        self.window.show()
        self.scrollArea = ZoomableScrollArea(self.window)
        self.window.setCentralWidget(self.scrollArea)
        self.boxDecayView = BoxDecayView()
        self.scrollArea.setWidget(self.boxDecayView)
        accessor=TestDataAccessor()
        self.boxDecayView.setDataAccessor(accessor)
        self.boxDecayView.setDataObjects(accessor.topLevelObjects())
        self.boxDecayView.setBoxContentScript("str(object.Label)")
        self.boxDecayView.updateContent()
        for w in self.boxDecayView.children():
            if hasattr(w, "setDragable"):
                w.setDragable(True, True)

        if not hasattr(unittest,"NO_GUI_TEST"):
            self.app.exec_()
示例#5
0
 def createBox(self, widgetParent, container, title, text):
     widget = BoxDecayView.createBox(self, widgetParent, container, title,
                                     text)
     widget.setToolTip(
         "Double click to display this module with its dependencies")
     return widget
示例#6
0
 def updateContent(self, overrideCheck=False):
     self._highlightedWidgets = []
     ok = BoxDecayView.updateContent(self, overrideCheck)
     self.highlight()
     return ok
示例#7
0
 def createBox(self, widgetParent, container, title, text):
     widget = BoxDecayView.createBox(self, widgetParent, container, title, text)
     widget.setToolTip("Double click to display this module with its dependencies")
     return widget
示例#8
0
 def updateContent(self, overrideCheck=False):
     self._highlightedWidgets = []
     ok = BoxDecayView.updateContent(self, overrideCheck)
     self.highlight()
     return ok
示例#9
0
 def selection(self):
     return self.dataAccessor().read(BoxDecayView.selection(self))
示例#10
0
 def createBox(self, widgetParent, container, title, text):
     widget = BoxDecayView.createBox(self, widgetParent, container, title,
                                     text)
     if isinstance(widget, WidgetContainer):
         widget.setNotCollapsable()
     return widget
示例#11
0
 def selection(self):
     return self.dataAccessor().read(BoxDecayView.selection(self))
示例#12
0
 def createBox(self, widgetParent, container, title, text):
     widget = BoxDecayView.createBox(self, widgetParent, container, title, text)
     if isinstance(widget, WidgetContainer):
         widget.setNotCollapsable()
     return widget