mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
Объединенные ячейки списка
This commit is contained in:
31
InstructorsAndTrainees/tasks/customdelegate.h
Normal file
31
InstructorsAndTrainees/tasks/customdelegate.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user