2021-12-08 15:10:56 +08:00
|
|
|
#ifndef GUI_ACCOUNTROLECOMBODELEGATE_H
|
|
|
|
|
|
|
|
|
|
#define GUI_ACCOUNTROLECOMBODELEGATE_H
|
|
|
|
|
|
|
|
|
|
#include <QAbstractItemModel>
|
|
|
|
|
#include <QItemDelegate>
|
|
|
|
|
class AccountRoleComboDelegate:public QItemDelegate {
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
explicit AccountRoleComboDelegate(QWidget *parent = nullptr);
|
2021-12-08 17:49:11 +08:00
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void drawDisplay(QPainter *painter, const QStyleOptionViewItem &option,
|
|
|
|
|
const QRect &rect, const QString &text) const override ;
|
2025-05-30 14:22:46 +08:00
|
|
|
private:
|
|
|
|
|
void initRoleString();
|
2022-06-07 15:05:05 +08:00
|
|
|
|
2021-12-08 15:10:56 +08:00
|
|
|
private:
|
2022-06-07 15:05:05 +08:00
|
|
|
QMap<QString,QVariant> mRoleMap ;
|
2021-12-08 15:10:56 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif //GUI_ACCOUNTROLECOMBODELEGATE_H
|