12#ifndef PREF_DELEGATE_H
13#define PREF_DELEGATE_H
19#include <QStyledItemDelegate>
42 QWidget *
createEditor(QWidget *parent,
const QStyleOptionViewItem &option,
43 const QModelIndex &index)
const override;
51 void setEditorData(QWidget *editor,
const QModelIndex &index)
const override;
60 void setModelData(QWidget *editor, QAbstractItemModel *model,
61 const QModelIndex &index)
const override;
70 PrefsItem *indexToPref(
const QModelIndex &index)
const;
void setEditorData(QWidget *editor, const QModelIndex &index) const override
Populate the editor with the current preference value.
Definition pref_delegate.cpp:58
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
Write the editor's current value back to the model.
Definition pref_delegate.cpp:72
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Create an editor widget appropriate for the preference at index.
Definition pref_delegate.cpp:27
AdvancedPrefDelegate(QObject *parent=0)
Construct an AdvancedPrefDelegate.
Definition pref_delegate.cpp:17
A single node in the PrefsModel tree.
Definition pref_models.h:136