Exemple #1
0
 def sizeHint(self, option, index):
     """ Returns the size needed to display the item in a QSize object. """
     if index.column() == 3:
         starRating = StarRating(index.data())
         return starRating.sizeHint()
     else:
         return QStyledItemDelegate.sizeHint(self, option, index)
Exemple #2
0
    def sizeHint(self, option, index):
        """ Returns the size needed to display the item in a QSize object. """
        imagen = QPixmap()
        try:
            imagen.loadFromData(index.data())  # , Qt.DisplayRole
        except TypeError:
            return QStyledItemDelegate.sizeHint(self, option, index) + QSize(
                1, 1)

        size_hint = QSize(5 * imagen.width(), imagen.height()) + QSize(1, 1)
        return size_hint
Exemple #3
0
    def sizeHint(self, option, index):

        return QStyledItemDelegate.sizeHint(self, option, index)