Beispiel #1
0
    def build_widget(self):
        self._h_layout = QtWidgets.QHBoxLayout()

        spacer = QtWidgets.QSpacerItem(20, 20)

        self._integrate_location_label = QtWidgets.QLabel()
        self._integrate_location_label.setText('Output Location: {}'.format(
            self.add_configuration.output_location))
        self._integrate_location_changeBtn = QtWidgets.QPushButton()
        self._integrate_location_changeBtn.setMaximumHeight(23)
        self._integrate_location_changeBtn.setText('Change')

        self._logging_location_label = QtWidgets.QLabel()
        self._logging_location_label.setText('Logging Location: {}'.format(
            self.add_configuration.logging_location))
        self._logging_location_changeBtn = QtWidgets.QPushButton()
        self._logging_location_changeBtn.setMaximumHeight(23)
        self._logging_location_changeBtn.setText('Change')

        self._logging_status = QtWidgets.QLabel()
        self._logging_status.setText('Logging: ')
        self._logging_status_checkBox = QtWidgets.QCheckBox()
        self._logging_status_checkBox.setChecked(
            self.add_configuration.logging_option)

        self._h_layout.addWidget(self._integrate_location_label)
        self._h_layout.addWidget(self._integrate_location_changeBtn)
        self._h_layout.addItem(spacer)
        self._h_layout.addWidget(self._logging_location_label)
        self._h_layout.addWidget(self._logging_location_changeBtn)
        self._h_layout.addItem(spacer)
        self._h_layout.addWidget(self._logging_status)
        self._h_layout.addWidget(self._logging_status_checkBox)
        self.setLayout(self._h_layout)
    def build_widget_items(self, top_item):
        """
        Building the QTreeWidgetItems for the QTreeWidget

        Args:
            top_item (QTreeWidget): The top item the widgets
                will be parented to. Single items will only be 
                parented to QTreeWidget. Folders will be parented
                to the first item widget.
        """
        ## Column 0 - Input:
        self._folder_widget = QtWidgets.QLabel()
        self._folder_widget.setText(self._folder)
        top_item.setItemWidget(self, 0, self._folder_widget)

        ## Column 1 - filename:
        self._filename_widget = QtWidgets.QLabel()
        self._filename_widget.setText(self._filename)
        self._filename_widget.setAlignment(QtCore.Qt.AlignCenter)
        top_item.setItemWidget(self, 1, self._filename_widget)
 
        ## Column 1 - Sequence:
        self._sequence_widget = QtWidgets.QComboBox()
        self._sequence_widget.addItem(self._sequence)
        self._sequence_widget.setEditable(True)
        top_item.setItemWidget(self, 2, self._sequence_widget)
        {
            self._sequence_widget.addItem(os.path.basename(key)) 
            for (key, value) in self._app_config.add_configuration.output_subfolders.items()
        }
        self._sequence_widget.currentIndexChanged.connect(self.update_shot_wdgs)
 
        ## Column 2 - Shot:
        self._shot_widget = QtWidgets.QComboBox()
        self._shot_widget.addItem(self._shot)
        self._shot_widget.setEditable(True)
        top_item.setItemWidget(self, 3, self._shot_widget)

        ## Column 3 - Location
        self._location_widget = QtWidgets.QComboBox()
        self._location_widget.addItem(str(self._location))
        self._location_widget.setEditable(True)
        top_item.setItemWidget(self, 4, self._location_widget)

        ## Column 4 - Option
        self._option_widget = QtWidgets.QComboBox()
        [self._option_widget.addItem(option) for option in self._OPTIONS]
        top_item.setItemWidget(self, 5, self._option_widget)

        self.option_override()
        self._option_widget.currentIndexChanged.connect(self.option_override)

        # If the header file is passed, some overrides need to be set to allow 
        # an easier override option for all sub items
        if self._header:
            self._option_widget.currentIndexChanged.connect(self.header_option_override)
            self._location_widget.currentTextChanged.connect(self.header_location_override)
            self._sequence_widget.currentTextChanged.connect(self.header_sequence_override)
            self._shot_widget.currentTextChanged.connect(self.header_shot_override)