Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/gui/kernel/qkeysequence.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||||||||
2 | - | |||||||||||||||||||||||||||||||
3 | - | |||||||||||||||||||||||||||||||
4 | - | |||||||||||||||||||||||||||||||
5 | - | |||||||||||||||||||||||||||||||
6 | - | |||||||||||||||||||||||||||||||
7 | - | |||||||||||||||||||||||||||||||
8 | - | |||||||||||||||||||||||||||||||
9 | static bool qt_sequence_no_mnemonics = false; | - | ||||||||||||||||||||||||||||||
10 | void __attribute__((visibility("default"))) qt_set_sequence_auto_mnemonic(bool b) { qt_sequence_no_mnemonics = !b; } | - | ||||||||||||||||||||||||||||||
11 | static const struct { | - | ||||||||||||||||||||||||||||||
12 | int key; | - | ||||||||||||||||||||||||||||||
13 | const char name[25]; | - | ||||||||||||||||||||||||||||||
14 | } keyname[] = { | - | ||||||||||||||||||||||||||||||
15 | - | |||||||||||||||||||||||||||||||
16 | - | |||||||||||||||||||||||||||||||
17 | - | |||||||||||||||||||||||||||||||
18 | { Qt::Key_Space, "Space" }, | - | ||||||||||||||||||||||||||||||
19 | { Qt::Key_Escape, "Esc" }, | - | ||||||||||||||||||||||||||||||
20 | { Qt::Key_Tab, "Tab" }, | - | ||||||||||||||||||||||||||||||
21 | { Qt::Key_Backtab, "Backtab" }, | - | ||||||||||||||||||||||||||||||
22 | { Qt::Key_Backspace, "Backspace" }, | - | ||||||||||||||||||||||||||||||
23 | { Qt::Key_Return, "Return" }, | - | ||||||||||||||||||||||||||||||
24 | { Qt::Key_Enter, "Enter" }, | - | ||||||||||||||||||||||||||||||
25 | { Qt::Key_Insert, "Ins" }, | - | ||||||||||||||||||||||||||||||
26 | { Qt::Key_Delete, "Del" }, | - | ||||||||||||||||||||||||||||||
27 | { Qt::Key_Pause, "Pause" }, | - | ||||||||||||||||||||||||||||||
28 | { Qt::Key_Print, "Print" }, | - | ||||||||||||||||||||||||||||||
29 | { Qt::Key_SysReq, "SysReq" }, | - | ||||||||||||||||||||||||||||||
30 | { Qt::Key_Home, "Home" }, | - | ||||||||||||||||||||||||||||||
31 | { Qt::Key_End, "End" }, | - | ||||||||||||||||||||||||||||||
32 | { Qt::Key_Left, "Left" }, | - | ||||||||||||||||||||||||||||||
33 | { Qt::Key_Up, "Up" }, | - | ||||||||||||||||||||||||||||||
34 | { Qt::Key_Right, "Right" }, | - | ||||||||||||||||||||||||||||||
35 | { Qt::Key_Down, "Down" }, | - | ||||||||||||||||||||||||||||||
36 | { Qt::Key_PageUp, "PgUp" }, | - | ||||||||||||||||||||||||||||||
37 | { Qt::Key_PageDown, "PgDown" }, | - | ||||||||||||||||||||||||||||||
38 | { Qt::Key_CapsLock, "CapsLock" }, | - | ||||||||||||||||||||||||||||||
39 | { Qt::Key_NumLock, "NumLock" }, | - | ||||||||||||||||||||||||||||||
40 | { Qt::Key_ScrollLock, "ScrollLock" }, | - | ||||||||||||||||||||||||||||||
41 | { Qt::Key_Menu, "Menu" }, | - | ||||||||||||||||||||||||||||||
42 | { Qt::Key_Help, "Help" }, | - | ||||||||||||||||||||||||||||||
43 | - | |||||||||||||||||||||||||||||||
44 | - | |||||||||||||||||||||||||||||||
45 | - | |||||||||||||||||||||||||||||||
46 | - | |||||||||||||||||||||||||||||||
47 | { Qt::Key_Back, "Back" }, | - | ||||||||||||||||||||||||||||||
48 | { Qt::Key_Forward, "Forward" }, | - | ||||||||||||||||||||||||||||||
49 | { Qt::Key_Stop, "Stop" }, | - | ||||||||||||||||||||||||||||||
50 | { Qt::Key_Refresh, "Refresh" }, | - | ||||||||||||||||||||||||||||||
51 | { Qt::Key_VolumeDown, "Volume Down" }, | - | ||||||||||||||||||||||||||||||
52 | { Qt::Key_VolumeMute, "Volume Mute" }, | - | ||||||||||||||||||||||||||||||
53 | { Qt::Key_VolumeUp, "Volume Up" }, | - | ||||||||||||||||||||||||||||||
54 | { Qt::Key_BassBoost, "Bass Boost" }, | - | ||||||||||||||||||||||||||||||
55 | { Qt::Key_BassUp, "Bass Up" }, | - | ||||||||||||||||||||||||||||||
56 | { Qt::Key_BassDown, "Bass Down" }, | - | ||||||||||||||||||||||||||||||
57 | { Qt::Key_TrebleUp, "Treble Up" }, | - | ||||||||||||||||||||||||||||||
58 | { Qt::Key_TrebleDown, "Treble Down" }, | - | ||||||||||||||||||||||||||||||
59 | { Qt::Key_MediaPlay, "Media Play" }, | - | ||||||||||||||||||||||||||||||
60 | { Qt::Key_MediaStop, "Media Stop" }, | - | ||||||||||||||||||||||||||||||
61 | { Qt::Key_MediaPrevious, "Media Previous" }, | - | ||||||||||||||||||||||||||||||
62 | { Qt::Key_MediaNext, "Media Next" }, | - | ||||||||||||||||||||||||||||||
63 | { Qt::Key_MediaRecord, "Media Record" }, | - | ||||||||||||||||||||||||||||||
64 | - | |||||||||||||||||||||||||||||||
65 | { Qt::Key_MediaPause, "Media Pause" }, | - | ||||||||||||||||||||||||||||||
66 | - | |||||||||||||||||||||||||||||||
67 | { Qt::Key_MediaTogglePlayPause, "Toggle Media Play/Pause" }, | - | ||||||||||||||||||||||||||||||
68 | { Qt::Key_HomePage, "Home Page" }, | - | ||||||||||||||||||||||||||||||
69 | { Qt::Key_Favorites, "Favorites" }, | - | ||||||||||||||||||||||||||||||
70 | { Qt::Key_Search, "Search" }, | - | ||||||||||||||||||||||||||||||
71 | { Qt::Key_Standby, "Standby" }, | - | ||||||||||||||||||||||||||||||
72 | { Qt::Key_OpenUrl, "Open URL" }, | - | ||||||||||||||||||||||||||||||
73 | { Qt::Key_LaunchMail, "Launch Mail" }, | - | ||||||||||||||||||||||||||||||
74 | { Qt::Key_LaunchMedia, "Launch Media" }, | - | ||||||||||||||||||||||||||||||
75 | { Qt::Key_Launch0, "Launch (0)" }, | - | ||||||||||||||||||||||||||||||
76 | { Qt::Key_Launch1, "Launch (1)" }, | - | ||||||||||||||||||||||||||||||
77 | { Qt::Key_Launch2, "Launch (2)" }, | - | ||||||||||||||||||||||||||||||
78 | { Qt::Key_Launch3, "Launch (3)" }, | - | ||||||||||||||||||||||||||||||
79 | { Qt::Key_Launch4, "Launch (4)" }, | - | ||||||||||||||||||||||||||||||
80 | { Qt::Key_Launch5, "Launch (5)" }, | - | ||||||||||||||||||||||||||||||
81 | { Qt::Key_Launch6, "Launch (6)" }, | - | ||||||||||||||||||||||||||||||
82 | { Qt::Key_Launch7, "Launch (7)" }, | - | ||||||||||||||||||||||||||||||
83 | { Qt::Key_Launch8, "Launch (8)" }, | - | ||||||||||||||||||||||||||||||
84 | { Qt::Key_Launch9, "Launch (9)" }, | - | ||||||||||||||||||||||||||||||
85 | { Qt::Key_LaunchA, "Launch (A)" }, | - | ||||||||||||||||||||||||||||||
86 | { Qt::Key_LaunchB, "Launch (B)" }, | - | ||||||||||||||||||||||||||||||
87 | { Qt::Key_LaunchC, "Launch (C)" }, | - | ||||||||||||||||||||||||||||||
88 | { Qt::Key_LaunchD, "Launch (D)" }, | - | ||||||||||||||||||||||||||||||
89 | { Qt::Key_LaunchE, "Launch (E)" }, | - | ||||||||||||||||||||||||||||||
90 | { Qt::Key_LaunchF, "Launch (F)" }, | - | ||||||||||||||||||||||||||||||
91 | { Qt::Key_MonBrightnessUp, "Monitor Brightness Up" }, | - | ||||||||||||||||||||||||||||||
92 | { Qt::Key_MonBrightnessDown, "Monitor Brightness Down" }, | - | ||||||||||||||||||||||||||||||
93 | { Qt::Key_KeyboardLightOnOff, "Keyboard Light On/Off" }, | - | ||||||||||||||||||||||||||||||
94 | { Qt::Key_KeyboardBrightnessUp, "Keyboard Brightness Up" }, | - | ||||||||||||||||||||||||||||||
95 | { Qt::Key_KeyboardBrightnessDown, "Keyboard Brightness Down" }, | - | ||||||||||||||||||||||||||||||
96 | { Qt::Key_PowerOff, "Power Off" }, | - | ||||||||||||||||||||||||||||||
97 | { Qt::Key_WakeUp, "Wake Up" }, | - | ||||||||||||||||||||||||||||||
98 | { Qt::Key_Eject, "Eject" }, | - | ||||||||||||||||||||||||||||||
99 | { Qt::Key_ScreenSaver, "Screensaver" }, | - | ||||||||||||||||||||||||||||||
100 | { Qt::Key_WWW, "WWW" }, | - | ||||||||||||||||||||||||||||||
101 | { Qt::Key_Sleep, "Sleep" }, | - | ||||||||||||||||||||||||||||||
102 | { Qt::Key_LightBulb, "LightBulb" }, | - | ||||||||||||||||||||||||||||||
103 | { Qt::Key_Shop, "Shop" }, | - | ||||||||||||||||||||||||||||||
104 | { Qt::Key_History, "History" }, | - | ||||||||||||||||||||||||||||||
105 | { Qt::Key_AddFavorite, "Add Favorite" }, | - | ||||||||||||||||||||||||||||||
106 | { Qt::Key_HotLinks, "Hot Links" }, | - | ||||||||||||||||||||||||||||||
107 | { Qt::Key_BrightnessAdjust, "Adjust Brightness" }, | - | ||||||||||||||||||||||||||||||
108 | { Qt::Key_Finance, "Finance" }, | - | ||||||||||||||||||||||||||||||
109 | { Qt::Key_Community, "Community" }, | - | ||||||||||||||||||||||||||||||
110 | { Qt::Key_AudioRewind, "Media Rewind" }, | - | ||||||||||||||||||||||||||||||
111 | { Qt::Key_BackForward, "Back Forward" }, | - | ||||||||||||||||||||||||||||||
112 | { Qt::Key_ApplicationLeft, "Application Left" }, | - | ||||||||||||||||||||||||||||||
113 | { Qt::Key_ApplicationRight, "Application Right" }, | - | ||||||||||||||||||||||||||||||
114 | { Qt::Key_Book, "Book" }, | - | ||||||||||||||||||||||||||||||
115 | { Qt::Key_CD, "CD" }, | - | ||||||||||||||||||||||||||||||
116 | { Qt::Key_Calculator, "Calculator" }, | - | ||||||||||||||||||||||||||||||
117 | { Qt::Key_Clear, "Clear" }, | - | ||||||||||||||||||||||||||||||
118 | { Qt::Key_ClearGrab, "Clear Grab" }, | - | ||||||||||||||||||||||||||||||
119 | { Qt::Key_Close, "Close" }, | - | ||||||||||||||||||||||||||||||
120 | { Qt::Key_Copy, "Copy" }, | - | ||||||||||||||||||||||||||||||
121 | { Qt::Key_Cut, "Cut" }, | - | ||||||||||||||||||||||||||||||
122 | { Qt::Key_Display, "Display" }, | - | ||||||||||||||||||||||||||||||
123 | { Qt::Key_DOS, "DOS" }, | - | ||||||||||||||||||||||||||||||
124 | { Qt::Key_Documents, "Documents" }, | - | ||||||||||||||||||||||||||||||
125 | { Qt::Key_Excel, "Spreadsheet" }, | - | ||||||||||||||||||||||||||||||
126 | { Qt::Key_Explorer, "Browser" }, | - | ||||||||||||||||||||||||||||||
127 | { Qt::Key_Game, "Game" }, | - | ||||||||||||||||||||||||||||||
128 | { Qt::Key_Go, "Go" }, | - | ||||||||||||||||||||||||||||||
129 | { Qt::Key_iTouch, "iTouch" }, | - | ||||||||||||||||||||||||||||||
130 | { Qt::Key_LogOff, "Logoff" }, | - | ||||||||||||||||||||||||||||||
131 | { Qt::Key_Market, "Market" }, | - | ||||||||||||||||||||||||||||||
132 | { Qt::Key_Meeting, "Meeting" }, | - | ||||||||||||||||||||||||||||||
133 | { Qt::Key_MenuKB, "Keyboard Menu" }, | - | ||||||||||||||||||||||||||||||
134 | { Qt::Key_MenuPB, "Menu PB" }, | - | ||||||||||||||||||||||||||||||
135 | { Qt::Key_MySites, "My Sites" }, | - | ||||||||||||||||||||||||||||||
136 | { Qt::Key_News, "News" }, | - | ||||||||||||||||||||||||||||||
137 | { Qt::Key_OfficeHome, "Home Office" }, | - | ||||||||||||||||||||||||||||||
138 | { Qt::Key_Option, "Option" }, | - | ||||||||||||||||||||||||||||||
139 | { Qt::Key_Paste, "Paste" }, | - | ||||||||||||||||||||||||||||||
140 | { Qt::Key_Phone, "Phone" }, | - | ||||||||||||||||||||||||||||||
141 | { Qt::Key_Reply, "Reply" }, | - | ||||||||||||||||||||||||||||||
142 | { Qt::Key_Reload, "Reload" }, | - | ||||||||||||||||||||||||||||||
143 | { Qt::Key_RotateWindows, "Rotate Windows" }, | - | ||||||||||||||||||||||||||||||
144 | { Qt::Key_RotationPB, "Rotation PB" }, | - | ||||||||||||||||||||||||||||||
145 | { Qt::Key_RotationKB, "Rotation KB" }, | - | ||||||||||||||||||||||||||||||
146 | { Qt::Key_Save, "Save" }, | - | ||||||||||||||||||||||||||||||
147 | { Qt::Key_Send, "Send" }, | - | ||||||||||||||||||||||||||||||
148 | { Qt::Key_Spell, "Spellchecker" }, | - | ||||||||||||||||||||||||||||||
149 | { Qt::Key_SplitScreen, "Split Screen" }, | - | ||||||||||||||||||||||||||||||
150 | { Qt::Key_Support, "Support" }, | - | ||||||||||||||||||||||||||||||
151 | { Qt::Key_TaskPane, "Task Panel" }, | - | ||||||||||||||||||||||||||||||
152 | { Qt::Key_Terminal, "Terminal" }, | - | ||||||||||||||||||||||||||||||
153 | { Qt::Key_Tools, "Tools" }, | - | ||||||||||||||||||||||||||||||
154 | { Qt::Key_Travel, "Travel" }, | - | ||||||||||||||||||||||||||||||
155 | { Qt::Key_Video, "Video" }, | - | ||||||||||||||||||||||||||||||
156 | { Qt::Key_Word, "Word Processor" }, | - | ||||||||||||||||||||||||||||||
157 | { Qt::Key_Xfer, "XFer" }, | - | ||||||||||||||||||||||||||||||
158 | { Qt::Key_ZoomIn, "Zoom In" }, | - | ||||||||||||||||||||||||||||||
159 | { Qt::Key_ZoomOut, "Zoom Out" }, | - | ||||||||||||||||||||||||||||||
160 | { Qt::Key_Away, "Away" }, | - | ||||||||||||||||||||||||||||||
161 | { Qt::Key_Messenger, "Messenger" }, | - | ||||||||||||||||||||||||||||||
162 | { Qt::Key_WebCam, "WebCam" }, | - | ||||||||||||||||||||||||||||||
163 | { Qt::Key_MailForward, "Mail Forward" }, | - | ||||||||||||||||||||||||||||||
164 | { Qt::Key_Pictures, "Pictures" }, | - | ||||||||||||||||||||||||||||||
165 | { Qt::Key_Music, "Music" }, | - | ||||||||||||||||||||||||||||||
166 | { Qt::Key_Battery, "Battery" }, | - | ||||||||||||||||||||||||||||||
167 | { Qt::Key_Bluetooth, "Bluetooth" }, | - | ||||||||||||||||||||||||||||||
168 | { Qt::Key_WLAN, "Wireless" }, | - | ||||||||||||||||||||||||||||||
169 | { Qt::Key_UWB, "Ultra Wide Band" }, | - | ||||||||||||||||||||||||||||||
170 | { Qt::Key_AudioForward, "Media Fast Forward" }, | - | ||||||||||||||||||||||||||||||
171 | { Qt::Key_AudioRepeat, "Audio Repeat" }, | - | ||||||||||||||||||||||||||||||
172 | { Qt::Key_AudioRandomPlay, "Audio Random Play" }, | - | ||||||||||||||||||||||||||||||
173 | { Qt::Key_Subtitle, "Subtitle" }, | - | ||||||||||||||||||||||||||||||
174 | { Qt::Key_AudioCycleTrack, "Audio Cycle Track" }, | - | ||||||||||||||||||||||||||||||
175 | { Qt::Key_Time, "Time" }, | - | ||||||||||||||||||||||||||||||
176 | { Qt::Key_Hibernate, "Hibernate" }, | - | ||||||||||||||||||||||||||||||
177 | { Qt::Key_View, "View" }, | - | ||||||||||||||||||||||||||||||
178 | { Qt::Key_TopMenu, "Top Menu" }, | - | ||||||||||||||||||||||||||||||
179 | { Qt::Key_PowerDown, "Power Down" }, | - | ||||||||||||||||||||||||||||||
180 | { Qt::Key_Suspend, "Suspend" }, | - | ||||||||||||||||||||||||||||||
181 | - | |||||||||||||||||||||||||||||||
182 | { Qt::Key_MicMute, "Microphone Mute" }, | - | ||||||||||||||||||||||||||||||
183 | - | |||||||||||||||||||||||||||||||
184 | { Qt::Key_Red, "Red" }, | - | ||||||||||||||||||||||||||||||
185 | { Qt::Key_Green, "Green" }, | - | ||||||||||||||||||||||||||||||
186 | { Qt::Key_Yellow, "Yellow" }, | - | ||||||||||||||||||||||||||||||
187 | { Qt::Key_Blue, "Blue" }, | - | ||||||||||||||||||||||||||||||
188 | - | |||||||||||||||||||||||||||||||
189 | { Qt::Key_ChannelUp, "Channel Up" }, | - | ||||||||||||||||||||||||||||||
190 | { Qt::Key_ChannelDown, "Channel Down" }, | - | ||||||||||||||||||||||||||||||
191 | - | |||||||||||||||||||||||||||||||
192 | { Qt::Key_Guide, "Guide" }, | - | ||||||||||||||||||||||||||||||
193 | { Qt::Key_Info, "Info" }, | - | ||||||||||||||||||||||||||||||
194 | { Qt::Key_Settings, "Settings" }, | - | ||||||||||||||||||||||||||||||
195 | - | |||||||||||||||||||||||||||||||
196 | { Qt::Key_MicVolumeUp, "Microphone Volume Up" }, | - | ||||||||||||||||||||||||||||||
197 | { Qt::Key_MicVolumeDown, "Microphone Volume Down" }, | - | ||||||||||||||||||||||||||||||
198 | - | |||||||||||||||||||||||||||||||
199 | { Qt::Key_New, "New" }, | - | ||||||||||||||||||||||||||||||
200 | { Qt::Key_Open, "Open" }, | - | ||||||||||||||||||||||||||||||
201 | { Qt::Key_Find, "Find" }, | - | ||||||||||||||||||||||||||||||
202 | { Qt::Key_Undo, "Undo" }, | - | ||||||||||||||||||||||||||||||
203 | { Qt::Key_Redo, "Redo" }, | - | ||||||||||||||||||||||||||||||
204 | - | |||||||||||||||||||||||||||||||
205 | - | |||||||||||||||||||||||||||||||
206 | - | |||||||||||||||||||||||||||||||
207 | { Qt::Key_Print, "Print Screen" }, | - | ||||||||||||||||||||||||||||||
208 | { Qt::Key_PageUp, "Page Up" }, | - | ||||||||||||||||||||||||||||||
209 | { Qt::Key_PageDown, "Page Down" }, | - | ||||||||||||||||||||||||||||||
210 | { Qt::Key_CapsLock, "Caps Lock" }, | - | ||||||||||||||||||||||||||||||
211 | { Qt::Key_NumLock, "Num Lock" }, | - | ||||||||||||||||||||||||||||||
212 | { Qt::Key_NumLock, "Number Lock" }, | - | ||||||||||||||||||||||||||||||
213 | { Qt::Key_ScrollLock, "Scroll Lock" }, | - | ||||||||||||||||||||||||||||||
214 | { Qt::Key_Insert, "Insert" }, | - | ||||||||||||||||||||||||||||||
215 | { Qt::Key_Delete, "Delete" }, | - | ||||||||||||||||||||||||||||||
216 | { Qt::Key_Escape, "Escape" }, | - | ||||||||||||||||||||||||||||||
217 | { Qt::Key_SysReq, "System Request" }, | - | ||||||||||||||||||||||||||||||
218 | - | |||||||||||||||||||||||||||||||
219 | - | |||||||||||||||||||||||||||||||
220 | - | |||||||||||||||||||||||||||||||
221 | { Qt::Key_Select, "Select" }, | - | ||||||||||||||||||||||||||||||
222 | { Qt::Key_Yes, "Yes" }, | - | ||||||||||||||||||||||||||||||
223 | { Qt::Key_No, "No" }, | - | ||||||||||||||||||||||||||||||
224 | - | |||||||||||||||||||||||||||||||
225 | - | |||||||||||||||||||||||||||||||
226 | - | |||||||||||||||||||||||||||||||
227 | { Qt::Key_Context1, "Context1" }, | - | ||||||||||||||||||||||||||||||
228 | { Qt::Key_Context2, "Context2" }, | - | ||||||||||||||||||||||||||||||
229 | { Qt::Key_Context3, "Context3" }, | - | ||||||||||||||||||||||||||||||
230 | { Qt::Key_Context4, "Context4" }, | - | ||||||||||||||||||||||||||||||
231 | - | |||||||||||||||||||||||||||||||
232 | { Qt::Key_Call, "Call" }, | - | ||||||||||||||||||||||||||||||
233 | - | |||||||||||||||||||||||||||||||
234 | { Qt::Key_Hangup, "Hangup" }, | - | ||||||||||||||||||||||||||||||
235 | - | |||||||||||||||||||||||||||||||
236 | { Qt::Key_ToggleCallHangup, "Toggle Call/Hangup" }, | - | ||||||||||||||||||||||||||||||
237 | { Qt::Key_Flip, "Flip" }, | - | ||||||||||||||||||||||||||||||
238 | - | |||||||||||||||||||||||||||||||
239 | { Qt::Key_VoiceDial, "Voice Dial" }, | - | ||||||||||||||||||||||||||||||
240 | - | |||||||||||||||||||||||||||||||
241 | { Qt::Key_LastNumberRedial, "Last Number Redial" }, | - | ||||||||||||||||||||||||||||||
242 | - | |||||||||||||||||||||||||||||||
243 | { Qt::Key_Camera, "Camera Shutter" }, | - | ||||||||||||||||||||||||||||||
244 | - | |||||||||||||||||||||||||||||||
245 | { Qt::Key_CameraFocus, "Camera Focus" }, | - | ||||||||||||||||||||||||||||||
246 | - | |||||||||||||||||||||||||||||||
247 | - | |||||||||||||||||||||||||||||||
248 | - | |||||||||||||||||||||||||||||||
249 | { Qt::Key_Kanji, "Kanji" }, | - | ||||||||||||||||||||||||||||||
250 | { Qt::Key_Muhenkan, "Muhenkan" }, | - | ||||||||||||||||||||||||||||||
251 | { Qt::Key_Henkan, "Henkan" }, | - | ||||||||||||||||||||||||||||||
252 | { Qt::Key_Romaji, "Romaji" }, | - | ||||||||||||||||||||||||||||||
253 | { Qt::Key_Hiragana, "Hiragana" }, | - | ||||||||||||||||||||||||||||||
254 | { Qt::Key_Katakana, "Katakana" }, | - | ||||||||||||||||||||||||||||||
255 | { Qt::Key_Hiragana_Katakana,"Hiragana Katakana" }, | - | ||||||||||||||||||||||||||||||
256 | { Qt::Key_Zenkaku, "Zenkaku" }, | - | ||||||||||||||||||||||||||||||
257 | { Qt::Key_Hankaku, "Hankaku" }, | - | ||||||||||||||||||||||||||||||
258 | { Qt::Key_Zenkaku_Hankaku, "Zenkaku Hankaku" }, | - | ||||||||||||||||||||||||||||||
259 | { Qt::Key_Touroku, "Touroku" }, | - | ||||||||||||||||||||||||||||||
260 | { Qt::Key_Massyo, "Massyo" }, | - | ||||||||||||||||||||||||||||||
261 | { Qt::Key_Kana_Lock, "Kana Lock" }, | - | ||||||||||||||||||||||||||||||
262 | { Qt::Key_Kana_Shift, "Kana Shift" }, | - | ||||||||||||||||||||||||||||||
263 | { Qt::Key_Eisu_Shift, "Eisu Shift" }, | - | ||||||||||||||||||||||||||||||
264 | { Qt::Key_Eisu_toggle, "Eisu toggle" }, | - | ||||||||||||||||||||||||||||||
265 | { Qt::Key_Codeinput, "Code input" }, | - | ||||||||||||||||||||||||||||||
266 | { Qt::Key_MultipleCandidate,"Multiple Candidate" }, | - | ||||||||||||||||||||||||||||||
267 | { Qt::Key_PreviousCandidate,"Previous Candidate" }, | - | ||||||||||||||||||||||||||||||
268 | - | |||||||||||||||||||||||||||||||
269 | - | |||||||||||||||||||||||||||||||
270 | - | |||||||||||||||||||||||||||||||
271 | { Qt::Key_Hangul, "Hangul" }, | - | ||||||||||||||||||||||||||||||
272 | { Qt::Key_Hangul_Start, "Hangul Start" }, | - | ||||||||||||||||||||||||||||||
273 | { Qt::Key_Hangul_End, "Hangul End" }, | - | ||||||||||||||||||||||||||||||
274 | { Qt::Key_Hangul_Hanja, "Hangul Hanja" }, | - | ||||||||||||||||||||||||||||||
275 | { Qt::Key_Hangul_Jamo, "Hangul Jamo" }, | - | ||||||||||||||||||||||||||||||
276 | { Qt::Key_Hangul_Romaja, "Hangul Romaja" }, | - | ||||||||||||||||||||||||||||||
277 | { Qt::Key_Hangul_Jeonja, "Hangul Jeonja" }, | - | ||||||||||||||||||||||||||||||
278 | { Qt::Key_Hangul_Banja, "Hangul Banja" }, | - | ||||||||||||||||||||||||||||||
279 | { Qt::Key_Hangul_PreHanja, "Hangul PreHanja" }, | - | ||||||||||||||||||||||||||||||
280 | { Qt::Key_Hangul_PostHanja,"Hangul PostHanja" }, | - | ||||||||||||||||||||||||||||||
281 | { Qt::Key_Hangul_Special, "Hangul Special" }, | - | ||||||||||||||||||||||||||||||
282 | - | |||||||||||||||||||||||||||||||
283 | - | |||||||||||||||||||||||||||||||
284 | - | |||||||||||||||||||||||||||||||
285 | { Qt::Key_Cancel, "Cancel" }, | - | ||||||||||||||||||||||||||||||
286 | { Qt::Key_Printer, "Printer" }, | - | ||||||||||||||||||||||||||||||
287 | { Qt::Key_Execute, "Execute" }, | - | ||||||||||||||||||||||||||||||
288 | { Qt::Key_Play, "Play" }, | - | ||||||||||||||||||||||||||||||
289 | { Qt::Key_Zoom, "Zoom" }, | - | ||||||||||||||||||||||||||||||
290 | { Qt::Key_Exit, "Exit" }, | - | ||||||||||||||||||||||||||||||
291 | { Qt::Key_TouchpadToggle, "Touchpad Toggle" }, | - | ||||||||||||||||||||||||||||||
292 | { Qt::Key_TouchpadOn, "Touchpad On" }, | - | ||||||||||||||||||||||||||||||
293 | { Qt::Key_TouchpadOff, "Touchpad Off" }, | - | ||||||||||||||||||||||||||||||
294 | - | |||||||||||||||||||||||||||||||
295 | }; | - | ||||||||||||||||||||||||||||||
296 | static constexpr int numKeyNames = sizeof keyname / sizeof *keyname; | - | ||||||||||||||||||||||||||||||
297 | QKeySequence::QKeySequence(StandardKey key) | - | ||||||||||||||||||||||||||||||
298 | { | - | ||||||||||||||||||||||||||||||
299 | const QList <QKeySequence> bindings = keyBindings(key); | - | ||||||||||||||||||||||||||||||
300 | - | |||||||||||||||||||||||||||||||
301 | if (bindings.size() > 0) { | - | ||||||||||||||||||||||||||||||
302 | d = bindings.first().d; | - | ||||||||||||||||||||||||||||||
303 | d->ref.ref(); | - | ||||||||||||||||||||||||||||||
304 | } | - | ||||||||||||||||||||||||||||||
305 | else | - | ||||||||||||||||||||||||||||||
306 | d = new QKeySequencePrivate(); | - | ||||||||||||||||||||||||||||||
307 | } | - | ||||||||||||||||||||||||||||||
308 | - | |||||||||||||||||||||||||||||||
309 | - | |||||||||||||||||||||||||||||||
310 | - | |||||||||||||||||||||||||||||||
311 | - | |||||||||||||||||||||||||||||||
312 | - | |||||||||||||||||||||||||||||||
313 | QKeySequence::QKeySequence() | - | ||||||||||||||||||||||||||||||
314 | { | - | ||||||||||||||||||||||||||||||
315 | static QKeySequencePrivate shared_empty; | - | ||||||||||||||||||||||||||||||
316 | d = &shared_empty; | - | ||||||||||||||||||||||||||||||
317 | d->ref.ref(); | - | ||||||||||||||||||||||||||||||
318 | } | - | ||||||||||||||||||||||||||||||
319 | QKeySequence::QKeySequence(const QString &key, QKeySequence::SequenceFormat format) | - | ||||||||||||||||||||||||||||||
320 | { | - | ||||||||||||||||||||||||||||||
321 | d = new QKeySequencePrivate(); | - | ||||||||||||||||||||||||||||||
322 | assign(key, format); | - | ||||||||||||||||||||||||||||||
323 | } | - | ||||||||||||||||||||||||||||||
324 | - | |||||||||||||||||||||||||||||||
325 | static_assert(bool(QKeySequencePrivate::MaxKeyCount == 4), "Change docs and ctor impl below"); | - | ||||||||||||||||||||||||||||||
326 | QKeySequence::QKeySequence(int k1, int k2, int k3, int k4) | - | ||||||||||||||||||||||||||||||
327 | { | - | ||||||||||||||||||||||||||||||
328 | d = new QKeySequencePrivate(); | - | ||||||||||||||||||||||||||||||
329 | d->key[0] = k1; | - | ||||||||||||||||||||||||||||||
330 | d->key[1] = k2; | - | ||||||||||||||||||||||||||||||
331 | d->key[2] = k3; | - | ||||||||||||||||||||||||||||||
332 | d->key[3] = k4; | - | ||||||||||||||||||||||||||||||
333 | } | - | ||||||||||||||||||||||||||||||
334 | - | |||||||||||||||||||||||||||||||
335 | - | |||||||||||||||||||||||||||||||
336 | - | |||||||||||||||||||||||||||||||
337 | - | |||||||||||||||||||||||||||||||
338 | QKeySequence::QKeySequence(const QKeySequence& keysequence) | - | ||||||||||||||||||||||||||||||
339 | : d(keysequence.d) | - | ||||||||||||||||||||||||||||||
340 | { | - | ||||||||||||||||||||||||||||||
341 | d->ref.ref(); | - | ||||||||||||||||||||||||||||||
342 | } | - | ||||||||||||||||||||||||||||||
343 | QList<QKeySequence> QKeySequence::keyBindings(StandardKey key) | - | ||||||||||||||||||||||||||||||
344 | { | - | ||||||||||||||||||||||||||||||
345 | return QGuiApplicationPrivate::platformTheme()->keyBindings(key); | - | ||||||||||||||||||||||||||||||
346 | } | - | ||||||||||||||||||||||||||||||
347 | - | |||||||||||||||||||||||||||||||
348 | - | |||||||||||||||||||||||||||||||
349 | - | |||||||||||||||||||||||||||||||
350 | - | |||||||||||||||||||||||||||||||
351 | QKeySequence::~QKeySequence() | - | ||||||||||||||||||||||||||||||
352 | { | - | ||||||||||||||||||||||||||||||
353 | if (!d->ref.deref()) | - | ||||||||||||||||||||||||||||||
354 | delete d; | - | ||||||||||||||||||||||||||||||
355 | } | - | ||||||||||||||||||||||||||||||
356 | void QKeySequence::setKey(int key, int index) | - | ||||||||||||||||||||||||||||||
357 | { | - | ||||||||||||||||||||||||||||||
358 | ((!(index >= 0 && index < QKeySequencePrivate::MaxKeyCount)) ? qt_assert_x("QKeySequence::setKey", "index out of range",__FILE__,900906) : qt_noop()); | - | ||||||||||||||||||||||||||||||
359 | qAtomicDetach(d); | - | ||||||||||||||||||||||||||||||
360 | d->key[index] = key; | - | ||||||||||||||||||||||||||||||
361 | } | - | ||||||||||||||||||||||||||||||
362 | - | |||||||||||||||||||||||||||||||
363 | static_assert(bool(QKeySequencePrivate::MaxKeyCount == 4), "Change docs below"); | - | ||||||||||||||||||||||||||||||
364 | - | |||||||||||||||||||||||||||||||
365 | - | |||||||||||||||||||||||||||||||
366 | - | |||||||||||||||||||||||||||||||
367 | - | |||||||||||||||||||||||||||||||
368 | int QKeySequence::count() const | - | ||||||||||||||||||||||||||||||
369 | { | - | ||||||||||||||||||||||||||||||
370 | return int(std::distance(d->key, std::find(d->key, d->key + QKeySequencePrivate::MaxKeyCount, 0))); | - | ||||||||||||||||||||||||||||||
371 | } | - | ||||||||||||||||||||||||||||||
372 | - | |||||||||||||||||||||||||||||||
373 | - | |||||||||||||||||||||||||||||||
374 | - | |||||||||||||||||||||||||||||||
375 | - | |||||||||||||||||||||||||||||||
376 | - | |||||||||||||||||||||||||||||||
377 | - | |||||||||||||||||||||||||||||||
378 | bool QKeySequence::isEmpty() const | - | ||||||||||||||||||||||||||||||
379 | { | - | ||||||||||||||||||||||||||||||
380 | return !d->key[0]; | - | ||||||||||||||||||||||||||||||
381 | } | - | ||||||||||||||||||||||||||||||
382 | QKeySequence QKeySequence::mnemonic(const QString &text) | - | ||||||||||||||||||||||||||||||
383 | { | - | ||||||||||||||||||||||||||||||
384 | QKeySequence ret; | - | ||||||||||||||||||||||||||||||
385 | - | |||||||||||||||||||||||||||||||
386 | if(qt_sequence_no_mnemonics) | - | ||||||||||||||||||||||||||||||
387 | return ret; | - | ||||||||||||||||||||||||||||||
388 | - | |||||||||||||||||||||||||||||||
389 | bool found = false; | - | ||||||||||||||||||||||||||||||
390 | int p = 0; | - | ||||||||||||||||||||||||||||||
391 | while (p >= 0) { | - | ||||||||||||||||||||||||||||||
392 | p = text.indexOf(QLatin1Char('&'), p) + 1; | - | ||||||||||||||||||||||||||||||
393 | if (p <= 0 || p >= (int)text.length()) | - | ||||||||||||||||||||||||||||||
394 | break; | - | ||||||||||||||||||||||||||||||
395 | if (text.at(p) != QLatin1Char('&')) { | - | ||||||||||||||||||||||||||||||
396 | QChar c = text.at(p); | - | ||||||||||||||||||||||||||||||
397 | if (c.isPrint()) { | - | ||||||||||||||||||||||||||||||
398 | if (!found) { | - | ||||||||||||||||||||||||||||||
399 | c = c.toUpper(); | - | ||||||||||||||||||||||||||||||
400 | ret = QKeySequence(c.unicode() + Qt::ALT); | - | ||||||||||||||||||||||||||||||
401 | - | |||||||||||||||||||||||||||||||
402 | - | |||||||||||||||||||||||||||||||
403 | - | |||||||||||||||||||||||||||||||
404 | found = true; | - | ||||||||||||||||||||||||||||||
405 | } else { | - | ||||||||||||||||||||||||||||||
406 | QMessageLogger(__FILE__, 963969, __PRETTY_FUNCTION__).warning("QKeySequence::mnemonic: \"%s\" contains multiple occurrences of '&'", QString(text).toLocal8Bit().constData()); | - | ||||||||||||||||||||||||||||||
407 | - | |||||||||||||||||||||||||||||||
408 | } | - | ||||||||||||||||||||||||||||||
409 | } | - | ||||||||||||||||||||||||||||||
410 | } | - | ||||||||||||||||||||||||||||||
411 | p++; | - | ||||||||||||||||||||||||||||||
412 | } | - | ||||||||||||||||||||||||||||||
413 | return ret; | - | ||||||||||||||||||||||||||||||
414 | } | - | ||||||||||||||||||||||||||||||
415 | int QKeySequence::assign(const QString &ks) | - | ||||||||||||||||||||||||||||||
416 | { | - | ||||||||||||||||||||||||||||||
417 | return assign(ks, NativeText); | - | ||||||||||||||||||||||||||||||
418 | } | - | ||||||||||||||||||||||||||||||
419 | int QKeySequence::assign(const QString &ks, QKeySequence::SequenceFormat format) | - | ||||||||||||||||||||||||||||||
420 | { | - | ||||||||||||||||||||||||||||||
421 | QString keyseq = ks; | - | ||||||||||||||||||||||||||||||
422 | QString part; | - | ||||||||||||||||||||||||||||||
423 | int n = 0; | - | ||||||||||||||||||||||||||||||
424 | int p = 0, diff = 0; | - | ||||||||||||||||||||||||||||||
425 | - | |||||||||||||||||||||||||||||||
426 | - | |||||||||||||||||||||||||||||||
427 | - | |||||||||||||||||||||||||||||||
428 | while (keyseq.length() && n < QKeySequencePrivate::MaxKeyCount) { | - | ||||||||||||||||||||||||||||||
429 | - | |||||||||||||||||||||||||||||||
430 | - | |||||||||||||||||||||||||||||||
431 | - | |||||||||||||||||||||||||||||||
432 | p = keyseq.indexOf(QLatin1Char(',')); | - | ||||||||||||||||||||||||||||||
433 | if (-1 != p) { | - | ||||||||||||||||||||||||||||||
434 | if (p == keyseq.count() - 1) { | - | ||||||||||||||||||||||||||||||
435 | p = -1; | - | ||||||||||||||||||||||||||||||
436 | } else { | - | ||||||||||||||||||||||||||||||
437 | if (QLatin1Char(',') == keyseq.at(p+1)) | - | ||||||||||||||||||||||||||||||
438 | p++; | - | ||||||||||||||||||||||||||||||
439 | if (QLatin1Char(' ') == keyseq.at(p+1)) { | - | ||||||||||||||||||||||||||||||
440 | diff = 1; | - | ||||||||||||||||||||||||||||||
441 | p++; | - | ||||||||||||||||||||||||||||||
442 | } else { | - | ||||||||||||||||||||||||||||||
443 | diff = 0; | - | ||||||||||||||||||||||||||||||
444 | } | - | ||||||||||||||||||||||||||||||
445 | } | - | ||||||||||||||||||||||||||||||
446 | } | - | ||||||||||||||||||||||||||||||
447 | part = keyseq.left(-1 == p ? keyseq.length() : p - diff); | - | ||||||||||||||||||||||||||||||
448 | keyseq = keyseq.right(-1 == p ? 0 : keyseq.length() - (p + 1)); | - | ||||||||||||||||||||||||||||||
449 | d->key[n] = QKeySequencePrivate::decodeString(part, format); | - | ||||||||||||||||||||||||||||||
450 | ++n; | - | ||||||||||||||||||||||||||||||
451 | } | - | ||||||||||||||||||||||||||||||
452 | return n; | - | ||||||||||||||||||||||||||||||
453 | } | - | ||||||||||||||||||||||||||||||
454 | - | |||||||||||||||||||||||||||||||
455 | struct QModifKeyName { | - | ||||||||||||||||||||||||||||||
456 | QModifKeyName() { } | - | ||||||||||||||||||||||||||||||
457 | QModifKeyName(int q, QChar n) : qt_key(q), name(n) { } | - | ||||||||||||||||||||||||||||||
458 | QModifKeyName(int q, const QString &n) : qt_key(q), name(n) { } | - | ||||||||||||||||||||||||||||||
459 | int qt_key; | - | ||||||||||||||||||||||||||||||
460 | QString name; | - | ||||||||||||||||||||||||||||||
461 | }; | - | ||||||||||||||||||||||||||||||
462 | template<> class QTypeInfo<QModifKeyName > { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isRelocatable = !isStatic || ((Q_MOVABLE_TYPE) & Q_RELOCATABLE_TYPE), isLarge = (sizeof(QModifKeyName)>sizeof(void*)), isPointer = false, isIntegral = QtPrivate::is_integral< QModifKeyName >::value, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0), sizeOf = sizeof(QModifKeyName) }; static inline const char *name() { return "QModifKeyName"; } }; | - | ||||||||||||||||||||||||||||||
463 | - | |||||||||||||||||||||||||||||||
464 | namespace { namespace Q_QGS_globalModifs { typedef QVector<QModifKeyName> Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized) guard.store(QtGlobalStatic::Destroyed); } }; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; return &holder.value; } } } static QGlobalStatic<QVector<QModifKeyName>, Q_QGS_globalModifs::innerFunction, Q_QGS_globalModifs::guard> globalModifs; | - | ||||||||||||||||||||||||||||||
465 | namespace { namespace Q_QGS_globalPortableModifs { typedef QVector<QModifKeyName> Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized) guard.store(QtGlobalStatic::Destroyed); } }; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; return &holder.value; } } } static QGlobalStatic<QVector<QModifKeyName>, Q_QGS_globalPortableModifs::innerFunction, Q_QGS_globalPortableModifs::guard> globalPortableModifs; | - | ||||||||||||||||||||||||||||||
466 | - | |||||||||||||||||||||||||||||||
467 | - | |||||||||||||||||||||||||||||||
468 | - | |||||||||||||||||||||||||||||||
469 | - | |||||||||||||||||||||||||||||||
470 | int QKeySequence::decodeString(const QString &str) | - | ||||||||||||||||||||||||||||||
471 | { | - | ||||||||||||||||||||||||||||||
472 | return QKeySequencePrivate::decodeString(str, NativeText); | - | ||||||||||||||||||||||||||||||
473 | } | - | ||||||||||||||||||||||||||||||
474 | - | |||||||||||||||||||||||||||||||
475 | int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::SequenceFormat format) | - | ||||||||||||||||||||||||||||||
476 | { | - | ||||||||||||||||||||||||||||||
477 | int ret = 0; | - | ||||||||||||||||||||||||||||||
478 | QString accel = str.toLower(); | - | ||||||||||||||||||||||||||||||
479 | bool nativeText = (format == QKeySequence::NativeText); | - | ||||||||||||||||||||||||||||||
480 | - | |||||||||||||||||||||||||||||||
481 | QVector<QModifKeyName> *gmodifs; | - | ||||||||||||||||||||||||||||||
482 | if (nativeText
| 0 | ||||||||||||||||||||||||||||||
483 | gmodifs = globalModifs(); | - | ||||||||||||||||||||||||||||||
484 | if (gmodifs->isEmpty()
| 0 | ||||||||||||||||||||||||||||||
485 | *gmodifs << QModifKeyName(Qt::CTRL, QLatin1String("ctrl+")) | - | ||||||||||||||||||||||||||||||
486 | << QModifKeyName(Qt::SHIFT, QLatin1String("shift+")) | - | ||||||||||||||||||||||||||||||
487 | << QModifKeyName(Qt::ALT, QLatin1String("alt+")) | - | ||||||||||||||||||||||||||||||
488 | << QModifKeyName(Qt::META, QLatin1String("meta+")) | - | ||||||||||||||||||||||||||||||
489 | << QModifKeyName(Qt::KeypadModifier, QLatin1String("num+")); | - | ||||||||||||||||||||||||||||||
490 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
491 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||
492 | gmodifs = globalPortableModifs(); | - | ||||||||||||||||||||||||||||||
493 | if (gmodifs->isEmpty()
| 0 | ||||||||||||||||||||||||||||||
494 | *gmodifs << QModifKeyName(Qt::CTRL, QLatin1String("ctrl+")) | - | ||||||||||||||||||||||||||||||
495 | << QModifKeyName(Qt::SHIFT, QLatin1String("shift+")) | - | ||||||||||||||||||||||||||||||
496 | << QModifKeyName(Qt::ALT, QLatin1String("alt+")) | - | ||||||||||||||||||||||||||||||
497 | << QModifKeyName(Qt::META, QLatin1String("meta+")) | - | ||||||||||||||||||||||||||||||
498 | << QModifKeyName(Qt::KeypadModifier, QLatin1String("num+")); | - | ||||||||||||||||||||||||||||||
499 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
500 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
501 | if (!gmodifs
never executed: ret;return ret; never executed: return ret; | 0 | ||||||||||||||||||||||||||||||
502 | - | |||||||||||||||||||||||||||||||
503 | - | |||||||||||||||||||||||||||||||
504 | QVector<QModifKeyName> modifs; | - | ||||||||||||||||||||||||||||||
505 | if (nativeText
| 0 | ||||||||||||||||||||||||||||||
506 | modifs << QModifKeyName(Qt::CTRL, QCoreApplication::translate("QShortcut", "Ctrl").toLower().append(QLatin1Char('+'))) | - | ||||||||||||||||||||||||||||||
507 | << QModifKeyName(Qt::SHIFT, QCoreApplication::translate("QShortcut", "Shift").toLower().append(QLatin1Char('+'))) | - | ||||||||||||||||||||||||||||||
508 | << QModifKeyName(Qt::ALT, QCoreApplication::translate("QShortcut", "Alt").toLower().append(QLatin1Char('+'))) | - | ||||||||||||||||||||||||||||||
509 | << QModifKeyName(Qt::META, QCoreApplication::translate("QShortcut", "Meta").toLower().append(QLatin1Char('+'))) | - | ||||||||||||||||||||||||||||||
510 | << QModifKeyName(Qt::KeypadModifier, QCoreApplication::translate("QShortcut", "Num").toLower().append(QLatin1Char('+'))); | - | ||||||||||||||||||||||||||||||
511 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
512 | modifs += *gmodifs; | - | ||||||||||||||||||||||||||||||
513 | - | |||||||||||||||||||||||||||||||
514 | QString sl = accel; | - | ||||||||||||||||||||||||||||||
515 | int i = 0; | - | ||||||||||||||||||||||||||||||
516 | int lastI = 0; | - | ||||||||||||||||||||||||||||||
517 | while ((
| 0 | ||||||||||||||||||||||||||||||
518 | const QStringRef sub = sl.midRef(lastI, i - lastI + 1); | - | ||||||||||||||||||||||||||||||
519 | if (sub.length() == 1
| 0 | ||||||||||||||||||||||||||||||
520 | - | |||||||||||||||||||||||||||||||
521 | if (accel.lastIndexOf(QLatin1Char('+')) != accel.length()-1
| 0 | ||||||||||||||||||||||||||||||
522 | return never executed: Qt::Key_unknown;return Qt::Key_unknown; never executed: return Qt::Key_unknown; | 0 | ||||||||||||||||||||||||||||||
523 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||
524 | - | |||||||||||||||||||||||||||||||
525 | bool validModifier = false; | - | ||||||||||||||||||||||||||||||
526 | for (int j = 0; j < modifs.size()
| 0 | ||||||||||||||||||||||||||||||
527 | const QModifKeyName &mkf = modifs.at(j); | - | ||||||||||||||||||||||||||||||
528 | if (sub == mkf.name
| 0 | ||||||||||||||||||||||||||||||
529 | ret |= mkf.qt_key; | - | ||||||||||||||||||||||||||||||
530 | validModifier = true; | - | ||||||||||||||||||||||||||||||
531 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||
532 | } | - | ||||||||||||||||||||||||||||||
533 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
534 | - | |||||||||||||||||||||||||||||||
535 | if (!validModifier
| 0 | ||||||||||||||||||||||||||||||
536 | return never executed: Qt::Key_unknown;return Qt::Key_unknown; never executed: return Qt::Key_unknown; | 0 | ||||||||||||||||||||||||||||||
537 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
538 | lastI = i + 1; | - | ||||||||||||||||||||||||||||||
539 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
540 | - | |||||||||||||||||||||||||||||||
541 | int p = accel.lastIndexOf(QLatin1Char('+'), str.length() - 2); | - | ||||||||||||||||||||||||||||||
542 | QStringRef accelRef(&accel); | - | ||||||||||||||||||||||||||||||
543 | if(p > 0
| 0 | ||||||||||||||||||||||||||||||
544 | accelaccelRef never executed: = accelaccelRef.mid(p + 1);accelRef = accelRef.mid(p + 1); never executed: accelRef = accelRef.mid(p + 1); | 0 | ||||||||||||||||||||||||||||||
545 | - | |||||||||||||||||||||||||||||||
546 | int fnum = 0; | - | ||||||||||||||||||||||||||||||
547 | if (accelaccelRef
| 0 | ||||||||||||||||||||||||||||||
548 | - | |||||||||||||||||||||||||||||||
549 | - | |||||||||||||||||||||||||||||||
550 | - | |||||||||||||||||||||||||||||||
551 | - | |||||||||||||||||||||||||||||||
552 | - | |||||||||||||||||||||||||||||||
553 | - | |||||||||||||||||||||||||||||||
554 | { | - | ||||||||||||||||||||||||||||||
555 | ret |= accel[accelRef.at(0].).toUpper().unicode(); | - | ||||||||||||||||||||||||||||||
556 | } | - | ||||||||||||||||||||||||||||||
557 | } never executed: else if (accel[accelRef.at(end of block
| 0 | ||||||||||||||||||||||||||||||
558 | ret |= Qt::Key_F1 + fnum - 1; | - | ||||||||||||||||||||||||||||||
559 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||
560 | - | |||||||||||||||||||||||||||||||
561 | - | |||||||||||||||||||||||||||||||
562 | - | |||||||||||||||||||||||||||||||
563 | bool found = false; | - | ||||||||||||||||||||||||||||||
564 | for (int tran = 0; tran < 2
| 0 | ||||||||||||||||||||||||||||||
565 | if (!nativeText
| 0 | ||||||||||||||||||||||||||||||
566 | ++ never executed: tran;++tran; never executed: ++tran; | 0 | ||||||||||||||||||||||||||||||
567 | for (int i = 0; i < numKeyNames
| 0 | ||||||||||||||||||||||||||||||
568 | QString keyName(tran == 0 | - | ||||||||||||||||||||||||||||||
569 | ? QCoreApplication::translate("QShortcut", keyname[i].name) | - | ||||||||||||||||||||||||||||||
570 | : QString::fromLatin1(keyname[i].name)); | - | ||||||||||||||||||||||||||||||
571 | if (accelaccelRef
| 0 | ||||||||||||||||||||||||||||||
572 | ret |= keyname[i].key; | - | ||||||||||||||||||||||||||||||
573 | found = true; | - | ||||||||||||||||||||||||||||||
574 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||
575 | } | - | ||||||||||||||||||||||||||||||
576 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
577 | if (found
| 0 | ||||||||||||||||||||||||||||||
578 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||
579 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
580 | - | |||||||||||||||||||||||||||||||
581 | if (!found
| 0 | ||||||||||||||||||||||||||||||
582 | return never executed: Qt::Key_unknown;return Qt::Key_unknown; never executed: return Qt::Key_unknown; | 0 | ||||||||||||||||||||||||||||||
583 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
584 | return never executed: ret;return ret; never executed: return ret; | 0 | ||||||||||||||||||||||||||||||
585 | } | - | ||||||||||||||||||||||||||||||
586 | - | |||||||||||||||||||||||||||||||
587 | - | |||||||||||||||||||||||||||||||
588 | - | |||||||||||||||||||||||||||||||
589 | - | |||||||||||||||||||||||||||||||
590 | - | |||||||||||||||||||||||||||||||
591 | - | |||||||||||||||||||||||||||||||
592 | QString QKeySequence::encodeString(int key) | - | ||||||||||||||||||||||||||||||
593 | { | - | ||||||||||||||||||||||||||||||
594 | return QKeySequencePrivate::encodeString(key, NativeText); | - | ||||||||||||||||||||||||||||||
595 | } | - | ||||||||||||||||||||||||||||||
596 | - | |||||||||||||||||||||||||||||||
597 | static inline void addKey(QString &str, const QString &theKey, QKeySequence::SequenceFormat format) | - | ||||||||||||||||||||||||||||||
598 | { | - | ||||||||||||||||||||||||||||||
599 | if (!str.isEmpty()) | - | ||||||||||||||||||||||||||||||
600 | str += (format == QKeySequence::NativeText) ? QCoreApplication::translate("QShortcut", "+") | - | ||||||||||||||||||||||||||||||
601 | : QString::fromLatin1("+"); | - | ||||||||||||||||||||||||||||||
602 | str += theKey; | - | ||||||||||||||||||||||||||||||
603 | } | - | ||||||||||||||||||||||||||||||
604 | - | |||||||||||||||||||||||||||||||
605 | QString QKeySequencePrivate::encodeString(int key, QKeySequence::SequenceFormat format) | - | ||||||||||||||||||||||||||||||
606 | { | - | ||||||||||||||||||||||||||||||
607 | bool nativeText = (format == QKeySequence::NativeText); | - | ||||||||||||||||||||||||||||||
608 | QString s; | - | ||||||||||||||||||||||||||||||
609 | - | |||||||||||||||||||||||||||||||
610 | - | |||||||||||||||||||||||||||||||
611 | if (key == -1 || key == Qt::Key_unknown) | - | ||||||||||||||||||||||||||||||
612 | return s; | - | ||||||||||||||||||||||||||||||
613 | { | - | ||||||||||||||||||||||||||||||
614 | - | |||||||||||||||||||||||||||||||
615 | if ((key & Qt::META) == Qt::META) | - | ||||||||||||||||||||||||||||||
616 | s = nativeText ? QCoreApplication::translate("QShortcut", "Meta") : QString::fromLatin1("Meta"); | - | ||||||||||||||||||||||||||||||
617 | if ((key & Qt::CTRL) == Qt::CTRL) | - | ||||||||||||||||||||||||||||||
618 | addKey(s, nativeText ? QCoreApplication::translate("QShortcut", "Ctrl") : QString::fromLatin1("Ctrl"), format); | - | ||||||||||||||||||||||||||||||
619 | if ((key & Qt::ALT) == Qt::ALT) | - | ||||||||||||||||||||||||||||||
620 | addKey(s, nativeText ? QCoreApplication::translate("QShortcut", "Alt") : QString::fromLatin1("Alt"), format); | - | ||||||||||||||||||||||||||||||
621 | if ((key & Qt::SHIFT) == Qt::SHIFT) | - | ||||||||||||||||||||||||||||||
622 | addKey(s, nativeText ? QCoreApplication::translate("QShortcut", "Shift") : QString::fromLatin1("Shift"), format); | - | ||||||||||||||||||||||||||||||
623 | } | - | ||||||||||||||||||||||||||||||
624 | if ((key & Qt::KeypadModifier) == Qt::KeypadModifier) | - | ||||||||||||||||||||||||||||||
625 | addKey(s, nativeText ? QCoreApplication::translate("QShortcut", "Num") : QString::fromLatin1("Num"), format); | - | ||||||||||||||||||||||||||||||
626 | - | |||||||||||||||||||||||||||||||
627 | QString p = keyName(key, format); | - | ||||||||||||||||||||||||||||||
628 | - | |||||||||||||||||||||||||||||||
629 | - | |||||||||||||||||||||||||||||||
630 | - | |||||||||||||||||||||||||||||||
631 | - | |||||||||||||||||||||||||||||||
632 | - | |||||||||||||||||||||||||||||||
633 | - | |||||||||||||||||||||||||||||||
634 | addKey(s, p, format); | - | ||||||||||||||||||||||||||||||
635 | return s; | - | ||||||||||||||||||||||||||||||
636 | } | - | ||||||||||||||||||||||||||||||
637 | QString QKeySequencePrivate::keyName(int key, QKeySequence::SequenceFormat format) | - | ||||||||||||||||||||||||||||||
638 | { | - | ||||||||||||||||||||||||||||||
639 | bool nativeText = (format == QKeySequence::NativeText); | - | ||||||||||||||||||||||||||||||
640 | key &= ~(Qt::ShiftModifier | Qt::ControlModifier | Qt::AltModifier | Qt::MetaModifier | Qt::KeypadModifier); | - | ||||||||||||||||||||||||||||||
641 | QString p; | - | ||||||||||||||||||||||||||||||
642 | - | |||||||||||||||||||||||||||||||
643 | if (key && key < Qt::Key_Escape && key != Qt::Key_Space) { | - | ||||||||||||||||||||||||||||||
644 | if (!QChar::requiresSurrogates(key)) { | - | ||||||||||||||||||||||||||||||
645 | p = QChar(ushort(key)).toUpper(); | - | ||||||||||||||||||||||||||||||
646 | } else { | - | ||||||||||||||||||||||||||||||
647 | p += QChar(QChar::highSurrogate(key)); | - | ||||||||||||||||||||||||||||||
648 | p += QChar(QChar::lowSurrogate(key)); | - | ||||||||||||||||||||||||||||||
649 | } | - | ||||||||||||||||||||||||||||||
650 | } else if (key >= Qt::Key_F1 && key <= Qt::Key_F35) { | - | ||||||||||||||||||||||||||||||
651 | p = nativeText ? QCoreApplication::translate("QShortcut", "F%1").arg(key - Qt::Key_F1 + 1) | - | ||||||||||||||||||||||||||||||
652 | : QString::fromLatin1("F%1").arg(key - Qt::Key_F1 + 1); | - | ||||||||||||||||||||||||||||||
653 | } else if (key) { | - | ||||||||||||||||||||||||||||||
654 | int i=0; | - | ||||||||||||||||||||||||||||||
655 | { | - | ||||||||||||||||||||||||||||||
656 | - | |||||||||||||||||||||||||||||||
657 | - | |||||||||||||||||||||||||||||||
658 | - | |||||||||||||||||||||||||||||||
659 | while (i < numKeyNames) { | - | ||||||||||||||||||||||||||||||
660 | if (key == keyname[i].key) { | - | ||||||||||||||||||||||||||||||
661 | p = nativeText ? QCoreApplication::translate("QShortcut", keyname[i].name) | - | ||||||||||||||||||||||||||||||
662 | : QString::fromLatin1(keyname[i].name); | - | ||||||||||||||||||||||||||||||
663 | break; | - | ||||||||||||||||||||||||||||||
664 | } | - | ||||||||||||||||||||||||||||||
665 | ++i; | - | ||||||||||||||||||||||||||||||
666 | } | - | ||||||||||||||||||||||||||||||
667 | - | |||||||||||||||||||||||||||||||
668 | - | |||||||||||||||||||||||||||||||
669 | - | |||||||||||||||||||||||||||||||
670 | - | |||||||||||||||||||||||||||||||
671 | if (i >= numKeyNames) { | - | ||||||||||||||||||||||||||||||
672 | if (!QChar::requiresSurrogates(key)) { | - | ||||||||||||||||||||||||||||||
673 | p = QChar(ushort(key)).toUpper(); | - | ||||||||||||||||||||||||||||||
674 | } else { | - | ||||||||||||||||||||||||||||||
675 | p += QChar(QChar::highSurrogate(key)); | - | ||||||||||||||||||||||||||||||
676 | p += QChar(QChar::lowSurrogate(key)); | - | ||||||||||||||||||||||||||||||
677 | } | - | ||||||||||||||||||||||||||||||
678 | } | - | ||||||||||||||||||||||||||||||
679 | } | - | ||||||||||||||||||||||||||||||
680 | } | - | ||||||||||||||||||||||||||||||
681 | return p; | - | ||||||||||||||||||||||||||||||
682 | } | - | ||||||||||||||||||||||||||||||
683 | - | |||||||||||||||||||||||||||||||
684 | - | |||||||||||||||||||||||||||||||
685 | - | |||||||||||||||||||||||||||||||
686 | - | |||||||||||||||||||||||||||||||
687 | - | |||||||||||||||||||||||||||||||
688 | - | |||||||||||||||||||||||||||||||
689 | QKeySequence::SequenceMatch QKeySequence::matches(const QKeySequence &seq) const | - | ||||||||||||||||||||||||||||||
690 | { | - | ||||||||||||||||||||||||||||||
691 | uint userN = count(), | - | ||||||||||||||||||||||||||||||
692 | seqN = seq.count(); | - | ||||||||||||||||||||||||||||||
693 | - | |||||||||||||||||||||||||||||||
694 | if (userN > seqN) | - | ||||||||||||||||||||||||||||||
695 | return NoMatch; | - | ||||||||||||||||||||||||||||||
696 | - | |||||||||||||||||||||||||||||||
697 | - | |||||||||||||||||||||||||||||||
698 | - | |||||||||||||||||||||||||||||||
699 | SequenceMatch match = (userN == seqN ? ExactMatch : PartialMatch); | - | ||||||||||||||||||||||||||||||
700 | - | |||||||||||||||||||||||||||||||
701 | for (uint i = 0; i < userN; ++i) { | - | ||||||||||||||||||||||||||||||
702 | int userKey = (*this)[i], | - | ||||||||||||||||||||||||||||||
703 | sequenceKey = seq[i]; | - | ||||||||||||||||||||||||||||||
704 | if (userKey != sequenceKey) | - | ||||||||||||||||||||||||||||||
705 | return NoMatch; | - | ||||||||||||||||||||||||||||||
706 | } | - | ||||||||||||||||||||||||||||||
707 | return match; | - | ||||||||||||||||||||||||||||||
708 | } | - | ||||||||||||||||||||||||||||||
709 | QKeySequence::operator QVariant() const | - | ||||||||||||||||||||||||||||||
710 | { | - | ||||||||||||||||||||||||||||||
711 | return QVariant(QVariant::KeySequence, this); | - | ||||||||||||||||||||||||||||||
712 | } | - | ||||||||||||||||||||||||||||||
713 | int QKeySequence::operator[](uint index) const | - | ||||||||||||||||||||||||||||||
714 | { | - | ||||||||||||||||||||||||||||||
715 | ((!(index < QKeySequencePrivate::MaxKeyCount)) ? qt_assert_x("QKeySequence::operator[]", "index out of range",__FILE__,13981405) : qt_noop()); | - | ||||||||||||||||||||||||||||||
716 | return d->key[index]; | - | ||||||||||||||||||||||||||||||
717 | } | - | ||||||||||||||||||||||||||||||
718 | - | |||||||||||||||||||||||||||||||
719 | - | |||||||||||||||||||||||||||||||
720 | - | |||||||||||||||||||||||||||||||
721 | - | |||||||||||||||||||||||||||||||
722 | - | |||||||||||||||||||||||||||||||
723 | - | |||||||||||||||||||||||||||||||
724 | QKeySequence &QKeySequence::operator=(const QKeySequence &other) | - | ||||||||||||||||||||||||||||||
725 | { | - | ||||||||||||||||||||||||||||||
726 | qAtomicAssign(d, other.d); | - | ||||||||||||||||||||||||||||||
727 | return *this; | - | ||||||||||||||||||||||||||||||
728 | } | - | ||||||||||||||||||||||||||||||
729 | bool QKeySequence::operator==(const QKeySequence &other) const | - | ||||||||||||||||||||||||||||||
730 | { | - | ||||||||||||||||||||||||||||||
731 | return (d->key[0] == other.d->key[0] && | - | ||||||||||||||||||||||||||||||
732 | d->key[1] == other.d->key[1] && | - | ||||||||||||||||||||||||||||||
733 | d->key[2] == other.d->key[2] && | - | ||||||||||||||||||||||||||||||
734 | d->key[3] == other.d->key[3]); | - | ||||||||||||||||||||||||||||||
735 | } | - | ||||||||||||||||||||||||||||||
736 | - | |||||||||||||||||||||||||||||||
737 | - | |||||||||||||||||||||||||||||||
738 | - | |||||||||||||||||||||||||||||||
739 | - | |||||||||||||||||||||||||||||||
740 | - | |||||||||||||||||||||||||||||||
741 | - | |||||||||||||||||||||||||||||||
742 | - | |||||||||||||||||||||||||||||||
743 | uint qHash(const QKeySequence &key, uint seed) noexcept | - | ||||||||||||||||||||||||||||||
744 | { | - | ||||||||||||||||||||||||||||||
745 | return never executed: qHashRange(key.d->key, key.d->key + QKeySequencePrivate::MaxKeyCount, seed);return qHashRange(key.d->key, key.d->key + QKeySequencePrivate::MaxKeyCount, seed); never executed: return qHashRange(key.d->key, key.d->key + QKeySequencePrivate::MaxKeyCount, seed); | 0 | ||||||||||||||||||||||||||||||
746 | } | - | ||||||||||||||||||||||||||||||
747 | bool QKeySequence::operator< (const QKeySequence &other) const | - | ||||||||||||||||||||||||||||||
748 | { | - | ||||||||||||||||||||||||||||||
749 | return std::lexicographical_compare(d->key, d->key + QKeySequencePrivate::MaxKeyCount, | - | ||||||||||||||||||||||||||||||
750 | other.d->key, other.d->key + QKeySequencePrivate::MaxKeyCount); | - | ||||||||||||||||||||||||||||||
751 | } | - | ||||||||||||||||||||||||||||||
752 | bool QKeySequence::isDetached() const | - | ||||||||||||||||||||||||||||||
753 | { | - | ||||||||||||||||||||||||||||||
754 | return d->ref.load() == 1; | - | ||||||||||||||||||||||||||||||
755 | } | - | ||||||||||||||||||||||||||||||
756 | QString QKeySequence::toString(SequenceFormat format) const | - | ||||||||||||||||||||||||||||||
757 | { | - | ||||||||||||||||||||||||||||||
758 | QString finalString; | - | ||||||||||||||||||||||||||||||
759 | - | |||||||||||||||||||||||||||||||
760 | - | |||||||||||||||||||||||||||||||
761 | int end = count(); | - | ||||||||||||||||||||||||||||||
762 | for (int i = 0; i < end; ++i) { | - | ||||||||||||||||||||||||||||||
763 | finalString += d->encodeString(d->key[i], format); | - | ||||||||||||||||||||||||||||||
764 | finalString += QLatin1String(", "); | - | ||||||||||||||||||||||||||||||
765 | } | - | ||||||||||||||||||||||||||||||
766 | finalString.truncate(finalString.length() - 2); | - | ||||||||||||||||||||||||||||||
767 | return finalString; | - | ||||||||||||||||||||||||||||||
768 | } | - | ||||||||||||||||||||||||||||||
769 | QKeySequence QKeySequence::fromString(const QString &str, SequenceFormat format) | - | ||||||||||||||||||||||||||||||
770 | { | - | ||||||||||||||||||||||||||||||
771 | return QKeySequence(str, format); | - | ||||||||||||||||||||||||||||||
772 | } | - | ||||||||||||||||||||||||||||||
773 | QList<QKeySequence> QKeySequence::listFromString(const QString &str, SequenceFormat format) | - | ||||||||||||||||||||||||||||||
774 | { | - | ||||||||||||||||||||||||||||||
775 | QList<QKeySequence> result; | - | ||||||||||||||||||||||||||||||
776 | - | |||||||||||||||||||||||||||||||
777 | const QStringList strings = str.split(QLatin1String("; ")); | - | ||||||||||||||||||||||||||||||
778 | result.reserve(strings.count()); | - | ||||||||||||||||||||||||||||||
779 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(strings)>::type> _container_((strings)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1)for (const QString &string = *_container_.i; _container_.control; _container_.control = 0: strings) { | - | ||||||||||||||||||||||||||||||
780 | result << fromString(string, format); | - | ||||||||||||||||||||||||||||||
781 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
782 | - | |||||||||||||||||||||||||||||||
783 | return never executed: result;return result; never executed: return result; | 0 | ||||||||||||||||||||||||||||||
784 | } | - | ||||||||||||||||||||||||||||||
785 | QString QKeySequence::listToString(const QList<QKeySequence> &list, SequenceFormat format) | - | ||||||||||||||||||||||||||||||
786 | { | - | ||||||||||||||||||||||||||||||
787 | QString result; | - | ||||||||||||||||||||||||||||||
for (QForeachContainer<typename QtPrivate::remove_reference<decltype(list)>::type> _container_((list)); _container_.control && _container_.i != _container_.e; | ||||||||||||||||||||||||||||||||
788 | - | |||||||||||||||||||||||||||||||
789 | ++_container_.i, _container_.control ^= 1)for (const QKeySequence &sequence = *_container_.i; _container_.control; _container_.control = 0: list) { | - | ||||||||||||||||||||||||||||||
790 | result += sequence.toString(format); | - | ||||||||||||||||||||||||||||||
791 | result += QLatin1String("; "); | - | ||||||||||||||||||||||||||||||
792 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
793 | result.truncate(result.length() - 2); | - | ||||||||||||||||||||||||||||||
794 | - | |||||||||||||||||||||||||||||||
795 | return never executed: result;return result; never executed: return result; | 0 | ||||||||||||||||||||||||||||||
796 | } | - | ||||||||||||||||||||||||||||||
797 | QDataStream &operator<<(QDataStream &s, const QKeySequence &keysequence) | - | ||||||||||||||||||||||||||||||
798 | { | - | ||||||||||||||||||||||||||||||
799 | static_assert(bool(QKeySequencePrivate::MaxKeyCount == 4), "Forgot to adapt QDataStream &operator<<(QDataStream &s, const QKeySequence &keysequence) to new QKeySequence::MaxKeyCount"); | - | ||||||||||||||||||||||||||||||
800 | const bool extended = s.version() >= 5 && keysequence.count() > 1; | - | ||||||||||||||||||||||||||||||
801 | s << quint32(extended ? 4 : 1) << quint32(keysequence.d->key[0]); | - | ||||||||||||||||||||||||||||||
802 | if (extended) { | - | ||||||||||||||||||||||||||||||
803 | s << quint32(keysequence.d->key[1]) | - | ||||||||||||||||||||||||||||||
804 | << quint32(keysequence.d->key[2]) | - | ||||||||||||||||||||||||||||||
805 | << quint32(keysequence.d->key[3]); | - | ||||||||||||||||||||||||||||||
806 | } | - | ||||||||||||||||||||||||||||||
807 | return s; | - | ||||||||||||||||||||||||||||||
808 | } | - | ||||||||||||||||||||||||||||||
809 | QDataStream &operator>>(QDataStream &s, QKeySequence &keysequence) | - | ||||||||||||||||||||||||||||||
810 | { | - | ||||||||||||||||||||||||||||||
811 | const quint32 MaxKeys = QKeySequencePrivate::MaxKeyCount; | - | ||||||||||||||||||||||||||||||
812 | quint32 c; | - | ||||||||||||||||||||||||||||||
813 | s >> c; | - | ||||||||||||||||||||||||||||||
814 | quint32 keys[MaxKeys] = {0}; | - | ||||||||||||||||||||||||||||||
815 | for (uint i = 0; i < qMin(c, MaxKeys); ++i) { | - | ||||||||||||||||||||||||||||||
816 | if (s.atEnd()) { | - | ||||||||||||||||||||||||||||||
817 | QMessageLogger(__FILE__, 16361643, __PRETTY_FUNCTION__).warning("Premature EOF while reading QKeySequence"); | - | ||||||||||||||||||||||||||||||
818 | return s; | - | ||||||||||||||||||||||||||||||
819 | } | - | ||||||||||||||||||||||||||||||
820 | s >> keys[i]; | - | ||||||||||||||||||||||||||||||
821 | } | - | ||||||||||||||||||||||||||||||
822 | qAtomicDetach(keysequence.d); | - | ||||||||||||||||||||||||||||||
823 | std::copy(keys, keys + MaxKeys, (keysequence.d->key)); | - | ||||||||||||||||||||||||||||||
824 | return s; | - | ||||||||||||||||||||||||||||||
825 | } | - | ||||||||||||||||||||||||||||||
826 | - | |||||||||||||||||||||||||||||||
827 | - | |||||||||||||||||||||||||||||||
828 | - | |||||||||||||||||||||||||||||||
829 | - | |||||||||||||||||||||||||||||||
830 | QDebug operator<<(QDebug dbg, const QKeySequence &p) | - | ||||||||||||||||||||||||||||||
831 | { | - | ||||||||||||||||||||||||||||||
832 | QDebugStateSaver saver(dbg); | - | ||||||||||||||||||||||||||||||
833 | dbg.nospace() << "QKeySequence(" << p.toString() << ')'; | - | ||||||||||||||||||||||||||||||
834 | return dbg; | - | ||||||||||||||||||||||||||||||
835 | } | - | ||||||||||||||||||||||||||||||
836 | - | |||||||||||||||||||||||||||||||
Switch to Source code | Preprocessed file |