def rowCount(self, parent=QModelIndex()): return len(self._primesList) + 2
def columnCount(self, index=QModelIndex()): return 6
def rowCount(self, parent=QModelIndex()): return self.row_count
def __init__(self, parent, name, data): if not type(data) == BinaryView: raise Exception('expected widget data to be a BinaryView') self.bv = data QWidget.__init__(self, parent) DockContextHandler.__init__(self, self, name) self.actionHandler = UIActionHandler() self.actionHandler.setupActionHandler(self) self.table = QTableView(self) self.model = DebugBreakpointsListModel(self.table, data) self.table.setModel(self.model) self.item_delegate = DebugBreakpointsItemDelegate(self) self.table.setItemDelegate(self.item_delegate) # self.table.setSortingEnabled(True) self.table.setSelectionBehavior(QAbstractItemView.SelectionBehavior.SelectRows) self.table.setSelectionMode(QAbstractItemView.ExtendedSelection) self.table.verticalHeader().setSectionResizeMode(QHeaderView.ResizeToContents) self.table.verticalHeader().setVisible(False) self.table.setHorizontalScrollMode(QAbstractItemView.ScrollPerPixel) self.table.setVerticalScrollMode(QAbstractItemView.ScrollPerPixel) self.table.resizeColumnsToContents() self.table.resizeRowsToContents() for i in range(len(self.model.columns)): self.table.setColumnWidth(i, self.item_delegate.sizeHint(self.table.viewOptions(), self.model.index(-1, i, QModelIndex())).width()) self.table.horizontalHeader().setSectionResizeMode(1, QHeaderView.Stretch) layout = QVBoxLayout() layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(0) layout.addWidget(self.table) self.setLayout(layout)
def parent(self, child): return QModelIndex()
def columnCount(self, index = QModelIndex()): if index.isValid(): return 0 else: return 4
def rowCount(self, index=QModelIndex()): """ Returns the number of rows the model holds. """ return len(self.addresses)
def columnCount(self, parent=QModelIndex()): """Number of columns in the model.""" return len(self.header) or len(next(iter(self._main_data), []))
def selectFirstItem(self): self.setCurrentIndex(self.model.index(0, 0, QModelIndex()))
def append_objects(self, objects): self.beginInsertRows(QModelIndex(), len(self.m_objects), len(self.m_objects) + len(self.objects) - 1) self.m_objects = self.m_objects + objects self.endInsertRows() QObject.emit(self, SIGNAL("countChanged()"))
def rowCount(self, parent=QModelIndex()): """Number of rows in the model.""" return len(self._main_data)
def insert(self, i, mobject): self.beginInsertRows(QModelIndex(), i, i) self.m_objects.append(mobject) self.endInsertRows() QObject.emit(self, SIGNAL("countChanged()"))
def rowCount(self, parent=QModelIndex()): return len(self._benchmarks) + 1
def columnCount(self, parent=QModelIndex()): return self._tableWidth
def columnCount(self, parent=QModelIndex()): # Add an extra column to get nicer UI return self.lightAttributes.count() + 1
def activateFirstItem(self): self.exportDoubleClicked(self.model.index(0, 0, QModelIndex()))
def rowCount(self, index = QModelIndex()): if index.isValid(): return 0 else: return len(self.m_tasks)
def parent(self, index): return QModelIndex()
def rowCount(self, parent=QModelIndex()): return len(self.data_name)
def removeRows(self, position, rows=1, index=QModelIndex()): self.beginRemoveRows(QModelIndex(), position, position + rows - 1) del self.nutrients[position:position + rows] self.endRemoveRows() return True
def columnCount(self, index=QModelIndex()): """ Returns the number of columns the model holds. """ return 2
def rowCount(self, index=QModelIndex()): return len(self.nutrients)
def index(self, row, column, parent): if parent.isValid() or column > len(self.columns) or row >= len(self.rows): return QModelIndex() return self.createIndex(row, column)
def columnCount(self, index=QModelIndex()): return len(nut_col_to_attr)
def rowCount(self, index=QModelIndex()): return len(self.domains)
def index(self, row, column, parentIndex=QModelIndex()): """ Returns the index of the item in the model specified by the given row, column and parent index. """ if not self.hasIndex(row, column, parentIndex): return QModelIndex() parent = self.nodeFromIndex(parentIndex) return self.createIndex(row, column, parent.child(row))
def rowCount(self, parent=QModelIndex()): return max(len(self._filestats['read-blocks']), len(self._filestats['write-blocks']))
def rowCount(self, parentIndex=QModelIndex()): """ Returns the number of rows under the given parent """ parent = self.nodeFromIndex(parentIndex) if not parent: return 0 return parent.childCount()
def columnCount(self, parent=QModelIndex()): return self.column_count
def deleteRow(self): """Delete all rows corresponding to selected cells.""" rowidxlst = list(set(elt.row() for elt in self.table.selectedIndexes())) for idx in sorted(rowidxlst, reverse=True): self.model.removeRows(idx, 1, QModelIndex())