mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
26 lines
716 B
C++
26 lines
716 B
C++
#pragma once
|
|
|
|
#include <QStyledItemDelegate>
|
|
|
|
namespace chatterino {
|
|
|
|
// stolen from https://wiki.qt.io/Combo_Boxes_in_Item_Views
|
|
|
|
class ComboBoxItemDelegate : public QStyledItemDelegate
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
ComboBoxItemDelegate(QObject *parent = nullptr);
|
|
~ComboBoxItemDelegate() override;
|
|
|
|
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
|
|
const QModelIndex &index) const override;
|
|
void setEditorData(QWidget *editor,
|
|
const QModelIndex &index) const override;
|
|
void setModelData(QWidget *editor, QAbstractItemModel *model,
|
|
const QModelIndex &index) const override;
|
|
};
|
|
|
|
} // namespace chatterino
|