コード例 #1
0
ファイル: repotreeview.py プロジェクト: xyt556/argos
    def __init__(self, repoTreeModel, collector, parent=None):
        """ Constructor.
            :param parent:
        """
        super(RepoWidget, self).__init__(parent=parent)

        self.detailDockPanes = []

        self.mainLayout = QtWidgets.QVBoxLayout()
        self.mainLayout.setSpacing(DOCK_SPACING)
        self.mainLayout.setContentsMargins(DOCK_MARGIN, DOCK_MARGIN,
                                           DOCK_MARGIN, DOCK_MARGIN)
        self.setLayout(self.mainLayout)

        self.mainSplitter = QtWidgets.QSplitter(orientation=Qt.Vertical)
        self.mainLayout.addWidget(self.mainSplitter)

        self.repoTreeView = RepoTreeView(repoTreeModel, collector)
        self.mainSplitter.addWidget(self.repoTreeView)
        self.mainSplitter.setCollapsible(0, False)

        self.tabWidget = QtWidgets.QTabWidget()
        self.mainSplitter.addWidget(self.tabWidget)
        self.mainSplitter.setCollapsible(1, True)

        self.propertiesPane = self.addDetailsPane(
            PropertiesPane(self.repoTreeView))
        self.attributesPane = self.addDetailsPane(
            AttributesPane(self.repoTreeView))

        self.repoTreeView.sigRepoItemChanged.connect(self.repoItemChanged)
        self.tabWidget.currentChanged.connect(self.tabChanged)

        self.tabWidget.setCurrentIndex(
            1)  # Show attributes the first time the program runs
コード例 #2
0
    def __init__(self,
                 inspectorRegistry=None,
                 rtiRegistry=None,
                 parent=None):
        """ Constructor
        """
        super(PluginsDialog, self).__init__(parent=parent)

        self.setWindowTitle("Installed Argos Plugins")
        self.setModal(False)

        layout = QtWidgets.QVBoxLayout(self)

        self.tabWidget = QtWidgets.QTabWidget()
        layout.addWidget(self.tabWidget)

        attrNames = ['fullName', 'fullClassName', 'pythonPath']
        headerSizes = [200, 300, None]

        if inspectorRegistry:
            inspectorTab = RegistryTab(inspectorRegistry,
                                       attrNames=attrNames, headerSizes=headerSizes)
            self.tabWidget.addTab(inspectorTab, "Inspectors")

        if rtiRegistry:
            rtiTab = RegistryTab(rtiRegistry,
                                 attrNames=attrNames, headerSizes=headerSizes)
            self.tabWidget.addTab(rtiTab, "File Formats")

        # Sort by fullName by default.
        for tabNr in range(self.tabWidget.count()):
            self.tabWidget.widget(tabNr).tableView.sortByColumn(0, Qt.AscendingOrder)

        # Buttons
        buttonBox = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Ok)
        buttonBox.accepted.connect(self.accept)
        layout.addWidget(buttonBox)

        self.resize(QtCore.QSize(1100, 700))