📄 qkeysequence.cpp
字号:
{QKeySequence::Cut, 1, Qt::CTRL | Qt::Key_X, QApplicationPrivate::KB_All}, {QKeySequence::Redo, 1, Qt::CTRL | Qt::Key_Y, QApplicationPrivate::KB_Win}, {QKeySequence::Redo, 0, Qt::CTRL | Qt::Key_Y, QApplicationPrivate::KB_Mac},//different priority from above {QKeySequence::Undo, 1, Qt::CTRL | Qt::Key_Z, QApplicationPrivate::KB_All}, {QKeySequence::Back, 1, Qt::CTRL | Qt::Key_BracketLeft, QApplicationPrivate::KB_Mac}, {QKeySequence::Forward, 1, Qt::CTRL | Qt::Key_BracketRight, QApplicationPrivate::KB_Mac}, {QKeySequence::PreviousChild, 1, Qt::CTRL | Qt::Key_BraceLeft, QApplicationPrivate::KB_Mac}, {QKeySequence::NextChild, 1, Qt::CTRL | Qt::Key_BraceRight, QApplicationPrivate::KB_Mac}, {QKeySequence::NextChild, 1, Qt::CTRL | Qt::Key_Tab, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11}, {QKeySequence::NextChild, 0, Qt::CTRL | Qt::Key_Tab, QApplicationPrivate::KB_Mac}, //different priority from above {QKeySequence::DeleteStartOfWord, 0, Qt::CTRL | Qt::Key_Backspace, QApplicationPrivate::KB_X11 | QApplicationPrivate::KB_Win}, {QKeySequence::Copy, 0, Qt::CTRL | Qt::Key_Insert, QApplicationPrivate::KB_X11 | QApplicationPrivate::KB_Win}, {QKeySequence::DeleteEndOfWord, 0, Qt::CTRL | Qt::Key_Delete, QApplicationPrivate::KB_X11 | QApplicationPrivate::KB_Win}, {QKeySequence::MoveToStartOfDocument, 0, Qt::CTRL | Qt::Key_Home, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11}, {QKeySequence::MoveToEndOfDocument, 0, Qt::CTRL | Qt::Key_End, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11}, {QKeySequence::Back, 0, Qt::CTRL | Qt::Key_Left, QApplicationPrivate::KB_Mac}, {QKeySequence::MoveToPreviousWord, 0, Qt::CTRL | Qt::Key_Left, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11}, {QKeySequence::MoveToStartOfLine, 0, Qt::CTRL | Qt::Key_Left, QApplicationPrivate::KB_Mac }, {QKeySequence::MoveToStartOfDocument, 1, Qt::CTRL | Qt::Key_Up, QApplicationPrivate::KB_Mac}, {QKeySequence::Forward, 0, Qt::CTRL | Qt::Key_Right, QApplicationPrivate::KB_Mac}, {QKeySequence::MoveToEndOfLine, 0, Qt::CTRL | Qt::Key_Right, QApplicationPrivate::KB_Mac }, {QKeySequence::MoveToNextWord, 0, Qt::CTRL | Qt::Key_Right, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11}, {QKeySequence::MoveToEndOfDocument, 1, Qt::CTRL | Qt::Key_Down, QApplicationPrivate::KB_Mac}, {QKeySequence::Close, 1, Qt::CTRL | Qt::Key_F4, QApplicationPrivate::KB_Win}, {QKeySequence::Close, 0, Qt::CTRL | Qt::Key_F4, QApplicationPrivate::KB_Mac}, {QKeySequence::NextChild, 0, Qt::CTRL | Qt::Key_F6, QApplicationPrivate::KB_Win}, {QKeySequence::FindPrevious, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_G, QApplicationPrivate::KB_Gnome | QApplicationPrivate::KB_Mac}, {QKeySequence::FindPrevious, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_G, QApplicationPrivate::KB_Win}, {QKeySequence::AddTab, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_N, QApplicationPrivate::KB_KDE}, {QKeySequence::Redo, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Z, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11}, {QKeySequence::Redo, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_Z, QApplicationPrivate::KB_Mac}, //different priority from above {QKeySequence::PreviousChild, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_Tab, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11}, {QKeySequence::PreviousChild, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Tab, QApplicationPrivate::KB_Mac },//different priority from above {QKeySequence::SelectStartOfDocument, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Home, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11}, {QKeySequence::SelectEndOfDocument, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_End, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11}, {QKeySequence::SelectPreviousWord, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Left, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11}, {QKeySequence::SelectStartOfLine, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_Left, QApplicationPrivate::KB_Mac }, {QKeySequence::SelectStartOfDocument, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_Up, QApplicationPrivate::KB_Mac}, {QKeySequence::SelectNextWord, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Right, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11}, {QKeySequence::SelectEndOfLine, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_Right, QApplicationPrivate::KB_Mac }, {QKeySequence::SelectEndOfDocument, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_Down, QApplicationPrivate::KB_Mac}, {QKeySequence::PreviousChild, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_F6, QApplicationPrivate::KB_Win}, {QKeySequence::Undo, 0, Qt::ALT | Qt::Key_Backspace, QApplicationPrivate::KB_Win}, {QKeySequence::DeleteStartOfWord, 0, Qt::ALT | Qt::Key_Backspace, QApplicationPrivate::KB_Mac}, {QKeySequence::DeleteEndOfWord, 0, Qt::ALT | Qt::Key_Delete, QApplicationPrivate::KB_Mac}, {QKeySequence::Back, 1, Qt::ALT | Qt::Key_Left, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11}, {QKeySequence::MoveToPreviousWord, 0, Qt::ALT | Qt::Key_Left, QApplicationPrivate::KB_Mac}, {QKeySequence::MoveToStartOfBlock, 0, Qt::ALT | Qt::Key_Up, QApplicationPrivate::KB_Mac}, //mac only {QKeySequence::MoveToNextWord, 0, Qt::ALT | Qt::Key_Right, QApplicationPrivate::KB_Mac}, {QKeySequence::Forward, 1, Qt::ALT | Qt::Key_Right, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11}, {QKeySequence::MoveToEndOfBlock, 0, Qt::ALT | Qt::Key_Down, QApplicationPrivate::KB_Mac}, //mac only {QKeySequence::MoveToPreviousPage, 0, Qt::ALT | Qt::Key_PageUp, QApplicationPrivate::KB_Mac }, {QKeySequence::MoveToNextPage, 0, Qt::ALT | Qt::Key_PageDown, QApplicationPrivate::KB_Mac }, {QKeySequence::Redo, 0, Qt::ALT | Qt::SHIFT | Qt::Key_Backspace,QApplicationPrivate::KB_Win}, {QKeySequence::SelectPreviousWord, 0, Qt::ALT | Qt::SHIFT | Qt::Key_Left, QApplicationPrivate::KB_Mac}, {QKeySequence::SelectStartOfBlock, 0, Qt::ALT | Qt::SHIFT | Qt::Key_Up, QApplicationPrivate::KB_Mac}, //mac only {QKeySequence::SelectNextWord, 0, Qt::ALT | Qt::SHIFT | Qt::Key_Right, QApplicationPrivate::KB_Mac}, {QKeySequence::SelectEndOfBlock, 0, Qt::ALT | Qt::SHIFT | Qt::Key_Down, QApplicationPrivate::KB_Mac}, //mac only {QKeySequence::MoveToStartOfBlock, 0, Qt::META | Qt::Key_A, QApplicationPrivate::KB_Mac}, {QKeySequence::Delete, 0, Qt::META | Qt::Key_D, QApplicationPrivate::KB_Mac}, {QKeySequence::MoveToEndOfBlock, 0, Qt::META | Qt::Key_E, QApplicationPrivate::KB_Mac}, {QKeySequence::MoveToStartOfLine, 0, Qt::META | Qt::Key_Left, QApplicationPrivate::KB_Mac}, {QKeySequence::MoveToPreviousPage, 0, Qt::META | Qt::Key_Up, QApplicationPrivate::KB_Mac}, {QKeySequence::MoveToEndOfLine, 0, Qt::META | Qt::Key_Right, QApplicationPrivate::KB_Mac}, {QKeySequence::MoveToNextPage, 0, Qt::META | Qt::Key_Down, QApplicationPrivate::KB_Mac}, {QKeySequence::MoveToPreviousPage, 0, Qt::META | Qt::Key_PageUp, QApplicationPrivate::KB_Mac}, {QKeySequence::MoveToNextPage, 0, Qt::META | Qt::Key_PageDown, QApplicationPrivate::KB_Mac}, {QKeySequence::SelectStartOfLine, 0, Qt::META | Qt::SHIFT | Qt::Key_Left, QApplicationPrivate::KB_Mac}, {QKeySequence::SelectEndOfLine, 0, Qt::META | Qt::SHIFT | Qt::Key_Right, QApplicationPrivate::KB_Mac} };const uint QKeySequencePrivate::numberOfKeyBindings = sizeof(QKeySequencePrivate::keyBindings)/(sizeof(QKeyBinding));/*! \enum QKeySequence::StandardKey \since 4.2 This enum represent standard key bindings. They can be used to assign platform dependent keyboard shortcuts to a QAction. QKeyEvent also provides the function QKeyEvent::standardKey() to query if it matches an existing key binding. Note that the key bindings are platform dependent. The currently bound shortcuts can be queried using keyBindings(). \value UnknownKey Unbound key. \value HelpContents Open help contents. \value WhatsThis Activate whats this. \value Open Open Document. \value Close Close Document/Tab. \value Save Save Document. \value New Create new Document. \value Delete Delete. \value Cut Cut. \value Copy Copy. \value Paste Paste. \value Undo Undo. \value Redo Redo. \value Back Navigate back. \value Forward Navigate forward. \value Refresh Refresh or reload current document. \value ZoomIn Zoom in. \value ZoomOut Zoom out. \value Print Print document. \value AddTab Add new tab. \value NextChild Navigate to next tab or child window. \value PreviousChild Navigate to previous tab or child window. \value Find Find in document. \value FindNext Find next result. \value FindPrevious Find previous result. \value Replace Find and replace. \value SelectAll Select all text. \value Bold Bold text. \value Italic Italic text. \value Underline Underline text. \value MoveToNextChar Move cursor to next character. \value MoveToPreviousChar Move cursor to previous character. \value MoveToNextWord Move cursor to next word. \value MoveToPreviousWord Move cursor to previous word. \value MoveToNextLine Move cursor to next line. \value MoveToPreviousLine Move cursor to previous line. \value MoveToNextPage Move cursor to next page. \value MoveToPreviousPage Move cursor to previous page. \value MoveToStartOfLine Move cursor to start of line. \value MoveToEndOfLine Move cursor to end of line. \value MoveToStartOfBlock Move cursor to start of a block. This shortcut is only used on OS X. \value MoveToEndOfBlock Move cursor to end of block. This shortcut is only used on the OS X. \value MoveToStartOfDocument Move cursor to start of document. \value MoveToEndOfDocument Move cursor to end of document. \value SelectNextChar Extend selection to next character. \value SelectPreviousChar Extend selection to previous character. \value SelectNextWord Extend selection to next word. \value SelectPreviousWord Extend selection to previous word. \value SelectNextLine Extend selection to next line. \value SelectPreviousLine Extend selection to previous line. \value SelectNextPage Extend selection to next page. \value SelectPreviousPage Extend selection to previous page. \value SelectStartOfLine Extend selection to start of line. \value SelectEndOfLine Extend selection to end of line. \value SelectStartOfBlock Extend selection to the start of a text block. This shortcut is only used on OS X. \value SelectEndOfBlock Extend selection to the end of a text block. This shortcut is only used on OS X. \value SelectStartOfDocument Extend selection to start of document. \value SelectEndOfDocument Extend selection to end of document. \value DeleteStartOfWord Delete the beginning of a word up to the cursor. \value DeleteEndOfWord Delete word from the end of the cursor. \value DeleteEndOfLine Delete end of line.*//*! \since 4.2 Constructs a QKeySequence object for the given \a key. The result will depend on the currently running platform. The resulting object will be based on the first element in the list of key bindings for the \a key.*/QKeySequence::QKeySequence(StandardKey key){ const QList <QKeySequence> bindings = keyBindings(key); //pick only the first/primary shortcut from current bindings if (bindings.size() > 0) { d = bindings.first().d; d->ref.ref(); } else d = new QKeySequencePrivate();}/*! Constructs an empty key sequence.*/QKeySequence::QKeySequence(){ d = new QKeySequencePrivate();}/*! Creates a key sequence from the \a key string. For example "Ctrl+O" gives CTRL+'O'. The strings "Ctrl", "Shift", "Alt" and "Meta" are recognized, as well as their translated equivalents in the "QShortcut" context (using QObject::tr()). Up to four key codes may be entered by separating them with commas, e.g. "Alt+X,Ctrl+S,Q". This constructor is typically used with \link QObject::tr() tr \endlink(), so that shortcut keys can be replaced in translations: \code QMenu *file = new QMenu(this); file->addAction(tr("&Open..."), this, SLOT(open()), QKeySequence(tr("Ctrl+O", "File|Open"))); \endcode Note the "File|Open" translator comment. It is by no means necessary, but it provides some context for the human translator.*/QKeySequence::QKeySequence(const QString &key){ d = new QKeySequencePrivate(); assign(key);}/*! Constructs a key sequence with up to 4 keys \a k1, \a k2, \a k3 and \a k4. The key codes are listed in Qt::Key and can be combined with modifiers (see Qt::Modifier) such as Qt::SHIFT, Qt::CTRL, Qt::ALT, or Qt::META.*/QKeySequence::QKeySequence(int k1, int k2, int k3, int k4){ d = new QKeySequencePrivate(); d->key[0] = k1; d->key[1] = k2; d->key[2] = k3; d->key[3] = k4;}/*! Copy constructor. Makes a copy of \a keysequence. */QKeySequence::QKeySequence(const QKeySequence& keysequence) : d(keysequence.d){ d->ref.ref();}/*! \since 4.2 Returns a list of key bindings for the given \a key. The result of calling this function will vary based on the target platform. The first element of the list indicates the primary shortcut for the given platform. If the result contains more than one result, these can
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -