How to use the harvesters._private.frontend.pyqt5.feature_tree.TreeItem function in harvesters

To help you get started, we’ve selected a few harvesters examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github genicam / harvesters / harvesters / _private / frontend / pyqt5 / feature_tree.py View on Github external
def setupModelData(self, features, parent_item):
        for feature in features:
            interface_type = feature.node.principal_interface_type
            item = TreeItem([feature, feature], parent_item)
            parent_item.appendChild(item)
            if interface_type == EInterfaceType.intfICategory:
                self.setupModelData(feature.features, item)
github genicam / harvesters / harvesters / _private / frontend / pyqt5 / feature_tree.py View on Github external
def __init__(self, parent=None, node_map: NodeMap=None, thread=None):
        """
        REMARKS: QAbstractItemModel might impact the performance and could
        slow Harvester. As far as we've confirmed, QAbstractItemModel calls
        its index() method for every item already shown. Especially, such
        a call happens every time when (1) its view got/lost focus or (2)
        its view was scrolled. If such slow performance makes people
        irritating we should investigate how can we optimize it.

        """
        #
        super().__init__()

        #
        self._root_item = TreeItem(('Feature Name', 'Value'))
        self._node_map = node_map
        if node_map:
            self.setupModelData(node_map.Root.features, self._root_item)