-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdelegatebottone.h
33 lines (31 loc) · 939 Bytes
/
delegatebottone.h
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
32
33
/*
* Andrea Favero
* 1125545
*/
#ifndef DELEGATEBOTTONE_H
#define DELEGATEBOTTONE_H
#include <QItemDelegate>
#include <QAbstractItemModel>
#include <QEvent>
#include <QModelIndex>
#include <QStyleOptionViewItem>
#include <QList>
#include <QString>
class DelegateBottone : public QItemDelegate {
Q_OBJECT
public:
DelegateBottone(QString titolo, QObject *parent = nullptr);
void paint(QPainter*, const QStyleOptionViewItem&, const QModelIndex&) const override;
bool editorEvent(QEvent*, QAbstractItemModel*,
const QStyleOptionViewItem &, const QModelIndex &) override;
~DelegateBottone() override;
private:
QString titoloBottone;
protected:
typedef QMap<QModelIndex, QStyleOptionButton*> bottoniEliminazione; // per risparmiare anni di vita
bottoniEliminazione btnEl;
signals:
void avvisoPressioneBottone(int);
};
#endif // DELEGATEBOTTONE_H