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.
21 lines
643 B
21 lines
643 B
#pragma once |
|
|
|
#include <QStyledItemDelegate> |
|
|
|
enum ChannelDataRole { |
|
ChannelNameRole = Qt::DisplayRole, |
|
ChannelIconRole = Qt::DecorationRole, |
|
ChannelLastMessageRole = Qt::UserRole + 1, |
|
ChannelChannelIdRole = Qt::UserRole + 2 |
|
}; |
|
|
|
class ChannelDelegate : public QStyledItemDelegate { |
|
Q_OBJECT |
|
public: |
|
explicit ChannelDelegate(QObject *parent = nullptr); |
|
|
|
void paint(QPainter *painter, const QStyleOptionViewItem &option, |
|
const QModelIndex &index) const override; |
|
QSize sizeHint(const QStyleOptionViewItem &option, |
|
const QModelIndex &index) const override; |
|
};
|
|
|