关闭

pyqt4文档阅读(11):QKeySequence

标签: qtpyqtQKeySequence
1045人阅读 评论(0) 收藏 举报
分类:

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


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

枚举量 备注
NoMatch 0 不匹配
PartialMatch 1 部分匹配(仅当自己能完全匹配参数里序列的前缀)
ExactMatch 2 完全匹配

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

标准键 Windows Mac OS X KDE GNOME
HelpContents F1 Ctrl+? F1 F1
WhatsThis Shift+F1 Shift+F1 Shift+F1 Shift+F1
Open Ctrl+O Ctrl+O Ctrl+O Ctrl+O
Close Ctrl+F4, Ctrl+W Ctrl+W, Ctrl+F4 Ctrl+W Ctrl+W
Save Ctrl+S Ctrl+S Ctrl+S Ctrl+S
New Ctrl+N Ctrl+N Ctrl+N Ctrl+N
Delete Del Del, Meta+D Del, Ctrl+D Del, Ctrl+D
Cut Ctrl+X, Shift+Del Ctrl+X Ctrl+X, F20, Shift+Del Ctrl+X, F20, Shift+Del
Copy Ctrl+C, Ctrl+Ins Ctrl+C Ctrl+C, F16, Ctrl+Ins Ctrl+C, F16, Ctrl+Ins
Paste Ctrl+V, Shift+Ins Ctrl+V Ctrl+V, F18, Shift+Ins Ctrl+V, F18, Shift+Ins
Undo Ctrl+Z, Alt+Backspace Ctrl+Z Ctrl+Z, F14 Ctrl+Z, F14
Redo Ctrl+Y, Shift+Ctrl+Z, Alt+Shift+Backspace Ctrl+Shift+Z, Ctrl+Y Ctrl+Shift+Z Ctrl+Shift+Z
Back Alt+Left, Backspace Ctrl+[ Alt+Left Alt+Left
Forward Alt+Right, Shift+Backspace Ctrl+] Alt+Right Alt+Right
Refresh F5 F5 F5 Ctrl+R, F5
ZoomIn Ctrl+Plus Ctrl+Plus Ctrl+Plus Ctrl+Plus
ZoomOut Ctrl+Minus Ctrl+Minus Ctrl+Minus Ctrl+Minus
Print Ctrl+P Ctrl+P Ctrl+P Ctrl+P
AddTab Ctrl+T Ctrl+T Ctrl+Shift+N, Ctrl+T Ctrl+T
NextChild Ctrl+Tab, Forward, Ctrl+F6 Ctrl+}, Forward, Ctrl+Tab Ctrl+Tab, Forward, Ctrl+Comma Ctrl+Tab, Forward
PreviousChild Ctrl+Shift+Tab, Back, Ctrl+Shift+F6 Ctrl+{, Back, Ctrl+Shift+Tab Ctrl+Shift+Tab, Back, Ctrl+Period Ctrl+Shift+Tab, Back
Find Ctrl+F Ctrl+F Ctrl+F Ctrl+F
FindNext F3, Ctrl+G Ctrl+G F3 Ctrl+G, F3
FindPrevious Shift+F3, Ctrl+Shift+G Ctrl+Shift+G Shift+F3 Ctrl+Shift+G, Shift+F3
Replace Ctrl+H (none) Ctrl+R Ctrl+H
SelectAll Ctrl+A Ctrl+A Ctrl+A Ctrl+A
Bold Ctrl+B Ctrl+B Ctrl+B Ctrl+B
Italic Ctrl+I Ctrl+I Ctrl+I Ctrl+I
Underline Ctrl+U Ctrl+U Ctrl+U Ctrl+U
MoveToNextChar Right Right Right Right
MoveToPreviousChar Left Left Left Left
MoveToNextWord Ctrl+Right Alt+Right Ctrl+Right Ctrl+Right
MoveToPreviousWord Ctrl+Left Alt+Left Ctrl+Left Ctrl+Left
MoveToNextLine Down Down Down Down
MoveToPreviousLine Up Up Up Up
MoveToNextPage PgDown PgDown, Alt+PgDown, Meta+Down, Meta+PgDown PgDown PgDown
MoveToPreviousPage PgUp PgUp, Alt+PgUp, Meta+Up, Meta+PgUp PgUp PgUp
MoveToStartOfLine Home Ctrl+Left, Meta+Left Home Home
MoveToEndOfLine End Ctrl+Right, Meta+Right End End
MoveToStartOfBlock (none) Alt+Up, Meta+A (none) (none)
MoveToEndOfBlock (none) Alt+Down, Meta+E (none) (none)
MoveToStartOfDocument Ctrl+Home Ctrl+Up, Home Ctrl+Home Ctrl+Home
MoveToEndOfDocument Ctrl+End Ctrl+Down, End Ctrl+End Ctrl+End
SelectNextChar Shift+Right Shift+Right Shift+Right Shift+Right
SelectPreviousChar Shift+Left Shift+Left Shift+Left Shift?left
SelectNextWord Ctrl+Shift+Right Alt+Shift+Right Ctrl+Shift+Right Ctrl+Shift+Right
SelectPreviousWord Ctrl+Shift+Left Alt+Shift+Left Ctrl+Shift+Left Ctrl+Shift+Left
SelectNextLine Shift+Down Shift+Down Shift+Down Shift+Down
SelectPreviousLine Shift+Up Shift+Up Shift+Up Shift+Up
SelectNextPage Shift+PgDown Shift+PgDown Shift+PgDown Shift+PgDown
SelectPreviousPage Shift+PgUp Shift+PgUp Shift+PgUp Shift+PgUp
SelectStartOfLine Shift+Home Ctrl+Shift+Left Shift+Home Shift+Home
SelectEndOfLine Shift+End Ctrl+Shift+Right Shift+End Shift+End
SelectStartOfBlock (none) Alt+Shift+Up (none) (none)
SelectEndOfBlock (none) Alt+Shift+Down (none) (none)
SelectStartOfDocument Ctrl+Shift+Home Ctrl+Shift+Up, Shift+Home Ctrl+Shift+Home Ctrl+Shift+Home
SelectEndOfDocument Ctrl+Shift+End Ctrl+Shift+Down, Shift+End Ctrl+Shift+End Ctrl+Shift+End
DeleteStartOfWord Ctrl+Backspace Alt+Backspace Ctrl+Backspace Ctrl+Backspace
DeleteEndOfWord Ctrl+Del (none) Ctrl+Del Ctrl+Del
DeleteEndOfLine (none) (none) Ctrl+K Ctrl+K

11.基础键和修饰键表

Qt.Key

枚举量 备注
Qt.Key_Escape 0x01000000  
Qt.Key_Tab 0x01000001  
Qt.Key_Backtab 0x01000002  
Qt.Key_Backspace 0x01000003  
Qt.Key_Return 0x01000004  
Qt.Key_Enter 0x01000005 Typically located on the keypad.
Qt.Key_Insert 0x01000006  
Qt.Key_Delete 0x01000007  
Qt.Key_Pause 0x01000008  
Qt.Key_Print 0x01000009  
Qt.Key_SysReq 0x0100000a  
Qt.Key_Clear 0x0100000b  
Qt.Key_Home 0x01000010  
Qt.Key_End 0x01000011  
Qt.Key_Left 0x01000012  
Qt.Key_Up 0x01000013  
Qt.Key_Right 0x01000014  
Qt.Key_Down 0x01000015  
Qt.Key_PageUp 0x01000016  
Qt.Key_PageDown 0x01000017  
Qt.Key_Shift 0x01000020  
Qt.Key_Control 0x01000021 On Mac OS X, this corresponds to the Command keys.
Qt.Key_Meta 0x01000022 On Mac OS X, this corresponds to the Control keys. On Windows keyboards, this key is mapped to the Windows key.
Qt.Key_Alt 0x01000023  
Qt.Key_AltGr 0x01001103 On Windows, when the KeyDown event for this key is sent, the Ctrl+Alt modifiers are also set.
Qt.Key_CapsLock 0x01000024  
Qt.Key_NumLock 0x01000025  
Qt.Key_ScrollLock 0x01000026  
Qt.Key_F1 0x01000030  
Qt.Key_F2 0x01000031  
Qt.Key_F3 0x01000032  
Qt.Key_F4 0x01000033  
Qt.Key_F5 0x01000034  
Qt.Key_F6 0x01000035  
Qt.Key_F7 0x01000036  
Qt.Key_F8 0x01000037  
Qt.Key_F9 0x01000038  
Qt.Key_F10 0x01000039  
Qt.Key_F11 0x0100003a  
Qt.Key_F12 0x0100003b  
Qt.Key_F13 0x0100003c  
Qt.Key_F14 0x0100003d  
Qt.Key_F15 0x0100003e  
Qt.Key_F16 0x0100003f  
Qt.Key_F17 0x01000040  
Qt.Key_F18 0x01000041  
Qt.Key_F19 0x01000042  
Qt.Key_F20 0x01000043  
Qt.Key_F21 0x01000044  
Qt.Key_F22 0x01000045  
Qt.Key_F23 0x01000046  
Qt.Key_F24 0x01000047  
Qt.Key_F25 0x01000048  
Qt.Key_F26 0x01000049  
Qt.Key_F27 0x0100004a  
Qt.Key_F28 0x0100004b  
Qt.Key_F29 0x0100004c  
Qt.Key_F30 0x0100004d  
Qt.Key_F31 0x0100004e  
Qt.Key_F32 0x0100004f  
Qt.Key_F33 0x01000050  
Qt.Key_F34 0x01000051  
Qt.Key_F35 0x01000052  
Qt.Key_Super_L 0x01000053  
Qt.Key_Super_R 0x01000054  
Qt.Key_Menu 0x01000055  
Qt.Key_Hyper_L 0x01000056  
Qt.Key_Hyper_R 0x01000057  
Qt.Key_Help 0x01000058  
Qt.Key_Direction_L 0x01000059  
Qt.Key_Direction_R 0x01000060  
Qt.Key_Space 0x20  
Qt.Key_Any Key_Space  
Qt.Key_Exclam 0x21  
Qt.Key_QuoteDbl 0x22  
Qt.Key_NumberSign 0x23  
Qt.Key_Dollar 0x24  
Qt.Key_Percent 0x25  
Qt.Key_Ampersand 0x26  
Qt.Key_Apostrophe 0x27  
Qt.Key_ParenLeft 0x28  
Qt.Key_ParenRight 0x29  
Qt.Key_Asterisk 0x2a  
Qt.Key_Plus 0x2b  
Qt.Key_Comma 0x2c  
Qt.Key_Minus 0x2d  
Qt.Key_Period 0x2e  
Qt.Key_Slash 0x2f  
Qt.Key_0 0x30  
Qt.Key_1 0x31  
Qt.Key_2 0x32  
Qt.Key_3 0x33  
Qt.Key_4 0x34  
Qt.Key_5 0x35  
Qt.Key_6 0x36  
Qt.Key_7 0x37  
Qt.Key_8 0x38  
Qt.Key_9 0x39  
Qt.Key_Colon 0x3a  
Qt.Key_Semicolon 0x3b  
Qt.Key_Less 0x3c  
Qt.Key_Equal 0x3d  
Qt.Key_Greater 0x3e  
Qt.Key_Question 0x3f  
Qt.Key_At 0x40  
Qt.Key_A 0x41  
Qt.Key_B 0x42  
Qt.Key_C 0x43  
Qt.Key_D 0x44  
Qt.Key_E 0x45  
Qt.Key_F 0x46  
Qt.Key_G 0x47  
Qt.Key_H 0x48  
Qt.Key_I 0x49  
Qt.Key_J 0x4a  
Qt.Key_K 0x4b  
Qt.Key_L 0x4c  
Qt.Key_M 0x4d  
Qt.Key_N 0x4e  
Qt.Key_O 0x4f  
Qt.Key_P 0x50  
Qt.Key_Q 0x51  
Qt.Key_R 0x52  
Qt.Key_S 0x53  
Qt.Key_T 0x54  
Qt.Key_U 0x55  
Qt.Key_V 0x56  
Qt.Key_W 0x57  
Qt.Key_X 0x58  
Qt.Key_Y 0x59  
Qt.Key_Z 0x5a  
Qt.Key_BracketLeft 0x5b  
Qt.Key_Backslash 0x5c  
Qt.Key_BracketRight 0x5d  
Qt.Key_AsciiCircum 0x5e  
Qt.Key_Underscore 0x5f  
Qt.Key_QuoteLeft 0x60  
Qt.Key_BraceLeft 0x7b  
Qt.Key_Bar 0x7c  
Qt.Key_BraceRight 0x7d  
Qt.Key_AsciiTilde 0x7e  
Qt.Key_nobreakspace 0x0a0  
Qt.Key_exclamdown 0x0a1  
Qt.Key_cent 0x0a2  
Qt.Key_sterling 0x0a3  
Qt.Key_currency 0x0a4  
Qt.Key_yen 0x0a5  
Qt.Key_brokenbar 0x0a6  
Qt.Key_section 0x0a7  
Qt.Key_diaeresis 0x0a8  
Qt.Key_copyright 0x0a9  
Qt.Key_ordfeminine 0x0aa  
Qt.Key_guillemotleft 0x0ab  
Qt.Key_notsign 0x0ac  
Qt.Key_hyphen 0x0ad  
Qt.Key_registered 0x0ae  
Qt.Key_macron 0x0af  
Qt.Key_degree 0x0b0  
Qt.Key_plusminus 0x0b1  
Qt.Key_twosuperior 0x0b2  
Qt.Key_threesuperior 0x0b3  
Qt.Key_acute 0x0b4  
Qt.Key_mu 0x0b5  
Qt.Key_paragraph 0x0b6  
Qt.Key_periodcentered 0x0b7  
Qt.Key_cedilla 0x0b8  
Qt.Key_onesuperior 0x0b9  
Qt.Key_masculine 0x0ba  
Qt.Key_guillemotright 0x0bb  
Qt.Key_onequarter 0x0bc  
Qt.Key_onehalf 0x0bd  
Qt.Key_threequarters 0x0be  
Qt.Key_questiondown 0x0bf  
Qt.Key_Agrave 0x0c0  
Qt.Key_Aacute 0x0c1  
Qt.Key_Acircumflex 0x0c2  
Qt.Key_Atilde 0x0c3  
Qt.Key_Adiaeresis 0x0c4  
Qt.Key_Aring 0x0c5  
Qt.Key_AE 0x0c6  
Qt.Key_Ccedilla 0x0c7  
Qt.Key_Egrave 0x0c8  
Qt.Key_Eacute 0x0c9  
Qt.Key_Ecircumflex 0x0ca  
Qt.Key_Ediaeresis 0x0cb  
Qt.Key_Igrave 0x0cc  
Qt.Key_Iacute 0x0cd  
Qt.Key_Icircumflex 0x0ce  
Qt.Key_Idiaeresis 0x0cf  
Qt.Key_ETH 0x0d0  
Qt.Key_Ntilde 0x0d1  
Qt.Key_Ograve 0x0d2  
Qt.Key_Oacute 0x0d3  
Qt.Key_Ocircumflex 0x0d4  
Qt.Key_Otilde 0x0d5  
Qt.Key_Odiaeresis 0x0d6  
Qt.Key_multiply 0x0d7  
Qt.Key_Ooblique 0x0d8  
Qt.Key_Ugrave 0x0d9  
Qt.Key_Uacute 0x0da  
Qt.Key_Ucircumflex 0x0db  
Qt.Key_Udiaeresis 0x0dc  
Qt.Key_Yacute 0x0dd  
Qt.Key_THORN 0x0de  
Qt.Key_ssharp 0x0df  
Qt.Key_division 0x0f7  
Qt.Key_ydiaeresis 0x0ff  
Qt.Key_Multi_key 0x01001120  
Qt.Key_Codeinput 0x01001137  
Qt.Key_SingleCandidate 0x0100113c  
Qt.Key_MultipleCandidate 0x0100113d  
Qt.Key_PreviousCandidate 0x0100113e  
Qt.Key_Mode_switch 0x0100117e  
Qt.Key_Kanji 0x01001121  
Qt.Key_Muhenkan 0x01001122  
Qt.Key_Henkan 0x01001123  
Qt.Key_Romaji 0x01001124  
Qt.Key_Hiragana 0x01001125  
Qt.Key_Katakana 0x01001126  
Qt.Key_Hiragana_Katakana 0x01001127  
Qt.Key_Zenkaku 0x01001128  
Qt.Key_Hankaku 0x01001129  
Qt.Key_Zenkaku_Hankaku 0x0100112a  
Qt.Key_Touroku 0x0100112b  
Qt.Key_Massyo 0x0100112c  
Qt.Key_Kana_Lock 0x0100112d  
Qt.Key_Kana_Shift 0x0100112e  
Qt.Key_Eisu_Shift 0x0100112f  
Qt.Key_Eisu_toggle 0x01001130  
Qt.Key_Hangul 0x01001131  
Qt.Key_Hangul_Start 0x01001132  
Qt.Key_Hangul_End 0x01001133  
Qt.Key_Hangul_Hanja 0x01001134  
Qt.Key_Hangul_Jamo 0x01001135  
Qt.Key_Hangul_Romaja 0x01001136  
Qt.Key_Hangul_Jeonja 0x01001138  
Qt.Key_Hangul_Banja 0x01001139  
Qt.Key_Hangul_PreHanja 0x0100113a  
Qt.Key_Hangul_PostHanja 0x0100113b  
Qt.Key_Hangul_Special 0x0100113f  
Qt.Key_Dead_Grave 0x01001250  
Qt.Key_Dead_Acute 0x01001251  
Qt.Key_Dead_Circumflex 0x01001252  
Qt.Key_Dead_Tilde 0x01001253  
Qt.Key_Dead_Macron 0x01001254  
Qt.Key_Dead_Breve 0x01001255  
Qt.Key_Dead_Abovedot 0x01001256  
Qt.Key_Dead_Diaeresis 0x01001257  
Qt.Key_Dead_Abovering 0x01001258  
Qt.Key_Dead_Doubleacute 0x01001259  
Qt.Key_Dead_Caron 0x0100125a  
Qt.Key_Dead_Cedilla 0x0100125b  
Qt.Key_Dead_Ogonek 0x0100125c  
Qt.Key_Dead_Iota 0x0100125d  
Qt.Key_Dead_Voiced_Sound 0x0100125e  
Qt.Key_Dead_Semivoiced_Sound 0x0100125f  
Qt.Key_Dead_Belowdot 0x01001260  
Qt.Key_Dead_Hook 0x01001261  
Qt.Key_Dead_Horn 0x01001262  
Qt.Key_Back 0x01000061  
Qt.Key_Forward 0x01000062  
Qt.Key_Stop 0x01000063  
Qt.Key_Refresh 0x01000064  
Qt.Key_VolumeDown 0x01000070  
Qt.Key_VolumeMute 0x01000071  
Qt.Key_VolumeUp 0x01000072  
Qt.Key_BassBoost 0x01000073  
Qt.Key_BassUp 0x01000074  
Qt.Key_BassDown 0x01000075  
Qt.Key_TrebleUp 0x01000076  
Qt.Key_TrebleDown 0x01000077  
Qt.Key_MediaPlay 0x01000080  
Qt.Key_MediaStop 0x01000081  
Qt.Key_MediaPrevious 0x01000082  
Qt.Key_MediaNext 0x01000083  
Qt.Key_MediaRecord 0x01000084  
Qt.Key_HomePage 0x01000090  
Qt.Key_Favorites 0x01000091  
Qt.Key_Search 0x01000092  
Qt.Key_Standby 0x01000093  
Qt.Key_OpenUrl 0x01000094  
Qt.Key_LaunchMail 0x010000a0  
Qt.Key_LaunchMedia 0x010000a1  
Qt.Key_Launch0 0x010000a2  
Qt.Key_Launch1 0x010000a3  
Qt.Key_Launch2 0x010000a4  
Qt.Key_Launch3 0x010000a5  
Qt.Key_Launch4 0x010000a6  
Qt.Key_Launch5 0x010000a7  
Qt.Key_Launch6 0x010000a8  
Qt.Key_Launch7 0x010000a9  
Qt.Key_Launch8 0x010000aa  
Qt.Key_Launch9 0x010000ab  
Qt.Key_LaunchA 0x010000ac  
Qt.Key_LaunchB 0x010000ad  
Qt.Key_LaunchC 0x010000ae  
Qt.Key_LaunchD 0x010000af  
Qt.Key_LaunchE 0x010000b0  
Qt.Key_LaunchF 0x010000b1  
Qt.Key_MediaLast 0x0100ffff  
Qt.Key_unknown 0x01ffffff  
Qt.Key_Call 0x01100004  
Qt.Key_Context1 0x01100000  
Qt.Key_Context2 0x01100001  
Qt.Key_Context3 0x01100002  
Qt.Key_Context4 0x01100003  
Qt.Key_Flip 0x01100006  
Qt.Key_Hangup 0x01100005  
Qt.Key_No 0x01010002  
Qt.Key_Select 0x01010000  
Qt.Key_Yes 0x01010001  
Qt.Key_Execute 0x01020003  
Qt.Key_Printer 0x01020002  
Qt.Key_Play 0x01020005  
Qt.Key_Sleep 0x01020004  
Qt.Key_Zoom 0x01020006  
Qt.Key_Cancel 0x01020001  

Qt.KeyboardModifier

枚举量 描述
Qt.NoModifier 0x00000000 No modifier key is pressed.
Qt.ShiftModifier 0x02000000 A Shift key on the keyboard is pressed.
Qt.ControlModifier 0x04000000 A Ctrl key on the keyboard is pressed.
Qt.AltModifier 0x08000000 An Alt key on the keyboard is pressed.
Qt.MetaModifier 0x10000000 A Meta key on the keyboard is pressed.
Qt.KeypadModifier 0x20000000 A keypad button is pressed.
Qt.GroupSwitchModifier 0x40000000 X11 only. A Mode_switch key on the keyboard is pressed.

Qt.Modifier

枚举量 描述
Qt.SHIFT Qt.ShiftModifier The Shift keys provided on all standard keyboards.
Qt.META Qt.MetaModifier The Meta keys.
Qt.CTRL Qt.ControlModifier The Ctrl keys.
Qt.ALT Qt.AltModifier The normal Alt keys, but not keys like AltGr.
Qt.UNICODE_ACCEL 0x00000000 The shortcut is specified as a Unicode code point, not as a Qt Key.

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:59560次
    • 积分:1841
    • 等级:
    • 排名:千里之外
    • 原创:126篇
    • 转载:0篇
    • 译文:0篇
    • 评论:17条
    文章分类
    最新评论