pyqt4文档阅读(11):QKeySequence

本系列文章长期更新修改.


QKeySequence,按键序列,是Qt用来记录键盘序列的一个类,比如(ctrl+c,alt+tab,ctrl+v)这样的一个按键序列.


属性:

Types

  • enum SequenceFormat { NativeText, PortableText }
  • enum SequenceMatch { NoMatch, PartialMatch, ExactMatch }
  • enum StandardKey { UnknownKey, HelpContents, WhatsThis, Open, ..., DeleteEndOfLine }

Methods

  • __init__ (self)
  • __init__ (self, QKeySequence ks)
  • __init__ (self, int k1, int k2 = 0, int k3 = 0, int k4 = 0)
  • __init__ (self, QVariant variant)
  • unsigned long count (self)
  • bool isDetached (self)
  • bool isEmpty (self)
  • SequenceMatch matches (self, QKeySequence seq)
  • QString toString (self, SequenceFormat format = QKeySequence.PortableText)

Static Methods

  • QKeySequence fromString (QString str, SequenceFormat format = QKeySequence.PortableText)
  • QKeySequence-list keyBindings (StandardKey key)
  • QKeySequence mnemonic (QString text)

Special Methods

  • bool __eq__ (self, QKeySequence other)
  • bool __ge__ (self, QKeySequence other)
  • int __getitem__ (self, int i)
  • bool __gt__ (self, QKeySequence other)
  • int __int__ (self)
  • bool __le__ (self, QKeySequence other)
  • bool __lt__ (self, QKeySequence ks)
  • bool __ne__ (self, QKeySequence other)


详细分析:


1.含义

QKeySequence是一个按键的序列,并不是ctrl+alt+del这样的组合键!

一个按键序列包括多次的按键,每次按键可以是单键或组合键.

QKeySequence最多支持4次按键的序列.

2.按键的表示

Qt里按键的表示有多种形式.

第一种是字符串类型,如"ctrl+alt+del"通过键的名字和加号来表示组合键,如果是按键序列则用逗号分隔每次的按键,如"ctrl+c,ctrl+v"

第二种是枚举类型,通过枚举量来表示按键,如Qt.CTRL+Qt.Key_A.

关于按键的枚举量,Qt是分成了两类,一类是基本键,如Qt.Key_A,一类是修饰键,如Qt.CTRL这些组合键用到的.

所有的组合键都应该是一个基本键+若干个修饰键,"a+b"这样的组合键是不行的(同时,"ctrl+shift"也不行).

实际上,Qt的组合键和单键一样,都是一个int.组合键就是基本键的值加上高位的flag,这些flag就是修饰键加上去的.

第三种也是枚举类型,是对第二种的一些补充.

由于一些非字符按键的按键码是跟操作系统相关的,这样不利于Qt的跨平台,因此Qt增加了标准键这样的枚举.

标准键包括了大部分的操作的单键和组合键,比如Cut,Copy这些.在不同的OS上,这些标准键的值可能不一样.

3.shift转换

有一些字符的按键需要加上shift转换,比如百分号%,这时候"ctrl+%"和"ctrl+shift+5"是等价的.

但是,字符按键是大小写不敏感的,也就是说"ctrl+A"等于"ctrl+a",但不等于"ctrl+shift+a".

4.初始化

QKeySequence有4种初始化方式,常用的只有一种,通过枚举量或标准键来初始化.

  • __init__ (self, int k1, int k2 = 0, int k3 = 0, int k4 = 0)

想通过字符串来初始化的话,需要使用静态方法.

  • QKeySequence fromString (QString str, SequenceFormat format = QKeySequence.PortableText)

该函数的第二个参数是一个枚举类型,表示输入的字符串是普通文本还是富文本.

文档上写道,大部分情况下富文本的按键字符串和普通文本是差不多的,也就是说这个参数几乎可以不用管.

  • enum SequenceFormat { NativeText, PortableText }
5.字符串转换

初始化的时候可以把字符串变成按键序列,那么按键序列也能生成对应字符串.

  • QString toString (self, SequenceFormat format = QKeySequence.PortableText)
6.序列匹配

QKeySequence里提供了按键序列的匹配(意义好像不大).

  • SequenceMatch matches (self, QKeySequence seq)

返回值是一个枚举量,含义如下表:

QKeySequence.SequenceMatch

枚举量备注
NoMatch0不匹配
PartialMatch1部分匹配(仅当自己能完全匹配参数里序列的前缀)
ExactMatch2完全匹配

