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.
30 lines
1.2 KiB
30 lines
1.2 KiB
/* Отрисовка строки участника AccountList: аватар, имя, online и служебные значки. */ |
|
#pragma once |
|
|
|
#include <QStyledItemDelegate> |
|
#include <QPersistentModelIndex> |
|
|
|
class AccountDelegate : public QStyledItemDelegate { |
|
Q_OBJECT |
|
public: |
|
explicit AccountDelegate(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; |
|
bool editorEvent(QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option, |
|
const QModelIndex& index) override; |
|
bool helpEvent(QHelpEvent* event, QAbstractItemView* view, const QStyleOptionViewItem& option, |
|
const QModelIndex& index) override; |
|
signals: |
|
void inviteRequested(const QModelIndex& index); |
|
void avatarRequested(const QModelIndex& index); |
|
void radioMuteRequested(const QModelIndex& index); |
|
private: |
|
QPersistentModelIndex m_invitePress; |
|
QPersistentModelIndex m_avatarPress; |
|
QPoint m_avatarPosition; |
|
QPersistentModelIndex m_radioMutePress; |
|
QPoint m_radioMutePosition; |
|
};
|
|
|