def _updateWidgets(self): """ Updates the combo and spin boxes given the new rti or axes. Emits the sigContentsChanged signal. """ row = 0 model = self.tree.model() # Create path label nodePath = '' if self.rti is None else self.rti.nodePath pathItem = model.item(row, 0) if pathItem: # Reusing path item. If we remove all items the column size will be lost. pathItem.setText(nodePath) else: pathItem = QtGui.QStandardItem(nodePath) pathItem.setEditable(False) model.setItem(row, 0, pathItem) pathItem.setToolTip(nodePath) if self.rti is not None: pathItem.setIcon(self.rti.decoration) self._deleteSpinBoxes(row) self._populateComboBoxes(row) self._createSpinBoxes(row) self._updateRtiInfo() self.tree.resizeColumnsFromContents(startCol=self.COL_FIRST_COMBO) logger.debug("{} sigContentsChanged signal (_updateWidgets)".format( "Blocked" if self.signalsBlocked() else "Emitting")) self.sigContentsChanged.emit(UpdateReason.RTI_CHANGED)
def _setHeaderLabel(self, col, text): """ Sets the header of column col to text. Will increase the number of columns if col is larger than the current number. """ model = self.tree.model() item = model.horizontalHeaderItem(col) if item: item.setText(text) else: model.setHorizontalHeaderItem(col, QtGui.QStandardItem(text))