KDEUI
kkeysequencewidget.cpp
Go to the documentation of this file.
137 QString message = i18ncp("%1 is the number of conflicts (hidden), %2 is the key sequence of the shortcut that is problematic",
144 "Conflict with Registered Global Shortcut", "Conflict with Registered Global Shortcuts", hashSize);
204 ,checkAgainstShortcutTypes(KKeySequenceWidget::LocalShortcuts & KKeySequenceWidget::GlobalShortcuts)
216 QString title = i18ncp("%1 is the number of conflicts", "Shortcut Conflict", "Shortcut Conflicts", listSize);
235 if (KMessageBox::warningContinueCancel(q, message, title, KGuiItem(i18n("Reassign"))) != KMessageBox::Continue)
276 keyButton->setToolTip(i18n("Click on the button, then enter the shortcut like you would in the program.\nExample for Ctrl+a: hold the Ctrl key and press a."));
354 Q_ASSERT(d->checkActionCollections.isEmpty()); // don't call this method if you call setCheckActionCollections!
358 void KKeySequenceWidget::setCheckActionCollections(const QList<KActionCollection *>& actionCollections)
483 //on windows F12 is reserved by the debugger at all times, so we can't use it for a global shortcut
486 QString message = i18n("The F12 key is reserved on Windows, so cannot be used for a global shortcut.\n"
624 bool KKeySequenceWidgetPrivate::stealStandardShortcut(KStandardShortcut::StandardShortcut std, const QKeySequence &seq)
632 if (KMessageBox::warningContinueCancel(q, message, title, KGuiItem(i18n("Reassign"))) != KMessageBox::Continue) {
text
void message(KMessage::MessageType messageType, const QString &text, const QString &caption=QString())
bool isShiftAsModifierAllowed(int keyQt)
Test if the shift modifier should be recorded for a given key.
Definition: kkeyserver.cpp:113
QString i18n(const char *text)
void setComponentName(const QString &componentName)
If the component using this widget supports shortcuts contexts, it has to set its component name so w...
Definition: kkeysequencewidget.cpp:301
Qt::KeyboardModifiers modifiers() const
QString & append(QChar ch)
Type type() const
iterator insert(const Key &key, const T &value)
Definition: kmessagebox.h:74
Check against global shortcuts.
Definition: kkeysequencewidget.h:103
uint count() const
QString componentFriendlyName
Definition: kglobalshortcutinfo.h:45
void setModifierlessAllowed(bool allow)
This only applies to user input, not to setShortcut().
Definition: kkeysequencewidget.cpp:323
StandardShortcut find(const QKeySequence &seq)
Return the StandardShortcut id of the standard accel action which uses this key sequence, or AccelNone if none of them do.
Definition: kstandardshortcut.cpp:295
int timeout
QString & prepend(QChar ch)
QString label(StandardShortcut id)
Returns a localized label for user-visible display.
Definition: kstandardshortcut.cpp:267
int size() const
Definition: kglobalshortcutinfo.h:35
Defines platform-independent classes for keyboard shortcut handling.
void writeSettings(KConfigGroup *config=0, bool writeDefaults=false, QAction *oneAction=0) const
Write the current configurable key associations to config.
Definition: kactioncollection.cpp:563
void setMultiKeyShortcutsAllowed(bool)
Allow multikey shortcuts?
Definition: kkeysequencewidget.cpp:312
const_iterator insert(const T &value)
bool conflictsWith(const QKeySequence &needle) const
Returns whether at least one of the key sequences conflicts witho needle.
Definition: kshortcut.cpp:156
QString i18nc(const char *ctxt, const char *text)
int size() const
void append(const T &value)
ShortcutTypes checkForConflictsAgainst() const
The shortcut types we check for conflicts.
void setKeySequence(const QKeySequence &seq, Validation val=NoValidate)
Set the key sequence.
Definition: kkeysequencewidget.cpp:377
StandardShortcut
Defines the identifier of all standard accelerators.
Definition: kstandardshortcut.h:55
QString i18ncp(const char *ctxt, const char *sing, const char *plur, const A1 &a1)
QWidget * keyboardGrabber()
bool isEmpty() const
static void sorry(QWidget *parent, const QString &text, const QString &caption=QString(), Options options=Notify)
Display an "Sorry" dialog.
Definition: kmessagebox.cpp:904
void setFocusProxy(QWidget *w)
bool isEmpty() const
QList< QAction * > actions() const
Returns the list of KActions which belong to this action collection.
Definition: kactioncollection.cpp:186
void captureKeySequence()
Capture a shortcut from the keyboard.
Definition: kkeysequencewidget.cpp:364
bool isModifierlessAllowed()
Definition: kkeysequencewidget.cpp:339
void applyStealShortcut()
Actually remove the shortcut that the user wanted to steal, from the action that was using it...
Definition: kkeysequencewidget.cpp:398
void setShortcut(const KShortcut &shortcut, ShortcutTypes type=ShortcutTypes(ActiveShortcut|DefaultShortcut))
Set the shortcut for this action.
Definition: kaction.cpp:198
int key() const
void accept()
virtual void keyReleaseEvent(QKeyEvent *e)
bool contains(QChar ch, Qt::CaseSensitivity cs) const
Check against standard shortcuts.
Definition: kkeysequencewidget.h:102
shortcut
bool contains(const T &value) const
bool isEmpty() const
void setCheckActionCollections(const QList< KActionCollection * > &actionCollections)
Set a list of action collections to check against for conflictuous shortcut.
Definition: kkeysequencewidget.cpp:358
void setCheckActionList(const QList< QAction * > &checkList)
Definition: kkeysequencewidget.cpp:351
KLocale * locale()
QString removeAcceleratorMarker(const QString &label) const
static QList< KGlobalShortcutInfo > getGlobalShortcutsByKey(const QKeySequence &seq)
Returns a list of global shortcuts registered for the shortcut .
Definition: kglobalaccel.cpp:520
QString & replace(int position, int n, QChar after)
The shortcut will immediately become active but may be reset to "default".
Definition: kaction.h:235
QString toString(SequenceFormat format) const
char * toString(const T &value)
bool isEmpty() const
bool multiKeyShortcutsAllowed() const
QKeySequence keySequence() const
Return the currently selected key sequence.
Definition: kkeysequencewidget.cpp:370
virtual bool event(QEvent *e)
void setClearButtonShown(bool show)
Set whether a small button to set an empty key sequence should be displayed next to the main input wi...
Definition: kkeysequencewidget.cpp:345
static QDebug kWarning(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
bool isShortcutConfigurable() const
Returns true if this action's shortcut is configurable.
Definition: kaction.cpp:173
void setText(const QString &text)
void setCheckForConflictsAgainst(ShortcutTypes types)
Configure if the widget should check for conflicts with existing shortcuts.
Definition: kkeysequencewidget.cpp:318
bool isKeySequenceAvailable(const QKeySequence &seq) const
Checks whether the key sequence seq is available to grab.
Definition: kkeysequencewidget.cpp:329
virtual void keyPressEvent(QKeyEvent *e)
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
static void stealShortcutSystemwide(const QKeySequence &seq)
Take away the given shortcut from the named action it belongs to.
Definition: kglobalaccel.cpp:593
QString toString() const
Returns a description of the shortcut as a semicolon-separated list of key sequences, as returned by QKeySequence::toString().
Definition: kshortcut.cpp:249
static bool isGlobalShortcutAvailable(const QKeySequence &seq, const QString &component=QString())
Check if the shortcut is available for the component.
Definition: kglobalaccel.cpp:526
static int warningContinueCancel(QWidget *parent, const QString &text, const QString &caption=QString(), const KGuiItem &buttonContinue=KStandardGuiItem::cont(), const KGuiItem &buttonCancel=KStandardGuiItem::cancel(), const QString &dontAskAgainName=QString(), Options options=Notify)
Display a "warning" dialog.
Definition: kmessagebox.cpp:644
QString modToStringUser(uint mod)
Converts the mask of ORed KKey::ModFlag modifiers to a user-readable string.
Definition: kkeyserver.cpp:98
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.