32 lines
939 B
C++
32 lines
939 B
C++
#ifndef SPINBOXDELEGATE_H
|
|
#define SPINBOXDELEGATE_H
|
|
|
|
|
|
#include <QStyledItemDelegate>
|
|
#include <QItemDelegate>
|
|
#include <QModelIndex>
|
|
#include <QPainter>
|
|
#include <QWidget>
|
|
|
|
#define COMBOXCOL 1
|
|
|
|
class SpinBoxDelegate: public QItemDelegate
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
SpinBoxDelegate(QObject *parent = nullptr);
|
|
~SpinBoxDelegate();
|
|
|
|
void paint(QPainter *painter, const QStyleOptionViewItem &option,
|
|
const QModelIndex &index) const;
|
|
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
|
|
|
|
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
|
|
const QModelIndex &index) const;
|
|
void setEditorData(QWidget *editor, const QModelIndex &index) const;
|
|
void setModelData(QWidget *editor, QAbstractItemModel *model,
|
|
const QModelIndex &index) const;
|
|
};
|
|
|
|
#endif // SPINBOXDELEGATE_H
|