File indexing completed on 2024-07-21 07:58:07

0001 /*
0002     SPDX-FileCopyrightText: 2011 Ilia Kats <ilia-kats@gmx.net>
0003 
0004     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006 
0007 #ifndef DELEGATE_H
0008 #define DELEGATE_H
0009 
0010 #include <QStyledItemDelegate>
0011 #include <QWidget>
0012 
0013 class Delegate : public QStyledItemDelegate
0014 {
0015     Q_OBJECT
0016 public:
0017     explicit Delegate(QObject *parent = nullptr);
0018     ~Delegate() override;
0019 
0020     QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
0021     void setEditorData(QWidget *editor, const QModelIndex &index) const override;
0022 
0023     void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override;
0024 
0025     void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
0026 };
0027 
0028 #endif