《Qt5:键盘事件》

article/2025/9/29 3:18:17

QKeyEvent类用来描述了一个键盘事件。常用的键盘事件有两种:按键按下和按键释放,一般按键按下事件用的多一点,下面为键盘按下和释放事件的声明:

public:void keyPressEvent(QKeyEvent *event);void keyReleaseEvent(QKeyEvent *event);

cpp部分代码,添加了一个编辑框用于显示按下的按键值

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDebug>MainWindow::MainWindow(QWidget *parent) :QMainWindow(parent),ui(new Ui::MainWindow)
{ui->setupUi(this);setWindowTitle(tr("键盘事件"));ui->lineEdit->setStyleSheet("QLineEdit{color:rgb(0,0,255);font: 24pt 微软雅黑;}");
}MainWindow::~MainWindow()
{delete ui;
}//键盘按下事件
void MainWindow::keyPressEvent(QKeyEvent *event)
{ui->lineEdit->setText(event->text());
}//键盘释放事件
void MainWindow::keyReleaseEvent(QKeyEvent *event)
{;
}

显示结果:

 

 下面对代码稍作修改,当按下的按键值为Qt::Key_Escape时,键盘上的ESC键,关闭窗口

//键盘按下事件
void MainWindow::keyPressEvent(QKeyEvent *event)
{ui->lineEdit->setText(event->text());if(event->key()==Qt::Key_Escape){close();}
}

