23 #include <QAbstractItemDelegate>
24 #include <QKeySequence>
28 #include "../vproperty_p.h"
44 if (column == DPC_Data && (Qt::DisplayRole == role || Qt::EditRole == role))
46 return d_ptr->VariantValue;
54 const QAbstractItemDelegate* delegate)
61 VShortcutEditWidget::connect(tmpWidget, SIGNAL(commitData(QWidget*)), delegate, SIGNAL(commitData(QWidget*)));
63 tmpWidget->setLocale(parent->locale());
73 tmpWidget->
setShortcut(d_ptr->VariantValue.toString(),
false);
virtual Q_REQUIRED_RESULT VProperty * clone(bool include_children=true, VProperty *container=nullptr) const
Clones this property.
virtual QVariant data(int column=DPC_Name, int role=Qt::DisplayRole) const
Get the data how it should be displayed.
virtual void setValue(const QVariant &value)
Sets the value of the property.
This property can be used to handle key shortcuts.
virtual void setValue(const QVariant &value) Q_DECL_OVERRIDE
Sets the value of the property.
virtual QVariant data(int column=DPC_Name, int role=Qt::DisplayRole) const Q_DECL_OVERRIDE
Get the data how it should be displayed.
virtual QString type() const Q_DECL_OVERRIDE
Returns a string containing the type of the property.
virtual QVariant getEditorData(const QWidget *editor) const Q_DECL_OVERRIDE
Gets the data from the widget.
virtual ~VShortcutProperty() Q_DECL_OVERRIDE
The destructor.
VShortcutProperty(const QString &name)
virtual QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &options, const QAbstractItemDelegate *delegate) Q_DECL_OVERRIDE
Returns an editor widget, or NULL if it doesn't supply one.
virtual Q_REQUIRED_RESULT VProperty * clone(bool include_children=true, VProperty *container=nullptr) const Q_DECL_OVERRIDE
Clones this property.
virtual bool setEditorData(QWidget *editor) Q_DECL_OVERRIDE
Sets the property's data to the editor (returns false, if the standard delegate should do that)