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; } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
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
| 0 | ||||||||||||||||||||||||||||||||||||||||||
302 | d = bindings.first().d; | - | ||||||||||||||||||||||||||||||||||||||||||
303 | d->ref.ref(); | - | ||||||||||||||||||||||||||||||||||||||||||
304 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
305 | else | - | ||||||||||||||||||||||||||||||||||||||||||
306 | d = new QKeySequencePrivate(); never executed: d = new QKeySequencePrivate(); | 0 | ||||||||||||||||||||||||||||||||||||||||||
307 | } | - | ||||||||||||||||||||||||||||||||||||||||||
308 | - | |||||||||||||||||||||||||||||||||||||||||||
309 | - | |||||||||||||||||||||||||||||||||||||||||||
310 | - | |||||||||||||||||||||||||||||||||||||||||||
311 | - | |||||||||||||||||||||||||||||||||||||||||||
312 | - | |||||||||||||||||||||||||||||||||||||||||||
313 | QKeySequence::QKeySequence() | - | ||||||||||||||||||||||||||||||||||||||||||
314 | { | - | ||||||||||||||||||||||||||||||||||||||||||
315 | static QKeySequencePrivate shared_empty; | - | ||||||||||||||||||||||||||||||||||||||||||
316 | d = &shared_empty; | - | ||||||||||||||||||||||||||||||||||||||||||
317 | d->ref.ref(); | - | ||||||||||||||||||||||||||||||||||||||||||
318 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
319 | QKeySequence::QKeySequence(const QString &key, QKeySequence::SequenceFormat format) | - | ||||||||||||||||||||||||||||||||||||||||||
320 | { | - | ||||||||||||||||||||||||||||||||||||||||||
321 | d = new QKeySequencePrivate(); | - | ||||||||||||||||||||||||||||||||||||||||||
322 | assign(key, format); | - | ||||||||||||||||||||||||||||||||||||||||||
323 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
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 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
334 | - | |||||||||||||||||||||||||||||||||||||||||||
335 | - | |||||||||||||||||||||||||||||||||||||||||||
336 | - | |||||||||||||||||||||||||||||||||||||||||||
337 | - | |||||||||||||||||||||||||||||||||||||||||||
338 | QKeySequence::QKeySequence(const QKeySequence& keysequence) | - | ||||||||||||||||||||||||||||||||||||||||||
339 | : d(keysequence.d) | - | ||||||||||||||||||||||||||||||||||||||||||
340 | { | - | ||||||||||||||||||||||||||||||||||||||||||
341 | d->ref.ref(); | - | ||||||||||||||||||||||||||||||||||||||||||
342 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
343 | QList<QKeySequence> QKeySequence::keyBindings(StandardKey key) | - | ||||||||||||||||||||||||||||||||||||||||||
344 | { | - | ||||||||||||||||||||||||||||||||||||||||||
345 | return never executed: QGuiApplicationPrivate::platformTheme()->keyBindings(key);return QGuiApplicationPrivate::platformTheme()->keyBindings(key); never executed: return QGuiApplicationPrivate::platformTheme()->keyBindings(key); | 0 | ||||||||||||||||||||||||||||||||||||||||||
346 | } | - | ||||||||||||||||||||||||||||||||||||||||||
347 | - | |||||||||||||||||||||||||||||||||||||||||||
348 | - | |||||||||||||||||||||||||||||||||||||||||||
349 | - | |||||||||||||||||||||||||||||||||||||||||||
350 | - | |||||||||||||||||||||||||||||||||||||||||||
351 | QKeySequence::~QKeySequence() | - | ||||||||||||||||||||||||||||||||||||||||||
352 | { | - | ||||||||||||||||||||||||||||||||||||||||||
353 | if (!d->ref.deref()
| 0 | ||||||||||||||||||||||||||||||||||||||||||
354 | delete d; never executed: delete d; | 0 | ||||||||||||||||||||||||||||||||||||||||||
355 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
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__,900) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||||||||
359 | qAtomicDetach(d); | - | ||||||||||||||||||||||||||||||||||||||||||
360 | d->key[index] = key; | - | ||||||||||||||||||||||||||||||||||||||||||
361 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
362 | - | |||||||||||||||||||||||||||||||||||||||||||
363 | static_assert(bool(QKeySequencePrivate::MaxKeyCount == 4), "Change docs below"); | - | ||||||||||||||||||||||||||||||||||||||||||
364 | - | |||||||||||||||||||||||||||||||||||||||||||
365 | - | |||||||||||||||||||||||||||||||||||||||||||
366 | - | |||||||||||||||||||||||||||||||||||||||||||
367 | - | |||||||||||||||||||||||||||||||||||||||||||
368 | int QKeySequence::count() const | - | ||||||||||||||||||||||||||||||||||||||||||
369 | { | - | ||||||||||||||||||||||||||||||||||||||||||
370 | return never executed: int(std::distance(d->key, std::find(d->key, d->key + QKeySequencePrivate::MaxKeyCount, 0)));return int(std::distance(d->key, std::find(d->key, d->key + QKeySequencePrivate::MaxKeyCount, 0))); never executed: return int(std::distance(d->key, std::find(d->key, d->key + QKeySequencePrivate::MaxKeyCount, 0))); | 0 | ||||||||||||||||||||||||||||||||||||||||||
371 | } | - | ||||||||||||||||||||||||||||||||||||||||||
372 | - | |||||||||||||||||||||||||||||||||||||||||||
373 | - | |||||||||||||||||||||||||||||||||||||||||||
374 | - | |||||||||||||||||||||||||||||||||||||||||||
375 | - | |||||||||||||||||||||||||||||||||||||||||||
376 | - | |||||||||||||||||||||||||||||||||||||||||||
377 | - | |||||||||||||||||||||||||||||||||||||||||||
378 | bool QKeySequence::isEmpty() const | - | ||||||||||||||||||||||||||||||||||||||||||
379 | { | - | ||||||||||||||||||||||||||||||||||||||||||
380 | return never executed: !d->key[0];return !d->key[0]; never executed: return !d->key[0]; | 0 | ||||||||||||||||||||||||||||||||||||||||||
381 | } | - | ||||||||||||||||||||||||||||||||||||||||||
382 | QKeySequence QKeySequence::mnemonic(const QString &text) | - | ||||||||||||||||||||||||||||||||||||||||||
383 | { | - | ||||||||||||||||||||||||||||||||||||||||||
384 | QKeySequence ret; | - | ||||||||||||||||||||||||||||||||||||||||||
385 | - | |||||||||||||||||||||||||||||||||||||||||||
386 | if(qt_sequence_no_mnemonics
| 0 | ||||||||||||||||||||||||||||||||||||||||||
387 | return never executed: ret;return ret; never executed: return ret; | 0 | ||||||||||||||||||||||||||||||||||||||||||
388 | - | |||||||||||||||||||||||||||||||||||||||||||
389 | bool found = false; | - | ||||||||||||||||||||||||||||||||||||||||||
390 | int p = 0; | - | ||||||||||||||||||||||||||||||||||||||||||
391 | while (p >= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||
392 | p = text.indexOf(QLatin1Char('&'), p) + 1; | - | ||||||||||||||||||||||||||||||||||||||||||
393 | if (p <= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||
394 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||
395 | if (text.at(p) != QLatin1Char('&')
| 0 | ||||||||||||||||||||||||||||||||||||||||||
396 | QChar c = text.at(p); | - | ||||||||||||||||||||||||||||||||||||||||||
397 | if (c.isPrint()
| 0 | ||||||||||||||||||||||||||||||||||||||||||
398 | if (!found
| 0 | ||||||||||||||||||||||||||||||||||||||||||
399 | c = c.toUpper(); | - | ||||||||||||||||||||||||||||||||||||||||||
400 | ret = QKeySequence(c.unicode() + Qt::ALT); | - | ||||||||||||||||||||||||||||||||||||||||||
401 | - | |||||||||||||||||||||||||||||||||||||||||||
402 | - | |||||||||||||||||||||||||||||||||||||||||||
403 | - | |||||||||||||||||||||||||||||||||||||||||||
404 | found = true; | - | ||||||||||||||||||||||||||||||||||||||||||
405 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
406 | QMessageLogger(__FILE__, 963, __PRETTY_FUNCTION__).warning("QKeySequence::mnemonic: \"%s\" contains multiple occurrences of '&'", QString(text).toLocal8Bit().constData()); | - | ||||||||||||||||||||||||||||||||||||||||||
407 | - | |||||||||||||||||||||||||||||||||||||||||||
408 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
409 | } | - | ||||||||||||||||||||||||||||||||||||||||||
410 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
411 | p++; | - | ||||||||||||||||||||||||||||||||||||||||||
412 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
413 | return never executed: ret;return ret; never executed: return ret; | 0 | ||||||||||||||||||||||||||||||||||||||||||
414 | } | - | ||||||||||||||||||||||||||||||||||||||||||
415 | int QKeySequence::assign(const QString &ks) | - | ||||||||||||||||||||||||||||||||||||||||||
416 | { | - | ||||||||||||||||||||||||||||||||||||||||||
417 | return never executed: assign(ks, NativeText);return assign(ks, NativeText); never executed: return assign(ks, NativeText); | 0 | ||||||||||||||||||||||||||||||||||||||||||
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()
| 0 | ||||||||||||||||||||||||||||||||||||||||||
429 | - | |||||||||||||||||||||||||||||||||||||||||||
430 | - | |||||||||||||||||||||||||||||||||||||||||||
431 | - | |||||||||||||||||||||||||||||||||||||||||||
432 | p = keyseq.indexOf(QLatin1Char(',')); | - | ||||||||||||||||||||||||||||||||||||||||||
433 | if (-
| 0 | ||||||||||||||||||||||||||||||||||||||||||
434 | if (p == keyseq.count() - 1
| 0 | ||||||||||||||||||||||||||||||||||||||||||
435 | p = -1; | - | ||||||||||||||||||||||||||||||||||||||||||
436 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
437 | if (QLatin1Char(',') == keyseq.at(p+1)
| 0 | ||||||||||||||||||||||||||||||||||||||||||
438 | p++; never executed: p++; | 0 | ||||||||||||||||||||||||||||||||||||||||||
439 | if (QLatin1Char(' ') == keyseq.at(p+1)
| 0 | ||||||||||||||||||||||||||||||||||||||||||
440 | diff = 1; | - | ||||||||||||||||||||||||||||||||||||||||||
441 | p++; | - | ||||||||||||||||||||||||||||||||||||||||||
442 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
443 | diff = 0; | - | ||||||||||||||||||||||||||||||||||||||||||
444 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
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 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
452 | return never executed: n;return n; never executed: return n; | 0 | ||||||||||||||||||||||||||||||||||||||||||
453 | } | - | ||||||||||||||||||||||||||||||||||||||||||
454 | - | |||||||||||||||||||||||||||||||||||||||||||
455 | struct QModifKeyName { | - | ||||||||||||||||||||||||||||||||||||||||||
456 | QModifKeyName() { } | - | ||||||||||||||||||||||||||||||||||||||||||
457 | QModifKeyName(int q, QChar n) : qt_key(q), name(n) { } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
458 | QModifKeyName(int q, const QString &n) : qt_key(q), name(n) { } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
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
never executed: }guard.store(QtGlobalStatic::Destroyed); never executed: }; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; returnend of block never executed: &holder.value;return &holder.value; never executed: } } } static QGlobalStatic<QVector<QModifKeyName>, Q_QGS_globalModifs::innerFunction, Q_QGS_globalModifs::guard> globalModifs;return &holder.value; | 0 | ||||||||||||||||||||||||||||||||||||||||||
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
never executed: }guard.store(QtGlobalStatic::Destroyed); never executed: }; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; returnend of block never executed: &holder.value;return &holder.value; never executed: } } } static QGlobalStatic<QVector<QModifKeyName>, Q_QGS_globalPortableModifs::innerFunction, Q_QGS_globalPortableModifs::guard> globalPortableModifs;return &holder.value; | 0 | ||||||||||||||||||||||||||||||||||||||||||
466 | - | |||||||||||||||||||||||||||||||||||||||||||
467 | - | |||||||||||||||||||||||||||||||||||||||||||
468 | - | |||||||||||||||||||||||||||||||||||||||||||
469 | - | |||||||||||||||||||||||||||||||||||||||||||
470 | int QKeySequence::decodeString(const QString &str) | - | ||||||||||||||||||||||||||||||||||||||||||
471 | { | - | ||||||||||||||||||||||||||||||||||||||||||
472 | return never executed: QKeySequencePrivate::decodeString(str, NativeText);return QKeySequencePrivate::decodeString(str, NativeText); never executed: return QKeySequencePrivate::decodeString(str, NativeText); | 0 | ||||||||||||||||||||||||||||||||||||||||||
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 | if(p > 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||
543 | accel = accel.mid(p + 1); never executed: accel = accel.mid(p + 1); | 0 | ||||||||||||||||||||||||||||||||||||||||||
544 | - | |||||||||||||||||||||||||||||||||||||||||||
545 | int fnum = 0; | - | ||||||||||||||||||||||||||||||||||||||||||
546 | if (accel.length() == 1
| 0 | ||||||||||||||||||||||||||||||||||||||||||
547 | - | |||||||||||||||||||||||||||||||||||||||||||
548 | - | |||||||||||||||||||||||||||||||||||||||||||
549 | - | |||||||||||||||||||||||||||||||||||||||||||
550 | - | |||||||||||||||||||||||||||||||||||||||||||
551 | - | |||||||||||||||||||||||||||||||||||||||||||
552 | - | |||||||||||||||||||||||||||||||||||||||||||
553 | { | - | ||||||||||||||||||||||||||||||||||||||||||
554 | ret |= accel[0].toUpper().unicode(); | - | ||||||||||||||||||||||||||||||||||||||||||
555 | } | - | ||||||||||||||||||||||||||||||||||||||||||
556 | } never executed: else if (accel[0] == QLatin1Char('f')end of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||
557 | ret |= Qt::Key_F1 + fnum - 1; | - | ||||||||||||||||||||||||||||||||||||||||||
558 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
559 | - | |||||||||||||||||||||||||||||||||||||||||||
560 | - | |||||||||||||||||||||||||||||||||||||||||||
561 | - | |||||||||||||||||||||||||||||||||||||||||||
562 | bool found = false; | - | ||||||||||||||||||||||||||||||||||||||||||
563 | for (int tran = 0; tran < 2
| 0 | ||||||||||||||||||||||||||||||||||||||||||
564 | if (!nativeText
| 0 | ||||||||||||||||||||||||||||||||||||||||||
565 | ++ never executed: tran;++tran; never executed: ++tran; | 0 | ||||||||||||||||||||||||||||||||||||||||||
566 | for (int i = 0; i < numKeyNames
| 0 | ||||||||||||||||||||||||||||||||||||||||||
567 | QString keyName(tran == 0 | - | ||||||||||||||||||||||||||||||||||||||||||
568 | ? QCoreApplication::translate("QShortcut", keyname[i].name) | - | ||||||||||||||||||||||||||||||||||||||||||
569 | : QString::fromLatin1(keyname[i].name)); | - | ||||||||||||||||||||||||||||||||||||||||||
570 | if (accel == keyName.toLower()
| 0 | ||||||||||||||||||||||||||||||||||||||||||
571 | ret |= keyname[i].key; | - | ||||||||||||||||||||||||||||||||||||||||||
572 | found = true; | - | ||||||||||||||||||||||||||||||||||||||||||
573 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||
574 | } | - | ||||||||||||||||||||||||||||||||||||||||||
575 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
576 | if (found
| 0 | ||||||||||||||||||||||||||||||||||||||||||
577 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||
578 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
579 | - | |||||||||||||||||||||||||||||||||||||||||||
580 | if (!found
| 0 | ||||||||||||||||||||||||||||||||||||||||||
581 | return never executed: Qt::Key_unknown;return Qt::Key_unknown; never executed: return Qt::Key_unknown; | 0 | ||||||||||||||||||||||||||||||||||||||||||
582 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
583 | return never executed: ret;return ret; never executed: return ret; | 0 | ||||||||||||||||||||||||||||||||||||||||||
584 | } | - | ||||||||||||||||||||||||||||||||||||||||||
585 | - | |||||||||||||||||||||||||||||||||||||||||||
586 | - | |||||||||||||||||||||||||||||||||||||||||||
587 | - | |||||||||||||||||||||||||||||||||||||||||||
588 | - | |||||||||||||||||||||||||||||||||||||||||||
589 | - | |||||||||||||||||||||||||||||||||||||||||||
590 | - | |||||||||||||||||||||||||||||||||||||||||||
591 | QString QKeySequence::encodeString(int key) | - | ||||||||||||||||||||||||||||||||||||||||||
592 | { | - | ||||||||||||||||||||||||||||||||||||||||||
593 | return never executed: QKeySequencePrivate::encodeString(key, NativeText);return QKeySequencePrivate::encodeString(key, NativeText); never executed: return QKeySequencePrivate::encodeString(key, NativeText); | 0 | ||||||||||||||||||||||||||||||||||||||||||
594 | } | - | ||||||||||||||||||||||||||||||||||||||||||
595 | - | |||||||||||||||||||||||||||||||||||||||||||
596 | static inline void addKey(QString &str, const QString &theKey, QKeySequence::SequenceFormat format) | - | ||||||||||||||||||||||||||||||||||||||||||
597 | { | - | ||||||||||||||||||||||||||||||||||||||||||
598 | if (!str.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||||||||
599 | str += (
never executed: str += (format == QKeySequence::NativeText) ? QCoreApplication::translate("QShortcut", "+") : QString::fromLatin1("+"); | 0 | ||||||||||||||||||||||||||||||||||||||||||
600 | : QString::fromLatin1("+"); never executed: str += (format == QKeySequence::NativeText) ? QCoreApplication::translate("QShortcut", "+") : QString::fromLatin1("+"); | 0 | ||||||||||||||||||||||||||||||||||||||||||
601 | str += theKey; | - | ||||||||||||||||||||||||||||||||||||||||||
602 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
603 | - | |||||||||||||||||||||||||||||||||||||||||||
604 | QString QKeySequencePrivate::encodeString(int key, QKeySequence::SequenceFormat format) | - | ||||||||||||||||||||||||||||||||||||||||||
605 | { | - | ||||||||||||||||||||||||||||||||||||||||||
606 | bool nativeText = (format == QKeySequence::NativeText); | - | ||||||||||||||||||||||||||||||||||||||||||
607 | QString s; | - | ||||||||||||||||||||||||||||||||||||||||||
608 | - | |||||||||||||||||||||||||||||||||||||||||||
609 | - | |||||||||||||||||||||||||||||||||||||||||||
610 | if (key == -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||
611 | return never executed: s;return s; never executed: return s; | 0 | ||||||||||||||||||||||||||||||||||||||||||
612 | { | - | ||||||||||||||||||||||||||||||||||||||||||
613 | - | |||||||||||||||||||||||||||||||||||||||||||
614 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||||||||
615 | s = nativeText
never executed: s = nativeText ? QCoreApplication::translate("QShortcut", "Meta") : QString::fromLatin1("Meta"); | 0 | ||||||||||||||||||||||||||||||||||||||||||
616 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||||||||
617 | addKey(s, nativeText ? QCoreApplication::translate("QShortcut", "Ctrl") : QString::fromLatin1("Ctrl"), format); never executed: addKey(s, nativeText ? QCoreApplication::translate("QShortcut", "Ctrl") : QString::fromLatin1("Ctrl"), format); | 0 | ||||||||||||||||||||||||||||||||||||||||||
618 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||||||||
619 | addKey(s, nativeText ? QCoreApplication::translate("QShortcut", "Alt") : QString::fromLatin1("Alt"), format); never executed: addKey(s, nativeText ? QCoreApplication::translate("QShortcut", "Alt") : QString::fromLatin1("Alt"), format); | 0 | ||||||||||||||||||||||||||||||||||||||||||
620 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||||||||
621 | addKey(s, nativeText ? QCoreApplication::translate("QShortcut", "Shift") : QString::fromLatin1("Shift"), format); never executed: addKey(s, nativeText ? QCoreApplication::translate("QShortcut", "Shift") : QString::fromLatin1("Shift"), format); | 0 | ||||||||||||||||||||||||||||||||||||||||||
622 | } | - | ||||||||||||||||||||||||||||||||||||||||||
623 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||||||||
624 | addKey(s, nativeText ? QCoreApplication::translate("QShortcut", "Num") : QString::fromLatin1("Num"), format); never executed: addKey(s, nativeText ? QCoreApplication::translate("QShortcut", "Num") : QString::fromLatin1("Num"), format); | 0 | ||||||||||||||||||||||||||||||||||||||||||
625 | - | |||||||||||||||||||||||||||||||||||||||||||
626 | QString p = keyName(key, format); | - | ||||||||||||||||||||||||||||||||||||||||||
627 | - | |||||||||||||||||||||||||||||||||||||||||||
628 | - | |||||||||||||||||||||||||||||||||||||||||||
629 | - | |||||||||||||||||||||||||||||||||||||||||||
630 | - | |||||||||||||||||||||||||||||||||||||||||||
631 | - | |||||||||||||||||||||||||||||||||||||||||||
632 | - | |||||||||||||||||||||||||||||||||||||||||||
633 | addKey(s, p, format); | - | ||||||||||||||||||||||||||||||||||||||||||
634 | return never executed: s;return s; never executed: return s; | 0 | ||||||||||||||||||||||||||||||||||||||||||
635 | } | - | ||||||||||||||||||||||||||||||||||||||||||
636 | QString QKeySequencePrivate::keyName(int key, QKeySequence::SequenceFormat format) | - | ||||||||||||||||||||||||||||||||||||||||||
637 | { | - | ||||||||||||||||||||||||||||||||||||||||||
638 | bool nativeText = (format == QKeySequence::NativeText); | - | ||||||||||||||||||||||||||||||||||||||||||
639 | key &= ~(Qt::ShiftModifier | Qt::ControlModifier | Qt::AltModifier | Qt::MetaModifier | Qt::KeypadModifier); | - | ||||||||||||||||||||||||||||||||||||||||||
640 | QString p; | - | ||||||||||||||||||||||||||||||||||||||||||
641 | - | |||||||||||||||||||||||||||||||||||||||||||
642 | if (key
| 0 | ||||||||||||||||||||||||||||||||||||||||||
643 | if (!QChar::requiresSurrogates(key)
| 0 | ||||||||||||||||||||||||||||||||||||||||||
644 | p = QChar(ushort(key)).toUpper(); | - | ||||||||||||||||||||||||||||||||||||||||||
645 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
646 | p += QChar(QChar::highSurrogate(key)); | - | ||||||||||||||||||||||||||||||||||||||||||
647 | p += QChar(QChar::lowSurrogate(key)); | - | ||||||||||||||||||||||||||||||||||||||||||
648 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
649 | } else if (key >= Qt::Key_F1
| 0 | ||||||||||||||||||||||||||||||||||||||||||
650 | p = nativeText
| 0 | ||||||||||||||||||||||||||||||||||||||||||
651 | : QString::fromLatin1("F%1").arg(key - Qt::Key_F1 + 1); | - | ||||||||||||||||||||||||||||||||||||||||||
652 | } never executed: else if (keyend of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||
653 | int i=0; | - | ||||||||||||||||||||||||||||||||||||||||||
654 | { | - | ||||||||||||||||||||||||||||||||||||||||||
655 | - | |||||||||||||||||||||||||||||||||||||||||||
656 | - | |||||||||||||||||||||||||||||||||||||||||||
657 | - | |||||||||||||||||||||||||||||||||||||||||||
658 | while (i < numKeyNames
| 0 | ||||||||||||||||||||||||||||||||||||||||||
659 | if (key == keyname[i].key
| 0 | ||||||||||||||||||||||||||||||||||||||||||
660 | p = nativeText
| 0 | ||||||||||||||||||||||||||||||||||||||||||
661 | : QString::fromLatin1(keyname[i].name); | - | ||||||||||||||||||||||||||||||||||||||||||
662 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||
663 | } | - | ||||||||||||||||||||||||||||||||||||||||||
664 | ++i; | - | ||||||||||||||||||||||||||||||||||||||||||
665 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
666 | - | |||||||||||||||||||||||||||||||||||||||||||
667 | - | |||||||||||||||||||||||||||||||||||||||||||
668 | - | |||||||||||||||||||||||||||||||||||||||||||
669 | - | |||||||||||||||||||||||||||||||||||||||||||
670 | if (i >= numKeyNames
| 0 | ||||||||||||||||||||||||||||||||||||||||||
671 | if (!QChar::requiresSurrogates(key)
| 0 | ||||||||||||||||||||||||||||||||||||||||||
672 | p = QChar(ushort(key)).toUpper(); | - | ||||||||||||||||||||||||||||||||||||||||||
673 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
674 | p += QChar(QChar::highSurrogate(key)); | - | ||||||||||||||||||||||||||||||||||||||||||
675 | p += QChar(QChar::lowSurrogate(key)); | - | ||||||||||||||||||||||||||||||||||||||||||
676 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
677 | } | - | ||||||||||||||||||||||||||||||||||||||||||
678 | } | - | ||||||||||||||||||||||||||||||||||||||||||
679 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
680 | return never executed: p;return p; never executed: return p; | 0 | ||||||||||||||||||||||||||||||||||||||||||
681 | } | - | ||||||||||||||||||||||||||||||||||||||||||
682 | - | |||||||||||||||||||||||||||||||||||||||||||
683 | - | |||||||||||||||||||||||||||||||||||||||||||
684 | - | |||||||||||||||||||||||||||||||||||||||||||
685 | - | |||||||||||||||||||||||||||||||||||||||||||
686 | - | |||||||||||||||||||||||||||||||||||||||||||
687 | - | |||||||||||||||||||||||||||||||||||||||||||
688 | QKeySequence::SequenceMatch QKeySequence::matches(const QKeySequence &seq) const | - | ||||||||||||||||||||||||||||||||||||||||||
689 | { | - | ||||||||||||||||||||||||||||||||||||||||||
690 | uint userN = count(), | - | ||||||||||||||||||||||||||||||||||||||||||
691 | seqN = seq.count(); | - | ||||||||||||||||||||||||||||||||||||||||||
692 | - | |||||||||||||||||||||||||||||||||||||||||||
693 | if (userN > seqN
| 0 | ||||||||||||||||||||||||||||||||||||||||||
694 | return never executed: NoMatch;return NoMatch; never executed: return NoMatch; | 0 | ||||||||||||||||||||||||||||||||||||||||||
695 | - | |||||||||||||||||||||||||||||||||||||||||||
696 | - | |||||||||||||||||||||||||||||||||||||||||||
697 | - | |||||||||||||||||||||||||||||||||||||||||||
698 | SequenceMatch match = (userN == seqN
| 0 | ||||||||||||||||||||||||||||||||||||||||||
699 | - | |||||||||||||||||||||||||||||||||||||||||||
700 | for (uint i = 0; i < userN
| 0 | ||||||||||||||||||||||||||||||||||||||||||
701 | int userKey = (*this)[i], | - | ||||||||||||||||||||||||||||||||||||||||||
702 | sequenceKey = seq[i]; | - | ||||||||||||||||||||||||||||||||||||||||||
703 | if (userKey != sequenceKey
| 0 | ||||||||||||||||||||||||||||||||||||||||||
704 | return never executed: NoMatch;return NoMatch; never executed: return NoMatch; | 0 | ||||||||||||||||||||||||||||||||||||||||||
705 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
706 | return never executed: match;return match; never executed: return match; | 0 | ||||||||||||||||||||||||||||||||||||||||||
707 | } | - | ||||||||||||||||||||||||||||||||||||||||||
708 | QKeySequence::operator QVariant() const | - | ||||||||||||||||||||||||||||||||||||||||||
709 | { | - | ||||||||||||||||||||||||||||||||||||||||||
710 | return never executed: QVariant(QVariant::KeySequence, this);return QVariant(QVariant::KeySequence, this); never executed: return QVariant(QVariant::KeySequence, this); | 0 | ||||||||||||||||||||||||||||||||||||||||||
711 | } | - | ||||||||||||||||||||||||||||||||||||||||||
712 | int QKeySequence::operator[](uint index) const | - | ||||||||||||||||||||||||||||||||||||||||||
713 | { | - | ||||||||||||||||||||||||||||||||||||||||||
714 | ((!(index < QKeySequencePrivate::MaxKeyCount)) ? qt_assert_x("QKeySequence::operator[]", "index out of range",__FILE__,1398) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||||||||
715 | return never executed: d->key[index];return d->key[index]; never executed: return d->key[index]; | 0 | ||||||||||||||||||||||||||||||||||||||||||
716 | } | - | ||||||||||||||||||||||||||||||||||||||||||
717 | - | |||||||||||||||||||||||||||||||||||||||||||
718 | - | |||||||||||||||||||||||||||||||||||||||||||
719 | - | |||||||||||||||||||||||||||||||||||||||||||
720 | - | |||||||||||||||||||||||||||||||||||||||||||
721 | - | |||||||||||||||||||||||||||||||||||||||||||
722 | - | |||||||||||||||||||||||||||||||||||||||||||
723 | QKeySequence &QKeySequence::operator=(const QKeySequence &other) | - | ||||||||||||||||||||||||||||||||||||||||||
724 | { | - | ||||||||||||||||||||||||||||||||||||||||||
725 | qAtomicAssign(d, other.d); | - | ||||||||||||||||||||||||||||||||||||||||||
726 | return never executed: *this;return *this; never executed: return *this; | 0 | ||||||||||||||||||||||||||||||||||||||||||
727 | } | - | ||||||||||||||||||||||||||||||||||||||||||
728 | bool QKeySequence::operator==(const QKeySequence &other) const | - | ||||||||||||||||||||||||||||||||||||||||||
729 | { | - | ||||||||||||||||||||||||||||||||||||||||||
730 | return never executed: (d->key[0] == other.d->key[0]return (d->key[0] == other.d->key[0] && d->key[1] == other.d->key[1] && d->key[2] == other.d->key[2] && d->key[3] == other.d->key[3]);
never executed: return (d->key[0] == other.d->key[0] && d->key[1] == other.d->key[1] && d->key[2] == other.d->key[2] && d->key[3] == other.d->key[3]); | 0 | ||||||||||||||||||||||||||||||||||||||||||
731 | d->key[1] == other.d->key[1]
never executed: return (d->key[0] == other.d->key[0] && d->key[1] == other.d->key[1] && d->key[2] == other.d->key[2] && d->key[3] == other.d->key[3]); | 0 | ||||||||||||||||||||||||||||||||||||||||||
732 | d->key[2] == other.d->key[2]
never executed: return (d->key[0] == other.d->key[0] && d->key[1] == other.d->key[1] && d->key[2] == other.d->key[2] && d->key[3] == other.d->key[3]); | 0 | ||||||||||||||||||||||||||||||||||||||||||
733 | d->key[3] == other.d->key[3]
never executed: return (d->key[0] == other.d->key[0] && d->key[1] == other.d->key[1] && d->key[2] == other.d->key[2] && d->key[3] == other.d->key[3]); | 0 | ||||||||||||||||||||||||||||||||||||||||||
734 | } | - | ||||||||||||||||||||||||||||||||||||||||||
735 | - | |||||||||||||||||||||||||||||||||||||||||||
736 | - | |||||||||||||||||||||||||||||||||||||||||||
737 | - | |||||||||||||||||||||||||||||||||||||||||||
738 | - | |||||||||||||||||||||||||||||||||||||||||||
739 | - | |||||||||||||||||||||||||||||||||||||||||||
740 | - | |||||||||||||||||||||||||||||||||||||||||||
741 | - | |||||||||||||||||||||||||||||||||||||||||||
742 | uint qHash(const QKeySequence &key, uint seed) noexcept | - | ||||||||||||||||||||||||||||||||||||||||||
743 | { | - | ||||||||||||||||||||||||||||||||||||||||||
744 | 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 | ||||||||||||||||||||||||||||||||||||||||||
745 | } | - | ||||||||||||||||||||||||||||||||||||||||||
746 | bool QKeySequence::operator< (const QKeySequence &other) const | - | ||||||||||||||||||||||||||||||||||||||||||
747 | { | - | ||||||||||||||||||||||||||||||||||||||||||
748 | return never executed: std::lexicographical_compare(d->key, d->key + QKeySequencePrivate::MaxKeyCount,return std::lexicographical_compare(d->key, d->key + QKeySequencePrivate::MaxKeyCount, other.d->key, other.d->key + QKeySequencePrivate::MaxKeyCount); never executed: return std::lexicographical_compare(d->key, d->key + QKeySequencePrivate::MaxKeyCount, other.d->key, other.d->key + QKeySequencePrivate::MaxKeyCount); | 0 | ||||||||||||||||||||||||||||||||||||||||||
749 | other.d->key, other.d->key + QKeySequencePrivate::MaxKeyCount); never executed: return std::lexicographical_compare(d->key, d->key + QKeySequencePrivate::MaxKeyCount, other.d->key, other.d->key + QKeySequencePrivate::MaxKeyCount); | 0 | ||||||||||||||||||||||||||||||||||||||||||
750 | } | - | ||||||||||||||||||||||||||||||||||||||||||
751 | bool QKeySequence::isDetached() const | - | ||||||||||||||||||||||||||||||||||||||||||
752 | { | - | ||||||||||||||||||||||||||||||||||||||||||
753 | return never executed: d->ref.load() == 1;return d->ref.load() == 1; never executed: return d->ref.load() == 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||
754 | } | - | ||||||||||||||||||||||||||||||||||||||||||
755 | QString QKeySequence::toString(SequenceFormat format) const | - | ||||||||||||||||||||||||||||||||||||||||||
756 | { | - | ||||||||||||||||||||||||||||||||||||||||||
757 | QString finalString; | - | ||||||||||||||||||||||||||||||||||||||||||
758 | - | |||||||||||||||||||||||||||||||||||||||||||
759 | - | |||||||||||||||||||||||||||||||||||||||||||
760 | int end = count(); | - | ||||||||||||||||||||||||||||||||||||||||||
761 | for (int i = 0; i < end
| 0 | ||||||||||||||||||||||||||||||||||||||||||
762 | finalString += d->encodeString(d->key[i], format); | - | ||||||||||||||||||||||||||||||||||||||||||
763 | finalString += QLatin1String(", "); | - | ||||||||||||||||||||||||||||||||||||||||||
764 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
765 | finalString.truncate(finalString.length() - 2); | - | ||||||||||||||||||||||||||||||||||||||||||
766 | return never executed: finalString;return finalString; never executed: return finalString; | 0 | ||||||||||||||||||||||||||||||||||||||||||
767 | } | - | ||||||||||||||||||||||||||||||||||||||||||
768 | QKeySequence QKeySequence::fromString(const QString &str, SequenceFormat format) | - | ||||||||||||||||||||||||||||||||||||||||||
769 | { | - | ||||||||||||||||||||||||||||||||||||||||||
770 | return never executed: QKeySequence(str, format);return QKeySequence(str, format); never executed: return QKeySequence(str, format); | 0 | ||||||||||||||||||||||||||||||||||||||||||
771 | } | - | ||||||||||||||||||||||||||||||||||||||||||
772 | QList<QKeySequence> QKeySequence::listFromString(const QString &str, SequenceFormat format) | - | ||||||||||||||||||||||||||||||||||||||||||
773 | { | - | ||||||||||||||||||||||||||||||||||||||||||
774 | QList<QKeySequence> result; | - | ||||||||||||||||||||||||||||||||||||||||||
775 | - | |||||||||||||||||||||||||||||||||||||||||||
776 | QStringList strings = str.split(QLatin1String("; ")); | - | ||||||||||||||||||||||||||||||||||||||||||
777 | result.reserve(strings.count()); | - | ||||||||||||||||||||||||||||||||||||||||||
778 | 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) { | - | ||||||||||||||||||||||||||||||||||||||||||
779 | result << fromString(string, format); | - | ||||||||||||||||||||||||||||||||||||||||||
780 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
781 | - | |||||||||||||||||||||||||||||||||||||||||||
782 | return never executed: result;return result; never executed: return result; | 0 | ||||||||||||||||||||||||||||||||||||||||||
783 | } | - | ||||||||||||||||||||||||||||||||||||||||||
784 | QString QKeySequence::listToString(const QList<QKeySequence> &list, SequenceFormat format) | - | ||||||||||||||||||||||||||||||||||||||||||
785 | { | - | ||||||||||||||||||||||||||||||||||||||||||
786 | QString result; | - | ||||||||||||||||||||||||||||||||||||||||||
787 | - | |||||||||||||||||||||||||||||||||||||||||||
788 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(list)>::type> _container_((list)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (const QKeySequence &sequence = *_container_.i; _container_.control; _container_.control = 0) { | - | ||||||||||||||||||||||||||||||||||||||||||
789 | result += sequence.toString(format); | - | ||||||||||||||||||||||||||||||||||||||||||
790 | result += QLatin1String("; "); | - | ||||||||||||||||||||||||||||||||||||||||||
791 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
792 | result.truncate(result.length() - 2); | - | ||||||||||||||||||||||||||||||||||||||||||
793 | - | |||||||||||||||||||||||||||||||||||||||||||
794 | return never executed: result;return result; never executed: return result; | 0 | ||||||||||||||||||||||||||||||||||||||||||
795 | } | - | ||||||||||||||||||||||||||||||||||||||||||
796 | QDataStream &operator<<(QDataStream &s, const QKeySequence &keysequence) | - | ||||||||||||||||||||||||||||||||||||||||||
797 | { | - | ||||||||||||||||||||||||||||||||||||||||||
798 | static_assert(bool(QKeySequencePrivate::MaxKeyCount == 4), "Forgot to adapt QDataStream &operator<<(QDataStream &s, const QKeySequence &keysequence) to new QKeySequence::MaxKeyCount"); | - | ||||||||||||||||||||||||||||||||||||||||||
799 | const bool extended = s.version() >= 5
| 0 | ||||||||||||||||||||||||||||||||||||||||||
800 | s << quint32(extended ? 4 : 1) << quint32(keysequence.d->key[0]); | - | ||||||||||||||||||||||||||||||||||||||||||
801 | if (extended
| 0 | ||||||||||||||||||||||||||||||||||||||||||
802 | s << quint32(keysequence.d->key[1]) | - | ||||||||||||||||||||||||||||||||||||||||||
803 | << quint32(keysequence.d->key[2]) | - | ||||||||||||||||||||||||||||||||||||||||||
804 | << quint32(keysequence.d->key[3]); | - | ||||||||||||||||||||||||||||||||||||||||||
805 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
806 | return never executed: s;return s; never executed: return s; | 0 | ||||||||||||||||||||||||||||||||||||||||||
807 | } | - | ||||||||||||||||||||||||||||||||||||||||||
808 | QDataStream &operator>>(QDataStream &s, QKeySequence &keysequence) | - | ||||||||||||||||||||||||||||||||||||||||||
809 | { | - | ||||||||||||||||||||||||||||||||||||||||||
810 | const quint32 MaxKeys = QKeySequencePrivate::MaxKeyCount; | - | ||||||||||||||||||||||||||||||||||||||||||
811 | quint32 c; | - | ||||||||||||||||||||||||||||||||||||||||||
812 | s >> c; | - | ||||||||||||||||||||||||||||||||||||||||||
813 | quint32 keys[MaxKeys] = {0}; | - | ||||||||||||||||||||||||||||||||||||||||||
814 | for (uint i = 0; i < qMin(c, MaxKeys)
| 0 | ||||||||||||||||||||||||||||||||||||||||||
815 | if (s.atEnd()
| 0 | ||||||||||||||||||||||||||||||||||||||||||
816 | QMessageLogger(__FILE__, 1636, __PRETTY_FUNCTION__).warning("Premature EOF while reading QKeySequence"); | - | ||||||||||||||||||||||||||||||||||||||||||
817 | return never executed: s;return s; never executed: return s; | 0 | ||||||||||||||||||||||||||||||||||||||||||
818 | } | - | ||||||||||||||||||||||||||||||||||||||||||
819 | s >> keys[i]; | - | ||||||||||||||||||||||||||||||||||||||||||
820 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
821 | qAtomicDetach(keysequence.d); | - | ||||||||||||||||||||||||||||||||||||||||||
822 | std::copy(keys, keys + MaxKeys, (keysequence.d->key)); | - | ||||||||||||||||||||||||||||||||||||||||||
823 | return never executed: s;return s; never executed: return s; | 0 | ||||||||||||||||||||||||||||||||||||||||||
824 | } | - | ||||||||||||||||||||||||||||||||||||||||||
825 | - | |||||||||||||||||||||||||||||||||||||||||||
826 | - | |||||||||||||||||||||||||||||||||||||||||||
827 | - | |||||||||||||||||||||||||||||||||||||||||||
828 | - | |||||||||||||||||||||||||||||||||||||||||||
829 | QDebug operator<<(QDebug dbg, const QKeySequence &p) | - | ||||||||||||||||||||||||||||||||||||||||||
830 | { | - | ||||||||||||||||||||||||||||||||||||||||||
831 | QDebugStateSaver saver(dbg); | - | ||||||||||||||||||||||||||||||||||||||||||
832 | dbg.nospace() << "QKeySequence(" << p.toString() << ')'; | - | ||||||||||||||||||||||||||||||||||||||||||
833 | return never executed: dbg;return dbg; never executed: return dbg; | 0 | ||||||||||||||||||||||||||||||||||||||||||
834 | } | - | ||||||||||||||||||||||||||||||||||||||||||
835 | - | |||||||||||||||||||||||||||||||||||||||||||
Switch to Source code | Preprocessed file |