mirror-chatterino2/src/widgets/helper/ComboBoxItemDelegate.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
716 B
C++
Raw Normal View History

2018-04-27 01:11:09 +02:00
#pragma once
2018-04-27 01:11:09 +02:00
#include <QStyledItemDelegate>
2018-04-27 01:11:09 +02:00
namespace chatterino {
2018-04-27 01:11:09 +02:00
// stolen from https://wiki.qt.io/Combo_Boxes_in_Item_Views
2018-04-27 01:11:09 +02:00
class ComboBoxItemDelegate : public QStyledItemDelegate
{
Q_OBJECT
2018-04-27 01:11:09 +02:00
public:
2018-07-06 19:23:47 +02:00
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;
2018-04-27 01:11:09 +02:00
};
2018-04-27 01:11:09 +02:00
} // namespace chatterino