以下为Qt的所有键值 :

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_Pause0x01000008The Pause/Break key (Note: Not related to pausing media)
Qt::Key_Print0x01000009 
Qt::Key_SysReq0x0100000a 
Qt::Key_Clear0x0100000bCorresponds to the Clear key on selected Apple keyboard models. On other systems it is commonly mapped to the numeric keypad key 5, when Num Lock is off.
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 macOS, this corresponds to the Command keys.
Qt::Key_Meta0x01000022On macOS, 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_Dead_Stroke0x01001263 
Qt::Key_Dead_Abovecomma0x01001264 
Qt::Key_Dead_Abovereversedcomma0x01001265 
Qt::Key_Dead_Doublegrave0x01001266 
Qt::Key_Dead_Belowring0x01001267 
Qt::Key_Dead_Belowmacron0x01001268 
Qt::Key_Dead_Belowcircumflex0x01001269 
Qt::Key_Dead_Belowtilde0x0100126a 
Qt::Key_Dead_Belowbreve0x0100126b 
Qt::Key_Dead_Belowdiaeresis0x0100126c 
Qt::Key_Dead_Invertedbreve0x0100126d 
Qt::Key_Dead_Belowcomma0x0100126e 
Qt::Key_Dead_Currency0x0100126f 
Qt::Key_Dead_a0x01001280 
Qt::Key_Dead_A0x01001281 
Qt::Key_Dead_e0x01001282 
Qt::Key_Dead_E0x01001283 
Qt::Key_Dead_i0x01001284 
Qt::Key_Dead_I0x01001285 
Qt::Key_Dead_o0x01001286 
Qt::Key_Dead_O0x01001287 
Qt::Key_Dead_u0x01001288 
Qt::Key_Dead_U0x01001289 
Qt::Key_Dead_Small_Schwa0x0100128a 
Qt::Key_Dead_Capital_Schwa0x0100128b 
Qt::Key_Dead_Greek0x0100128c 
Qt::Key_Dead_Lowline0x01001290 
Qt::Key_Dead_Aboveverticalline0x01001291 
Qt::Key_Dead_Belowverticalline0x01001292 
Qt::Key_Dead_Longsolidusoverlay0x01001293 
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_MediaPlay0x01000080A key setting the state of the media player to play
Qt::Key_MediaStop0x01000081A key setting the state of the media player to stop
Qt::Key_MediaPrevious0x01000082 
Qt::Key_MediaNext0x01000083 
Qt::Key_MediaRecord0x01000084 
Qt::Key_MediaPause0x1000085A key setting the state of the media player to pause (Note: not the pause/break key)
Qt::Key_MediaTogglePlayPause0x1000086A key to toggle the play/pause state in the media player (rather than setting an absolute state)
Qt::Key_HomePage0x01000090 
Qt::Key_Favorites0x01000091 
Qt::Key_Search0x01000092 
Qt::Key_Standby0x01000093 
Qt::Key_OpenUrl0x01000094 
Qt::Key_LaunchMail0x010000a0 
Qt::Key_LaunchMedia0x010000a1 
Qt::Key_Launch00x010000a2On X11 this key is mapped to "My Computer" (XF86XK_MyComputer) key for legacy reasons.
Qt::Key_Launch10x010000a3On X11 this key is mapped to "Calculator" (XF86XK_Calculator) key for legacy reasons.
Qt::Key_Launch20x010000a4On X11 this key is mapped to XF86XK_Launch0 key for legacy reasons.
Qt::Key_Launch30x010000a5On X11 this key is mapped to XF86XK_Launch1 key for legacy reasons.
Qt::Key_Launch40x010000a6On X11 this key is mapped to XF86XK_Launch2 key for legacy reasons.
Qt::Key_Launch50x010000a7On X11 this key is mapped to XF86XK_Launch3 key for legacy reasons.
Qt::Key_Launch60x010000a8On X11 this key is mapped to XF86XK_Launch4 key for legacy reasons.
Qt::Key_Launch70x010000a9On X11 this key is mapped to XF86XK_Launch5 key for legacy reasons.
Qt::Key_Launch80x010000aaOn X11 this key is mapped to XF86XK_Launch6 key for legacy reasons.
Qt::Key_Launch90x010000abOn X11 this key is mapped to XF86XK_Launch7 key for legacy reasons.
Qt::Key_LaunchA0x010000acOn X11 this key is mapped to XF86XK_Launch8 key for legacy reasons.
Qt::Key_LaunchB0x010000adOn X11 this key is mapped to XF86XK_Launch9 key for legacy reasons.
Qt::Key_LaunchC0x010000aeOn X11 this key is mapped to XF86XK_LaunchA key for legacy reasons.
Qt::Key_LaunchD0x010000afOn X11 this key is mapped to XF86XK_LaunchB key for legacy reasons.
Qt::Key_LaunchE0x010000b0On X11 this key is mapped to XF86XK_LaunchC key for legacy reasons.
Qt::Key_LaunchF0x010000b1On X11 this key is mapped to XF86XK_LaunchD key for legacy reasons.
Qt::Key_LaunchG0x0100010eOn X11 this key is mapped to XF86XK_LaunchE key for legacy reasons.
Qt::Key_LaunchH0x0100010fOn X11 this key is mapped to XF86XK_LaunchF key for legacy reasons.
Qt::Key_MonBrightnessUp0x010000b2 
Qt::Key_MonBrightnessDown0x010000b3 
Qt::Key_KeyboardLightOnOff0x010000b4 
Qt::Key_KeyboardBrightnessUp0x010000b5 
Qt::Key_KeyboardBrightnessDown0x010000b6 
Qt::Key_PowerOff0x010000b7 
Qt::Key_WakeUp0x010000b8 
Qt::Key_Eject0x010000b9 
Qt::Key_ScreenSaver0x010000ba 
Qt::Key_WWW0x010000bb 
Qt::Key_Memo0x010000bc 
Qt::Key_LightBulb0x010000bd 
Qt::Key_Shop0x010000be 
Qt::Key_History0x010000bf 
Qt::Key_AddFavorite0x010000c0 
Qt::Key_HotLinks0x010000c1 
Qt::Key_BrightnessAdjust0x010000c2 
Qt::Key_Finance0x010000c3 
Qt::Key_Community0x010000c4 
Qt::Key_AudioRewind0x010000c5 
Qt::Key_BackForward0x010000c6 
Qt::Key_ApplicationLeft0x010000c7 
Qt::Key_ApplicationRight0x010000c8 
Qt::Key_Book0x010000c9 
Qt::Key_CD0x010000ca 
Qt::Key_Calculator0x010000cbOn X11 this key is not mapped for legacy reasons. Use Qt::Key_Launch1 instead.
Qt::Key_ToDoList0x010000cc 
Qt::Key_ClearGrab0x010000cd 
Qt::Key_Close0x010000ce 
Qt::Key_Copy0x010000cf 
Qt::Key_Cut0x010000d0 
Qt::Key_Display0x010000d1 
Qt::Key_DOS0x010000d2 
Qt::Key_Documents0x010000d3 
Qt::Key_Excel0x010000d4 
Qt::Key_Explorer0x010000d5 
Qt::Key_Game0x010000d6 
Qt::Key_Go0x010000d7 
Qt::Key_iTouch0x010000d8 
Qt::Key_LogOff0x010000d9 
Qt::Key_Market0x010000da 
Qt::Key_Meeting0x010000db 
Qt::Key_MenuKB0x010000dc 
Qt::Key_MenuPB0x010000dd 
Qt::Key_MySites0x010000de 
Qt::Key_News0x010000df 
Qt::Key_OfficeHome0x010000e0 
Qt::Key_Option0x010000e1 
Qt::Key_Paste0x010000e2 
Qt::Key_Phone0x010000e3 
Qt::Key_Calendar0x010000e4 
Qt::Key_Reply0x010000e5 
Qt::Key_Reload0x010000e6 
Qt::Key_RotateWindows0x010000e7 
Qt::Key_RotationPB0x010000e8 
Qt::Key_RotationKB0x010000e9 
Qt::Key_Save0x010000ea 
Qt::Key_Send0x010000eb 
Qt::Key_Spell0x010000ec 
Qt::Key_SplitScreen0x010000ed 
Qt::Key_Support0x010000ee 
Qt::Key_TaskPane0x010000ef 
Qt::Key_Terminal0x010000f0 
Qt::Key_Tools0x010000f1 
Qt::Key_Travel0x010000f2 
Qt::Key_Video0x010000f3 
Qt::Key_Word0x010000f4 
Qt::Key_Xfer0x010000f5 
Qt::Key_ZoomIn0x010000f6 
Qt::Key_ZoomOut0x010000f7 
Qt::Key_Away0x010000f8 
Qt::Key_Messenger0x010000f9 
Qt::Key_WebCam0x010000fa 
Qt::Key_MailForward0x010000fb 
Qt::Key_Pictures0x010000fc 
Qt::Key_Music0x010000fd 
Qt::Key_Battery0x010000fe 
Qt::Key_Bluetooth0x010000ff 
Qt::Key_WLAN0x01000100 
Qt::Key_UWB0x01000101 
Qt::Key_AudioForward0x01000102 
Qt::Key_AudioRepeat0x01000103 
Qt::Key_AudioRandomPlay0x01000104 
Qt::Key_Subtitle0x01000105 
Qt::Key_AudioCycleTrack0x01000106 
Qt::Key_Time0x01000107 
Qt::Key_Hibernate0x01000108 
Qt::Key_View0x01000109 
Qt::Key_TopMenu0x0100010a 
Qt::Key_PowerDown0x0100010b 
Qt::Key_Suspend0x0100010c 
Qt::Key_ContrastAdjust0x0100010d 
Qt::Key_TouchpadToggle0x01000110 
Qt::Key_TouchpadOn0x01000111 
Qt::Key_TouchpadOff0x01000112 
Qt::Key_MicMute0x01000113 
Qt::Key_Red0x01000114 
Qt::Key_Green0x01000115 
Qt::Key_Yellow0x01000116 
Qt::Key_Blue0x01000117 
Qt::Key_ChannelUp0x01000118 
Qt::Key_ChannelDown0x01000119 
Qt::Key_Guide0x0100011a 
Qt::Key_Info0x0100011b 
Qt::Key_Settings0x0100011c 
Qt::Key_MicVolumeUp0x0100011d 
Qt::Key_MicVolumeDown0x0100011e 
Qt::Key_New0x01000120 
Qt::Key_Open0x01000121 
Qt::Key_Find0x01000122 
Qt::Key_Undo0x01000123 
Qt::Key_Redo0x01000124 
Qt::Key_MediaLast0x0100ffff 
Qt::Key_unknown0x01ffffff 
Qt::Key_Call0x01100004A key to answer or initiate a call (see Qt::Key_ToggleCallHangup for a key to toggle current call state)
Qt::Key_Camera0x01100020A key to activate the camera shutter. On Windows Runtime, the environment variable QT_QPA_ENABLE_CAMERA_KEYS must be set to receive the event.
Qt::Key_CameraFocus0x01100021A key to focus the camera. On Windows Runtime, the environment variable QT_QPA_ENABLE_CAMERA_KEYS must be set to receive the event.
Qt::Key_Context10x01100000 
Qt::Key_Context20x01100001 
Qt::Key_Context30x01100002 
Qt::Key_Context40x01100003 
Qt::Key_Flip0x01100006 
Qt::Key_Hangup0x01100005A key to end an ongoing call (see Qt::Key_ToggleCallHangup for a key to toggle current call state)
Qt::Key_No0x01010002 
Qt::Key_Select0x01010000 
Qt::Key_Yes0x01010001 
Qt::Key_ToggleCallHangup0x01100007A key to toggle the current call state (ie. either answer, or hangup) depending on current call state
Qt::Key_VoiceDial0x01100008 
Qt::Key_LastNumberRedial0x01100009 
Qt::Key_Execute0x01020003 
Qt::Key_Printer0x01020002 
Qt::Key_Play0x01020005 
Qt::Key_Sleep0x01020004 
Qt::Key_Zoom0x01020006 
Qt::Key_Exit0x0102000a 
Qt::Key_Cancel0x01020001

 


