Ejemplo n.º 1
0
    def __init__(self, parent=None):
        super(CQueueWindow, self).__init__(parent)
        self.setWindowTitle('CQueue')
        self.setObjectName('CQueueWindow')
        self.resize(1280, 600)
        self.recent_menu = None
        self.create_menu()

        main_widget = QtWidgets.QWidget(self)
        main_vbox = QtWidgets.QVBoxLayout(main_widget)
        self.setCentralWidget(main_widget)

        splitter = QtWidgets.QSplitter()
        splitter.setSizePolicy(QtWidgets.QSizePolicy.Preferred,
                               QtWidgets.QSizePolicy.Expanding)
        main_vbox.addWidget(splitter)

        # Create the list of available components
        widget = QtWidgets.QWidget()
        vbox = QtWidgets.QVBoxLayout(widget)
        vbox.setContentsMargins(0, 0, 0, 0)
        self.component_tree = QtWidgets.QTreeView()
        self.component_tree.setSelectionMode(
            QtWidgets.QAbstractItemView.ExtendedSelection)
        self.component_tree.setDragEnabled(True)
        vbox.addWidget(self.component_tree)
        splitter.addWidget(widget)

        widget = QtWidgets.QWidget()
        splitter.addWidget(widget)
        vbox = QtWidgets.QVBoxLayout(widget)
        scroll_area = QtWidgets.QScrollArea()
        scroll_area.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                  QtWidgets.QSizePolicy.Expanding)
        self.queue_widget = QueueWidget(parent=self)
        self.queue_widget.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                        QtWidgets.QSizePolicy.Expanding)
        scroll_area.setWidget(self.queue_widget)
        scroll_area.setWidgetResizable(True)
        vbox.addWidget(scroll_area)
        hbox = QtWidgets.QHBoxLayout()
        vbox.addLayout(hbox)
        button = QtWidgets.QPushButton('Execute')
        button.released.connect(self.queue_widget.execute_queue)
        hbox.addWidget(button)

        splitter.setSizes([50, 300])
        splitter.setStretchFactor(0, 0.5)

        self.populate_components()
Ejemplo n.º 2
0
    def __init__(self, parent=None):
        super(WeightRemapDialog, self).__init__(parent)
        self.setWindowTitle('Remap Weights')
        self.setObjectName('remapWeightsUI')
        self.setModal(True)
        self.resize(600, 400)
        self.mapping = {}

        mainvbox = QtWidgets.QVBoxLayout(self)

        label = QtWidgets.QLabel('The following influences have no corresponding influence from the ' \
                             'imported file.  You can either remap the influences or skip them.')
        label.setWordWrap(True)
        mainvbox.addWidget(label)

        hbox = QtWidgets.QHBoxLayout()
        mainvbox.addLayout(hbox)

        # The existing influences that didn't have weight imported
        vbox = QtWidgets.QVBoxLayout()
        hbox.addLayout(vbox)
        vbox.addWidget(QtWidgets.QLabel('Unmapped influences'))
        self.existing_influences = QtWidgets.QListWidget()
        vbox.addWidget(self.existing_influences)

        vbox = QtWidgets.QVBoxLayout()
        hbox.addLayout(vbox)
        vbox.addWidget(QtWidgets.QLabel('Available imported influences'))
        widget = QtWidgets.QScrollArea()
        self.imported_influence_layout = QtWidgets.QVBoxLayout(widget)
        vbox.addWidget(widget)

        hbox = QtWidgets.QHBoxLayout()
        mainvbox.addLayout(hbox)
        hbox.addStretch()
        btn = QtWidgets.QPushButton('Ok')
        btn.released.connect(self.accept)
        hbox.addWidget(btn)