A delegate providing editors for the type property of KisShortcutConfiguration.
More...
#include <kis_input_type_delegate.h>
A delegate providing editors for the type property of KisShortcutConfiguration.
Definition at line 16 of file kis_input_type_delegate.h.
◆ KisInputTypeDelegate()
| KisInputTypeDelegate::KisInputTypeDelegate |
( |
QObject * | parent = 0 | ) |
|
|
explicit |
◆ ~KisInputTypeDelegate()
| KisInputTypeDelegate::~KisInputTypeDelegate |
( |
| ) |
|
|
override |
◆ createEditor()
| QWidget * KisInputTypeDelegate::createEditor |
( |
QWidget * | parent, |
|
|
const QStyleOptionViewItem & | , |
|
|
const QModelIndex & | ) const |
|
override |
Definition at line 31 of file kis_input_type_delegate.cpp.
32{
33 KComboBox *
combo =
new KComboBox(parent);
35 << i18n("Key Combination")
36 << i18n("Mouse Button")
37 << i18n("Mouse Wheel")
38 << i18n("Gesture")
39 );
40 combo->setCurrentIndex(0);
41
43}
QList< QString > QStringList
◆ setEditorData()
| void KisInputTypeDelegate::setEditorData |
( |
QWidget * | editor, |
|
|
const QModelIndex & | index ) const |
|
override |
Definition at line 45 of file kis_input_type_delegate.cpp.
46{
47 KComboBox *
combo = qobject_cast<KComboBox *>(editor);
48 Q_ASSERT(combo);
49
50 combo->setCurrentIndex(index.data(Qt::EditRole).toUInt() - 1);
51}
◆ setModelData()
| void KisInputTypeDelegate::setModelData |
( |
QWidget * | editor, |
|
|
QAbstractItemModel * | model, |
|
|
const QModelIndex & | index ) const |
|
override |
Definition at line 53 of file kis_input_type_delegate.cpp.
54{
55 KComboBox *
combo = qobject_cast<KComboBox *>(editor);
56 Q_ASSERT(combo);
57 model->setData(index,
combo->currentIndex() + 1, Qt::EditRole);
58}
◆ updateEditorGeometry()
| void KisInputTypeDelegate::updateEditorGeometry |
( |
QWidget * | editor, |
|
|
const QStyleOptionViewItem & | option, |
|
|
const QModelIndex & | ) const |
|
override |
| Private* const KisInputTypeDelegate::d |
|
private |
The documentation for this class was generated from the following files: