Exemplo n.º 1
0
    def configure(self, window, document):
        """Summary

        Args:
            window (TYPE): Description
            document (TYPE): Description

        Returns:
            TYPE: Description
        """
        self._window = window
        self._document = document
        self._controller = ViewRootController(self, document)
        self._root = self.invisibleRootItem()

        # Appearance
        self.setFont(_FONT)
        # Columns
        self.setColumnCount(2)
        self.setIndentation(14)
        # Header
        self.setHeaderLabels(["Property", "Value"])
        h = self.header()
        h.resizeSection(0, 200)
        h.resizeSection(1, 100)
        h.setSectionResizeMode(QHeaderView.Interactive)
        # h.setStretchLastSection(False)

        custom_delegate = CustomStyleItemDelegate(self)
        self.setItemDelegate(custom_delegate)

        self.model().dataChanged.connect(self.dataChangedSlot)
Exemplo n.º 2
0
    def resetDocumentAndController(self, document):
        """docstring for resetDocumentAndController

        Args:
            document (TYPE): Description
        """
        self._document = document
        self._controller = ViewRootController(self, document)
Exemplo n.º 3
0
 def __init__(self, rect, parent, window, document):
     super(PathRootItem, self).__init__(rect, parent)
     self._window = window
     self._document = document
     self._controller = ViewRootController(self, document)
     self._model_part = None
     self._part_item_for_part = {}  # Maps Part -> PartItem
     self._selection_filter_dict = {}
     self._initSelections()
Exemplo n.º 4
0
    def resetDocumentAndController(self, document):
        """docstring for resetDocumentAndController

        Args:
            document (TYPE): Description

        Raises:
            ImportError: Description
        """
        self._document = document
        self._controller = ViewRootController(self, document)
        if len(self.instance_items) > 0:
            raise ImportError
Exemplo n.º 5
0
    def configure(self, window, document):
        self._window = window
        self._document = document
        self._controller = ViewRootController(self, document)
        self._root = self.invisibleRootItem()  # access to top level item
        self._instance_items = {}

        # Appearance
        self.setFont(_FONT)
        # Columns
        self.setColumnCount(3)
        self.setIndentation(14)
        # Header
        self.setHeaderLabels(["Name", "", "", ""])
        h = self.header()
        h.setStretchLastSection(False)
        h.setSectionResizeMode(0, QHeaderView.Stretch)
        h.setSectionResizeMode(1, QHeaderView.Fixed)
        h.setSectionResizeMode(2, QHeaderView.Fixed)
        h.setSectionResizeMode(3, QHeaderView.Fixed)
        h.setSectionsMovable(True)
        self.setColumnWidth(0, 120)
        self.setColumnWidth(1, 18)
        self.setColumnWidth(2, 18)
        self.setColumnWidth(3, 18)

        self.setContextMenuPolicy(Qt.CustomContextMenu)
        self.customContextMenuRequested.connect(self.getCustomContextMenu)

        # Dragging
        self.setDragEnabled(True)
        self.setDragDropMode(QAbstractItemView.InternalMove)
        self.setSelectionMode(QAbstractItemView.ExtendedSelection)
        # self.setSelectionMode(QAbstractItemView.MultiSelection)
        self.setSelectionBehavior(QAbstractItemView.SelectRows)

        self.model_selection_changes = (set(), set())
        self.is_child_adding = 0

        custom_delegate = CustomStyleItemDelegate(self)
        self.setItemDelegate(custom_delegate)

        self.selectionModel().selectionChanged.connect(self.selectionFilter)
        '''Temporarily disable the selectionFilter with this so you dont
        get double events
        '''
        self.selection_filter_disabled = False

        self.model().dataChanged.connect(self.dataChangedSlot)

        self.itemClicked.connect(self.itemClickedHandler)
Exemplo n.º 6
0
    def __init__(self, rect, parent, window, document):
        """Summary

        Args:
            rect (TYPE): Description
            parent (TYPE): Description
            window (TYPE): Description
            document (TYPE): Description
        """
        super(SliceRootItem, self).__init__(rect, parent)
        self._window = window
        self._document = document
        self._controller = ViewRootController(self, document)
        self.instance_items = {}
        self.manager = None
        self.select_tool = None
Exemplo n.º 7
0
    def __init__(self, rect, parent, window, document):
        """Summary

        Args:
            rect (TYPE): Description
            parent (TYPE): Description
            window (TYPE): Description
            document (TYPE): Description
        """
        super(PathRootItem, self).__init__(rect, parent)
        self._window = window
        self._document = document
        self._controller = ViewRootController(self, document)
        self._model_part = None
        self._part_item_for_part_instance = {}  # Maps Part -> PartItem
        self._prexover_filter = None
        self.manager = None
        self.select_tool = None
Exemplo n.º 8
0
 def resetDocumentAndController(self, document):
     """docstring for resetDocumentAndController"""
     self._document = document
     self._controller = ViewRootController(self, document)
     if len(self._instance_items) > 0:
         raise ImportError
Exemplo n.º 9
0
 def __init__(self, rect, parent, window, document):
     super(SliceRootItem, self).__init__(rect, parent)
     self._window = window
     self._document = document
     self._controller = ViewRootController(self, document)
     self._instance_items = {}
Exemplo n.º 10
0
 def resetDocumentAndController(self, document):
     """docstring for resetDocumentAndController"""
     self._document = document
     self._controller = ViewRootController(self, document)