mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
32 lines
840 B
C++
32 lines
840 B
C++
#ifndef CUSTOMDELEGATE_H
|
|
#define CUSTOMDELEGATE_H
|
|
|
|
#include <QApplication>
|
|
#include <QTreeWidget>
|
|
#include <QTreeWidgetItem>
|
|
#include <QStyledItemDelegate>
|
|
#include <QPainter>
|
|
#include <QStyle>
|
|
#include <QItemDelegate>
|
|
|
|
enum UserRoles {
|
|
UserRole_MergeCell = Qt::UserRole + 1 // Пользовательская роль для хранения признака объединения
|
|
};
|
|
|
|
class CustomDelegate : public QItemDelegate
|
|
{
|
|
public:
|
|
//using QStyledItemDelegate::QStyledItemDelegate;
|
|
|
|
CustomDelegate(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;
|
|
};
|
|
|
|
#endif // CUSTOMDELEGATE_H
|