-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathnotifydelegate.h
More file actions
31 lines (27 loc) · 1.1 KB
/
notifydelegate.h
File metadata and controls
31 lines (27 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef NOTIFYDELEGATE_H
#define NOTIFYDELEGATE_H
#include <QStyledItemDelegate>
#include <QModelIndex>
#include <QColor>
class NotifyDelegate : public QStyledItemDelegate
{
public:
NotifyDelegate(int tableWidth,QObject *parent = 0);
void paint(QPainter *painter, const QStyleOptionViewItem &option,
const QModelIndex &index) const;
void setEditorData(QWidget *editor, const QModelIndex &index) const;
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,const QModelIndex &index) const;
void setModelData(QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index) const;
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const;
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
void setNumNew(quint32 newcnt);
private:
int minColumnHeight;
qreal textDocWidth;
quint32 numNew;
QColor mouseOverColor, newNtfColor, separatorColor;
public slots:
void updateTextDocWidth(qreal diff);
};
#endif // NOTIFYDELEGATE_H