http://chatgpt.dhexx.cn/article/RO9i8TsR.shtml

相关文章

小伙 这样你就可以在Mac 中运行 Office 办公软件了

小伙 这样你就可以在Mac 中运行 Office 办公软件了 请参考以下步骤&#xff1a; 1、打开已经安装好的 CrossOver&#xff0c;点击“安装 Windows 应用程序”&#xff0c;在选择应用中的搜索框中输入“office”&#xff0c;接下来在下拉列表中会出现非常多的已经列出的相关软件&…

Unicode 编码表

正则查找: 中文文字中文符号表情符号... [^\x00-\xff] 其中 \x00-\xff 匹配 ASCII 代码中十六进制代码为 00-ff 的字符&#xff0c; 加个取反 ^ &#xff0c;则就表示表示匹配非单字节的字符&#xff0c;例如汉字&#xff0c;汉字符号等字符集。 中文文字&#xff08;简体繁体…

arduino学习笔记-库函数解析_LiquidCrystal_i2c使用说明以及lcd1602的驱动

LiquidCrystal_i2c是一个通过i2c驱动lcd显示屏的库函数&#xff0c;具体使用说明如下 i2c转接芯片的型号 PCA8574 arduino R3 A05 为 SCL A04 为 SDL 在头文件下要初始化对象 LiquidCrystal_I2C lcd(0x27,16,2); 对象名 lcd 可以任意&#xff0c;这关系到下面你使用方法…

