You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

22 lines
700 B

  1. #ifndef DELEGATES_H
  2. #define DELEGATES_H
  3. #include <QStyledItemDelegate>
  4. class ItemSizeDelegate : public QStyledItemDelegate {
  5. public:
  6. ItemSizeDelegate(QObject *parent=0) : QStyledItemDelegate (parent){}
  7. QSize sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const{
  8. return QSize(option.widget->height()+5, 80);
  9. }
  10. };
  11. class ItemSizeDelegateCollections : public QStyledItemDelegate {
  12. public:
  13. ItemSizeDelegateCollections(QObject *parent=0) : QStyledItemDelegate (parent){}
  14. QSize sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const{
  15. return QSize(option.widget->height()+5, 47);
  16. }
  17. };
  18. #endif // DELEGATES_H