7.查找所有标准按键

在一些操作系统里,某个标准键可能对应多个键盘按键.

因此QKeySequence提供了一个类函数,该函数以标准键为参数,返回一个QKeySequence的列表.

  • QKeySequence-list keyBindings (StandardKey key)
8.shortCut转换

Qt里还有一类用表示快捷键的字符串,就是shortCut,比如"&Quit"表示Alt+Q.

这种字符串可以通过下面的类函数转换为QKeySequence.

  • QKeySequence mnemonic (QString text)

当字符串不存在快捷键时,函数返回空QKeySequence.

9.其他函数

函数头含义备注
unsigned long count (self)返回按键序列个数0<=count<=4
bool isDetached (self)?Qt5该函数被删掉
bool isEmpty (self)判断序列是否为空 

10.标准键表

QKeySequence.StandardKey

标准键WindowsMac OS XKDEGNOME
HelpContentsF1Ctrl+?F1F1
WhatsThisShift+F1Shift+F1Shift+F1Shift+F1
OpenCtrl+OCtrl+OCtrl+OCtrl+O
CloseCtrl+F4, Ctrl+WCtrl+W, Ctrl+F4Ctrl+WCtrl+W
SaveCtrl+SCtrl+SCtrl+SCtrl+S
NewCtrl+NCtrl+NCtrl+NCtrl+N
DeleteDelDel, Meta+DDel, Ctrl+DDel, Ctrl+D
CutCtrl+X, Shift+DelCtrl+XCtrl+X, F20, Shift+DelCtrl+X, F20, Shift+Del
CopyCtrl+C, Ctrl+InsCtrl+CCtrl+C, F16, Ctrl+InsCtrl+C, F16, Ctrl+Ins
PasteCtrl+V, Shift+InsCtrl+VCtrl+V, F18, Shift+InsCtrl+V, F18, Shift+Ins
UndoCtrl+Z, Alt+BackspaceCtrl+ZCtrl+Z, F14Ctrl+Z, F14
RedoCtrl+Y, Shift+Ctrl+Z, Alt+Shift+BackspaceCtrl+Shift+Z, Ctrl+YCtrl+Shift+ZCtrl+Shift+Z
BackAlt+Left, BackspaceCtrl+[Alt+LeftAlt+Left
ForwardAlt+Right, Shift+BackspaceCtrl+]Alt+RightAlt+Right
RefreshF5F5F5Ctrl+R, F5
ZoomInCtrl+PlusCtrl+PlusCtrl+PlusCtrl+Plus
ZoomOutCtrl+MinusCtrl+MinusCtrl+MinusCtrl+Minus
PrintCtrl+PCtrl+PCtrl+PCtrl+P
AddTabCtrl+TCtrl+TCtrl+Shift+N, Ctrl+TCtrl+T
NextChildCtrl+Tab, Forward, Ctrl+F6Ctrl+}, Forward, Ctrl+TabCtrl+Tab, Forward, Ctrl+CommaCtrl+Tab, Forward
PreviousChildCtrl+Shift+Tab, Back, Ctrl+Shift+F6Ctrl+{, Back, Ctrl+Shift+TabCtrl+Shift+Tab, Back, Ctrl+PeriodCtrl+Shift+Tab, Back
FindCtrl+FCtrl+FCtrl+FCtrl+F
FindNextF3, Ctrl+GCtrl+GF3Ctrl+G, F3
FindPreviousShift+F3, Ctrl+Shift+GCtrl+Shift+GShift+F3Ctrl+Shift+G, Shift+F3
ReplaceCtrl+H(none)Ctrl+RCtrl+H
SelectAllCtrl+ACtrl+ACtrl+ACtrl+A
BoldCtrl+BCtrl+BCtrl+BCtrl+B
ItalicCtrl+ICtrl+ICtrl+ICtrl+I
UnderlineCtrl+UCtrl+UCtrl+UCtrl+U
MoveToNextCharRightRightRightRight
MoveToPreviousCharLeftLeftLeftLeft
MoveToNextWordCtrl+RightAlt+RightCtrl+RightCtrl+Right
MoveToPreviousWordCtrl+LeftAlt+LeftCtrl+LeftCtrl+Left
MoveToNextLineDownDownDownDown
MoveToPreviousLineUpUpUpUp
MoveToNextPagePgDownPgDown, Alt+PgDown, Meta+Down, Meta+PgDownPgDownPgDown
MoveToPreviousPagePgUpPgUp, Alt+PgUp, Meta+Up, Meta+PgUpPgUpPgUp
MoveToStartOfLineHomeCtrl+Left, Meta+LeftHomeHome
MoveToEndOfLineEndCtrl+Right, Meta+RightEndEnd
MoveToStartOfBlock(none)Alt+Up, Meta+A(none)(none)
MoveToEndOfBlock(none)Alt+Down, Meta+E(none)(none)
MoveToStartOfDocumentCtrl+HomeCtrl+Up, HomeCtrl+HomeCtrl+Home
MoveToEndOfDocumentCtrl+EndCtrl+Down, EndCtrl+EndCtrl+End
SelectNextCharShift+RightShift+RightShift+RightShift+Right
SelectPreviousCharShift+LeftShift+LeftShift+LeftShift?left
SelectNextWordCtrl+Shift+RightAlt+Shift+RightCtrl+Shift+RightCtrl+Shift+Right
SelectPreviousWordCtrl+Shift+LeftAlt+Shift+LeftCtrl+Shift+LeftCtrl+Shift+Left
SelectNextLineShift+DownShift+DownShift+DownShift+Down
SelectPreviousLineShift+UpShift+UpShift+UpShift+Up
SelectNextPageShift+PgDownShift+PgDownShift+PgDownShift+PgDown
SelectPreviousPageShift+PgUpShift+PgUpShift+PgUpShift+PgUp
SelectStartOfLineShift+HomeCtrl+Shift+LeftShift+HomeShift+Home
SelectEndOfLineShift+EndCtrl+Shift+RightShift+EndShift+End
SelectStartOfBlock(none)Alt+Shift+Up(none)(none)
SelectEndOfBlock(none)Alt+Shift+Down(none)(none)
SelectStartOfDocumentCtrl+Shift+HomeCtrl+Shift+Up, Shift+HomeCtrl+Shift+HomeCtrl+Shift+Home
SelectEndOfDocumentCtrl+Shift+EndCtrl+Shift+Down, Shift+EndCtrl+Shift+EndCtrl+Shift+End
DeleteStartOfWordCtrl+BackspaceAlt+BackspaceCtrl+BackspaceCtrl+Backspace
DeleteEndOfWordCtrl+Del(none)Ctrl+DelCtrl+Del
DeleteEndOfLine(none)(none)Ctrl+KCtrl+K

11.基础键和修饰键表

Qt.Key

枚举量备注
Qt.Key_Escape0x01000000 
Qt.Key_Tab0x01000001 
Qt.Key_Backtab0x01000002 
Qt.Key_Backspace0x01000003 
Qt.Key_Return0x01000004 
Qt.Key_Enter0x01000005Typically located on the keypad.
Qt.Key_Insert0x01000006 
Qt.Key_Delete0x01000007 
Qt.Key_Pause0x01000008 
Qt.Key_Print0x01000009 
Qt.Key_SysReq0x0100000a 
Qt.Key_Clear0x0100000b 
Qt.Key_Home0x01000010 
Qt.Key_End0x01000011 
Qt.Key_Left0x01000012 
Qt.Key_Up0x01000013 
Qt.Key_Right0x01000014 
Qt.Key_Down0x01000015 
Qt.Key_PageUp0x01000016 
Qt.Key_PageDown0x01000017 
Qt.Key_Shift0x01000020 
Qt.Key_Control0x01000021On Mac OS X, this corresponds to the Command keys.
Qt.Key_Meta0x01000022On Mac OS X, this corresponds to the Control keys. On Windows keyboards, this key is mapped to the Windows key.
Qt.Key_Alt0x01000023 
Qt.Key_AltGr0x01001103On Windows, when the KeyDown event for this key is sent, the Ctrl+Alt modifiers are also set.
Qt.Key_CapsLock0x01000024 
Qt.Key_NumLock0x01000025 
Qt.Key_ScrollLock0x01000026 
Qt.Key_F10x01000030 
Qt.Key_F20x01000031 
Qt.Key_F30x01000032 
Qt.Key_F40x01000033 
Qt.Key_F50x01000034 
Qt.Key_F60x01000035 
Qt.Key_F70x01000036 
Qt.Key_F80x01000037 
Qt.Key_F90x01000038 
Qt.Key_F100x01000039 
Qt.Key_F110x0100003a 
Qt.Key_F120x0100003b 
Qt.Key_F130x0100003c 
Qt.Key_F140x0100003d 
Qt.Key_F150x0100003e 
Qt.Key_F160x0100003f 
Qt.Key_F170x01000040 
Qt.Key_F180x01000041 
Qt.Key_F190x01000042 
Qt.Key_F200x01000043 
Qt.Key_F210x01000044 
Qt.Key_F220x01000045 
Qt.Key_F230x01000046 
Qt.Key_F240x01000047 
Qt.Key_F250x01000048 
Qt.Key_F260x01000049 
Qt.Key_F270x0100004a 
Qt.Key_F280x0100004b 
Qt.Key_F290x0100004c 
Qt.Key_F300x0100004d 
Qt.Key_F310x0100004e 
Qt.Key_F320x0100004f 
Qt.Key_F330x01000050 
Qt.Key_F340x01000051 
Qt.Key_F350x01000052 
Qt.Key_Super_L0x01000053 
Qt.Key_Super_R0x01000054 
Qt.Key_Menu0x01000055 
Qt.Key_Hyper_L0x01000056 
Qt.Key_Hyper_R0x01000057 
Qt.Key_Help0x01000058 
Qt.Key_Direction_L0x01000059 
Qt.Key_Direction_R0x01000060 
Qt.Key_Space0x20 
Qt.Key_AnyKey_Space 
Qt.Key_Exclam0x21 
Qt.Key_QuoteDbl0x22 
Qt.Key_NumberSign0x23 
Qt.Key_Dollar0x24 
Qt.Key_Percent0x25 
Qt.Key_Ampersand0x26 
Qt.Key_Apostrophe0x27 
Qt.Key_ParenLeft0x28 
Qt.Key_ParenRight0x29 
Qt.Key_Asterisk0x2a 
Qt.Key_Plus0x2b 
Qt.Key_Comma0x2c 
Qt.Key_Minus0x2d 
Qt.Key_Period0x2e 
Qt.Key_Slash0x2f 
Qt.Key_00x30 
Qt.Key_10x31 
Qt.Key_20x32 
Qt.Key_30x33 
Qt.Key_40x34 
Qt.Key_50x35 
Qt.Key_60x36 
Qt.Key_70x37 
Qt.Key_80x38 
Qt.Key_90x39 
Qt.Key_Colon0x3a 
Qt.Key_Semicolon0x3b 
Qt.Key_Less0x3c 
Qt.Key_Equal0x3d 
Qt.Key_Greater0x3e 
Qt.Key_Question0x3f 
Qt.Key_At0x40 
Qt.Key_A0x41 
Qt.Key_B0x42 
Qt.Key_C0x43 
Qt.Key_D0x44 
Qt.Key_E0x45 
Qt.Key_F0x46 
Qt.Key_G0x47 
Qt.Key_H0x48 
Qt.Key_I0x49 
Qt.Key_J0x4a 
Qt.Key_K0x4b 
Qt.Key_L0x4c 
Qt.Key_M0x4d 
Qt.Key_N0x4e 
Qt.Key_O0x4f 
Qt.Key_P0x50 
Qt.Key_Q0x51 
Qt.Key_R0x52 
Qt.Key_S0x53 
Qt.Key_T0x54 
Qt.Key_U0x55 
Qt.Key_V0x56 
Qt.Key_W0x57 
Qt.Key_X0x58 
Qt.Key_Y0x59 
Qt.Key_Z0x5a 
Qt.Key_BracketLeft0x5b 
Qt.Key_Backslash0x5c 
Qt.Key_BracketRight0x5d 
Qt.Key_AsciiCircum0x5e 
Qt.Key_Underscore0x5f 
Qt.Key_QuoteLeft0x60 
Qt.Key_BraceLeft0x7b 
Qt.Key_Bar0x7c 
Qt.Key_BraceRight0x7d 
Qt.Key_AsciiTilde0x7e 
Qt.Key_nobreakspace0x0a0 
Qt.Key_exclamdown0x0a1 
Qt.Key_cent0x0a2 
Qt.Key_sterling0x0a3 
Qt.Key_currency0x0a4 
Qt.Key_yen0x0a5 
Qt.Key_brokenbar0x0a6 
Qt.Key_section0x0a7 
Qt.Key_diaeresis0x0a8 
Qt.Key_copyright0x0a9 
Qt.Key_ordfeminine0x0aa 
Qt.Key_guillemotleft0x0ab 
Qt.Key_notsign0x0ac 
Qt.Key_hyphen0x0ad 
Qt.Key_registered0x0ae 
Qt.Key_macron0x0af 
Qt.Key_degree0x0b0 
Qt.Key_plusminus0x0b1 
Qt.Key_twosuperior0x0b2 
Qt.Key_threesuperior0x0b3 
Qt.Key_acute0x0b4 
Qt.Key_mu0x0b5 
Qt.Key_paragraph0x0b6 
Qt.Key_periodcentered0x0b7 
Qt.Key_cedilla0x0b8 
Qt.Key_onesuperior0x0b9 
Qt.Key_masculine0x0ba 
Qt.Key_guillemotright0x0bb 
Qt.Key_onequarter0x0bc 
Qt.Key_onehalf0x0bd 
Qt.Key_threequarters0x0be 
Qt.Key_questiondown0x0bf 
Qt.Key_Agrave0x0c0 
Qt.Key_Aacute0x0c1 
Qt.Key_Acircumflex0x0c2 
Qt.Key_Atilde0x0c3 
Qt.Key_Adiaeresis0x0c4 
Qt.Key_Aring0x0c5 
Qt.Key_AE0x0c6 
Qt.Key_Ccedilla0x0c7 
Qt.Key_Egrave0x0c8 
Qt.Key_Eacute0x0c9 
Qt.Key_Ecircumflex0x0ca 
Qt.Key_Ediaeresis0x0cb 
Qt.Key_Igrave0x0cc 
Qt.Key_Iacute0x0cd 
Qt.Key_Icircumflex0x0ce 
Qt.Key_Idiaeresis0x0cf 
Qt.Key_ETH0x0d0 
Qt.Key_Ntilde0x0d1 
Qt.Key_Ograve0x0d2 
Qt.Key_Oacute0x0d3 
Qt.Key_Ocircumflex0x0d4 
Qt.Key_Otilde0x0d5 
Qt.Key_Odiaeresis0x0d6 
Qt.Key_multiply0x0d7 
Qt.Key_Ooblique0x0d8 
Qt.Key_Ugrave0x0d9 
Qt.Key_Uacute0x0da 
Qt.Key_Ucircumflex0x0db 
Qt.Key_Udiaeresis0x0dc 
Qt.Key_Yacute0x0dd 
Qt.Key_THORN0x0de 
Qt.Key_ssharp0x0df 
Qt.Key_division0x0f7 
Qt.Key_ydiaeresis0x0ff 
Qt.Key_Multi_key0x01001120 
Qt.Key_Codeinput0x01001137 
Qt.Key_SingleCandidate0x0100113c 
Qt.Key_MultipleCandidate0x0100113d 
Qt.Key_PreviousCandidate0x0100113e 
Qt.Key_Mode_switch0x0100117e 
Qt.Key_Kanji0x01001121 
Qt.Key_Muhenkan0x01001122 
Qt.Key_Henkan0x01001123 
Qt.Key_Romaji0x01001124 
Qt.Key_Hiragana0x01001125 
Qt.Key_Katakana0x01001126 
Qt.Key_Hiragana_Katakana0x01001127 
Qt.Key_Zenkaku0x01001128 
Qt.Key_Hankaku0x01001129 
Qt.Key_Zenkaku_Hankaku0x0100112a 
Qt.Key_Touroku0x0100112b 
Qt.Key_Massyo0x0100112c 
Qt.Key_Kana_Lock0x0100112d 
Qt.Key_Kana_Shift0x0100112e 
Qt.Key_Eisu_Shift0x0100112f 
Qt.Key_Eisu_toggle0x01001130 
Qt.Key_Hangul0x01001131 
Qt.Key_Hangul_Start0x01001132 
Qt.Key_Hangul_End0x01001133 
Qt.Key_Hangul_Hanja0x01001134 
Qt.Key_Hangul_Jamo0x01001135 
Qt.Key_Hangul_Romaja0x01001136 
Qt.Key_Hangul_Jeonja0x01001138 
Qt.Key_Hangul_Banja0x01001139 
Qt.Key_Hangul_PreHanja0x0100113a 
Qt.Key_Hangul_PostHanja0x0100113b 
Qt.Key_Hangul_Special0x0100113f 
Qt.Key_Dead_Grave0x01001250 
Qt.Key_Dead_Acute0x01001251 
Qt.Key_Dead_Circumflex0x01001252 
Qt.Key_Dead_Tilde0x01001253 
Qt.Key_Dead_Macron0x01001254 
Qt.Key_Dead_Breve0x01001255 
Qt.Key_Dead_Abovedot0x01001256 
Qt.Key_Dead_Diaeresis0x01001257 
Qt.Key_Dead_Abovering0x01001258 
Qt.Key_Dead_Doubleacute0x01001259 
Qt.Key_Dead_Caron0x0100125a 
Qt.Key_Dead_Cedilla0x0100125b 
Qt.Key_Dead_Ogonek0x0100125c 
Qt.Key_Dead_Iota0x0100125d 
Qt.Key_Dead_Voiced_Sound0x0100125e 
Qt.Key_Dead_Semivoiced_Sound0x0100125f 
Qt.Key_Dead_Belowdot0x01001260 
Qt.Key_Dead_Hook0x01001261 
Qt.Key_Dead_Horn0x01001262 
Qt.Key_Back0x01000061 
Qt.Key_Forward0x01000062 
Qt.Key_Stop0x01000063 
Qt.Key_Refresh0x01000064 
Qt.Key_VolumeDown0x01000070 
Qt.Key_VolumeMute0x01000071 
Qt.Key_VolumeUp0x01000072 
Qt.Key_BassBoost0x01000073 
Qt.Key_BassUp0x01000074 
Qt.Key_BassDown0x01000075 
Qt.Key_TrebleUp0x01000076 
Qt.Key_TrebleDown0x01000077 
Qt.Key_MediaPlay0x01000080 
Qt.Key_MediaStop0x01000081 
Qt.Key_MediaPrevious0x01000082 
Qt.Key_MediaNext0x01000083 
Qt.Key_MediaRecord0x01000084 
Qt.Key_HomePage0x01000090 
Qt.Key_Favorites0x01000091 
Qt.Key_Search0x01000092 
Qt.Key_Standby0x01000093 
Qt.Key_OpenUrl0x01000094 
Qt.Key_LaunchMail0x010000a0 
Qt.Key_LaunchMedia0x010000a1 
Qt.Key_Launch00x010000a2 
Qt.Key_Launch10x010000a3 
Qt.Key_Launch20x010000a4 
Qt.Key_Launch30x010000a5 
Qt.Key_Launch40x010000a6 
Qt.Key_Launch50x010000a7 
Qt.Key_Launch60x010000a8 
Qt.Key_Launch70x010000a9 
Qt.Key_Launch80x010000aa 
Qt.Key_Launch90x010000ab 
Qt.Key_LaunchA0x010000ac 
Qt.Key_LaunchB0x010000ad 
Qt.Key_LaunchC0x010000ae 
Qt.Key_LaunchD0x010000af 
Qt.Key_LaunchE0x010000b0 
Qt.Key_LaunchF0x010000b1 
Qt.Key_MediaLast0x0100ffff 
Qt.Key_unknown0x01ffffff 
Qt.Key_Call0x01100004 
Qt.Key_Context10x01100000 
Qt.Key_Context20x01100001 
Qt.Key_Context30x01100002 
Qt.Key_Context40x01100003 
Qt.Key_Flip0x01100006 
Qt.Key_Hangup0x01100005 
Qt.Key_No0x01010002 
Qt.Key_Select0x01010000 
Qt.Key_Yes0x01010001 
Qt.Key_Execute0x01020003 
Qt.Key_Printer0x01020002 
Qt.Key_Play0x01020005 
Qt.Key_Sleep0x01020004 
Qt.Key_Zoom0x01020006 
Qt.Key_Cancel0x01020001 

Qt.KeyboardModifier

枚举量描述
Qt.NoModifier0x00000000No modifier key is pressed.
Qt.ShiftModifier0x02000000A Shift key on the keyboard is pressed.
Qt.ControlModifier0x04000000A Ctrl key on the keyboard is pressed.
Qt.AltModifier0x08000000An Alt key on the keyboard is pressed.
Qt.MetaModifier0x10000000A Meta key on the keyboard is pressed.
Qt.KeypadModifier0x20000000A keypad button is pressed.
Qt.GroupSwitchModifier0x40000000X11 only. A Mode_switch key on the keyboard is pressed.

Qt.Modifier

枚举量描述
Qt.SHIFTQt.ShiftModifierThe Shift keys provided on all standard keyboards.
Qt.METAQt.MetaModifierThe Meta keys.
Qt.CTRLQt.ControlModifierThe Ctrl keys.
Qt.ALTQt.AltModifierThe normal Alt keys, but not keys like AltGr.
Qt.UNICODE_ACCEL0x00000000The shortcut is specified as a Unicode code point, not as a Qt Key.

  • 3
    点赞
  • 23
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值