Linux-Ubuntu系统 安装(重装)Mysql

一、检查服务器是否已有mysql &#xff08;如需自行下载jdbc相关包&#xff0c;例如mysql-connector等的有效网站&#xff1a;https://mvnrepository.com/artifact/mysql/mysql-connector-java/6.0.2&#xff09; 为确保后续没有权限错误&#xff0c;先切换到root用户权限&am…

HWP转Word说明

HWP&#xff0c;格式是韩国特有的文档格式&#xff0c;不能直接用MS Office打开或者直接转成Word&#xff0c;之前都是通过Hangul Viewer打印成XPS或PDF&#xff0c;再将文件转成Word&#xff0c;过程比较复杂&#xff0c;且Hangul Viewer打印时会自己在页脚处添加说明&#xf…

qt window release 打包的方法及常见问题,不同路径的差异

一、摘要&#xff1a;qt 程序开发后要发布打包&#xff0c;但是使用网上的教程&#xff0c;总是打这样那样的错误&#xff0c;如下面&#xff0c;我们总结一下原因&#xff0c;以及解决办法和注意事项 二、问题汇总 untitled01.exe-无法找到入口 无法定位程序输入点 ZNSt18cond…

Window系统打包QT程序

1、为什么打包 有时候我们编译出来的QT程序要给别人用&#xff0c;那么别人的电脑上可能没有安装QT&#xff0c;QT版本不同&#xff0c;或者其他因素的影响导致运行不了我们的程序&#xff0c;那么就需要打包给别人&#xff0c;把程序运行时候需要的一些库等资源都打包在一起&…

hangul2010(韩国办公软件) v8.0.0.466官方版

hangul2010 是一款韩文办公软件&#xff0c;由韩国软件公司hansoft开发的一款软件&#xff0c;由于其办公的实用性&#xff0c;软件界面的友好性&#xff0c;使得该软件在韩国非常出名&#xff0c;用户量也非常广。当然&#xff0c;也不是说只有韩国人才用的到该软件&#xff…

如何查看sql的执行计划

