def sizeHint(self, option, index): size = QStyledItemDelegate.sizeHint(self, option, index) parent = self.parent() item = parent.itemFromIndex(index) widget = parent.itemWidget(item, 0) if widget: size = QSize(size.width(), widget.sizeHint().height() / 2) return size
def sizeHint(self, option, index): size = QStyledItemDelegate.sizeHint(self, option, index) parent = self.parent() item = parent.itemFromIndex(index) widget = parent.itemWidget(item, 0) if widget: size = QSize(size.width(), widget.sizeHint().height() / 2) return size
def sizeHint(self, option, index): option = QStyleOptionViewItem(option) self.initStyleOption(option, index) size = QStyledItemDelegate.sizeHint(self, option, index) # TODO: get the default QMenu item height from the current style. size.setHeight(max(size.height(), 25)) return size
def sizeHint(self, option, index): option = QStyleOptionViewItem(option) self.initStyleOption(option, index) size = QStyledItemDelegate.sizeHint(self, option, index) # TODO: get the default QMenu item height from the current style. size.setHeight(max(size.height(), 25)) return size
def sizeHint(self, option, index): """ Overloads sizeHint and provides sizeHint for vertical text, cell with borders, or circles depending on indices. """ if index.column() == 0 or index.row() == 1: return gui.VerticalItemDelegate.sizeHint(self, option, index) elif index.column() == 1 or index.row() == 0: return BorderedItemDelegate.sizeHint(self, option, index) else: return QStyledItemDelegate.sizeHint(self, option, index)
def sizeHint(self, option, index): size = QStyledItemDelegate.sizeHint(self, option, index) return QSize(size.width(), size.height() + 4)
def sizeHint(self, option, index): size = QStyledItemDelegate.sizeHint(self, option, index) return QSize(size.width(), size.height() + 4)