1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QKeySequence Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QKeySequence Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QKeySequence class encapsulates a key sequence as used by
shortcuts. <a href="#details">More...</a></p>
<h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qkeysequence.html#SequenceFormat-enum">SequenceFormat</a></b> { NativeText, PortableText }</li><li><div class="fn" />enum <b><a href="qkeysequence.html#SequenceMatch-enum">SequenceMatch</a></b> { NoMatch, PartialMatch, ExactMatch }</li><li><div class="fn" />enum <b><a href="qkeysequence.html#StandardKey-enum">StandardKey</a></b> { UnknownKey, HelpContents, WhatsThis, Open, ..., Quit }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qkeysequence.html#QKeySequence">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qkeysequence.html#QKeySequence-2">__init__</a></b> (<i>self</i>, QKeySequence <i>ks</i>)</li><li><div class="fn" /><b><a href="qkeysequence.html#QKeySequence-3">__init__</a></b> (<i>self</i>, QString <i>key</i>, SequenceFormat <i>format</i>)</li><li><div class="fn" /><b><a href="qkeysequence.html#QKeySequence-4">__init__</a></b> (<i>self</i>, int <i>k1</i>, int <i>key2</i> = 0, int <i>key3</i> = 0, int <i>key4</i> = 0)</li><li><div class="fn" /><b><a href="qkeysequence.html#QKeySequence-5">__init__</a></b> (<i>self</i>, QVariant <i>variant</i>)</li><li><div class="fn" />int <b><a href="qkeysequence.html#count">count</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qkeysequence.html#isDetached">isDetached</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qkeysequence.html#isEmpty">isEmpty</a></b> (<i>self</i>)</li><li><div class="fn" />SequenceMatch <b><a href="qkeysequence.html#matches">matches</a></b> (<i>self</i>, QKeySequence <i>seq</i>)</li><li><div class="fn" /><b><a href="qkeysequence.html#swap">swap</a></b> (<i>self</i>, QKeySequence <i>other</i>)</li><li><div class="fn" />QString <b><a href="qkeysequence.html#toString">toString</a></b> (<i>self</i>, SequenceFormat <i>format</i> = QKeySequence.PortableText)</li></ul><h3>Static Methods</h3><ul><li><div class="fn" />QKeySequence <b><a href="qkeysequence.html#fromString">fromString</a></b> (QString <i>str</i>, SequenceFormat <i>format</i> = QKeySequence.PortableText)</li><li><div class="fn" />unknown-type <b><a href="qkeysequence.html#keyBindings">keyBindings</a></b> (StandardKey <i>key</i>)</li><li><div class="fn" />QKeySequence <b><a href="qkeysequence.html#mnemonic">mnemonic</a></b> (QString <i>text</i>)</li></ul><h3>Special Methods</h3><ul><li><div class="fn" />bool <b><a href="qkeysequence.html#__eq__">__eq__</a></b> (<i>self</i>, QKeySequence <i>other</i>)</li><li><div class="fn" />bool <b><a href="qkeysequence.html#__ge__">__ge__</a></b> (<i>self</i>, QKeySequence <i>other</i>)</li><li><div class="fn" />int <b><a href="qkeysequence.html#__getitem__">__getitem__</a></b> (<i>self</i>, int <i>i</i>)</li><li><div class="fn" />bool <b><a href="qkeysequence.html#__gt__">__gt__</a></b> (<i>self</i>, QKeySequence <i>other</i>)</li><li><div class="fn" />int <b><a href="qkeysequence.html#__int__">__int__</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qkeysequence.html#__le__">__le__</a></b> (<i>self</i>, QKeySequence <i>other</i>)</li><li><div class="fn" />int <b><a href="qkeysequence.html#__len__">__len__</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qkeysequence.html#__lt__">__lt__</a></b> (<i>self</i>, QKeySequence <i>ks</i>)</li><li><div class="fn" />bool <b><a href="qkeysequence.html#__ne__">__ne__</a></b> (<i>self</i>, QKeySequence <i>other</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>This class can be pickled.</p><p>
<a href="qkeysequence.html#StandardKey-enum">StandardKey</a>,
<a href="qstring.html">QString</a>
or a Python int object
may be used whenever
<a href="qkeysequence.html">QKeySequence</a>
is expected.</p>
<p>The QKeySequence class encapsulates a key sequence as used by
shortcuts.</p>
<p>In its most common form, a key sequence describes a combination
of keys that must be used together to perform some action. Key
sequences are used with <a href="qaction.html">QAction</a> objects
to specify which keyboard shortcuts can be used to trigger
actions.</p>
<p>Key sequences can be constructed for use as keyboard shortcuts
in three different ways:</p>
<ul>
<li>For standard shortcuts, a <a href="qkeysequence.html#StandardKey-enum">standard key</a> can be used
to request the platform-specific key sequence associated with each
shortcut.</li>
<li>For custom shortcuts, human-readable strings such as "Ctrl+X"
can be used, and these can be translated into the appropriate
shortcuts for users of different languages. Translations are made
in the "<a href="qshortcut.html">QShortcut</a>" context.</li>
<li>For hard-coded shortcuts, integer key codes can be specified
with a combination of values defined by the <a href="qt.html#Key-enum">Qt.Key</a> and <a href="qt.html#Modifier-enum">Qt.Modifier</a> enum values. Each key code
consists of a single <a href="qt.html#Key-enum">Qt.Key</a> value
and zero or more modifiers, such as <a href="qt.html#Modifier-enum">Qt.SHIFT</a>, <a href="qt.html#Modifier-enum">Qt.CTRL</a>, <a href="qt.html#Modifier-enum">Qt.ALT</a> and <a href="qt.html#Modifier-enum">Qt.META</a>.</li>
</ul>
<p>For example, <b>Ctrl P</b> might be a sequence used as a
shortcut for printing a document, and can be specified in any of
the following ways:</p>
<pre class="cpp">
<span class="type">QKeySequence</span>(<span class="type">QKeySequence</span><span class="operator">.</span>Print);
<span class="type">QKeySequence</span>(tr(<span class="string">"Ctrl+P"</span>));
<span class="type">QKeySequence</span>(tr(<span class="string">"Ctrl+p"</span>));
<span class="type">QKeySequence</span>(<span class="type"><a href="qt.html">Qt</a></span><span class="operator">.</span>CTRL <span class="operator">+</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">.</span>Key_P);
</pre>
<p>Note that, for letters, the case used in the specification
string does not matter. In the above examples, the user does not
need to hold down the <b>Shift</b> key to activate a shortcut
specified with "Ctrl+P". However, for other keys, the use of
<b>Shift</b> as an unspecified extra modifier key can lead to
confusion for users of an application whose keyboards have
different layouts to those used by the developers. See the <a href="#keyboard-layout-issues">Keyboard Layout Issues</a> section below
for more details.</p>
<p>It is preferable to use standard shortcuts where possible. When
creating key sequences for non-standard shortcuts, you should use
human-readable strings in preference to hard-coded integer
values.</p>
<p>QKeySequence objects can be cast to a <a href="qstring.html">QString</a> to obtain a human-readable translated
version of the sequence. Similarly, the <a href="qkeysequence.html#toString">toString</a>() function produces
human-readable strings for use in menus. On Mac OS X, the
appropriate symbols are used to describe keyboard shortcuts using
special keys on the Macintosh keyboard.</p>
<p>An alternative way to specify hard-coded key codes is to use the
Unicode code point of the character; for example, 'A' gives the
same key sequence as <a href="qt.html#Key-enum">Qt.Key_A</a>.</p>
<p><b>Note:</b> On Mac OS X, references to "Ctrl", <a href="qt.html#Modifier-enum">Qt.CTRL</a>, Qt.Control and <a href="qt.html#KeyboardModifier-enum">Qt.ControlModifier</a> correspond
to the <b>Command</b> keys on the Macintosh keyboard, and
references to "Meta", <a href="qt.html#Modifier-enum">Qt.META</a>,
Qt.Meta and <a href="qt.html#KeyboardModifier-enum">Qt.MetaModifier</a> correspond to
the <b>Control</b> keys. Developers on Mac OS X can use the same
shortcut descriptions across all platforms, and their applications
will automatically work as expected on Mac OS X.</p>
<a id="standard-shortcuts" name="standard-shortcuts" />
<h3>Standard Shortcuts</h3>
<p>QKeySequence defines many <a href="qkeysequence.html#StandardKey-enum">standard keyboard
shortcuts</a> to reduce the amount of effort required when setting
up actions in a typical application. The table below shows some
common key sequences that are often used for these standard
shortcuts by applications on four widely-used platforms. Note that
on Mac OS X, the <b>Ctrl</b> value corresponds to the
<b>Command</b> keys on the Macintosh keyboard, and the <b>Meta</b>
value corresponds to the <b>Control</b> keys.</p>
<table class="generic">
<thead>
<tr class="qt-style">
<th><a href="qkeysequence.html#StandardKey-enum">StandardKey</a></th>
<th>Windows</th>
<th>Mac OS X</th>
<th>KDE</th>
<th>GNOME</th>
<th>S60</th>
</tr>
</thead>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">HelpContents</a></td>
<td>F1</td>
<td>Ctrl+?</td>
<td>F1</td>
<td>F1</td>
<td>F2</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">WhatsThis</a></td>
<td>Shift+F1</td>
<td>Shift+F1</td>
<td>Shift+F1</td>
<td>Shift+F1</td>
<td>Shift+F1</td>
</tr>
<tr class="odd" valign="top">
<td>Open</td>
<td>Ctrl+O</td>
<td>Ctrl+O</td>
<td>Ctrl+O</td>
<td>Ctrl+O</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td>Close</td>
<td>Ctrl+F4, Ctrl+W</td>
<td>Ctrl+W, Ctrl+F4</td>
<td>Ctrl+W</td>
<td>Ctrl+W</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td>Save</td>
<td>Ctrl+S</td>
<td>Ctrl+S</td>
<td>Ctrl+S</td>
<td>Ctrl+S</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td>Quit</td>
<td />
<td>Ctrl+Q</td>
<td>Qtrl+Q</td>
<td>Qtrl+Q</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SaveAs</a></td>
<td />
<td>Ctrl+Shift+S</td>
<td />
<td>Ctrl+Shift+S</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td>New</td>
<td>Ctrl+N</td>
<td>Ctrl+N</td>
<td>Ctrl+N</td>
<td>Ctrl+N</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td>Delete</td>
<td>Del</td>
<td>Del, Meta+D</td>
<td>Del, Ctrl+D</td>
<td>Del, Ctrl+D</td>
<td>Del</td>
</tr>
<tr class="even" valign="top">
<td>Cut</td>
<td>Ctrl+X, Shift+Del</td>
<td>Ctrl+X</td>
<td>Ctrl+X, F20, Shift+Del</td>
<td>Ctrl+X, F20, Shift+Del</td>
<td>Ctrl+X</td>
</tr>
<tr class="odd" valign="top">
<td>Copy</td>
<td>Ctrl+C, Ctrl+Ins</td>
<td>Ctrl+C</td>
<td>Ctrl+C, F16, Ctrl+Ins</td>
<td>Ctrl+C, F16, Ctrl+Ins</td>
<td>Ctrl+C</td>
</tr>
<tr class="even" valign="top">
<td>Paste</td>
<td>Ctrl+V, Shift+Ins</td>
<td>Ctrl+V</td>
<td>Ctrl+V, F18, Shift+Ins</td>
<td>Ctrl+V, F18, Shift+Ins</td>
<td>Ctrl+V</td>
</tr>
<tr class="odd" valign="top">
<td>Preferences</td>
<td />
<td>Ctrl+,</td>
<td />
<td />
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td>Undo</td>
<td>Ctrl+Z, Alt+Backspace</td>
<td>Ctrl+Z</td>
<td>Ctrl+Z, F14</td>
<td>Ctrl+Z, F14</td>
<td>Ctrl+Z</td>
</tr>
<tr class="odd" valign="top">
<td>Redo</td>
<td>Ctrl+Y, Shift+Ctrl+Z, Alt+Shift+Backspace</td>
<td>Ctrl+Shift+Z</td>
<td>Ctrl+Shift+Z</td>
<td>Ctrl+Shift+Z</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td>Back</td>
<td>Alt+Left, Backspace</td>
<td>Ctrl+[</td>
<td>Alt+Left</td>
<td>Alt+Left</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td>Forward</td>
<td>Alt+Right, Shift+Backspace</td>
<td>Ctrl+]</td>
<td>Alt+Right</td>
<td>Alt+Right</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td>Refresh</td>
<td>F5</td>
<td>F5</td>
<td>F5</td>
<td>Ctrl+R, F5</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">ZoomIn</a></td>
<td>Ctrl+Plus</td>
<td>Ctrl+Plus</td>
<td>Ctrl+Plus</td>
<td>Ctrl+Plus</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">ZoomOut</a></td>
<td>Ctrl+Minus</td>
<td>Ctrl+Minus</td>
<td>Ctrl+Minus</td>
<td>Ctrl+Minus</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td>Print</td>
<td>Ctrl+P</td>
<td>Ctrl+P</td>
<td>Ctrl+P</td>
<td>Ctrl+P</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">AddTab</a></td>
<td>Ctrl+T</td>
<td>Ctrl+T</td>
<td>Ctrl+Shift+N, Ctrl+T</td>
<td>Ctrl+T</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">NextChild</a></td>
<td>Ctrl+Tab, Forward, Ctrl+F6</td>
<td>Ctrl+}, Forward, Ctrl+Tab</td>
<td>Ctrl+Tab, Forward, Ctrl+Comma</td>
<td>Ctrl+Tab, Forward</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">PreviousChild</a></td>
<td>Ctrl+Shift+Tab, Back, Ctrl+Shift+F6</td>
<td>Ctrl+{, Back, Ctrl+Shift+Tab</td>
<td>Ctrl+Shift+Tab, Back, Ctrl+Period</td>
<td>Ctrl+Shift+Tab, Back</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td>Find</td>
<td>Ctrl+F</td>
<td>Ctrl+F</td>
<td>Ctrl+F</td>
<td>Ctrl+F</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">FindNext</a></td>
<td>F3, Ctrl+G</td>
<td>Ctrl+G</td>
<td>F3</td>
<td>Ctrl+G, F3</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">FindPrevious</a></td>
<td>Shift+F3, Ctrl+Shift+G</td>
<td>Ctrl+Shift+G</td>
<td>Shift+F3</td>
<td>Ctrl+Shift+G, Shift+F3</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td>Replace</td>
<td>Ctrl+H</td>
<td>(none)</td>
<td>Ctrl+R</td>
<td>Ctrl+H</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SelectAll</a></td>
<td>Ctrl+A</td>
<td>Ctrl+A</td>
<td>Ctrl+A</td>
<td>Ctrl+A</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td>Bold</td>
<td>Ctrl+B</td>
<td>Ctrl+B</td>
<td>Ctrl+B</td>
<td>Ctrl+B</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td>Italic</td>
<td>Ctrl+I</td>
<td>Ctrl+I</td>
<td>Ctrl+I</td>
<td>Ctrl+I</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td>Underline</td>
<td>Ctrl+U</td>
<td>Ctrl+U</td>
<td>Ctrl+U</td>
<td>Ctrl+U</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">MoveToNextChar</a></td>
<td>Right</td>
<td>Right</td>
<td>Right</td>
<td>Right</td>
<td>Right</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">MoveToPreviousChar</a></td>
<td>Left</td>
<td>Left</td>
<td>Left</td>
<td>Left</td>
<td>Left</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">MoveToNextWord</a></td>
<td>Ctrl+Right</td>
<td>Alt+Right</td>
<td>Ctrl+Right</td>
<td>Ctrl+Right</td>
<td>Ctrl+Right</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">MoveToPreviousWord</a></td>
<td>Ctrl+Left</td>
<td>Alt+Left</td>
<td>Ctrl+Left</td>
<td>Ctrl+Left</td>
<td>Ctrl+Left</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">MoveToNextLine</a></td>
<td>Down</td>
<td>Down</td>
<td>Down</td>
<td>Down</td>
<td>Down</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">MoveToPreviousLine</a></td>
<td>Up</td>
<td>Up</td>
<td>Up</td>
<td>Up</td>
<td>Up</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">MoveToNextPage</a></td>
<td>PgDown</td>
<td>PgDown, Alt+PgDown, Meta+Down, Meta+PgDown</td>
<td>PgDown</td>
<td>PgDown</td>
<td>PgDown</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">MoveToPreviousPage</a></td>
<td>PgUp</td>
<td>PgUp, Alt+PgUp, Meta+Up, Meta+PgUp</td>
<td>PgUp</td>
<td>PgUp</td>
<td>PgUp</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">MoveToStartOfLine</a></td>
<td>Home</td>
<td>Ctrl+Left, Meta+Left</td>
<td>Home</td>
<td>Home</td>
<td>Home</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">MoveToEndOfLine</a></td>
<td>End</td>
<td>Ctrl+Right, Meta+Right</td>
<td>End</td>
<td>End</td>
<td>End</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">MoveToStartOfBlock</a></td>
<td>(none)</td>
<td>Alt+Up, Meta+A</td>
<td>(none)</td>
<td>(none)</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">MoveToEndOfBlock</a></td>
<td>(none)</td>
<td>Alt+Down, Meta+E</td>
<td>(none)</td>
<td>(none)</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">MoveToStartOfDocument</a></td>
<td>Ctrl+Home</td>
<td>Ctrl+Up, Home</td>
<td>Ctrl+Home</td>
<td>Ctrl+Home</td>
<td>Ctrl+Home</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">MoveToEndOfDocument</a></td>
<td>Ctrl+End</td>
<td>Ctrl+Down, End</td>
<td>Ctrl+End</td>
<td>Ctrl+End</td>
<td>Ctrl+End</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SelectNextChar</a></td>
<td>Shift+Right</td>
<td>Shift+Right</td>
<td>Shift+Right</td>
<td>Shift+Right</td>
<td>Shift+Right</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SelectPreviousChar</a></td>
<td>Shift+Left</td>
<td>Shift+Left</td>
<td>Shift+Left</td>
<td>Shift+Left</td>
<td>Shift+Left</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SelectNextWord</a></td>
<td>Ctrl+Shift+Right</td>
<td>Alt+Shift+Right</td>
<td>Ctrl+Shift+Right</td>
<td>Ctrl+Shift+Right</td>
<td>Ctrl+Shift+Right</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SelectPreviousWord</a></td>
<td>Ctrl+Shift+Left</td>
<td>Alt+Shift+Left</td>
<td>Ctrl+Shift+Left</td>
<td>Ctrl+Shift+Left</td>
<td>Ctrl+Shift+Left</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SelectNextLine</a></td>
<td>Shift+Down</td>
<td>Shift+Down</td>
<td>Shift+Down</td>
<td>Shift+Down</td>
<td>Shift+Down</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SelectPreviousLine</a></td>
<td>Shift+Up</td>
<td>Shift+Up</td>
<td>Shift+Up</td>
<td>Shift+Up</td>
<td>Shift+Up</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SelectNextPage</a></td>
<td>Shift+PgDown</td>
<td>Shift+PgDown</td>
<td>Shift+PgDown</td>
<td>Shift+PgDown</td>
<td>Shift+PgDown</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SelectPreviousPage</a></td>
<td>Shift+PgUp</td>
<td>Shift+PgUp</td>
<td>Shift+PgUp</td>
<td>Shift+PgUp</td>
<td>Shift+PgUp</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SelectStartOfLine</a></td>
<td>Shift+Home</td>
<td>Ctrl+Shift+Left</td>
<td>Shift+Home</td>
<td>Shift+Home</td>
<td>Shift+Home</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SelectEndOfLine</a></td>
<td>Shift+End</td>
<td>Ctrl+Shift+Right</td>
<td>Shift+End</td>
<td>Shift+End</td>
<td>Shift+End</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SelectStartOfBlock</a></td>
<td>(none)</td>
<td>Alt+Shift+Up, Meta+Shift+A</td>
<td>(none)</td>
<td>(none)</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SelectEndOfBlock</a></td>
<td>(none)</td>
<td>Alt+Shift+Down, Meta+Shift+E</td>
<td>(none)</td>
<td>(none)</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SelectStartOfDocument</a></td>
<td>Ctrl+Shift+Home</td>
<td>Ctrl+Shift+Up, Shift+Home</td>
<td>Ctrl+Shift+Home</td>
<td>Ctrl+Shift+Home</td>
<td>Ctrl+Shift+Home</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">SelectEndOfDocument</a></td>
<td>Ctrl+Shift+End</td>
<td>Ctrl+Shift+Down, Shift+End</td>
<td>Ctrl+Shift+End</td>
<td>Ctrl+Shift+End</td>
<td>Ctrl+Shift+End</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">DeleteStartOfWord</a></td>
<td>Ctrl+Backspace</td>
<td>Alt+Backspace</td>
<td>Ctrl+Backspace</td>
<td>Ctrl+Backspace</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">DeleteEndOfWord</a></td>
<td>Ctrl+Del</td>
<td>(none)</td>
<td>Ctrl+Del</td>
<td>Ctrl+Del</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">DeleteEndOfLine</a></td>
<td>(none)</td>
<td>(none)</td>
<td>Ctrl+K</td>
<td>Ctrl+K</td>
<td>(none)</td>
</tr>
<tr class="even" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">InsertParagraphSeparator</a></td>
<td>Enter</td>
<td>Enter</td>
<td>Enter</td>
<td>Enter</td>
<td>(none)</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qkeysequence.html#StandardKey-enum">InsertLineSeparator</a></td>
<td>Shift+Enter</td>
<td>Meta+Enter</td>
<td>Shift+Enter</td>
<td>Shift+Enter</td>
<td>(none)</td>
</tr>
</table>
<p>Note that, since the key sequences used for the standard
shortcuts differ between platforms, you still need to test your
shortcuts on each platform to ensure that you do not
unintentionally assign the same key sequence to many actions.</p>
<a id="keyboard-layout-issues" name="keyboard-layout-issues" />
<h3>Keyboard Layout Issues</h3>
<p>Many key sequence specifications are chosen by developers based
on the layout of certain types of keyboard, rather than choosing
keys that represent the first letter of an action's name, such as
<b>Ctrl S</b> ("Ctrl+S") or <b>Ctrl C</b> ("Ctrl+C"). Additionally,
because certain symbols can only be entered with the help of
modifier keys on certain keyboard layouts, key sequences intended
for use with one keyboard layout may map to a different key, map to
no keys at all, or require an additional modifier key to be used on
different keyboard layouts.</p>
<p>For example, the shortcuts, <b>Ctrl plus</b> and <b>Ctrl
minus</b>, are often used as shortcuts for zoom operations in
graphics applications, and these may be specified as "Ctrl++" and
"Ctrl+-" respectively. However, the way these shortcuts are
specified and interpreted depends on the keyboard layout. Users of
Norwegian keyboards will note that the <b>+</b> and <b>-</b> keys
are not adjacent on the keyboard, but will still be able to
activate both shortcuts without needing to press the <b>Shift</b>
key. However, users with British keyboards will need to hold down
the <b>Shift</b> key to enter the <b>+</b> symbol, making the
shortcut effectively the same as "Ctrl+Shift+=".</p>
<p>Although some developers might resort to fully specifying all
the modifiers they use on their keyboards to activate a shortcut,
this will also result in unexpected behavior for users of different
keyboard layouts.</p>
<p>For example, a developer using a British keyboard may decide to
specify "Ctrl+Shift+=" as the key sequence in order to create a
shortcut that coincidentally behaves in the same way as <b>Ctrl
plus</b>. However, the <b>=</b> key needs to be accessed using the
<b>Shift</b> key on Norwegian keyboard, making the required
shortcut effectively <b>Ctrl Shift Shift =</b> (an impossible key
combination).</p>
<p>As a result, both human-readable strings and hard-coded key
codes can both be problematic to use when specifying a key sequence
that can be used on a variety of different keyboard layouts. Only
the use of <a href="qkeysequence.html#StandardKey-enum">standard
shortcuts</a> guarantees that the user will be able to use the
shortcuts that the developer intended.</p>
<p>Despite this, we can address this issue by ensuring that
human-readable strings are used, making it possible for
translations of key sequences to be made for users of different
languages. This approach will be successful for users whose
keyboards have the most typical layout for the language they are
using.</p>
<a id="gnu-emacs-style-key-sequences" name="gnu-emacs-style-key-sequences" />
<h3>GNU Emacs Style Key Sequences</h3>
<p>Key sequences similar to those used in <a href="http://www.gnu.org/software/emacs/">GNU Emacs</a>, allowing up to
four key codes, can be created by using the multiple argument
constructor, or by passing a human-readable string of
comma-separated key sequences.</p>
<p>For example, the key sequence, <b>Ctrl X</b> followed by <b>Ctrl
C</b>, can be specified using either of the following ways:</p>
<pre class="cpp">
<span class="type">QKeySequence</span>(tr(<span class="string">"Ctrl+X, Ctrl+C"</span>));
<span class="type">QKeySequence</span>(<span class="type"><a href="qt.html">Qt</a></span><span class="operator">.</span>CTRL <span class="operator">+</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">.</span>Key_X<span class="operator">,</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">.</span>CTRL <span class="operator">+</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">.</span>Key_C);
</pre>
<p><b>Warning:</b> A <a href="qapplication.html">QApplication</a>
instance must have been constructed before a QKeySequence is
created; otherwise, your application may crash.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="SequenceFormat-enum" />QKeySequence.SequenceFormat</h3><table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.NativeText</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The key sequence as a platform specific
string. This means that it will be shown translated and on the Mac
it will resemble a key sequence from the menu bar. This enum is
best used when you want to display the string to the user.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.PortableText</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The key sequence is given in a "portable"
format, suitable for reading and writing to a file. In many cases,
it will look similar to the native text on Windows and X11.</td>
</tr>
</table>
<h3 class="fn"><a name="SequenceMatch-enum" />QKeySequence.SequenceMatch</h3><table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.NoMatch</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The key sequences are different; not even
partially matching.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.PartialMatch</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The key sequences match partially, but are not
the same.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.ExactMatch</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">The key sequences are the same.</td>
</tr>
</table>
<h3 class="fn"><a name="StandardKey-enum" />QKeySequence.StandardKey</h3><p>This enum represent standard key bindings. They can be used to
assign platform dependent keyboard shortcuts to a <a href="qaction.html">QAction</a>.</p>
<p>Note that the key bindings are platform dependent. The currently
bound shortcuts can be queried using <a href="qkeysequence.html#keyBindings">keyBindings</a>().</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.AddTab</tt></td>
<td class="topAlign"><tt>19</tt></td>
<td class="topAlign">Add new tab.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Back</tt></td>
<td class="topAlign"><tt>13</tt></td>
<td class="topAlign">Navigate back.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Bold</tt></td>
<td class="topAlign"><tt>27</tt></td>
<td class="topAlign">Bold text.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Close</tt></td>
<td class="topAlign"><tt>4</tt></td>
<td class="topAlign">Close document/tab.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Copy</tt></td>
<td class="topAlign"><tt>9</tt></td>
<td class="topAlign">Copy.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Cut</tt></td>
<td class="topAlign"><tt>8</tt></td>
<td class="topAlign">Cut.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Delete</tt></td>
<td class="topAlign"><tt>7</tt></td>
<td class="topAlign">Delete.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.DeleteEndOfLine</tt></td>
<td class="topAlign"><tt>60</tt></td>
<td class="topAlign">Delete end of line.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.DeleteEndOfWord</tt></td>
<td class="topAlign"><tt>59</tt></td>
<td class="topAlign">Delete word from the end of the cursor.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.DeleteStartOfWord</tt></td>
<td class="topAlign"><tt>58</tt></td>
<td class="topAlign">Delete the beginning of a word up to the
cursor.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Find</tt></td>
<td class="topAlign"><tt>22</tt></td>
<td class="topAlign">Find in document.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.FindNext</tt></td>
<td class="topAlign"><tt>23</tt></td>
<td class="topAlign">Find next result.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.FindPrevious</tt></td>
<td class="topAlign"><tt>24</tt></td>
<td class="topAlign">Find previous result.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Forward</tt></td>
<td class="topAlign"><tt>14</tt></td>
<td class="topAlign">Navigate forward.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.HelpContents</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">Open help contents.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QKeySequence.InsertLineSeparator</tt></td>
<td class="topAlign"><tt>62</tt></td>
<td class="topAlign">Insert a new line.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QKeySequence.InsertParagraphSeparator</tt></td>
<td class="topAlign"><tt>61</tt></td>
<td class="topAlign">Insert a new paragraph.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Italic</tt></td>
<td class="topAlign"><tt>28</tt></td>
<td class="topAlign">Italic text.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.MoveToEndOfBlock</tt></td>
<td class="topAlign"><tt>41</tt></td>
<td class="topAlign">Move cursor to end of block. This shortcut is
only used on the OS X.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QKeySequence.MoveToEndOfDocument</tt></td>
<td class="topAlign"><tt>43</tt></td>
<td class="topAlign">Move cursor to end of document.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.MoveToEndOfLine</tt></td>
<td class="topAlign"><tt>39</tt></td>
<td class="topAlign">Move cursor to end of line.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.MoveToNextChar</tt></td>
<td class="topAlign"><tt>30</tt></td>
<td class="topAlign">Move cursor to next character.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.MoveToNextLine</tt></td>
<td class="topAlign"><tt>34</tt></td>
<td class="topAlign">Move cursor to next line.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.MoveToNextPage</tt></td>
<td class="topAlign"><tt>36</tt></td>
<td class="topAlign">Move cursor to next page.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.MoveToNextWord</tt></td>
<td class="topAlign"><tt>32</tt></td>
<td class="topAlign">Move cursor to next word.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.MoveToPreviousChar</tt></td>
<td class="topAlign"><tt>31</tt></td>
<td class="topAlign">Move cursor to previous character.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.MoveToPreviousLine</tt></td>
<td class="topAlign"><tt>35</tt></td>
<td class="topAlign">Move cursor to previous line.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.MoveToPreviousPage</tt></td>
<td class="topAlign"><tt>37</tt></td>
<td class="topAlign">Move cursor to previous page.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.MoveToPreviousWord</tt></td>
<td class="topAlign"><tt>33</tt></td>
<td class="topAlign">Move cursor to previous word.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.MoveToStartOfBlock</tt></td>
<td class="topAlign"><tt>40</tt></td>
<td class="topAlign">Move cursor to start of a block. This shortcut
is only used on OS X.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QKeySequence.MoveToStartOfDocument</tt></td>
<td class="topAlign"><tt>42</tt></td>
<td class="topAlign">Move cursor to start of document.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.MoveToStartOfLine</tt></td>
<td class="topAlign"><tt>38</tt></td>
<td class="topAlign">Move cursor to start of line.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.New</tt></td>
<td class="topAlign"><tt>6</tt></td>
<td class="topAlign">Create new document.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.NextChild</tt></td>
<td class="topAlign"><tt>20</tt></td>
<td class="topAlign">Navigate to next tab or child window.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Open</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign">Open document.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Paste</tt></td>
<td class="topAlign"><tt>10</tt></td>
<td class="topAlign">Paste.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Preferences</tt></td>
<td class="topAlign"><tt>64</tt></td>
<td class="topAlign">Open the preferences dialog.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.PreviousChild</tt></td>
<td class="topAlign"><tt>21</tt></td>
<td class="topAlign">Navigate to previous tab or child window.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Print</tt></td>
<td class="topAlign"><tt>18</tt></td>
<td class="topAlign">Print document.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Quit</tt></td>
<td class="topAlign"><tt>65</tt></td>
<td class="topAlign">Quit the application.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Redo</tt></td>
<td class="topAlign"><tt>12</tt></td>
<td class="topAlign">Redo.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Refresh</tt></td>
<td class="topAlign"><tt>15</tt></td>
<td class="topAlign">Refresh or reload current document.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Replace</tt></td>
<td class="topAlign"><tt>25</tt></td>
<td class="topAlign">Find and replace.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.SaveAs</tt></td>
<td class="topAlign"><tt>63</tt></td>
<td class="topAlign">Save document after prompting the user for a
file name.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Save</tt></td>
<td class="topAlign"><tt>5</tt></td>
<td class="topAlign">Save document.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.SelectAll</tt></td>
<td class="topAlign"><tt>26</tt></td>
<td class="topAlign">Select all text.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.SelectEndOfBlock</tt></td>
<td class="topAlign"><tt>55</tt></td>
<td class="topAlign">Extend selection to the end of a text block.
This shortcut is only used on OS X.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QKeySequence.SelectEndOfDocument</tt></td>
<td class="topAlign"><tt>57</tt></td>
<td class="topAlign">Extend selection to end of document.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.SelectEndOfLine</tt></td>
<td class="topAlign"><tt>53</tt></td>
<td class="topAlign">Extend selection to end of line.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.SelectNextChar</tt></td>
<td class="topAlign"><tt>44</tt></td>
<td class="topAlign">Extend selection to next character.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.SelectNextLine</tt></td>
<td class="topAlign"><tt>48</tt></td>
<td class="topAlign">Extend selection to next line.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.SelectNextPage</tt></td>
<td class="topAlign"><tt>50</tt></td>
<td class="topAlign">Extend selection to next page.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.SelectNextWord</tt></td>
<td class="topAlign"><tt>46</tt></td>
<td class="topAlign">Extend selection to next word.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.SelectPreviousChar</tt></td>
<td class="topAlign"><tt>45</tt></td>
<td class="topAlign">Extend selection to previous character.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.SelectPreviousLine</tt></td>
<td class="topAlign"><tt>49</tt></td>
<td class="topAlign">Extend selection to previous line.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.SelectPreviousPage</tt></td>
<td class="topAlign"><tt>51</tt></td>
<td class="topAlign">Extend selection to previous page.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.SelectPreviousWord</tt></td>
<td class="topAlign"><tt>47</tt></td>
<td class="topAlign">Extend selection to previous word.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.SelectStartOfBlock</tt></td>
<td class="topAlign"><tt>54</tt></td>
<td class="topAlign">Extend selection to the start of a text block.
This shortcut is only used on OS X.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QKeySequence.SelectStartOfDocument</tt></td>
<td class="topAlign"><tt>56</tt></td>
<td class="topAlign">Extend selection to start of document.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.SelectStartOfLine</tt></td>
<td class="topAlign"><tt>52</tt></td>
<td class="topAlign">Extend selection to start of line.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Underline</tt></td>
<td class="topAlign"><tt>29</tt></td>
<td class="topAlign">Underline text.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.Undo</tt></td>
<td class="topAlign"><tt>11</tt></td>
<td class="topAlign">Undo.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.UnknownKey</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">Unbound key.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.WhatsThis</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">Activate whats this.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.ZoomIn</tt></td>
<td class="topAlign"><tt>16</tt></td>
<td class="topAlign">Zoom in.</td>
</tr>
<tr>
<td class="topAlign"><tt>QKeySequence.ZoomOut</tt></td>
<td class="topAlign"><tt>17</tt></td>
<td class="topAlign">Zoom out.</td>
</tr>
</table>
<p>This enum was introduced or modified in Qt 4.2.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QKeySequence" />QKeySequence.__init__ (<i>self</i>)</h3><p>Constructs an empty key sequence.</p>
<h3 class="fn"><a name="QKeySequence-2" />QKeySequence.__init__ (<i>self</i>, <a href="qkeysequence.html">QKeySequence</a> <i>ks</i>)</h3><p>Creates a key sequence from the <i>key</i> string. For example
"Ctrl+O" gives CTRL+'O'. The strings "Ctrl", "Shift", "Alt" and
"Meta" are recognized, as well as their translated equivalents in
the "<a href="qshortcut.html">QShortcut</a>" context (using
<a href="qobject.html#tr">QObject.tr</a>()).</p>
<p>Up to four key codes may be entered by separating them with
commas, e.g. "Alt+X,Ctrl+S,Q".</p>
<p><i>key</i> should be in <a href="qkeysequence.html#SequenceFormat-enum">NativeText</a> format.</p>
<p>This constructor is typically used with <a href="qobject.html#tr">tr</a>(), so that shortcut keys can be replaced
in translations:</p>
<pre class="cpp">
<span class="type"><a href="qmenu.html">QMenu</a></span> <span class="operator">*</span>file <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qmenu.html">QMenu</a></span>(<span class="keyword">this</span>);
file<span class="operator">-</span><span class="operator">></span>addAction(tr(<span class="string">"&Open..."</span>)<span class="operator">,</span> <span class="keyword">this</span><span class="operator">,</span> SLOT(open())<span class="operator">,</span>
<span class="type"><a href="qkeysequence.html">QKeySequence</a></span>(tr(<span class="string">"Ctrl+O"</span><span class="operator">,</span> <span class="string">"File|Open"</span>)));
</pre>
<p>Note the "File|Open" translator comment. It is by no means
necessary, but it provides some context for the human
translator.</p>
<h3 class="fn"><a name="QKeySequence-3" />QKeySequence.__init__ (<i>self</i>, QString <i>key</i>, <a href="qkeysequence.html#SequenceFormat-enum">SequenceFormat</a> <i>format</i>)</h3><p>Creates a key sequence from the <i>key</i> string based on
<i>format</i>.</p>
<p>This function was introduced in Qt 4.7.</p>
<h3 class="fn"><a name="QKeySequence-4" />QKeySequence.__init__ (<i>self</i>, int <i>k1</i>, int <i>key2</i> = 0, int <i>key3</i> = 0, int <i>key4</i> = 0)</h3><p>Constructs a key sequence with up to 4 keys <i>k1</i>,
<i>k2</i>, <i>k3</i> and <i>k4</i>.</p>
<p>The key codes are listed in <a href="qt.html#Key-enum">Qt.Key</a> and can be combined with modifiers
(see <a href="qt.html#Modifier-enum">Qt.Modifier</a>) such as
<a href="qt.html#Modifier-enum">Qt.SHIFT</a>, <a href="qt.html#Modifier-enum">Qt.CTRL</a>, <a href="qt.html#Modifier-enum">Qt.ALT</a>, or <a href="qt.html#Modifier-enum">Qt.META</a>.</p>
<h3 class="fn"><a name="QKeySequence-5" />QKeySequence.__init__ (<i>self</i>, QVariant <i>variant</i>)</h3><p>Copy constructor. Makes a copy of <i>keysequence</i>.</p>
<h3 class="fn"><a name="count" />int QKeySequence.count (<i>self</i>)</h3><p>Returns the number of keys in the key sequence. The maximum is
4.</p>
<h3 class="fn"><a name="fromString" /><a href="qkeysequence.html">QKeySequence</a> QKeySequence.fromString (QString <i>str</i>, <a href="qkeysequence.html#SequenceFormat-enum">SequenceFormat</a> <i>format</i> = QKeySequence.PortableText)</h3><p>Return a <a href="qkeysequence.html">QKeySequence</a> from the
string <i>str</i> based on <i>format</i>.</p>
<p>This function was introduced in Qt 4.1.</p>
<p><b>See also</b> <a href="qkeysequence.html#toString">toString</a>().</p>
<h3 class="fn"><a name="isDetached" />bool QKeySequence.isDetached (<i>self</i>)</h3><h3 class="fn"><a name="isEmpty" />bool QKeySequence.isEmpty (<i>self</i>)</h3><p>Returns true if the key sequence is empty; otherwise returns
false.</p>
<h3 class="fn"><a name="keyBindings" />unknown-type QKeySequence.keyBindings (<a href="qkeysequence.html#StandardKey-enum">StandardKey</a> <i>key</i>)</h3><p>Returns a list of key bindings for the given <i>key</i>. The
result of calling this function will vary based on the target
platform. The first element of the list indicates the primary
shortcut for the given platform. If the result contains more than
one result, these can be considered alternative shortcuts on the
same platform for the given <i>key</i>.</p>
<p>This function was introduced in Qt 4.2.</p>
<h3 class="fn"><a name="matches" /><a href="qkeysequence.html#SequenceMatch-enum">SequenceMatch</a> QKeySequence.matches (<i>self</i>, <a href="qkeysequence.html">QKeySequence</a> <i>seq</i>)</h3><p>Matches the sequence with <i>seq</i>. Returns <a href="qkeysequence.html#SequenceMatch-enum">ExactMatch</a> if
successful, <a href="qkeysequence.html#SequenceMatch-enum">PartialMatch</a> if
<i>seq</i> matches incompletely, and <a href="qkeysequence.html#SequenceMatch-enum">NoMatch</a> if the sequences
have nothing in common. Returns <a href="qkeysequence.html#SequenceMatch-enum">NoMatch</a> if <i>seq</i> is
shorter.</p>
<h3 class="fn"><a name="mnemonic" /><a href="qkeysequence.html">QKeySequence</a> QKeySequence.mnemonic (QString <i>text</i>)</h3><p>Returns the shortcut key sequence for the mnemonic in
<i>text</i>, or an empty key sequence if no mnemonics are
found.</p>
<p>For example, mnemonic("E&xit") returns
<tt>Qt.ALT+Qt.Key_X</tt>, mnemonic("&Quit") returns
<tt>ALT+Key_Q</tt>, and mnemonic("Quit") returns an empty <a href="qkeysequence.html">QKeySequence</a>.</p>
<p>We provide a <a href="accelerators.html">list of common
mnemonics</a> in English. At the time of writing, Microsoft and
Open Group do not appear to have issued equivalent recommendations
for other languages.</p>
<p><b>See also</b> <a href="qtcore.html#qt_set_sequence_auto_mnemonic">qt_set_sequence_auto_mnemonic</a>().</p>
<h3 class="fn"><a name="swap" />QKeySequence.swap (<i>self</i>, <a href="qkeysequence.html">QKeySequence</a> <i>other</i>)</h3><p>Swaps key sequence <i>other</i> with this key sequence. This
operation is very fast and never fails.</p>
<p>This function was introduced in Qt 4.8.</p>
<h3 class="fn"><a name="toString" />QString QKeySequence.toString (<i>self</i>, <a href="qkeysequence.html#SequenceFormat-enum">SequenceFormat</a> <i>format</i> = QKeySequence.PortableText)</h3><p>Return a string representation of the key sequence, based on
<i>format</i>.</p>
<p>For example, the value <a href="qt.html#Modifier-enum">Qt.CTRL</a>+<a href="qt.html#Key-enum">Qt.Key_O</a> results in "Ctrl+O". If the key
sequence has multiple key codes, each is separated by commas in the
string returned, such as "Alt+X, Ctrl+Y, Z". The strings, "Ctrl",
"Shift", etc. are translated using <a href="qobject.html#tr">QObject.tr</a>() in the "<a href="qshortcut.html">QShortcut</a>" context.</p>
<p>If the key sequence has no keys, an empty string is
returned.</p>
<p>On Mac OS X, the string returned resembles the sequence that is
shown in the menu bar.</p>
<p>This function was introduced in Qt 4.1.</p>
<p><b>See also</b> <a href="qkeysequence.html#fromString">fromString</a>().</p>
<h3 class="fn"><a name="__eq__" />bool QKeySequence.__eq__ (<i>self</i>, <a href="qkeysequence.html">QKeySequence</a> <i>other</i>)</h3><h3 class="fn"><a name="__ge__" />bool QKeySequence.__ge__ (<i>self</i>, <a href="qkeysequence.html">QKeySequence</a> <i>other</i>)</h3><h3 class="fn"><a name="__getitem__" />int QKeySequence.__getitem__ (<i>self</i>, int <i>i</i>)</h3><h3 class="fn"><a name="__gt__" />bool QKeySequence.__gt__ (<i>self</i>, <a href="qkeysequence.html">QKeySequence</a> <i>other</i>)</h3><h3 class="fn"><a name="__int__" />int QKeySequence.__int__ (<i>self</i>)</h3><h3 class="fn"><a name="__le__" />bool QKeySequence.__le__ (<i>self</i>, <a href="qkeysequence.html">QKeySequence</a> <i>other</i>)</h3><h3 class="fn"><a name="__len__" />int QKeySequence.__len__ (<i>self</i>)</h3><h3 class="fn"><a name="__lt__" />bool QKeySequence.__lt__ (<i>self</i>, <a href="qkeysequence.html">QKeySequence</a> <i>ks</i>)</h3><h3 class="fn"><a name="__ne__" />bool QKeySequence.__ne__ (<i>self</i>, <a href="qkeysequence.html">QKeySequence</a> <i>other</i>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.12.1 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qt.io">The Qt Company</a> 2015</td><td align="right" width="25%">Qt 4.8.7</td></tr></table></div></address></body></html>
|