示例#1
0
 def appendEmptyRow(self) -> bool:
     row = self.rowCount()
     # Create a dummy entry
     f = FrameModel()
     f.name = _EMPTY_ROW_NAME
     self.beginInsertRows(QModelIndex(), row, row)
     self.__workbench.append(f)
     self.__nameToIndex[f.name] = row
     self.endInsertRows()
     self.emptyRowInserted.emit(self.index(row, 0, QModelIndex()))
     return True
示例#2
0
 def injectEditor(self, editor: 'AbsOperationEditor') -> None:
     editor.setSizeHint(400, 600)
     # Set frame model from shape
     editor.table.setSourceFrameModel(FrameModel(editor, self.shapes[0]))
     # Stretch new section
     editor.table.tableView.horizontalHeader().setSectionResizeMode(
         3, QHeaderView.Stretch)
示例#3
0
 def setWorkbench(self, w: WorkbenchModel) -> None:
     self._workbench = w
     self.CBL.setModel(w)
     self.CBR.setModel(w)
     model = IncrementalRenderFrameModel(parent=self)
     frameModel = FrameModel(model)
     model.setSourceModel(frameModel)
     self.tableWidget.setModel(model)
示例#4
0
 def injectEditor(self, editor: AbsOperationEditor) -> None:
     # Set frame model
     editor.table.setSourceFrameModel(FrameModel(editor, self.shapes[0]))
     # Stretch new section
     editor.table.tableView.horizontalHeader().setSectionResizeMode(
         3, QHeaderView.Stretch)
     editor.table.tableView.horizontalHeader().setSectionResizeMode(
         4, QHeaderView.Stretch)
示例#5
0
 def injectEditor(self, editor: 'AbsOperationEditor') -> None:
     editor.selected.setSourceFrameModel(
         FrameModel(editor, frame=self.shapes[0]))
     hh = editor.selected.tableView.horizontalHeader()
     hh.setSectionResizeMode(1, QHeaderView.ResizeToContents)
     hh.setSectionResizeMode(2, QHeaderView.Fixed)
     hh.setSectionResizeMode(3, QHeaderView.Stretch)
     hh.setSectionResizeMode(4, QHeaderView.Stretch)
     editor.selected.tableView.setWordWrap(True)
     editor.setSizeHint(800, 500)
示例#6
0
 def setDataframeByName(self, name: str, value: d.Frame) -> bool:
     listPos: int = self.__nameToIndex.get(name, None)
     if listPos is not None:
         # Name already exists
         if self.__workbench[listPos].frame is value:
             return False
         frame_model = self.getDataframeModelByIndex(listPos)
         # This will reset any view currently showing the frame
         frame_model.setFrame(value)
         self.__workbench[listPos] = frame_model
         # nameToIndex is already updated (no change)
         # dataChanged is not emitted because the frame name has not changed
     else:
         # Name does not exists, so add as a new row
         row = self.rowCount()
         f = FrameModel(None, value)  # No parent is set
         f.name = name
         self.beginInsertRows(QModelIndex(), row, row)
         self.__workbench.append(f)
         self.__nameToIndex[name] = row
         self.endInsertRows()
     return True
示例#7
0
 def injectEditor(self, editor: AbsOperationEditor) -> None:
     editor.setSizeHint(500, 600)
     # Set frame model
     editor.attributes.setSourceFrameModel(
         FrameModel(editor, self.shapes[0]))
示例#8
0
 def injectEditor(self, editor: 'AbsOperationEditor') -> None:
     editor.attributes.setSourceFrameModel(
         FrameModel(editor, self._shapes[0]))
示例#9
0
 def injectEditor(self, editor: 'AbsOperationEditor') -> None:
     # Connect and set frame
     editor.selected.setSourceFrameModel(FrameModel(editor, self.shapes[0]))
示例#10
0
 def onPreviewComputed(self, header: Frame):
     self.tablePreview.setSourceFrameModel(FrameModel(self, header))
     self.tablePreview.model().setAllChecked(True)
     self.tableSpinner.stop()