17#include <QTreeWidgetItem>
28 "%1", KLocalizedString::removeAcceleratorMarker(
m_action->text()));
35 m_collator.setCaseSensitivity(Qt::CaseSensitive);
66 case Qt::DecorationRole:
73 case Qt::WhatsThisRole:
80 QFont modifiedFont = treeWidget()->font();
81 modifiedFont.setBold(
true);
85 case KExtendableItemDelegate::ShowExtensionIndicatorRole:
91 return !
m_action->property(
"isShortcutConfigurable").isValid()
92 ||
m_action->property(
"isShortcutConfigurable").toBool();
125 return QVariant::fromValue((QObject *)
m_action);
136 const int column = treeWidget() ? treeWidget()->sortColumn() : 0;
137 return m_collator.compare(text(column), other.text(column)) < 0;
150 return QKeySequence();
164 ks << QKeySequence();
167 if (ks.size() <= 1) {
229 dbgUI <<
"Committing changes for " <<
data(
Name, Qt::DisplayRole).toString();
QKeySequence alternateSequence(const QList< QKeySequence > &sequences)
QKeySequence primarySequence(const QList< QKeySequence > &sequences)
QAction * m_action
The action this item is responsible for.
void commit()
Commit the changes.
void undo()
Undo the changes since the last commit.
QList< QKeySequence > * m_oldLocalShortcut
The original shortcuts before user changes. 0 means no change.
~KisShortcutsEditorItem() override
Destructor will erase unsaved changes.
bool operator<(const QTreeWidgetItem &other) const override
bool m_isNameBold
Should the Name column be painted in bold?
QKeySequence keySequence(uint column) const
QString m_id
The action id. Needed for exporting and importing.
KisShortcutsEditorItem(QTreeWidgetItem *parent, QAction *action)
QCollator m_collator
The collator, for sorting.
void updateModified()
Recheck modified status - could have changed back to initial value.
QVariant data(int column, int role=Qt::DisplayRole) const override
QString m_actionNameInTable
The localized action name.
void setKeySequence(uint column, const QKeySequence &seq)