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 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>KAction</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<link rel="stylesheet" type="text/css" href="../common/doxygen.css" />
<link rel="stylesheet" media="screen" type="text/css" title="KDE Colors" href="../common/kde.css" />
</head>
<body>
<div id="container">
<div id="header">
<div id="header_top">
<div>
<div>
<img alt ="" src="../common/top-kde.jpg"/>
KDE 4.9 PyKDE API Reference
</div>
</div>
</div>
<div id="header_bottom">
<div id="location">
<ul>
<li>KDE's Python API</li>
</ul>
</div>
<div id="menu">
<ul>
<li><a href="../modules.html">Overview</a></li>
<li><a href="http://techbase.kde.org/Development/Languages/Python">PyKDE Home</a></li>
<li><a href="http://kde.org/family/">Sitemap</a></li>
<li><a href="http://kde.org/contact/">Contact Us</a></li>
</ul>
</div>
</div>
</div>
<div id="body_wrapper">
<div id="body">
<div id="right">
<div class="content">
<div id="main">
<div class="clearer"> </div>
<h1>KAction Class Reference</h1>
<code>from PyKDE4.kdeui import *</code>
<p>
Inherits: QWidgetAction → QAction → QObject<br />
Subclasses: <a href="../kdeui/KActionMenu.html">KActionMenu</a>, <a href="../kdeui/KDualAction.html">KDualAction</a>, <a href="../kdeui/KPasteTextAction.html">KPasteTextAction</a>, <a href="../kdeui/KSelectAction.html">KSelectAction</a>, <a href="../kdeui/KToggleAction.html">KToggleAction</a>, <a href="../kdeui/KToolBarLabelAction.html">KToolBarLabelAction</a>, <a href="../kdeui/KToolBarPopupAction.html">KToolBarPopupAction</a>, <a href="../kdeui/KToolBarSpacerAction.html">KToolBarSpacerAction</a><br />
<h2>Detailed Description</h2>
<p>Class to encapsulate user-driven action or event
@extends QAction
</p>
<p>
The KAction class (and derived and super classes) extends QAction,
which provides a way to easily encapsulate a "real" user-selected
action or event in your program.
</p>
<p>
For instance, a user may want to <b>paste</b> the contents of
the clipboard, <b>scroll</b> <b>down</b> a document, or <b>quit</b> the
application. These are all <b>actions</b> -- events that the
user causes to happen. The KAction class allows the developer to
deal with these actions in an easy and intuitive manner, and conforms
to KDE's extended functionality requirements - including supporting
multiple user-configurable shortcuts, and KDE named icons. Actions
also improve accessibility.
</p>
<p>
Specifically, QAction (and thus KAction) encapsulates the various attributes
of an event/action. For instance, an action might have an icon()
that provides a visual representation (a clipboard for a "paste" action or
scissors for a "cut" action). The action should also be described by some text().
It will certainly be connected to a method that actually <b>executes</b> the action!
All these attributes are contained within the action object.
</p>
<p>
The advantage of dealing with actions is that you can manipulate
the Action without regard to the GUI representation of it. For
instance, in the "normal" way of dealing with actions like "cut",
you would manually insert a item for Cut into a menu and a button
into a toolbar. If you want to disable the cut action for a moment
(maybe nothing is selected), you would have to hunt down the pointer
to the menu item and the toolbar button and disable both
individually. Setting the menu item and toolbar item up uses very
similar code - but has to be done twice!
</p>
<p>
With the action concept, you simply add the action to whatever
GUI element you want. The KAction class will then take care of
correctly defining the menu item (with icons, accelerators, text,
etc), toolbar button, or other. From then on, if you
manipulate the action at all, the effect will propagate through all
GUI representations of it. Back to the "cut" example: if you want
to disable the Cut Action, you would simply call
'cutAction->setEnabled(false)' and both the menuitem and button would
instantly be disabled!
</p>
<p>
This is the biggest advantage to the action concept -- there is a
one-to-one relationship between the "real" action and <b>all</b>
GUI representations of it.
</p>
<p>
KAction emits the hovered() signal on mouseover, and the triggered(bool checked)
signal on activation of a corresponding GUI element ( menu item, toolbar button, etc. )
</p>
<p>
If you are in the situation of wanting to map the triggered()
signal of multiple action objects to one slot, with a special
argument bound to each action, you have several options:
</p>
<p>
Using QActionGroup:
<li> Create a QActionGroup and assign it to each of the actions with setActionGroup(), then </li>
<li> Connect the QActionGroup.triggered(QAction*) signal to your slot. </li>
</p>
<p>
Using QSignalMapper:
<pre class="fragment">
QSignalMapper *desktopNumberMapper = new QSignalMapper( this );
connect( desktopNumberMapper, SIGNAL( mapped( int ) ),
this, SLOT( moveWindowToDesktop( int ) ) );
for ( uint i = 0; i < numberOfDesktops; ++i ) {
KAction *desktopAction = new KAction( i18n( "Move Window to Desktop %i" ).arg( i ), ... );
connect( desktopAction, SIGNAL( triggered(bool) ), desktopNumberMapper, SLOT( map() ) );
desktopNumberMapper->setMapping( desktopAction, i );
}
</pre>
</p>
<p>
<b>General Usage </b>
</p>
<p>
The steps to using actions are roughly as follows:
</p>
<p>
<li> Decide which attributes you want to associate with a given </li>
action (icons, text, keyboard shortcut, etc)
<li> Create the action using KAction (or derived or super class). </li>
<li> Add the action into whatever GUI element you want. Typically, </li>
this will be a menu or toolbar.
</p>
<p>
<b>The kinds of shortcuts </b>
</p>
<p>
Local shortcuts are active if their context has the focus, global shortcus
are active even if the program does not have the focus. If a global
shortcut and a local shortcut are ambiguous the global shortcut wins.
</p>
<p>
<li> Active shortcuts trigger a KAction if activated. </li>
<li> Default shortcuts are what the active shortcuts revert to if the user chooses </li>
to reset shortcuts to default.
</p>
<p>
<b>Detailed Example </b>
</p>
<p>
Here is an example of enabling a "New [document]" action
<pre class="fragment">
KAction *newAct = actionCollection()->addAction(
KStandardAction.New, //< see KStandardAction
this, //< Receiver
SLOT(fileNew()) ); //< SLOT
</pre>
</p>
<p>
This section creates our action. Text, Icon and Shortcut will be set from
KStandardAction. KStandardAction ensures your application complies to the
platform standards. When triggered the fileNew() slot will be called.
</p>
<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd> KStandardAction for more information.
</dd></dl> </p>
<p>
If you want to create your own actions use
<pre class="fragment">
KAction *newAct = actionCollection()->addAction("quick-connect");
newAct->setText(i18n("Quick Connect"))
newAct->setIcon(KIcon("quick-connect"));
newAct->setShortcut(Qt.Key_F6);
connect(newAct, SIGNAL(triggered()), this, SLOT(quickConnect()));
</pre>
</p>
<p>
This section creates our action. It displays the text "Quick Connect",
uses the Icon "quick-connect" and pressing F6 will trigger it. When
invoked, the slot quickConnect() is called.
</p>
<p>
<pre class="fragment">
QMenu *file = new QMenu;
file->addAction(newAct);
</pre>
That just inserted the action into the File menu. The point is, it's not
important in which menu it is: all manipulation of the item is
done through the newAct object.
</p>
<p>
<pre class="fragment">
toolBar()->addAction(newAct);
</pre>
And this added the action into the main toolbar as a button.
</p>
<p>
That's it!
</p>
<p>
If you want to disable that action sometime later, you can do so
with
<pre class="fragment">
newAct->setEnabled(false)
</pre>
and both the menuitem in File and the toolbar button will instantly
be disabled.
</p>
<p>
Unlike with previous versions of KDE, the action can simply be deleted
when you have finished with it - the destructor takes care of all
of the cleanup.
</p>
<p>
<dl class="warning" compact><dt><b>Warning:</b></dt><dd> calling QAction.setShortcut() on a KAction may lead to unexpected
behavior. There is nothing we can do about it because QAction.setShortcut()
is not virtual.
</dd></dl> </p>
<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd> if you are using a "standard" action like "new", "paste",
"quit", or any other action described in the KDE UI Standards,
please use the methods in the KStandardAction class rather than
defining your own.
</dd></dl> </p>
<p>
<b>Using QActions </b>
</p>
<p>
Mixing QActions and KActions in an application is not a
good idea. KShortcutsEditor doesn't handle QActions at all.
</p>
<p>
<b>Usage Within the XML Framework </b>
</p>
<p>
If you are using KAction within the context of the XML menu and
toolbar building framework, you do not ever
have to add your actions to containers manually. The framework
does that for you.
</p>
<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd> KStandardAction
</dd></dl>
</p>
<table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="2"><br><h2>Enumerations</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="#GlobalShortcutLoading">GlobalShortcutLoading</a> </td><td class="memItemRight" valign="bottom">{ Autoloading, NoAutoloading }</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="#ShortcutType">ShortcutType</a> </td><td class="memItemRight" valign="bottom">{ ActiveShortcut, DefaultShortcut }</td></tr>
<tr><td colspan="2"><br><h2>Signals</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#authorized">authorized</a> (<a href="../kdecore/KAuth.Action.html">KAuth.Action</a> action)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#globalShortcutChanged">globalShortcutChanged</a> (QKeySequence a0)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#triggered">triggered</a> (<a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qt.html">Qt::MouseButtons</a> buttons, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qt.html">Qt::KeyboardModifiers</a> modifiers)</td></tr>
<tr><td colspan="2"><br><h2>Methods</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#KAction">__init__</a> (self, QObject parent)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#KAction">__init__</a> (self, QString text, QObject parent)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#KAction">__init__</a> (self, <a href="../kdeui/KIcon.html">KIcon</a> icon, QString text, QObject parent)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdecore/KAuth.Action.html">KAuth.Action</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#authAction">authAction</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#event">event</a> (self, QEvent a0)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#forgetGlobalShortcut">forgetGlobalShortcut</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdeui/KShortcut.html">KShortcut</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#globalShortcut">globalShortcut</a> (self, <a href="../kdeui/KAction.html">KAction.ShortcutTypes</a> type=KAction.ActiveShortcut)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#globalShortcutAllowed">globalShortcutAllowed</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#isGlobalShortcutEnabled">isGlobalShortcutEnabled</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#isShortcutConfigurable">isShortcutConfigurable</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdeui/KRockerGesture.html">KRockerGesture</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#rockerGesture">rockerGesture</a> (self, <a href="../kdeui/KAction.html">KAction.ShortcutTypes</a> type=KAction.ActiveShortcut)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setAuthAction">setAuthAction</a> (self, <a href="../kdecore/KAuth.Action.html">KAuth.Action</a> action)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setAuthAction">setAuthAction</a> (self, QString actionName)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setGlobalShortcut">setGlobalShortcut</a> (self, <a href="../kdeui/KShortcut.html">KShortcut</a> shortcut, <a href="../kdeui/KAction.html">KAction.ShortcutTypes</a> type=KAction.ShortcutTypes(KAction.ActiveShortcut|KAction.DefaultShortcut), <a href="../kdeui/KAction.html#GlobalShortcutLoading">KAction.GlobalShortcutLoading</a> loading=KAction.Autoloading)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setGlobalShortcutAllowed">setGlobalShortcutAllowed</a> (self, bool allowed, <a href="../kdeui/KAction.html#GlobalShortcutLoading">KAction.GlobalShortcutLoading</a> loading=KAction.Autoloading)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setHelpText">setHelpText</a> (self, QString text)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setRockerGesture">setRockerGesture</a> (self, <a href="../kdeui/KRockerGesture.html">KRockerGesture</a> gest, <a href="../kdeui/KAction.html">KAction.ShortcutTypes</a> type=KAction.ShortcutTypes(KAction.ActiveShortcut|KAction.DefaultShortcut))</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setShapeGesture">setShapeGesture</a> (self, <a href="../kdeui/KShapeGesture.html">KShapeGesture</a> gest, <a href="../kdeui/KAction.html">KAction.ShortcutTypes</a> type=KAction.ShortcutTypes(KAction.ActiveShortcut|KAction.DefaultShortcut))</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setShortcut">setShortcut</a> (self, <a href="../kdeui/KShortcut.html">KShortcut</a> shortcut, <a href="../kdeui/KAction.html">KAction.ShortcutTypes</a> type=KAction.ShortcutTypes(KAction.ActiveShortcut|KAction.DefaultShortcut))</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setShortcut">setShortcut</a> (self, QKeySequence shortcut, <a href="../kdeui/KAction.html">KAction.ShortcutTypes</a> type=KAction.ShortcutTypes(KAction.ActiveShortcut|KAction.DefaultShortcut))</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setShortcutConfigurable">setShortcutConfigurable</a> (self, bool configurable)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setShortcuts">setShortcuts</a> (self, [QKeySequence] shortcuts, <a href="../kdeui/KAction.html">KAction.ShortcutTypes</a> type=KAction.ShortcutTypes(KAction.ActiveShortcut|KAction.DefaultShortcut))</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdeui/KShapeGesture.html">KShapeGesture</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#shapeGesture">shapeGesture</a> (self, <a href="../kdeui/KAction.html">KAction.ShortcutTypes</a> type=KAction.ActiveShortcut)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdeui/KShortcut.html">KShortcut</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#shortcut">shortcut</a> (self, <a href="../kdeui/KAction.html">KAction.ShortcutTypes</a> types=KAction.ActiveShortcut)</td></tr>
</table>
<hr><h2>Signal Documentation</h2><a class="anchor" name="authorized"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> authorized</td>
<td>(</td>
<td class="paramtype"><a href="../kdecore/KAuth.Action.html">KAuth.Action</a> </td>
<td class="paramname"><em>action</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Signal emitted when the action is triggered and authorized
</p>
<p>
If the action needs authorization, when the user triggers the action,
the authorization process automatically begins.
If it succeeds, this signal is emitted. The KAuth.Action object is provided for convenience
if you have multiple KAuthorizedAction objects, but of course it's always the same set with
setAuthAction().
</p>
<p>
WARNING: If your action needs authorization you should connect eventual slots processing
stuff to this signal, and NOT triggered. Triggered will be emitted even if the user has not
been authorized
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>action</em> </td><td> The object set with setAuthAction()
</td></tr>
</table></dl>
<p>
</p><dl compact><dt><b>Signal syntax:</b></dt><dd><code>QObject.connect(source, SIGNAL("authorized(KAuth::Action*)"), target_slot)</code></dd></dl></div></div><a class="anchor" name="globalShortcutChanged"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> globalShortcutChanged</td>
<td>(</td>
<td class="paramtype">QKeySequence </td>
<td class="paramname"><em>a0</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Emitted when the global shortcut is changed. A global shortcut is
subject to be changed by the global shortcuts kcm.
</p><dl compact><dt><b>Signal syntax:</b></dt><dd><code>QObject.connect(source, SIGNAL("globalShortcutChanged(const QKeySequence&)"), target_slot)</code></dd></dl></div></div><a class="anchor" name="triggered"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> triggered</td>
<td>(</td>
<td class="paramtype"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qt.html">Qt::MouseButtons</a> </td>
<td class="paramname"><em>buttons</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qt.html">Qt::KeyboardModifiers</a> </td>
<td class="paramname"><em>modifiers</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Emitted when the action is triggered. Also provides the state of the
keyboard modifiers and mouse buttons at the time.
</p><dl compact><dt><b>Signal syntax:</b></dt><dd><code>QObject.connect(source, SIGNAL("triggered(Qt::MouseButtons, Qt::KeyboardModifiers)"), target_slot)</code></dd></dl></div></div><hr><h2>Method Documentation</h2><a class="anchor" name="KAction"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">__init__</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QObject </td>
<td class="paramname"><em>parent</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Constructs an action.
</p></div></div><a class="anchor" name="KAction"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">__init__</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QString </td>
<td class="paramname"><em>text</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QObject </td>
<td class="paramname"><em>parent</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Constructs an action with the specified parent and visible text.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>text</em> </td><td> The visible text for this action.
<tr><td></td><td valign="top"><em>parent</em> </td><td> The parent for this action.
</td></tr>
</table></dl>
<p>
</p></div></div><a class="anchor" name="KAction"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">__init__</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdeui/KIcon.html">KIcon</a> </td>
<td class="paramname"><em>icon</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QString </td>
<td class="paramname"><em>text</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QObject </td>
<td class="paramname"><em>parent</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Constructs an action with text and icon; a shortcut may be specified by
the ampersand character (e.g. \"&amp;Option\" creates a shortcut with key O )
</p>
<p>
This is the other common KAction constructor used. Use it when you
do have a corresponding icon.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>icon</em> </td><td> The icon to display.
<tr><td></td><td valign="top"><em>text</em> </td><td> The text that will be displayed.
<tr><td></td><td valign="top"><em>parent</em> </td><td> The parent for this action.
</td></tr>
</table></dl>
<p>
</p></div></div><a class="anchor" name="authAction"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../kdecore/KAuth.Action.html">KAuth.Action</a> authAction</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns the action object associated with this action, or 0 if it does not have one
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> the KAuth.Action associated with this action.
</dd></dl>
</p></div></div><a class="anchor" name="event"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool event</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QEvent </td>
<td class="paramname"><em>a0</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>
</p></div></div><a class="anchor" name="forgetGlobalShortcut"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> forgetGlobalShortcut</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Sets the globalShortcutEnabled property to false and sets the global shortcut to an
empty shortcut.
This will also wipe out knowlegde about the existence of this action's global shortcut
so it will not be considered anymore for shortcut conflict resolution. It will also not be
visible anymore in the shortcuts KControl module.
This method should not be used unless these effects are explicitly desired.
<dl class="since" compact><dt><b>Since:</b></dt><dd> 4.1
</dd></dl>
</p></div></div><a class="anchor" name="globalShortcut"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../kdeui/KShortcut.html">KShortcut</a> globalShortcut</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdeui/KAction.html">KAction.ShortcutTypes</a> </td>
<td class="paramname"><em>type=KAction.ActiveShortcut</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Get the global shortcut for this action, if one exists. Global shortcuts
allow your actions to respond to accellerators independently of the focused window.
Unlike regular shortcuts, the application's window does not need focus
for them to be activated.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>type</em> </td><td> the type of shortcut to be returned. Should both be specified, only the
active shortcut will be returned. Defaults to the active shortcut,
if one exists.
</td></tr>
</table></dl>
<p> \sa KGlobalAccel
\sa setGlobalShortcut()
</p></div></div><a class="anchor" name="globalShortcutAllowed"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool globalShortcutAllowed</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns true if this action is permitted to have a global shortcut.
Defaults to false.
Use isGlobalShortcutEnabled() instead.
</p></div></div><a class="anchor" name="isGlobalShortcutEnabled"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool isGlobalShortcutEnabled</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns true if this action is enabled to have a global shortcut.
This will be respected by \class KGlobalShortcutsEditor.
Defaults to false.
</p></div></div><a class="anchor" name="isShortcutConfigurable"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool isShortcutConfigurable</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns true if this action's shortcut is configurable.
</p></div></div><a class="anchor" name="rockerGesture"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../kdeui/KRockerGesture.html">KRockerGesture</a> rockerGesture</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdeui/KAction.html">KAction.ShortcutTypes</a> </td>
<td class="paramname"><em>type=KAction.ActiveShortcut</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="setAuthAction"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> setAuthAction</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdecore/KAuth.Action.html">KAuth.Action</a> </td>
<td class="paramname"><em>action</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Sets the action object associated with this action
</p>
<p>
Overloaded member to allow creating the action by name
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>actionName</em> </td><td> the name of the action to associate
</td></tr>
</table></dl>
<p>
</p></div></div><a class="anchor" name="setAuthAction"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> setAuthAction</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QString </td>
<td class="paramname"><em>actionName</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Sets the action object associated with this action
</p>
<p>
Overloaded member to allow creating the action by name
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>actionName</em> </td><td> the name of the action to associate
</td></tr>
</table></dl>
<p>
</p></div></div><a class="anchor" name="setGlobalShortcut"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> setGlobalShortcut</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdeui/KShortcut.html">KShortcut</a> </td>
<td class="paramname"><em>shortcut</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdeui/KAction.html">KAction.ShortcutTypes</a> </td>
<td class="paramname"><em>type=KAction.ShortcutTypes(KAction.ActiveShortcut|KAction.DefaultShortcut)</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdeui/KAction.html#GlobalShortcutLoading">KAction.GlobalShortcutLoading</a> </td>
<td class="paramname"><em>loading=KAction.Autoloading</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Assign a global shortcut for this action. Global shortcuts
allow an action to respond to key shortcuts independently of the focused window,
i.e. the action will trigger if the keys were pressed no matter where in the X session.
</p>
<p>
The action must have a per main component unique
objectName() to enable cross-application bookeeping. If the objectName() is empty this method will
do nothing, otherwise the isGlobalShortcutEnabled() property will be set to true and the
shortcut will be enabled.
It is mandatory that the objectName() doesn't change once isGlobalshortcutEnabled()
has become true.
</p>
<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd> KActionCollection.insert(name, action) will set action's objectName to name so you often
don't have to set an objectName explicitly.
</dd></dl> </p>
<p>
When an action, identified by main component name and objectName(), is assigned
a global shortcut for the first time on a KDE installation the assignment will
be saved. The shortcut will then be restored every time setGlobalShortcut() is
called with <b>loading</b> == Autoloading.
</p>
<p>
If you actually want to change the global shortcut you have to set
<b>loading</b> to NoAutoloading. The new shortcut will be automatically saved again.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>shortcut</em> </td><td> global shortcut(s) to assign. Will be ignored unless <b>loading</b> is set to NoAutoloading or this is the first time ever you call this method (see above).
</td></tr> </table></dl>
<p> </p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>type</em> </td><td> the type of shortcut to be set, whether the active shortcut, the default shortcut,
or both (the default).
</td></tr> </table></dl>
<p> </p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>loading</em> </td><td> if Autoloading, assign the global shortcut this action has previously had if any.
That way user preferences and changes made to avoid clashes will be conserved.
if NoAutoloading the given shortcut will be assigned without looking up old values.
You should only do this if the user wants to change the shortcut or if you have
another very good reason. Key combinations that clash with other shortcuts will be
dropped.
</td></tr>
</table></dl>
<p> <dl class="note" compact><dt><b>Note:</b></dt><dd> the default shortcut will never be influenced by autoloading - it will be set as given.
</dd></dl> \sa globalShortcut()
</p></div></div><a class="anchor" name="setGlobalShortcutAllowed"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> setGlobalShortcutAllowed</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"><em>allowed</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdeui/KAction.html#GlobalShortcutLoading">KAction.GlobalShortcutLoading</a> </td>
<td class="paramname"><em>loading=KAction.Autoloading</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Indicate whether the programmer and/or user may define a global shortcut for this action.
Defaults to false. Note that calling setGlobalShortcut() turns this on automatically.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>allowed</em> </td><td> set to true if this action may have a global shortcut, otherwise false.
</td></tr> </table></dl>
<p> </p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>loading</em> </td><td> if Autoloading, assign to this action the global shortcut it has previously had
if any.
</td></tr>
</table></dl>
<p>
</p></div></div><a class="anchor" name="setHelpText"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> setHelpText</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QString </td>
<td class="paramname"><em>text</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Sets the help text for the action.
This help text will be set for all help mechanisms:
- the status-bar help text
- the tooltip (for toolbar buttons)
- the "WhatsThis" help text (unless one was already set)
</p>
<p>
This is more convenient than calling all three methods with the
same text, and this level of abstraction can allow to change
the default implementation of help one day more easily.
Of course you can also call setStatusTip, setToolTip and setWhatsThis
separately for more flexibility.
</p>
<p>
This method is also the easiest way to port from KDE3's KAction.setToolTip.
</p>
<p>
<dl class="since" compact><dt><b>Since:</b></dt><dd> 4.3
</dd></dl>
</p></div></div><a class="anchor" name="setRockerGesture"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> setRockerGesture</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdeui/KRockerGesture.html">KRockerGesture</a> </td>
<td class="paramname"><em>gest</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdeui/KAction.html">KAction.ShortcutTypes</a> </td>
<td class="paramname"><em>type=KAction.ShortcutTypes(KAction.ActiveShortcut|KAction.DefaultShortcut)</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="setShapeGesture"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> setShapeGesture</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdeui/KShapeGesture.html">KShapeGesture</a> </td>
<td class="paramname"><em>gest</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdeui/KAction.html">KAction.ShortcutTypes</a> </td>
<td class="paramname"><em>type=KAction.ShortcutTypes(KAction.ActiveShortcut|KAction.DefaultShortcut)</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="setShortcut"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> setShortcut</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdeui/KShortcut.html">KShortcut</a> </td>
<td class="paramname"><em>shortcut</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdeui/KAction.html">KAction.ShortcutTypes</a> </td>
<td class="paramname"><em>type=KAction.ShortcutTypes(KAction.ActiveShortcut|KAction.DefaultShortcut)</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>void setShortcut(const KShortcut& shortcut)
</p>
<p>
Set the primary shortcut only for this action.
</p>
<p>
This function is there to explicitly override QAction.setShortcut(const QKeySequence&).
QAction.setShortcut() will bypass everything in KAction and may lead to unexpected behavior.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>shortcut</em> </td><td> shortcut(s) to use for this action in its specified shortcutContext()
</td></tr> </table></dl>
<p> </p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>type</em> </td><td> type of shortcut to be set: active shortcut,
default shortcut, or both (default argument value).
</td></tr>
</table></dl>
<p>
</p></div></div><a class="anchor" name="setShortcut"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> setShortcut</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QKeySequence </td>
<td class="paramname"><em>shortcut</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdeui/KAction.html">KAction.ShortcutTypes</a> </td>
<td class="paramname"><em>type=KAction.ShortcutTypes(KAction.ActiveShortcut|KAction.DefaultShortcut)</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>void setShortcut(const KShortcut& shortcut)
</p>
<p>
Set the primary shortcut only for this action.
</p>
<p>
This function is there to explicitly override QAction.setShortcut(const QKeySequence&).
QAction.setShortcut() will bypass everything in KAction and may lead to unexpected behavior.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>shortcut</em> </td><td> shortcut(s) to use for this action in its specified shortcutContext()
</td></tr> </table></dl>
<p> </p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>type</em> </td><td> type of shortcut to be set: active shortcut,
default shortcut, or both (default argument value).
</td></tr>
</table></dl>
<p>
</p></div></div><a class="anchor" name="setShortcutConfigurable"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> setShortcutConfigurable</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"><em>configurable</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Indicate whether the user may configure the action's shortcut.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>configurable</em> </td><td> set to true if this shortcut may be configured by the user, otherwise false.
</td></tr>
</table></dl>
<p>
</p></div></div><a class="anchor" name="setShortcuts"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> setShortcuts</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">[QKeySequence] </td>
<td class="paramname"><em>shortcuts</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdeui/KAction.html">KAction.ShortcutTypes</a> </td>
<td class="paramname"><em>type=KAction.ShortcutTypes(KAction.ActiveShortcut|KAction.DefaultShortcut)</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>void setShortcuts(const QList<QKeySequence>& shortcuts).
</p>
<p>
Set the shortcuts for this action.
</p>
<p>
This function is there to explicitly override QAction.setShortcut(const QList<QKeySequence>&).
QAction.setShortcuts() will bypass everything in KAction and may lead to unexpected behavior.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>shortcut</em> </td><td> shortcut(s) to use for this action in its specified shortcutContext()
</td></tr> </table></dl>
<p> </p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>type</em> </td><td> type of shortcut to be set: active shortcut,
default shortcut, or both (default argument value).
</td></tr>
</table></dl>
<p>
</p></div></div><a class="anchor" name="shapeGesture"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../kdeui/KShapeGesture.html">KShapeGesture</a> shapeGesture</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdeui/KAction.html">KAction.ShortcutTypes</a> </td>
<td class="paramname"><em>type=KAction.ActiveShortcut</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="shortcut"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../kdeui/KShortcut.html">KShortcut</a> shortcut</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdeui/KAction.html">KAction.ShortcutTypes</a> </td>
<td class="paramname"><em>types=KAction.ActiveShortcut</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Get the shortcut for this action.
</p>
<p>
This is preferred over QAction.shortcut(), as it allows for multiple shortcuts
per action. The first and second shortcut as reported by shortcuts() will be the
primary and alternate shortcut of the shortcut returned.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>types</em> </td><td> the type of shortcut to return. Should both be specified, only the
active shortcut will be returned. Defaults to the active shortcut, if one exists.
</td></tr> </table></dl>
<p> \sa shortcuts()
</p></div></div><hr><h2>Enumeration Documentation</h2><a class="anchor" name="GlobalShortcutLoading"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr><td class="memname">GlobalShortcutLoading</td>
</tr>
</table>
</div>
<div class="memdoc"><p>An enum about global shortcut setter semantics
</p><dl compact><dt><b>Enumerator: </b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0"><tr><td valign="top"><em>Autoloading</em> = 0x0</td><td><tr><td valign="top"><em>NoAutoloading</em> = 0x4</td><td></table>
</dl>
</div></div><p><a class="anchor" name="ShortcutType"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr><td class="memname">ShortcutType</td>
</tr>
</table>
</div>
<div class="memdoc"><p>An enumeration about the two types of shortcuts in a KAction
</p><dl compact><dt><b>Enumerator: </b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0"><tr><td valign="top"><em>None</em> = 0x00</td><td><tr><td valign="top"><em>LocalShortcuts</em> = 0x01</td><td><tr><td valign="top"><em>StandardShortcuts</em> = 0x02</td><td><tr><td valign="top"><em>GlobalShortcuts</em> = 0x03</td><td></table>
</dl>
</div></div><p>
</div>
</div>
</div>
<div id="left">
<div class="menu_box">
<div class="nav_list">
<ul>
<li><a href="../allclasses.html">Full Index</a></li>
</ul>
</div>
<a name="cp-menu" /><div class="menutitle"><div>
<h2 id="cp-menu-project">Modules</h2>
</div></div>
<div class="nav_list">
<ul><li><a href="../akonadi/index.html">akonadi</a></li>
<li><a href="../dnssd/index.html">dnssd</a></li>
<li><a href="../kdecore/index.html">kdecore</a></li>
<li><a href="../kdeui/index.html">kdeui</a></li>
<li><a href="../khtml/index.html">khtml</a></li>
<li><a href="../kio/index.html">kio</a></li>
<li><a href="../knewstuff/index.html">knewstuff</a></li>
<li><a href="../kparts/index.html">kparts</a></li>
<li><a href="../kutils/index.html">kutils</a></li>
<li><a href="../nepomuk/index.html">nepomuk</a></li>
<li><a href="../phonon/index.html">phonon</a></li>
<li><a href="../plasma/index.html">plasma</a></li>
<li><a href="../polkitqt/index.html">polkitqt</a></li>
<li><a href="../solid/index.html">solid</a></li>
<li><a href="../soprano/index.html">soprano</a></li>
</ul></div></div>
</div>
</div>
<div class="clearer"/>
</div>
<div id="end_body"></div>
</div>
<div id="footer"><div id="footer_text">
This documentation is maintained by <a href="mailto:simon@simonzone.com">Simon Edwards</a>.<br />
KDE<sup>®</sup> and <a href="../images/kde_gear_black.png">the K Desktop Environment<sup>®</sup> logo</a> are registered trademarks of <a href="http://ev.kde.org/" title="Homepage of the KDE non-profit Organization">KDE e.V.</a> |
<a href="http://www.kde.org/contact/impressum.php">Legal</a>
</div></div>
</body>
</html>
|