Krita Source Code Documentation
Loading...
Searching...
No Matches
KisKShortcutWidget Class Reference

#include <kshortcutwidget.h>

+ Inheritance diagram for KisKShortcutWidget:

Public Slots

void applyStealShortcut ()
 
void clearShortcut ()
 
void setShortcut (const QList< QKeySequence > &cut)
 

Signals

void shortcutChanged (const QList< QKeySequence > &cut)
 

Public Member Functions

bool isModifierlessAllowed ()
 
 KisKShortcutWidget (QWidget *parent=0)
 
void setCheckActionCollections (const QList< KisKActionCollection * > &actionCollections)
 
void setClearButtonsShown (bool show)
 
void setModifierlessAllowed (bool allow)
 
QList< QKeySequence > shortcut () const
 
 ~KisKShortcutWidget () override
 

Properties

bool modifierlessAllowed
 

Private Attributes

KisKShortcutWidgetPrivate *const d
 

Friends

class KisKShortcutWidgetPrivate
 

Detailed Description

KDE Shortcut Widget

Definition at line 21 of file kshortcutwidget.h.

Constructor & Destructor Documentation

◆ KisKShortcutWidget()

KisKShortcutWidget::KisKShortcutWidget ( QWidget * parent = 0)

Definition at line 26 of file kshortcutwidget.cpp.

27 : QWidget(parent),
29{
30 d->holdChangedSignal = false;
31 d->ui.setupUi(this);
32 connect(d->ui.priEditor, SIGNAL(keySequenceChanged(QKeySequence)),
33 this, SLOT(priKeySequenceChanged(QKeySequence)));
34 connect(d->ui.altEditor, SIGNAL(keySequenceChanged(QKeySequence)),
35 this, SLOT(altKeySequenceChanged(QKeySequence)));
36}
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
Ui::KisKShortcutWidget ui
KisKShortcutWidgetPrivate *const d
friend class KisKShortcutWidgetPrivate

References connect(), d, KisKShortcutWidgetPrivate::holdChangedSignal, and KisKShortcutWidgetPrivate::ui.

◆ ~KisKShortcutWidget()

KisKShortcutWidget::~KisKShortcutWidget ( )
override

Definition at line 38 of file kshortcutwidget.cpp.

39{
40 delete d;
41}

References d.

Member Function Documentation

◆ applyStealShortcut

void KisKShortcutWidget::applyStealShortcut ( )
slot

Actually remove the shortcut that the user wanted to steal, from the action that was using it.

To be called before you apply your changes. No shortcuts are stolen until this function is called.

Definition at line 76 of file kshortcutwidget.cpp.

77{
78 d->ui.priEditor->applyStealShortcut();
79 d->ui.altEditor->applyStealShortcut();
80}

References d, and KisKShortcutWidgetPrivate::ui.

◆ clearShortcut

void KisKShortcutWidget::clearShortcut ( )
slot

Definition at line 105 of file kshortcutwidget.cpp.

106{
108}
void setShortcut(const QList< QKeySequence > &cut)

References setShortcut().

◆ isModifierlessAllowed()

bool KisKShortcutWidget::isModifierlessAllowed ( )

Definition at line 49 of file kshortcutwidget.cpp.

50{
51 return d->ui.priEditor->isModifierlessAllowed();
52}

References d, and KisKShortcutWidgetPrivate::ui.

◆ setCheckActionCollections()

void KisKShortcutWidget::setCheckActionCollections ( const QList< KisKActionCollection * > & actionCollections)

Set a list of action collections to check against for conflicting shortcut.

If there is a conflicting shortcut with a KAction, and that his shortcut can be configured (KAction::isShortcutConfigurable() returns true) the user will be prompted for eventually steal the shortcut from this action

Global shortcuts are automatically checked for conflicts

Don't forget to call applyStealShortcut to actually steal the shortcut.

Since
4.1

Definition at line 69 of file kshortcutwidget.cpp.

70{
71 d->ui.priEditor->setCheckActionCollections(actionCollections);
72 d->ui.altEditor->setCheckActionCollections(actionCollections);
73}

References d, and KisKShortcutWidgetPrivate::ui.

◆ setClearButtonsShown()

void KisKShortcutWidget::setClearButtonsShown ( bool show)

Definition at line 54 of file kshortcutwidget.cpp.

55{
56 d->ui.priEditor->setClearButtonShown(show);
57 d->ui.altEditor->setClearButtonShown(show);
58}

References d, and KisKShortcutWidgetPrivate::ui.

◆ setModifierlessAllowed()

void KisKShortcutWidget::setModifierlessAllowed ( bool allow)

Definition at line 43 of file kshortcutwidget.cpp.

44{
45 d->ui.priEditor->setModifierlessAllowed(allow);
46 d->ui.altEditor->setModifierlessAllowed(allow);
47}

References d, and KisKShortcutWidgetPrivate::ui.

◆ setShortcut

void KisKShortcutWidget::setShortcut ( const QList< QKeySequence > & cut)
slot

Definition at line 83 of file kshortcutwidget.cpp.

84{
85 if (newSc == d->cut) {
86 return;
87 }
88
89 d->holdChangedSignal = true;
90
91 if (!newSc.isEmpty()) {
92 d->ui.priEditor->setKeySequence(newSc.first());
93 }
94
95 if (newSc.size() > 1) {
96 d->ui.altEditor->setKeySequence(newSc.at(1));
97 }
98
99 d->holdChangedSignal = false;
100
101 Q_EMIT shortcutChanged(d->cut);
102}
QList< QKeySequence > cut
void shortcutChanged(const QList< QKeySequence > &cut)

References KisKShortcutWidgetPrivate::cut, d, KisKShortcutWidgetPrivate::holdChangedSignal, shortcutChanged(), and KisKShortcutWidgetPrivate::ui.

◆ shortcut()

QList< QKeySequence > KisKShortcutWidget::shortcut ( ) const

Definition at line 60 of file kshortcutwidget.cpp.

61{
63 ret << d->ui.priEditor->keySequence()
64 << d->ui.altEditor->keySequence();
65 return ret;
66}

References d, and KisKShortcutWidgetPrivate::ui.

◆ shortcutChanged

void KisKShortcutWidget::shortcutChanged ( const QList< QKeySequence > & cut)
signal

Friends And Related Symbol Documentation

◆ KisKShortcutWidgetPrivate

friend class KisKShortcutWidgetPrivate
friend

Definition at line 72 of file kshortcutwidget.h.

Member Data Documentation

◆ d

KisKShortcutWidgetPrivate* const KisKShortcutWidget::d
private

Definition at line 73 of file kshortcutwidget.h.

Property Documentation

◆ modifierlessAllowed

bool KisKShortcutWidget::modifierlessAllowed
readwrite

Definition at line 24 of file kshortcutwidget.h.


The documentation for this class was generated from the following files: