QString Action::text() const { QString text = QString(m_ActionTypeNames[keySequence().isMouseButton() ? type() + 6 : type() ]) + "("; switch (type()) { case keyDown: case keyUp: case keystroke: { text += keySequence().toString(); if (!keySequence().isMouseButton()) { const QStringList& screens = typeScreenNames(); if (haveScreens() && !screens.isEmpty()) { text += ","; for (int i = 0; i < screens.size(); i++) { text += screens[i]; if (i != screens.size() - 1) text += ":"; } } else text += ",*"; } } break; case switchToScreen: text += switchScreenName(); break; case switchInDirection: text += m_SwitchDirectionNames[m_SwitchDirection]; break; case lockCursorToScreen: text += m_LockCursorModeNames[m_LockCursorMode]; break; default: Q_ASSERT(0); break; } text += ")"; return text; }
void KeySequenceWidget::stopRecording() { if (!keySequence().valid()) { keySequence() = backupSequence(); updateOutput(); } setDown(false); focusNextChild(); releaseKeyboard(); setStatus(Stopped); emit keySequenceChanged(); }
void MenuCallback::addCommand(QString commandId, QString label, QString tooltip, QString shortcut) { shortcut = shortcut.replace("Enter", "\n"); QKeySequence keySequence(shortcut); #ifndef Q_WS_MAC if (shortcut.contains("\n")) { int value = (keySequence[0] & Qt::MODIFIER_MASK) + Qt::Key_Enter; keySequence = QKeySequence(value); } #endif QAction* pAction = menuStack_.top()->addAction(QIcon(), label, this, SLOT(actionInvoked()), keySequence); pAction->setData(commandId); pAction->setToolTip(tooltip); menuActions_[menuStack_.first()].append(pAction); }
void MenuCallback::addCommand(QString commandId, QString label, QString tooltip, QString shortcut) { shortcut = shortcut.replace(QString::fromUtf8("Enter"), QString::fromAscii("\n")); QKeySequence keySequence(shortcut); #ifndef Q_WS_MAC if (shortcut.contains(QString::fromAscii("\n"))) { int value = (keySequence[0] & Qt::MODIFIER_MASK) + Qt::Key_Enter; keySequence = QKeySequence(value); } #endif // allow custom action handlers first shot QAction* pAction = addCustomAction(commandId, label, tooltip); // if there was no custom handler then do stock command-id processing if (pAction == NULL) { pAction = menuStack_.top()->addAction(QIcon(), label, this, SLOT(actionInvoked()), keySequence); pAction->setData(commandId); pAction->setToolTip(tooltip); MenuActionBinder* pBinder = new MenuActionBinder(menuStack_.top(), pAction); connect(pBinder, SIGNAL(manageCommand(QString,QAction*)), this, SIGNAL(manageCommand(QString,QAction*))); }
bool KeyInput::fromPortableText(const QString &key, bool isQtKey) { mIsQtKey = isQtKey; if(mIsQtKey) { QKeySequence keySequence(key); mKey = keySequence[0]; mKey &= ~(Qt::ShiftModifier | Qt::ControlModifier | Qt::AltModifier | Qt::MetaModifier); return true; } for(int i = 0; i < KeyCount; ++i) { if(mKeyNames.first[i] == key) { mKey = i; return true; } } return false; }
QKeySequence cmdKeySeq( QString strCommandName ) { strCommandName = QString( "shortcuts/" ) + strCommandName; QKeySequence keySequence( pencilSettings()->value( strCommandName ).toString() ); return keySequence; }
bool KeySequenceWidget::event(QEvent* event) { if (status() == Recording) { switch(event->type()) { case QEvent::KeyPress: keyPressEvent(static_cast<QKeyEvent*>(event)); return true; case QEvent::MouseButtonRelease: event->accept(); return true; case QEvent::ShortcutOverride: event->accept(); return true; case QEvent::FocusOut: stopRecording(); if (!valid()) { keySequence() = backupSequence(); updateOutput(); } break; default: break; } } return QPushButton::event(event); }
bool ShortcutEdit::event(QEvent *event) { switch (event->type()) { case QEvent::KeyPress: { QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event); switch (keyEvent->key()) { case Qt::Key_Alt: case Qt::Key_Control: case Qt::Key_Meta: case Qt::Key_Shift: return true; default: m_key = keyEvent->key(); m_key |= translateModifiers(keyEvent->modifiers(), keyEvent->text()); setText(keySequence().toString(QKeySequence::NativeText)); } } case QEvent::ShortcutOverride: event->accept(); case QEvent::KeyRelease: case QEvent::Shortcut: return true; default: return QLineEdit::event(event); } }
void MenuCallback::addCommand(QString commandId, QString label, QString tooltip, QString shortcut) { shortcut = shortcut.replace(QString::fromUtf8("Enter"), QString::fromAscii("\n")); QKeySequence keySequence(shortcut); #ifndef Q_WS_MAC if (shortcut.contains(QString::fromAscii("\n"))) { int value = (keySequence[0] & Qt::MODIFIER_MASK) + Qt::Key_Enter; keySequence = QKeySequence(value); } #endif QAction* pAction = menuStack_.top()->addAction(QIcon(), label, this, SLOT(actionInvoked()), keySequence); pAction->setData(commandId); pAction->setToolTip(tooltip); MenuActionBinder* pBinder = new MenuActionBinder(menuStack_.top(), pAction); connect(pBinder, SIGNAL(manageCommand(QString,QAction*)), this, SIGNAL(manageCommand(QString,QAction*))); }
void KeySequenceWidget::setKeySequence(const KeySequence& seq) { keySequence() = seq; backupSequence() = seq; setStatus(Stopped); updateOutput(); }
void KeySequenceWidget::startRecording() { keySequence() = KeySequence(); setDown(true); setFocus(); grabKeyboard(); setStatus(Recording); }
KeyEdit::KeyEdit(QWidget *parent) : CodeComboBox(parent) { installEventFilter(this); connect(this, SIGNAL(currentIndexChanged(QString)), this, SLOT(currentIndexChanged(QString))); QKeySequence keySequence(Qt::Key_Print); addItem(keySequence.toString(QKeySequence::NativeText)); }
QString KeyInput::toPortableText() const { if(mIsQtKey) { QKeySequence keySequence(mKey); return keySequence.toString(QKeySequence::PortableText); } return mKeyNames.first[mKey]; }
QString KeyInput::toTranslatedText() const { if(mIsQtKey) { QKeySequence keySequence(mKey); return keySequence.toString(QKeySequence::NativeText); } return mKeyNames.second[mKey]; }
void Hotkey::saveSettings(QSettings& settings) const { keySequence().saveSettings(settings); settings.beginWriteArray("actions"); for (int i = 0; i < actions().size(); i++) { settings.setArrayIndex(i); actions()[i].saveSettings(settings); } settings.endArray(); }
void pKeySequenceEdit::keyPressEvent( QKeyEvent* event ) { // return if auto repeat if ( event->isAutoRepeat() ) { return; } // if user press something, sequence is not finished mFinished = false; // show current sequence setText( keySequence( event ) ); }
void pKeySequenceEdit::keyReleaseEvent( QKeyEvent* event ) { // return if auto repeat if ( event->isAutoRepeat() ) { return; } // check if sequence is finished or not if ( mFinished ) { return; } // show current sequence setText( keySequence( event ) ); }
void Hotkey::loadSettings(QSettings& settings) { keySequence().loadSettings(settings); actions().clear(); int num = settings.beginReadArray("actions"); for (int i = 0; i < num; i++) { settings.setArrayIndex(i); Action a; a.loadSettings(settings); actions().append(a); } settings.endArray(); }
void MenuCallback::addCommand(QString commandId, QString label, QString tooltip, QString shortcut) { shortcut = shortcut.replace("Enter", "\n"); QKeySequence keySequence(shortcut); QAction* pAction = menuStack_.top()->addAction(QIcon(), label, this, SLOT(actionInvoked()), keySequence); pAction->setData(commandId); pAction->setToolTip(tooltip); menuActions_[menuStack_.first()].append(pAction); }
void Action::saveSettings(QSettings& settings) const { keySequence().saveSettings(settings); settings.setValue("type", type()); settings.beginWriteArray("typeScreenNames"); for (int i = 0; i < typeScreenNames().size(); i++) { settings.setArrayIndex(i); settings.setValue("typeScreenName", typeScreenNames()[i]); } settings.endArray(); settings.setValue("switchScreenName", switchScreenName()); settings.setValue("switchInDirection", switchDirection()); settings.setValue("lockCursorToScreen", lockCursorMode()); settings.setValue("activeOnRelease", activeOnRelease()); settings.setValue("hasScreens", haveScreens()); }
void Action::loadSettings(QSettings& settings) { keySequence().loadSettings(settings); setType(settings.value("type", keyDown).toInt()); typeScreenNames().clear(); int numTypeScreens = settings.beginReadArray("typeScreenNames"); for (int i = 0; i < numTypeScreens; i++) { settings.setArrayIndex(i); typeScreenNames().append(settings.value("typeScreenName").toString()); } settings.endArray(); setSwitchScreenName(settings.value("switchScreenName").toString()); setSwitchDirection(settings.value("switchInDirection", switchLeft).toInt()); setLockCursorMode(settings.value("lockCursorToScreen", lockCursorToggle).toInt()); setActiveOnRelease(settings.value("activeOnRelease", false).toBool()); setHaveScreens(settings.value("hasScreens", false).toBool()); }
void ShortcutViewer::keyPressEvent(QKeyEvent *event) { int key = event->key(); if (key == Qt::Key_Control || key == Qt::Key_Shift || key == Qt::Key_Alt) { event->ignore(); return; } Qt::KeyboardModifiers modifiers = event->modifiers(); // Tasti che non possono essere utilizzati come shortcut if ((modifiers | (Qt::CTRL | Qt::SHIFT | Qt::ALT)) != (Qt::CTRL | Qt::SHIFT | Qt::ALT) || key == Qt::Key_Home || key == Qt::Key_End || key == Qt::Key_PageDown || key == Qt::Key_PageUp || key == Qt::Key_Escape || key == Qt::Key_Print || key == Qt::Key_Pause || key == Qt::Key_ScrollLock) { if (key != Qt::Key_Plus && key != Qt::Key_Minus && key != Qt::Key_Asterisk && key != Qt::Key_Slash) { event->ignore(); return; } else modifiers = 0; } if (m_action) { CommandManager *cm = CommandManager::instance(); QKeySequence keySequence(key + modifiers); std::string shortcutString = keySequence.toString().toStdString(); QAction *oldAction = cm->getActionFromShortcut(keySequence.toString().toStdString()); if (oldAction == m_action) return; if (oldAction) { QString msg = tr("%1 is already assigned to '%2'\nAssign to '%3'?").arg(keySequence.toString()).arg(oldAction->iconText()).arg(m_action->iconText()); int ret = DVGui::MsgBox(msg, tr("Yes"), tr("No"), 1); activateWindow(); if (ret == 2 || ret == 0) return; } CommandManager::instance()->setShortcut(m_action, shortcutString); emit shortcutChanged(); } event->accept(); update(); }
// ---------------------------------------------------------------------------------- QString GetToolTips(QString strCommandName) { strCommandName = QString("shortcuts/") + strCommandName; QKeySequence keySequence(pencilSettings().value(strCommandName).toString()); return QString("<b>%1</b>").arg(keySequence.toString()); // don't tr() this string. }
void MainWindow2::setupKeyboardShortcuts() { checkExistingShortcuts(); auto cmdKeySeq = []( QString strCommandName ) -> QKeySequence { strCommandName = QString( "shortcuts/" ) + strCommandName; QKeySequence keySequence( pencilSettings()->value( strCommandName ).toString() ); return keySequence; }; ui->actionNew->setShortcut( cmdKeySeq( CMD_NEW_FILE ) ); ui->actionOpen->setShortcut( cmdKeySeq( CMD_OPEN_FILE ) ); ui->actionSave->setShortcut( cmdKeySeq( CMD_SAVE_FILE ) ); ui->actionSave_as->setShortcut( cmdKeySeq( CMD_SAVE_AS ) ); ui->actionPrint->setShortcut( cmdKeySeq( CMD_PRINT ) ); ui->actionImport_Image->setShortcut( cmdKeySeq( CMD_IMPORT_IMAGE ) ); ui->actionImport_Image_Sequence->setShortcut( cmdKeySeq( CMD_IMPORT_IMAGE_SEQ ) ); ui->actionImport_Movie->setShortcut( cmdKeySeq( CMD_IMPORT_MOVIE ) ); ui->actionImport_Palette->setShortcut( cmdKeySeq( CMD_IMPORT_PALETTE ) ); ui->actionImport_Sound->setShortcut( cmdKeySeq( CMD_IMPORT_SOUND ) ); ui->actionExport_Image->setShortcut( cmdKeySeq( CMD_EXPORT_IMAGE ) ); ui->actionExport_Image_Sequence->setShortcut( cmdKeySeq( CMD_EXPORT_IMAGE_SEQ ) ); ui->actionExport_Movie->setShortcut( cmdKeySeq( CMD_EXPORT_MOVIE ) ); ui->actionExport_Palette->setShortcut( cmdKeySeq( CMD_EXPORT_PALETTE ) ); ui->actionExport_Svg_Image->setShortcut( cmdKeySeq( CMD_EXPORT_SVG ) ); ui->actionExport_X_sheet->setShortcut( cmdKeySeq( CMD_EXPORT_XSHEET ) ); // edit menu ui->actionUndo->setShortcut( cmdKeySeq( CMD_UNDO ) ); ui->actionRedo->setShortcut( cmdKeySeq( CMD_REDO ) ); ui->actionCut->setShortcut( cmdKeySeq( CMD_CUT ) ); ui->actionCopy->setShortcut( cmdKeySeq( CMD_COPY ) ); ui->actionPaste->setShortcut( cmdKeySeq( CMD_PASTE ) ); ui->actionClearFrame->setShortcut( cmdKeySeq( CMD_CLEAR_FRAME ) ); ui->actionSelect_All->setShortcut( cmdKeySeq( CMD_SELECT_ALL ) ); ui->actionDeselect_All->setShortcut( cmdKeySeq( CMD_DESELECT_ALL ) ); ui->actionPreference->setShortcut( cmdKeySeq( CMD_PREFERENCE ) ); ui->actionReset_Windows->setShortcut( cmdKeySeq( CMD_RESET_WINDOWS ) ); ui->actionReset_View->setShortcut( cmdKeySeq( CMD_RESET_ZOOM_ROTATE ) ); ui->actionZoom_In->setShortcut( cmdKeySeq( CMD_ZOOM_IN ) ); ui->actionZoom_Out->setShortcut( cmdKeySeq( CMD_ZOOM_OUT ) ); ui->actionRotate_Clockwise->setShortcut( cmdKeySeq( CMD_ROTATE_CLOCK ) ); ui->actionRotate_Anticlosewise->setShortcut( cmdKeySeq( CMD_ROTATE_ANTI_CLOCK ) ); ui->actionHorizontal_Flip->setShortcut( cmdKeySeq( CMD_FLIP_HORIZONTAL ) ); ui->actionVertical_Flip->setShortcut( cmdKeySeq( CMD_FLIP_VERTICAL ) ); ui->actionPreview->setShortcut( cmdKeySeq( CMD_PREVIEW ) ); ui->actionGrid->setShortcut( cmdKeySeq( CMD_GRID ) ); ui->actionOnionPrevious->setShortcut( cmdKeySeq( CMD_ONIONSKIN_PREV ) ); ui->actionOnionNext->setShortcut( cmdKeySeq( CMD_ONIONSKIN_NEXT ) ); ui->actionPlay->setShortcut( cmdKeySeq( CMD_PLAY ) ); ui->actionLoop->setShortcut( cmdKeySeq( CMD_LOOP ) ); ui->actionPrevious_Frame->setShortcut( cmdKeySeq( CMD_GOTO_PREV_FRAME ) ); ui->actionNext_Frame->setShortcut( cmdKeySeq( CMD_GOTO_NEXT_FRAME ) ); ui->actionPrev_KeyFrame->setShortcut( cmdKeySeq( CMD_GOTO_PREV_KEY_FRAME ) ); ui->actionNext_KeyFrame->setShortcut( cmdKeySeq( CMD_GOTO_NEXT_KEY_FRAME ) ); ui->actionAdd_Frame->setShortcut( cmdKeySeq( CMD_ADD_FRAME ) ); ui->actionDuplicate_Frame->setShortcut( cmdKeySeq( CMD_DUPLICATE_FRAME ) ); ui->actionRemove_Frame->setShortcut( cmdKeySeq( CMD_REMOVE_FRAME ) ); ui->actionMove_Frame_Backward->setShortcut( cmdKeySeq( CMD_MOVE_FRAME_BACKWARD ) ); ui->actionMove_Frame_Forward->setShortcut( cmdKeySeq( CMD_MOVE_FRAME_FORWARD ) ); ShortcutFilter* shortcutfilter = new ShortcutFilter( mScribbleArea ); ui->actionMove->setShortcut( cmdKeySeq( CMD_TOOL_MOVE ) ); ui->actionSelect->setShortcut( cmdKeySeq( CMD_TOOL_SELECT ) ); ui->actionBrush->setShortcut( cmdKeySeq( CMD_TOOL_BRUSH ) ); ui->actionPolyline->setShortcut( cmdKeySeq( CMD_TOOL_POLYLINE ) ); ui->actionSmudge->setShortcut( cmdKeySeq( CMD_TOOL_SMUDGE ) ); ui->actionPen->setShortcut( cmdKeySeq( CMD_TOOL_PEN ) ); ui->actionHand->setShortcut( cmdKeySeq( CMD_TOOL_HAND ) ); ui->actionPencil->setShortcut( cmdKeySeq( CMD_TOOL_PENCIL ) ); ui->actionBucket->setShortcut( cmdKeySeq( CMD_TOOL_BUCKET ) ); ui->actionEyedropper->setShortcut( cmdKeySeq( CMD_TOOL_EYEDROPPER ) ); ui->actionEraser->setShortcut( cmdKeySeq( CMD_TOOL_ERASER ) ); ui->actionMove->installEventFilter( shortcutfilter ); ui->actionMove->installEventFilter( shortcutfilter ); ui->actionSelect->installEventFilter( shortcutfilter ); ui->actionBrush->installEventFilter( shortcutfilter ); ui->actionPolyline->installEventFilter( shortcutfilter ); ui->actionSmudge->installEventFilter( shortcutfilter ); ui->actionPen->installEventFilter( shortcutfilter ); ui->actionHand->installEventFilter( shortcutfilter ); ui->actionPencil->installEventFilter( shortcutfilter ); ui->actionBucket->installEventFilter( shortcutfilter ); ui->actionEyedropper->installEventFilter( shortcutfilter ); ui->actionEraser->installEventFilter( shortcutfilter ); ui->actionTogglePalette->setShortcut( cmdKeySeq( CMD_TOGGLE_PALETTE ) ); //mScribbleArea->getPopupPalette()->closeButton->setText( tr("close/toggle (") + pencilSettings()->value( QString( "shortcuts/" ) + CMD_TOGGLE_PALETTE ).toString() + ")" ); //mScribbleArea->getPopupPalette()->closeButton->setShortcut( cmdKeySeq( CMD_TOGGLE_PALETTE ) ); ui->actionNew_Bitmap_Layer->setShortcut( cmdKeySeq( CMD_NEW_BITMAP_LAYER ) ); ui->actionNew_Vector_Layer->setShortcut( cmdKeySeq( CMD_NEW_VECTOR_LAYER ) ); ui->actionNew_Camera_Layer->setShortcut( cmdKeySeq( CMD_NEW_CAMERA_LAYER ) ); ui->actionNew_Sound_Layer->setShortcut( cmdKeySeq( CMD_NEW_SOUND_LAYER ) ); mToolBox->toggleViewAction()->setShortcut( cmdKeySeq( CMD_TOGGLE_TOOLBOX ) ); mToolOptions->toggleViewAction()->setShortcut( cmdKeySeq( CMD_TOGGLE_TOOL_OPTIONS ) ); mColorWheel->toggleViewAction()->setShortcut( cmdKeySeq( CMD_TOGGLE_COLOR_WHEEL ) ); mColorPalette->toggleViewAction()->setShortcut( cmdKeySeq( CMD_TOGGLE_COLOR_LIBRARY ) ); mTimeLine->toggleViewAction()->setShortcut( cmdKeySeq( CMD_TOGGLE_TIMELINE ) ); mDisplayOptionWidget->toggleViewAction()->setShortcut( cmdKeySeq( CMD_TOGGLE_DISPLAY_OPTIONS ) ); ui->actionHelp->setShortcut( cmdKeySeq( CMD_HELP ) ); }
int QKeySequenceWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 11) qt_static_metacall(this, _c, _id, _a); _id -= 11; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QKeySequence*>(_v) = keySequence(); break; case 1: *reinterpret_cast< QKeySequenceWidget::ClearButtonShow*>(_v) = clearButtonShow(); break; case 2: *reinterpret_cast< QString*>(_v) = noneText(); break; case 3: *reinterpret_cast< QIcon*>(_v) = clearButtonIcon(); break; } _id -= 4; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setKeySequence(*reinterpret_cast< QKeySequence*>(_v)); break; case 1: setClearButtonShow(*reinterpret_cast< QKeySequenceWidget::ClearButtonShow*>(_v)); break; case 2: setNoneText(*reinterpret_cast< QString*>(_v)); break; case 3: setClearButtonIcon(*reinterpret_cast< QIcon*>(_v)); break; } _id -= 4; } else if (_c == QMetaObject::ResetProperty) { _id -= 4; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 4; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 4; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 4; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 4; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 4; } #endif // QT_NO_PROPERTIES return _id; }
QVariant KShortcutsEditorItem::data(int column, int role) const { switch (role) { case Qt::DisplayRole: switch (column) { case Name: return m_actionNameInTable; case Id: return m_id; case LocalPrimary: case LocalAlternate: case GlobalPrimary: case GlobalAlternate: return keySequence(column); #if 0 case ShapeGesture: return KGestureMap::self()->shapeGesture(m_action).shapeName(); case RockerGesture: return KGestureMap::self()->rockerGesture(m_action).rockerName(); #endif default: break; } break; case Qt::DecorationRole: if (column == Name) { return m_action->icon(); } else { return QIcon(); } case Qt::WhatsThisRole: return m_action->whatsThis(); case Qt::ToolTipRole: // There is no such thing as a QAction::description(). So we have // nothing to display here. return QVariant(); case Qt::FontRole: if (column == Name && m_isNameBold) { QFont modifiedFont = treeWidget()->font(); modifiedFont.setBold(true); return modifiedFont; } break; case KExtendableItemDelegate::ShowExtensionIndicatorRole: switch (column) { case Name: return false; case LocalPrimary: case LocalAlternate: return !m_action->property("isShortcutConfigurable").isValid() || m_action->property("isShortcutConfigurable").toBool(); #if HAVE_GLOBALACCEL case GlobalPrimary: case GlobalAlternate: if (!KGlobalAccel::self()->hasShortcut(m_action)) { return false; } return true; #endif default: return false; } //the following are custom roles, defined in this source file only case ShortcutRole: switch (column) { case LocalPrimary: case LocalAlternate: case GlobalPrimary: case GlobalAlternate: return keySequence(column); #if 0 case ShapeGesture: { //scoping for "ret" QVariant ret; ret.setValue(KGestureMap::self()->shapeGesture(m_action)); return ret; } case RockerGesture: { QVariant ret; ret.setValue(KGestureMap::self()->rockerGesture(m_action)); return ret; } #endif default: // Column not valid for this role Q_ASSERT(false); return QVariant(); } case DefaultShortcutRole: { QList<QKeySequence> defaultShortcuts = m_action->property("defaultShortcuts").value<QList<QKeySequence> >(); #if HAVE_GLOBALACCEL QList<QKeySequence> defaultGlobalShortcuts = KGlobalAccel::self()->defaultShortcut(m_action); #endif switch (column) { case LocalPrimary: return primarySequence(defaultShortcuts); case LocalAlternate: return alternateSequence(defaultShortcuts); #if HAVE_GLOBALACCEL case GlobalPrimary: return primarySequence(defaultGlobalShortcuts); case GlobalAlternate: return alternateSequence(defaultGlobalShortcuts); #endif #if 0 case ShapeGesture: { QVariant ret; ret.setValue(KGestureMap::self()->defaultShapeGesture(m_action)); return ret; } case RockerGesture: { QVariant ret; ret.setValue(KGestureMap::self()->defaultRockerGesture(m_action)); return ret; } #endif default: // Column not valid for this role Q_ASSERT(false); return QVariant(); } } case ObjectRole: return qVariantFromValue(static_cast<QObject *>(m_action)); default: break; } return QVariant(); }
QString Action::stringWithAppendedShortcut(const QString &str) const { return Utils::ProxyAction::stringWithAppendedShortcut(str, keySequence()); }
QString ParupaintKey::toString() const { return keySequence().toString(); }
QString Hotkey::text() const { QString text = keySequence().toString(); if (keySequence().isMouseButton()) return "mousebutton(" + text + ")"; return "keystroke(" + text + ")"; }