文章目录 如何使用plsql查看sql的执行计划&#xff1f;使用navicat返回内容解释idselect_typetabletypepossible_keyskeykey_lenrefrowsextra 如何使用plsql查看sql的执行计划&#xff1f; explain plan for &#xff08;select * from table&#xff09; 可查看该语句的sql执…

Mysql查看执行计划

使用explain关键字可以模拟优化器执行SQL查询语句&#xff0c;从而知道MySQL是如何处理你的SQL语句的&#xff0c;分析你的查询语句或是表结构的性能瓶颈。 explain执行计划包含的信息 其中最重要的字段为&#xff1a;id、type、key、rows、Extra 各字段详解 id select查询…

Oracle查看执行计划

查看执行计划&#xff0c;分析慢查询SQL 在MySql中可以使用EXPLAIN关键字来查看执行计划并分析sql的执行情况&#xff0c;而在Oracle数据库中则需要两条sql来查看执行计划 EXPLAIN PLAN FOR SELECT * FROM user where username zhangsan; SELECT * FROM TABLE(dbms_xplan.d…

一文搞定 SQL Server 执行计划

导读 数据开发过程中&#xff0c;开发完成的 SQL 发布到生产环境&#xff0c;经常会发生 SQL 执行慢甚至根本无法执行&#xff0c;如何避免这种情况呢&#xff1f;这一篇我们分析一下 SQL Server 的执行计划是如何生成及如何阅读评估执行计划。 基本概念 在此之前&#xff0c…

spark学习之执行计划explain

&#x1f43c;今天我们来学习阅读spark的执行计划&#xff0c;在学习执行计划之前&#xff0c;我们需要了解spark中的代码是如何执行的&#xff0c;学习代码的执行过程有助于我们加深对spark的理解&#xff0c;对往期内容感兴趣的同学可以查看&#x1f447;: hadoop专题: hado…

详解mysql执行计划

在数据库查询的时候&#xff0c;我们通常会使用sql语句去查询自己所需要的数据。但是&#xff0c;关于sql在数据库中是如何执行的&#xff0c;它有没有使用索引&#xff0c;具体使用了哪些索引&#xff0c;查找了哪些字段和表&#xff0c;他们的顺序是怎样的&#xff0c;分别用…

Spark执行计划分析与研究

在学习、使用和研究spark的过程中&#xff0c;逐渐会发现&#xff1a;单纯看官方文档对spark参数调优只能解决一小部分的问题&#xff0c;要想进一步的学习spark&#xff0c;进一步调优甚至在spark源码的基础上二次开发&#xff0c;我觉得收益最高的应该是学习执行计划了。 因…

impala 执行计划详解

Impala是一个MPPMassivelyParallelProcessing计算引擎&#xff0c;简单来说就是将计算压力分到多个节点&#xff0c;得到结果后汇总&#xff0c;然后再返回给客户端。如果你留意过Impala的执行计划&#xff0c;会观察到exchange节点&#xff0c;该节点的作用就是分散计算压力的…

sqlserver 执行计划

一个很好的手册分享&#xff0c;执行计划里的属性解释官方文档&#xff1a;https://docs.microsoft.com/zh-cn/sql/relational-databases/showplan-logical-and-physical-operators-reference?viewsql-server-2017 想复杂的事情简单说&#xff0c;在看执行计划的其他文章的时…

MySQL执行计划

什么是执行计划 The set of operations T that the optimizer o chooses to perform the most efficient query t is called the “query execution plan”, also known as theEXPLAIN plan 如何获取SQL语句的执行计划 方法1&#xff1a; explain SQL 。方法2&#xff1a; …

sql 执行计划

一、各数据库执行计划执行方式 二、explan 三种格式 (以MySQL为例) 1.默认格式 2.tree 格式(与postgreSQL执行计划格式相似) 3.json格式 三、执行计划各字段名含义 1) id:查询编号 ,从小到大,编号越大执行顺序越往前 相同的话从上往下执行(也可以把编号当成缩进的格数…

mysql的执行计划_MySQL——执行计划

项目开发中,性能是我们比较关注的问题,特别是数据库的性能;作为一个开发,经常和SQL语句打交道,想要写出合格的SQL语句,我们需要了解SQL语句在数据库中是如何扫描表、如何使用索引的; MySQL提供explain/desc命令输出执行计划,我们通过执行计划优化SQL语句。 下面我们以M…