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
|
<?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>QAbstractItemView 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">QAbstractItemView Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QAbstractItemView class provides the basic functionality for
item view classes. <a href="#details">More...</a></p>
<p>Inherits <a href="qabstractscrollarea.html">QAbstractScrollArea</a>.</p><p>Inherited by <a href="qcolumnview.html">QColumnView</a>, <a href="qheaderview.html">QHeaderView</a>, <a href="qlistview.html">QListView</a>, <a href="qtableview.html">QTableView</a> and <a href="qtreeview.html">QTreeView</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qabstractitemview.html#CursorAction-enum">CursorAction</a></b> { MoveUp, MoveDown, MoveLeft, MoveRight, ..., MovePrevious }</li><li><div class="fn" />enum <b><a href="qabstractitemview.html#DragDropMode-enum">DragDropMode</a></b> { NoDragDrop, DragOnly, DropOnly, DragDrop, InternalMove }</li><li><div class="fn" />enum <b><a href="qabstractitemview.html#DropIndicatorPosition-enum">DropIndicatorPosition</a></b> { OnItem, AboveItem, BelowItem, OnViewport }</li><li><div class="fn" />enum <b><a href="qabstractitemview.html#EditTrigger-enum">EditTrigger</a></b> { NoEditTriggers, CurrentChanged, DoubleClicked, SelectedClicked, ..., AllEditTriggers }</li><li><div class="fn" />class <b><a href="qabstractitemview-edittriggers.html">EditTriggers</a></b></li><li><div class="fn" />enum <b><a href="qabstractitemview.html#ScrollHint-enum">ScrollHint</a></b> { EnsureVisible, PositionAtTop, PositionAtBottom, PositionAtCenter }</li><li><div class="fn" />enum <b><a href="qabstractitemview.html#ScrollMode-enum">ScrollMode</a></b> { ScrollPerItem, ScrollPerPixel }</li><li><div class="fn" />enum <b><a href="qabstractitemview.html#SelectionBehavior-enum">SelectionBehavior</a></b> { SelectItems, SelectRows, SelectColumns }</li><li><div class="fn" />enum <b><a href="qabstractitemview.html#SelectionMode-enum">SelectionMode</a></b> { NoSelection, SingleSelection, MultiSelection, ExtendedSelection, ContiguousSelection }</li><li><div class="fn" />enum <b><a href="qabstractitemview.html#State-enum">State</a></b> { NoState, DraggingState, DragSelectingState, EditingState, ..., AnimatingState }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qabstractitemview.html#QAbstractItemView">__init__</a></b> (<i>self</i>, QWidget <i>parent</i> = None)</li><li><div class="fn" />bool <b><a href="qabstractitemview.html#alternatingRowColors">alternatingRowColors</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qabstractitemview.html#autoScrollMargin">autoScrollMargin</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#clearSelection">clearSelection</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#closeEditor">closeEditor</a></b> (<i>self</i>, QWidget <i>editor</i>, QAbstractItemDelegate.EndEditHint <i>hint</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#closePersistentEditor">closePersistentEditor</a></b> (<i>self</i>, QModelIndex <i>index</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#commitData">commitData</a></b> (<i>self</i>, QWidget <i>editor</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#currentChanged">currentChanged</a></b> (<i>self</i>, QModelIndex <i>current</i>, QModelIndex <i>previous</i>)</li><li><div class="fn" />QModelIndex <b><a href="qabstractitemview.html#currentIndex">currentIndex</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#dataChanged">dataChanged</a></b> (<i>self</i>, QModelIndex <i>topLeft</i>, QModelIndex <i>bottomRight</i>)</li><li><div class="fn" />Qt.DropAction <b><a href="qabstractitemview.html#defaultDropAction">defaultDropAction</a></b> (<i>self</i>)</li><li><div class="fn" />QPoint <b><a href="qabstractitemview.html#dirtyRegionOffset">dirtyRegionOffset</a></b> (<i>self</i>)</li><li><div class="fn" />DragDropMode <b><a href="qabstractitemview.html#dragDropMode">dragDropMode</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qabstractitemview.html#dragDropOverwriteMode">dragDropOverwriteMode</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qabstractitemview.html#dragEnabled">dragEnabled</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#dragEnterEvent">dragEnterEvent</a></b> (<i>self</i>, QDragEnterEvent <i>e</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#dragLeaveEvent">dragLeaveEvent</a></b> (<i>self</i>, QDragLeaveEvent <i>e</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#dragMoveEvent">dragMoveEvent</a></b> (<i>self</i>, QDragMoveEvent <i>e</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#dropEvent">dropEvent</a></b> (<i>self</i>, QDropEvent <i>e</i>)</li><li><div class="fn" />DropIndicatorPosition <b><a href="qabstractitemview.html#dropIndicatorPosition">dropIndicatorPosition</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#edit">edit</a></b> (<i>self</i>, QModelIndex <i>index</i>)</li><li><div class="fn" />bool <b><a href="qabstractitemview.html#edit-2">edit</a></b> (<i>self</i>, QModelIndex <i>index</i>, EditTrigger <i>trigger</i>, QEvent <i>event</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#editorDestroyed">editorDestroyed</a></b> (<i>self</i>, QObject <i>editor</i>)</li><li><div class="fn" />EditTriggers <b><a href="qabstractitemview.html#editTriggers">editTriggers</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qabstractitemview.html#event">event</a></b> (<i>self</i>, QEvent <i>event</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#executeDelayedItemsLayout">executeDelayedItemsLayout</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#focusInEvent">focusInEvent</a></b> (<i>self</i>, QFocusEvent <i>e</i>)</li><li><div class="fn" />bool <b><a href="qabstractitemview.html#focusNextPrevChild">focusNextPrevChild</a></b> (<i>self</i>, bool <i>next</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#focusOutEvent">focusOutEvent</a></b> (<i>self</i>, QFocusEvent <i>e</i>)</li><li><div class="fn" />bool <b><a href="qabstractitemview.html#hasAutoScroll">hasAutoScroll</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qabstractitemview.html#horizontalOffset">horizontalOffset</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#horizontalScrollbarAction">horizontalScrollbarAction</a></b> (<i>self</i>, int <i>action</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#horizontalScrollbarValueChanged">horizontalScrollbarValueChanged</a></b> (<i>self</i>, int <i>value</i>)</li><li><div class="fn" />ScrollMode <b><a href="qabstractitemview.html#horizontalScrollMode">horizontalScrollMode</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qabstractitemview.html#horizontalStepsPerItem">horizontalStepsPerItem</a></b> (<i>self</i>)</li><li><div class="fn" />QSize <b><a href="qabstractitemview.html#iconSize">iconSize</a></b> (<i>self</i>)</li><li><div class="fn" />QModelIndex <b><a href="qabstractitemview.html#indexAt">indexAt</a></b> (<i>self</i>, QPoint <i>p</i>)</li><li><div class="fn" />QWidget <b><a href="qabstractitemview.html#indexWidget">indexWidget</a></b> (<i>self</i>, QModelIndex <i>index</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#inputMethodEvent">inputMethodEvent</a></b> (<i>self</i>, QInputMethodEvent <i>event</i>)</li><li><div class="fn" />QVariant <b><a href="qabstractitemview.html#inputMethodQuery">inputMethodQuery</a></b> (<i>self</i>, Qt.InputMethodQuery <i>query</i>)</li><li><div class="fn" />bool <b><a href="qabstractitemview.html#isIndexHidden">isIndexHidden</a></b> (<i>self</i>, QModelIndex <i>index</i>)</li><li><div class="fn" />QAbstractItemDelegate <b><a href="qabstractitemview.html#itemDelegate">itemDelegate</a></b> (<i>self</i>)</li><li><div class="fn" />QAbstractItemDelegate <b><a href="qabstractitemview.html#itemDelegate-2">itemDelegate</a></b> (<i>self</i>, QModelIndex <i>index</i>)</li><li><div class="fn" />QAbstractItemDelegate <b><a href="qabstractitemview.html#itemDelegateForColumn">itemDelegateForColumn</a></b> (<i>self</i>, int <i>column</i>)</li><li><div class="fn" />QAbstractItemDelegate <b><a href="qabstractitemview.html#itemDelegateForRow">itemDelegateForRow</a></b> (<i>self</i>, int <i>row</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#keyboardSearch">keyboardSearch</a></b> (<i>self</i>, QString <i>search</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#keyPressEvent">keyPressEvent</a></b> (<i>self</i>, QKeyEvent <i>e</i>)</li><li><div class="fn" />QAbstractItemModel <b><a href="qabstractitemview.html#model">model</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a></b> (<i>self</i>, QMouseEvent <i>e</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#mouseMoveEvent">mouseMoveEvent</a></b> (<i>self</i>, QMouseEvent <i>e</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#mousePressEvent">mousePressEvent</a></b> (<i>self</i>, QMouseEvent <i>e</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#mouseReleaseEvent">mouseReleaseEvent</a></b> (<i>self</i>, QMouseEvent <i>e</i>)</li><li><div class="fn" />QModelIndex <b><a href="qabstractitemview.html#moveCursor">moveCursor</a></b> (<i>self</i>, CursorAction <i>cursorAction</i>, Qt.KeyboardModifiers <i>modifiers</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#openPersistentEditor">openPersistentEditor</a></b> (<i>self</i>, QModelIndex <i>index</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#reset">reset</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#resizeEvent">resizeEvent</a></b> (<i>self</i>, QResizeEvent <i>e</i>)</li><li><div class="fn" />QModelIndex <b><a href="qabstractitemview.html#rootIndex">rootIndex</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#rowsAboutToBeRemoved">rowsAboutToBeRemoved</a></b> (<i>self</i>, QModelIndex <i>parent</i>, int <i>start</i>, int <i>end</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#rowsInserted">rowsInserted</a></b> (<i>self</i>, QModelIndex <i>parent</i>, int <i>start</i>, int <i>end</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#scheduleDelayedItemsLayout">scheduleDelayedItemsLayout</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#scrollDirtyRegion">scrollDirtyRegion</a></b> (<i>self</i>, int <i>dx</i>, int <i>dy</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#scrollTo">scrollTo</a></b> (<i>self</i>, QModelIndex <i>index</i>, ScrollHint <i>hint</i> = QAbstractItemView.EnsureVisible)</li><li><div class="fn" /><b><a href="qabstractitemview.html#scrollToBottom">scrollToBottom</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#scrollToTop">scrollToTop</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#selectAll">selectAll</a></b> (<i>self</i>)</li><li><div class="fn" />list-of-QModelIndex <b><a href="qabstractitemview.html#selectedIndexes">selectedIndexes</a></b> (<i>self</i>)</li><li><div class="fn" />SelectionBehavior <b><a href="qabstractitemview.html#selectionBehavior">selectionBehavior</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#selectionChanged">selectionChanged</a></b> (<i>self</i>, QItemSelection <i>selected</i>, QItemSelection <i>deselected</i>)</li><li><div class="fn" />QItemSelectionModel.SelectionFlags <b><a href="qabstractitemview.html#selectionCommand">selectionCommand</a></b> (<i>self</i>, QModelIndex <i>index</i>, QEvent <i>event</i> = None)</li><li><div class="fn" />SelectionMode <b><a href="qabstractitemview.html#selectionMode">selectionMode</a></b> (<i>self</i>)</li><li><div class="fn" />QItemSelectionModel <b><a href="qabstractitemview.html#selectionModel">selectionModel</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#setAlternatingRowColors">setAlternatingRowColors</a></b> (<i>self</i>, bool <i>enable</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#setAutoScroll">setAutoScroll</a></b> (<i>self</i>, bool <i>enable</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#setAutoScrollMargin">setAutoScrollMargin</a></b> (<i>self</i>, int <i>margin</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#setCurrentIndex">setCurrentIndex</a></b> (<i>self</i>, QModelIndex <i>index</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#setDefaultDropAction">setDefaultDropAction</a></b> (<i>self</i>, Qt.DropAction <i>dropAction</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#setDirtyRegion">setDirtyRegion</a></b> (<i>self</i>, QRegion <i>region</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#setDragDropMode">setDragDropMode</a></b> (<i>self</i>, DragDropMode <i>behavior</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#setDragDropOverwriteMode">setDragDropOverwriteMode</a></b> (<i>self</i>, bool <i>overwrite</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#setDragEnabled">setDragEnabled</a></b> (<i>self</i>, bool <i>enable</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#setDropIndicatorShown">setDropIndicatorShown</a></b> (<i>self</i>, bool <i>enable</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#setEditTriggers">setEditTriggers</a></b> (<i>self</i>, EditTriggers <i>triggers</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#setHorizontalScrollMode">setHorizontalScrollMode</a></b> (<i>self</i>, ScrollMode <i>mode</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#setHorizontalStepsPerItem">setHorizontalStepsPerItem</a></b> (<i>self</i>, int <i>steps</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#setIconSize">setIconSize</a></b> (<i>self</i>, QSize <i>size</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#setIndexWidget">setIndexWidget</a></b> (<i>self</i>, QModelIndex <i>index</i>, QWidget <i>widget</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#setItemDelegate">setItemDelegate</a></b> (<i>self</i>, QAbstractItemDelegate <i>delegate</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#setItemDelegateForColumn">setItemDelegateForColumn</a></b> (<i>self</i>, int <i>column</i>, QAbstractItemDelegate <i>delegate</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#setItemDelegateForRow">setItemDelegateForRow</a></b> (<i>self</i>, int <i>row</i>, QAbstractItemDelegate <i>delegate</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#setModel">setModel</a></b> (<i>self</i>, QAbstractItemModel <i>model</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#setRootIndex">setRootIndex</a></b> (<i>self</i>, QModelIndex <i>index</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#setSelection">setSelection</a></b> (<i>self</i>, QRect <i>rect</i>, QItemSelectionModel.SelectionFlags <i>command</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#setSelectionBehavior">setSelectionBehavior</a></b> (<i>self</i>, SelectionBehavior <i>behavior</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#setSelectionMode">setSelectionMode</a></b> (<i>self</i>, SelectionMode <i>mode</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#setSelectionModel">setSelectionModel</a></b> (<i>self</i>, QItemSelectionModel <i>selectionModel</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#setState">setState</a></b> (<i>self</i>, State <i>state</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#setTabKeyNavigation">setTabKeyNavigation</a></b> (<i>self</i>, bool <i>enable</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#setTextElideMode">setTextElideMode</a></b> (<i>self</i>, Qt.TextElideMode <i>mode</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#setVerticalScrollMode">setVerticalScrollMode</a></b> (<i>self</i>, ScrollMode <i>mode</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#setVerticalStepsPerItem">setVerticalStepsPerItem</a></b> (<i>self</i>, int <i>steps</i>)</li><li><div class="fn" />bool <b><a href="qabstractitemview.html#showDropIndicator">showDropIndicator</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qabstractitemview.html#sizeHintForColumn">sizeHintForColumn</a></b> (<i>self</i>, int <i>column</i>)</li><li><div class="fn" />QSize <b><a href="qabstractitemview.html#sizeHintForIndex">sizeHintForIndex</a></b> (<i>self</i>, QModelIndex <i>index</i>)</li><li><div class="fn" />int <b><a href="qabstractitemview.html#sizeHintForRow">sizeHintForRow</a></b> (<i>self</i>, int <i>row</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#startDrag">startDrag</a></b> (<i>self</i>, Qt.DropActions <i>supportedActions</i>)</li><li><div class="fn" />State <b><a href="qabstractitemview.html#state">state</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qabstractitemview.html#tabKeyNavigation">tabKeyNavigation</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.TextElideMode <b><a href="qabstractitemview.html#textElideMode">textElideMode</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#timerEvent">timerEvent</a></b> (<i>self</i>, QTimerEvent <i>e</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#update">update</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#update-2">update</a></b> (<i>self</i>, QModelIndex <i>index</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#updateEditorData">updateEditorData</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#updateEditorGeometries">updateEditorGeometries</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#updateGeometries">updateGeometries</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qabstractitemview.html#verticalOffset">verticalOffset</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#verticalScrollbarAction">verticalScrollbarAction</a></b> (<i>self</i>, int <i>action</i>)</li><li><div class="fn" /><b><a href="qabstractitemview.html#verticalScrollbarValueChanged">verticalScrollbarValueChanged</a></b> (<i>self</i>, int <i>value</i>)</li><li><div class="fn" />ScrollMode <b><a href="qabstractitemview.html#verticalScrollMode">verticalScrollMode</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qabstractitemview.html#verticalStepsPerItem">verticalStepsPerItem</a></b> (<i>self</i>)</li><li><div class="fn" />QStyleOptionViewItem <b><a href="qabstractitemview.html#viewOptions">viewOptions</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qabstractitemview.html#viewportEvent">viewportEvent</a></b> (<i>self</i>, QEvent <i>e</i>)</li><li><div class="fn" />QRect <b><a href="qabstractitemview.html#visualRect">visualRect</a></b> (<i>self</i>, QModelIndex <i>index</i>)</li><li><div class="fn" />QRegion <b><a href="qabstractitemview.html#visualRegionForSelection">visualRegionForSelection</a></b> (<i>self</i>, QItemSelection <i>selection</i>)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qabstractitemview.html#activated">activated</a></b> (const QModelIndex&)</li><li><div class="fn" />void <b><a href="qabstractitemview.html#clicked">clicked</a></b> (const QModelIndex&)</li><li><div class="fn" />void <b><a href="qabstractitemview.html#doubleClicked">doubleClicked</a></b> (const QModelIndex&)</li><li><div class="fn" />void <b><a href="qabstractitemview.html#entered">entered</a></b> (const QModelIndex&)</li><li><div class="fn" />void <b><a href="qabstractitemview.html#pressed">pressed</a></b> (const QModelIndex&)</li><li><div class="fn" />void <b><a href="qabstractitemview.html#viewportEntered">viewportEntered</a></b> ()</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QAbstractItemView class provides the basic functionality for
item view classes.</p>
<p>QAbstractItemView class is the base class for every standard
view that uses a <a href="qabstractitemmodel.html">QAbstractItemModel</a>. QAbstractItemView
is an abstract class and cannot itself be instantiated. It provides
a standard interface for interoperating with models through the
signals and slots mechanism, enabling subclasses to be kept
up-to-date with changes to their models. This class provides
standard support for keyboard and mouse navigation, viewport
scrolling, item editing, and selections. The keyboard navigation
implements this functionality:</p>
<table class="generic">
<thead>
<tr class="qt-style">
<th>Keys</th>
<th>Functionality</th>
</tr>
</thead>
<tr class="odd" valign="top">
<td>Arrow keys</td>
<td>Changes the current item and selects it.</td>
</tr>
<tr class="even" valign="top">
<td>Ctrl+Arrow keys</td>
<td>Changes the current item but does not select it.</td>
</tr>
<tr class="odd" valign="top">
<td>Shift+Arrow keys</td>
<td>Changes the current item and selects it. The previously
selected item(s) is not deselected.</td>
</tr>
<tr class="even" valign="top">
<td>Ctr+Space</td>
<td>Toggles selection of the current item.</td>
</tr>
<tr class="odd" valign="top">
<td>Tab/Backtab</td>
<td>Changes the current item to the next/previous item.</td>
</tr>
<tr class="even" valign="top">
<td>Home/End</td>
<td>Selects the first/last item in the model.</td>
</tr>
<tr class="odd" valign="top">
<td>Page up/Page down</td>
<td>Scrolls the rows shown up/down by the number of visible rows in
the view.</td>
</tr>
<tr class="even" valign="top">
<td>Ctrl+A</td>
<td>Selects all items in the model.</td>
</tr>
</table>
<p>Note that the above table assumes that the <a href="qabstractitemview.html#selectionMode-prop">selection mode</a>
allows the operations. For instance, you cannot select items if the
selection mode is <a href="qabstractitemview.html#SelectionMode-enum">QAbstractItemView.NoSelection</a>.</p>
<p>The QAbstractItemView class is one of the <a href="model-view.html">Model/View Classes</a> and is part of Qt's
<a href="model-view-programming.html">model/view framework</a>.</p>
<p>The view classes that inherit QAbstractItemView only need to
implement their own view-specific functionality, such as drawing
items, returning the geometry of items, finding items, etc.</p>
<p>QAbstractItemView provides common slots such as <a href="qabstractitemview.html#edit">edit</a>() and <a href="qabstractitemview.html#setCurrentIndex">setCurrentIndex</a>().
Many protected slots are also provided, including <a href="qabstractitemview.html#dataChanged">dataChanged</a>(), <a href="qabstractitemview.html#rowsInserted">rowsInserted</a>(), <a href="qabstractitemview.html#rowsAboutToBeRemoved">rowsAboutToBeRemoved</a>(),
<a href="qabstractitemview.html#selectionChanged">selectionChanged</a>(),
and <a href="qabstractitemview.html#currentChanged">currentChanged</a>().</p>
<p>The root item is returned by <a href="qabstractitemview.html#rootIndex">rootIndex</a>(), and the current
item by <a href="qabstractitemview.html#currentIndex">currentIndex</a>(). To make
sure that an item is visible use <a href="qabstractitemview.html#scrollTo">scrollTo</a>().</p>
<p>Some of QAbstractItemView's functions are concerned with
scrolling, for example <a href="qabstractitemview.html#horizontalScrollMode-prop">setHorizontalScrollMode</a>()
and <a href="qabstractitemview.html#verticalScrollMode-prop">setVerticalScrollMode</a>().
To set the range of the scroll bars, you can, for example,
reimplement the view's <a href="qabstractitemview.html#resizeEvent">resizeEvent</a>()
function:</p>
<pre class="cpp">
<span class="type">void</span> MyView<span class="operator">.</span><a href="qabstractitemview.html#resizeEvent">resizeEvent</a>(<span class="type"><a href="qresizeevent.html">QResizeEvent</a></span> <span class="operator">*</span>event) {
horizontalScrollBar()<span class="operator">-</span><span class="operator">></span>setRange(<span class="number">0</span><span class="operator">,</span> realWidth <span class="operator">-</span> width());
<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
}
</pre>
<p>Note that the range is not updated until the widget is
shown.</p>
<p>Several other functions are concerned with selection control;
for example <a href="qabstractitemview.html#selectionMode-prop">setSelectionMode</a>(),
and <a href="qabstractitemview.html#selectionBehavior-prop">setSelectionBehavior</a>().
This class provides a default selection model to work with
(<a href="qabstractitemview.html#selectionModel">selectionModel</a>()),
but this can be replaced by using <a href="qabstractitemview.html#setSelectionModel">setSelectionModel</a>()
with an instance of <a href="qitemselectionmodel.html">QItemSelectionModel</a>.</p>
<p>For complete control over the display and editing of items you
can specify a delegate with <a href="qabstractitemview.html#setItemDelegate">setItemDelegate</a>().</p>
<p>QAbstractItemView provides a lot of protected functions. Some
are concerned with editing, for example, <a href="qabstractitemview.html#edit">edit</a>(), and <a href="qabstractitemview.html#commitData">commitData</a>(), whilst others
are keyboard and mouse event handlers.</p>
<p><b>Note:</b> If you inherit QAbstractItemView and intend to
update the contents of the viewport, you should use
viewport-><a href="qabstractitemview.html#update">update</a>()
instead of <a href="qwidget.html#update">update()</a> as all
painting operations take place on the viewport.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="CursorAction-enum" />QAbstractItemView.CursorAction</h3><p>This enum describes the different ways to navigate between
items,</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>QAbstractItemView.MoveUp</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">Move to the item above the current item.</td>
</tr>
<tr>
<td class="topAlign"><tt>QAbstractItemView.MoveDown</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">Move to the item below the current item.</td>
</tr>
<tr>
<td class="topAlign"><tt>QAbstractItemView.MoveLeft</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">Move to the item left of the current
item.</td>
</tr>
<tr>
<td class="topAlign"><tt>QAbstractItemView.MoveRight</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign">Move to the item right of the current
item.</td>
</tr>
<tr>
<td class="topAlign"><tt>QAbstractItemView.MoveHome</tt></td>
<td class="topAlign"><tt>4</tt></td>
<td class="topAlign">Move to the top-left corner item.</td>
</tr>
<tr>
<td class="topAlign"><tt>QAbstractItemView.MoveEnd</tt></td>
<td class="topAlign"><tt>5</tt></td>
<td class="topAlign">Move to the bottom-right corner item.</td>
</tr>
<tr>
<td class="topAlign"><tt>QAbstractItemView.MovePageUp</tt></td>
<td class="topAlign"><tt>6</tt></td>
<td class="topAlign">Move one page up above the current item.</td>
</tr>
<tr>
<td class="topAlign"><tt>QAbstractItemView.MovePageDown</tt></td>
<td class="topAlign"><tt>7</tt></td>
<td class="topAlign">Move one page down below the current
item.</td>
</tr>
<tr>
<td class="topAlign"><tt>QAbstractItemView.MoveNext</tt></td>
<td class="topAlign"><tt>8</tt></td>
<td class="topAlign">Move to the item after the current item.</td>
</tr>
<tr>
<td class="topAlign"><tt>QAbstractItemView.MovePrevious</tt></td>
<td class="topAlign"><tt>9</tt></td>
<td class="topAlign">Move to the item before the current item.</td>
</tr>
</table>
<p><b>See also</b> <a href="qabstractitemview.html#moveCursor">moveCursor</a>().</p>
<h3 class="fn"><a name="DragDropMode-enum" />QAbstractItemView.DragDropMode</h3><p>Describes the various drag and drop events the view can act
upon. By default the view does not support dragging or dropping
(<tt>NoDragDrop</tt>).</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>QAbstractItemView.NoDragDrop</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">Does not support dragging or dropping.</td>
</tr>
<tr>
<td class="topAlign"><tt>QAbstractItemView.DragOnly</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The view supports dragging of its own
items</td>
</tr>
<tr>
<td class="topAlign"><tt>QAbstractItemView.DropOnly</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">The view accepts drops</td>
</tr>
<tr>
<td class="topAlign"><tt>QAbstractItemView.DragDrop</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign">The view supports both dragging and
dropping</td>
</tr>
<tr>
<td class="topAlign"><tt>QAbstractItemView.InternalMove</tt></td>
<td class="topAlign"><tt>4</tt></td>
<td class="topAlign">The view accepts move (<b>not copy</b>)
operations only from itself.</td>
</tr>
</table>
<p>Note that the model used needs to provide support for drag and
drop operations.</p>
<p>This enum was introduced or modified in Qt 4.2.</p>
<p><b>See also</b> <a href="qabstractitemview.html#dragDropMode-prop">setDragDropMode</a>()
and <a href="model-view-programming.html#using-drag-and-drop-with-item-views">Using
drag and drop with item views</a>.</p>
<h3 class="fn"><a name="DropIndicatorPosition-enum" />QAbstractItemView.DropIndicatorPosition</h3><p>This enum indicates the position of the drop indicator in
relation to the index at the current mouse position:</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>QAbstractItemView.OnItem</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The item will be dropped on the index.</td>
</tr>
<tr>
<td class="topAlign"><tt>QAbstractItemView.AboveItem</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The item will be dropped above the index.</td>
</tr>
<tr>
<td class="topAlign"><tt>QAbstractItemView.BelowItem</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">The item will be dropped below the index.</td>
</tr>
<tr>
<td class="topAlign"><tt>QAbstractItemView.OnViewport</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign">The item will be dropped onto a region of the
viewport with no items. The way each view handles items dropped
onto the viewport depends on the behavior of the underlying model
in use.</td>
</tr>
</table>
<h3 class="fn"><a name="EditTrigger-enum" />QAbstractItemView.EditTrigger</h3><p>This enum describes actions which will initiate item
editing.</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>QAbstractItemView.NoEditTriggers</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">No editing possible.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QAbstractItemView.CurrentChanged</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">Editing start whenever current item
changes.</td>
</tr>
<tr>
<td class="topAlign"><tt>QAbstractItemView.DoubleClicked</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">Editing starts when an item is double
clicked.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QAbstractItemView.SelectedClicked</tt></td>
<td class="topAlign"><tt>4</tt></td>
<td class="topAlign">Editing starts when clicking on an already
selected item.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QAbstractItemView.EditKeyPressed</tt></td>
<td class="topAlign"><tt>8</tt></td>
<td class="topAlign">Editing starts when the platform edit key has
been pressed over an item.</td>
</tr>
<tr>
<td class="topAlign"><tt>QAbstractItemView.AnyKeyPressed</tt></td>
<td class="topAlign"><tt>16</tt></td>
<td class="topAlign">Editing starts when any key is pressed over an
item.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QAbstractItemView.AllEditTriggers</tt></td>
<td class="topAlign"><tt>31</tt></td>
<td class="topAlign">Editing starts for all above actions.</td>
</tr>
</table>
<p>The EditTriggers type is a typedef for <a href="qflags.html">QFlags</a><EditTrigger>. It stores an OR
combination of EditTrigger values.</p>
<h3 class="fn"><a name="ScrollHint-enum" />QAbstractItemView.ScrollHint</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>QAbstractItemView.EnsureVisible</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">Scroll to ensure that the item is
visible.</td>
</tr>
<tr>
<td class="topAlign"><tt>QAbstractItemView.PositionAtTop</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">Scroll to position the item at the top of the
viewport.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QAbstractItemView.PositionAtBottom</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">Scroll to position the item at the bottom of
the viewport.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QAbstractItemView.PositionAtCenter</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign">Scroll to position the item at the center of
the viewport.</td>
</tr>
</table>
<h3 class="fn"><a name="ScrollMode-enum" />QAbstractItemView.ScrollMode</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>QAbstractItemView.ScrollPerItem</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The view will scroll the contents one item at
a time.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QAbstractItemView.ScrollPerPixel</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The view will scroll the contents one pixel at
a time.</td>
</tr>
</table>
<p>This enum was introduced or modified in Qt 4.2.</p>
<h3 class="fn"><a name="SelectionBehavior-enum" />QAbstractItemView.SelectionBehavior</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>QAbstractItemView.SelectItems</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">Selecting single items.</td>
</tr>
<tr>
<td class="topAlign"><tt>QAbstractItemView.SelectRows</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">Selecting only rows.</td>
</tr>
<tr>
<td class="topAlign"><tt>QAbstractItemView.SelectColumns</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">Selecting only columns.</td>
</tr>
</table>
<h3 class="fn"><a name="SelectionMode-enum" />QAbstractItemView.SelectionMode</h3><p>This enum indicates how the view responds to user
selections:</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>QAbstractItemView.SingleSelection</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">When the user selects an item, any
already-selected item becomes unselected, and the user cannot
unselect the selected item by clicking on it.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QAbstractItemView.ContiguousSelection</tt></td>
<td class="topAlign"><tt>4</tt></td>
<td class="topAlign">When the user selects an item in the usual
way, the selection is cleared and the new item selected. However,
if the user presses the Shift key while clicking on an item, all
items between the current item and the clicked item are selected or
unselected, depending on the state of the clicked item.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QAbstractItemView.ExtendedSelection</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign">When the user selects an item in the usual
way, the selection is cleared and the new item selected. However,
if the user presses the Ctrl key when clicking on an item, the
clicked item gets toggled and all other items are left untouched.
If the user presses the Shift key while clicking on an item, all
items between the current item and the clicked item are selected or
unselected, depending on the state of the clicked item. Multiple
items can be selected by dragging the mouse over them.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QAbstractItemView.MultiSelection</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">When the user selects an item in the usual
way, the selection status of that item is toggled and the other
items are left alone. Multiple items can be toggled by dragging the
mouse over them.</td>
</tr>
<tr>
<td class="topAlign"><tt>QAbstractItemView.NoSelection</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">Items cannot be selected.</td>
</tr>
</table>
<p>The most commonly used modes are SingleSelection and
ExtendedSelection.</p>
<h3 class="fn"><a name="State-enum" />QAbstractItemView.State</h3><p>Describes the different states the view can be in. This is
usually only interesting when reimplementing your own view.</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>QAbstractItemView.NoState</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The is the default state.</td>
</tr>
<tr>
<td class="topAlign"><tt>QAbstractItemView.DraggingState</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The user is dragging items.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QAbstractItemView.DragSelectingState</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">The user is selecting items.</td>
</tr>
<tr>
<td class="topAlign"><tt>QAbstractItemView.EditingState</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign">The user is editing an item in a widget
editor.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QAbstractItemView.ExpandingState</tt></td>
<td class="topAlign"><tt>4</tt></td>
<td class="topAlign">The user is opening a branch of items.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QAbstractItemView.CollapsingState</tt></td>
<td class="topAlign"><tt>5</tt></td>
<td class="topAlign">The user is closing a branch of items.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QAbstractItemView.AnimatingState</tt></td>
<td class="topAlign"><tt>6</tt></td>
<td class="topAlign">The item view is performing an animation.</td>
</tr>
</table>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QAbstractItemView" />QAbstractItemView.__init__ (<i>self</i>, <a href="qwidget.html">QWidget</a> <i>parent</i> = None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs an abstract item view with the given
<i>parent</i>.</p>
<h3 class="fn"><a name="alternatingRowColors" />bool QAbstractItemView.alternatingRowColors (<i>self</i>)</h3><h3 class="fn"><a name="autoScrollMargin" />int QAbstractItemView.autoScrollMargin (<i>self</i>)</h3><h3 class="fn"><a name="clearSelection" />QAbstractItemView.clearSelection (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void clearSelection()</tt>.</p><p>Deselects all selected items. The current index will not be
changed.</p>
<p><b>See also</b> <a href="qabstractitemview.html#setSelection">setSelection</a>() and
<a href="qabstractitemview.html#selectAll">selectAll</a>().</p>
<h3 class="fn"><a name="closeEditor" />QAbstractItemView.closeEditor (<i>self</i>, <a href="qwidget.html">QWidget</a> <i>editor</i>, <a href="qabstractitemdelegate.html#EndEditHint-enum">QAbstractItemDelegate.EndEditHint</a> <i>hint</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void closeEditor(QWidget *,QAbstractItemDelegate::EndEditHint)</tt>.</p><p>Closes the given <i>editor</i>, and releases it. The <i>hint</i>
is used to specify how the view should respond to the end of the
editing operation. For example, the hint may indicate that the next
item in the view should be opened for editing.</p>
<p><b>See also</b> <a href="qabstractitemview.html#edit">edit</a>()
and <a href="qabstractitemview.html#commitData">commitData</a>().</p>
<h3 class="fn"><a name="closePersistentEditor" />QAbstractItemView.closePersistentEditor (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>index</i>)</h3><p>Closes the persistent editor for the item at the given
<i>index</i>.</p>
<p><b>See also</b> <a href="qabstractitemview.html#openPersistentEditor">openPersistentEditor</a>().</p>
<h3 class="fn"><a name="commitData" />QAbstractItemView.commitData (<i>self</i>, <a href="qwidget.html">QWidget</a> <i>editor</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void commitData(QWidget *)</tt>.</p><p>Commit the data in the <i>editor</i> to the model.</p>
<p><b>See also</b> <a href="qabstractitemview.html#closeEditor">closeEditor</a>().</p>
<h3 class="fn"><a name="currentChanged" />QAbstractItemView.currentChanged (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>current</i>, <a href="qmodelindex.html">QModelIndex</a> <i>previous</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void currentChanged(const QModelIndex&,const QModelIndex&)</tt>.</p><p>This slot is called when a new item becomes the current item.
The previous current item is specified by the <i>previous</i>
index, and the new item by the <i>current</i> index.</p>
<p>If you want to know about changes to items see the <a href="qabstractitemview.html#dataChanged">dataChanged</a>() signal.</p>
<h3 class="fn"><a name="currentIndex" /><a href="qmodelindex.html">QModelIndex</a> QAbstractItemView.currentIndex (<i>self</i>)</h3><p>Returns the model index of the current item.</p>
<p><b>See also</b> <a href="qabstractitemview.html#setCurrentIndex">setCurrentIndex</a>().</p>
<h3 class="fn"><a name="dataChanged" />QAbstractItemView.dataChanged (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>topLeft</i>, <a href="qmodelindex.html">QModelIndex</a> <i>bottomRight</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void dataChanged(const QModelIndex&,const QModelIndex&)</tt>.</p><p>This slot is called when items are changed in the model. The
changed items are those from <i>topLeft</i> to <i>bottomRight</i>
inclusive. If just one item is changed <i>topLeft</i> ==
<i>bottomRight</i>.</p>
<h3 class="fn"><a name="defaultDropAction" /><a href="qt.html#DropAction-enum">Qt.DropAction</a> QAbstractItemView.defaultDropAction (<i>self</i>)</h3><h3 class="fn"><a name="dirtyRegionOffset" /><a href="qpoint.html">QPoint</a> QAbstractItemView.dirtyRegionOffset (<i>self</i>)</h3><p>Returns the offset of the dirty regions in the view.</p>
<p>If you use <a href="qabstractitemview.html#scrollDirtyRegion">scrollDirtyRegion</a>()
and implement a <a href="qabstractscrollarea.html#paintEvent">paintEvent</a>() in a
subclass of <a href="qabstractitemview.html">QAbstractItemView</a>,
you should translate the area given by the paint event with the
offset returned from this function.</p>
<p><b>See also</b> <a href="qabstractitemview.html#scrollDirtyRegion">scrollDirtyRegion</a>()
and <a href="qabstractitemview.html#setDirtyRegion">setDirtyRegion</a>().</p>
<h3 class="fn"><a name="dragDropMode" /><a href="qabstractitemview.html#DragDropMode-enum">DragDropMode</a> QAbstractItemView.dragDropMode (<i>self</i>)</h3><h3 class="fn"><a name="dragDropOverwriteMode" />bool QAbstractItemView.dragDropOverwriteMode (<i>self</i>)</h3><h3 class="fn"><a name="dragEnabled" />bool QAbstractItemView.dragEnabled (<i>self</i>)</h3><h3 class="fn"><a name="dragEnterEvent" />QAbstractItemView.dragEnterEvent (<i>self</i>, <a href="qdragenterevent.html">QDragEnterEvent</a> <i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#dragEnterEvent">QWidget.dragEnterEvent</a>().</p>
<p>This function is called with the given <i>event</i> when a drag
and drop operation enters the widget. If the drag is over a valid
dropping place (e.g. over an item that accepts drops), the event is
accepted; otherwise it is ignored.</p>
<p><b>See also</b> <a href="qabstractitemview.html#dropEvent">dropEvent</a>() and <a href="qabstractitemview.html#startDrag">startDrag</a>().</p>
<h3 class="fn"><a name="dragLeaveEvent" />QAbstractItemView.dragLeaveEvent (<i>self</i>, <a href="qdragleaveevent.html">QDragLeaveEvent</a> <i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#dragLeaveEvent">QWidget.dragLeaveEvent</a>().</p>
<p>This function is called when the item being dragged leaves the
view. The <i>event</i> describes the state of the drag and drop
operation.</p>
<h3 class="fn"><a name="dragMoveEvent" />QAbstractItemView.dragMoveEvent (<i>self</i>, <a href="qdragmoveevent.html">QDragMoveEvent</a> <i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#dragMoveEvent">QWidget.dragMoveEvent</a>().</p>
<p>This function is called continuously with the given <i>event</i>
during a drag and drop operation over the widget. It can cause the
view to scroll if, for example, the user drags a selection to
view's right or bottom edge. In this case, the event will be
accepted; otherwise it will be ignored.</p>
<p><b>See also</b> <a href="qabstractitemview.html#dropEvent">dropEvent</a>() and <a href="qabstractitemview.html#startDrag">startDrag</a>().</p>
<h3 class="fn"><a name="dropEvent" />QAbstractItemView.dropEvent (<i>self</i>, <a href="qdropevent.html">QDropEvent</a> <i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#dropEvent">QWidget.dropEvent</a>().</p>
<p>This function is called with the given <i>event</i> when a drop
event occurs over the widget. If the model accepts the even
position the drop event is accepted; otherwise it is ignored.</p>
<p><b>See also</b> <a href="qabstractitemview.html#startDrag">startDrag</a>().</p>
<h3 class="fn"><a name="dropIndicatorPosition" /><a href="qabstractitemview.html#DropIndicatorPosition-enum">DropIndicatorPosition</a> QAbstractItemView.dropIndicatorPosition (<i>self</i>)</h3><p>Returns the position of the drop indicator in relation to the
closest item.</p>
<p>This function was introduced in Qt 4.1.</p>
<h3 class="fn"><a name="edit" />QAbstractItemView.edit (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>index</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void edit(const QModelIndex&)</tt>.</p><p>Starts editing the item corresponding to the given <i>index</i>
if it is editable.</p>
<p>Note that this function does not change the current index. Since
the current index defines the next and previous items to edit,
users may find that keyboard navigation does not work as expected.
To provide consistent navigation behavior, call <a href="qabstractitemview.html#setCurrentIndex">setCurrentIndex</a>()
before this function with the same model index.</p>
<p><b>See also</b> <a href="qmodelindex.html#flags">QModelIndex.flags</a>().</p>
<h3 class="fn"><a name="edit-2" />bool QAbstractItemView.edit (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>index</i>, <a href="qabstractitemview.html#EditTrigger-enum">EditTrigger</a> <i>trigger</i>, <a href="qevent.html">QEvent</a> <i>event</i>)</h3><p>Starts editing the item at <i>index</i>, creating an editor if
necessary, and returns true if the view's <a href="qabstractitemview.html#State-enum">State</a> is now <a href="qabstractitemview.html#State-enum">EditingState</a>; otherwise
returns false.</p>
<p>The action that caused the editing process is described by
<i>trigger</i>, and the associated event is specified by
<i>event</i>.</p>
<p>Editing can be forced by specifying the <i>trigger</i> to be
<a href="qabstractitemview.html#EditTrigger-enum">QAbstractItemView.AllEditTriggers</a>.</p>
<p><b>See also</b> <a href="qabstractitemview.html#closeEditor">closeEditor</a>().</p>
<h3 class="fn"><a name="editorDestroyed" />QAbstractItemView.editorDestroyed (<i>self</i>, <a href="qobject.html">QObject</a> <i>editor</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void editorDestroyed(QObject *)</tt>.</p><p>This function is called when the given <i>editor</i> has been
destroyed.</p>
<p><b>See also</b> <a href="qabstractitemview.html#closeEditor">closeEditor</a>().</p>
<h3 class="fn"><a name="editTriggers" /><a href="qabstractitemview-edittriggers.html">EditTriggers</a> QAbstractItemView.editTriggers (<i>self</i>)</h3><h3 class="fn"><a name="event" />bool QAbstractItemView.event (<i>self</i>, <a href="qevent.html">QEvent</a> <i>event</i>)</h3><p>Reimplemented from <a href="qobject.html#event">QObject.event</a>().</p>
<h3 class="fn"><a name="executeDelayedItemsLayout" />QAbstractItemView.executeDelayedItemsLayout (<i>self</i>)</h3><p>Executes the scheduled layouts without waiting for the event
processing to begin.</p>
<p><b>See also</b> <a href="qabstractitemview.html#scheduleDelayedItemsLayout">scheduleDelayedItemsLayout</a>().</p>
<h3 class="fn"><a name="focusInEvent" />QAbstractItemView.focusInEvent (<i>self</i>, <a href="qfocusevent.html">QFocusEvent</a> <i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#focusInEvent">QWidget.focusInEvent</a>().</p>
<p>This function is called with the given <i>event</i> when the
widget obtains the focus. By default, the event is ignored.</p>
<p><b>See also</b> <a href="qwidget.html#setFocus">setFocus</a>()
and <a href="qabstractitemview.html#focusOutEvent">focusOutEvent</a>().</p>
<h3 class="fn"><a name="focusNextPrevChild" />bool QAbstractItemView.focusNextPrevChild (<i>self</i>, bool <i>next</i>)</h3><p>Reimplemented from <a href="qwidget.html#focusNextPrevChild">QWidget.focusNextPrevChild</a>().</p>
<h3 class="fn"><a name="focusOutEvent" />QAbstractItemView.focusOutEvent (<i>self</i>, <a href="qfocusevent.html">QFocusEvent</a> <i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#focusOutEvent">QWidget.focusOutEvent</a>().</p>
<p>This function is called with the given <i>event</i> when the
widget looses the focus. By default, the event is ignored.</p>
<p><b>See also</b> <a href="qwidget.html#clearFocus">clearFocus</a>() and <a href="qabstractitemview.html#focusInEvent">focusInEvent</a>().</p>
<h3 class="fn"><a name="hasAutoScroll" />bool QAbstractItemView.hasAutoScroll (<i>self</i>)</h3><h3 class="fn"><a name="horizontalOffset" />int QAbstractItemView.horizontalOffset (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the horizontal offset of the view.</p>
<p>In the base class this is a pure virtual function.</p>
<p><b>See also</b> <a href="qabstractitemview.html#verticalOffset">verticalOffset</a>().</p>
<h3 class="fn"><a name="horizontalScrollbarAction" />QAbstractItemView.horizontalScrollbarAction (<i>self</i>, int <i>action</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void horizontalScrollbarAction(int)</tt>.</p><h3 class="fn"><a name="horizontalScrollbarValueChanged" />QAbstractItemView.horizontalScrollbarValueChanged (<i>self</i>, int <i>value</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void horizontalScrollbarValueChanged(int)</tt>.</p><h3 class="fn"><a name="horizontalScrollMode" /><a href="qabstractitemview.html#ScrollMode-enum">ScrollMode</a> QAbstractItemView.horizontalScrollMode (<i>self</i>)</h3><h3 class="fn"><a name="horizontalStepsPerItem" />int QAbstractItemView.horizontalStepsPerItem (<i>self</i>)</h3><h3 class="fn"><a name="iconSize" /><a href="qsize.html">QSize</a> QAbstractItemView.iconSize (<i>self</i>)</h3><h3 class="fn"><a name="indexAt" /><a href="qmodelindex.html">QModelIndex</a> QAbstractItemView.indexAt (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>p</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the model index of the item at the viewport coordinates
<i>point</i>.</p>
<p>In the base class this is a pure virtual function.</p>
<p><b>See also</b> <a href="qabstractitemview.html#visualRect">visualRect</a>().</p>
<h3 class="fn"><a name="indexWidget" /><a href="qwidget.html">QWidget</a> QAbstractItemView.indexWidget (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>index</i>)</h3><p>Returns the widget for the item at the given <i>index</i>.</p>
<p>This function was introduced in Qt 4.1.</p>
<p><b>See also</b> <a href="qabstractitemview.html#setIndexWidget">setIndexWidget</a>().</p>
<h3 class="fn"><a name="inputMethodEvent" />QAbstractItemView.inputMethodEvent (<i>self</i>, <a href="qinputmethodevent.html">QInputMethodEvent</a> <i>event</i>)</h3><p>Reimplemented from <a href="qwidget.html#inputMethodEvent">QWidget.inputMethodEvent</a>().</p>
<h3 class="fn"><a name="inputMethodQuery" />QVariant QAbstractItemView.inputMethodQuery (<i>self</i>, <a href="qt.html#InputMethodQuery-enum">Qt.InputMethodQuery</a> <i>query</i>)</h3><p>Reimplemented from <a href="qwidget.html#inputMethodQuery">QWidget.inputMethodQuery</a>().</p>
<h3 class="fn"><a name="isIndexHidden" />bool QAbstractItemView.isIndexHidden (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>index</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns true if the item referred to by the given <i>index</i>
is hidden in the view, otherwise returns false.</p>
<p>Hiding is a view specific feature. For example in TableView a
column can be marked as hidden or a row in the TreeView.</p>
<p>In the base class this is a pure virtual function.</p>
<h3 class="fn"><a name="itemDelegate" /><a href="qabstractitemdelegate.html">QAbstractItemDelegate</a> QAbstractItemView.itemDelegate (<i>self</i>)</h3><p>Returns the item delegate used by this view and model. This is
either one set with <a href="qabstractitemview.html#setItemDelegate">setItemDelegate</a>(), or
the default one.</p>
<p><b>See also</b> <a href="qabstractitemview.html#setItemDelegate">setItemDelegate</a>().</p>
<h3 class="fn"><a name="itemDelegate-2" /><a href="qabstractitemdelegate.html">QAbstractItemDelegate</a> QAbstractItemView.itemDelegate (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>index</i>)</h3><p>Returns the item delegate used by this view and model for the
given <i>index</i>.</p>
<h3 class="fn"><a name="itemDelegateForColumn" /><a href="qabstractitemdelegate.html">QAbstractItemDelegate</a> QAbstractItemView.itemDelegateForColumn (<i>self</i>, int <i>column</i>)</h3><p>Returns the item delegate used by this view and model for the
given <i>column</i>. You can call <a href="qabstractitemview.html#itemDelegate">itemDelegate</a>() to get a
pointer to the current delegate for a given index.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qabstractitemview.html#setItemDelegateForColumn">setItemDelegateForColumn</a>(),
<a href="qabstractitemview.html#itemDelegateForRow">itemDelegateForRow</a>(),
and <a href="qabstractitemview.html#itemDelegate">itemDelegate</a>().</p>
<h3 class="fn"><a name="itemDelegateForRow" /><a href="qabstractitemdelegate.html">QAbstractItemDelegate</a> QAbstractItemView.itemDelegateForRow (<i>self</i>, int <i>row</i>)</h3><p>Returns the item delegate used by this view and model for the
given <i>row</i>, or 0 if no delegate has been assigned. You can
call <a href="qabstractitemview.html#itemDelegate">itemDelegate</a>() to get a
pointer to the current delegate for a given index.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qabstractitemview.html#setItemDelegateForRow">setItemDelegateForRow</a>(),
<a href="qabstractitemview.html#itemDelegateForColumn">itemDelegateForColumn</a>(),
and <a href="qabstractitemview.html#setItemDelegate">setItemDelegate</a>().</p>
<h3 class="fn"><a name="keyboardSearch" />QAbstractItemView.keyboardSearch (<i>self</i>, QString <i>search</i>)</h3><p>Moves to and selects the item best matching the string
<i>search</i>. If no item is found nothing happens.</p>
<p>In the default implementation, the search is reset if
<i>search</i> is empty, or the time interval since the last search
has exceeded <a href="qapplication.html#keyboardInputInterval-prop">QApplication.keyboardInputInterval</a>().</p>
<h3 class="fn"><a name="keyPressEvent" />QAbstractItemView.keyPressEvent (<i>self</i>, <a href="qkeyevent.html">QKeyEvent</a> <i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#keyPressEvent">QWidget.keyPressEvent</a>().</p>
<p>This function is called with the given <i>event</i> when a key
event is sent to the widget. The default implementation handles
basic cursor movement, e.g. Up, Down, Left, Right, Home, PageUp,
and PageDown; the <a href="qabstractitemview.html#activated">activated</a>() signal is
emitted if the current index is valid and the activation key is
pressed (e.g. Enter or Return, depending on the platform). This
function is where editing is initiated by key press, e.g. if F2 is
pressed.</p>
<p><b>See also</b> <a href="qabstractitemview.html#edit">edit</a>(), <a href="qabstractitemview.html#moveCursor">moveCursor</a>(), <a href="qabstractitemview.html#keyboardSearch">keyboardSearch</a>(), and
<a href="qabstractitemview.html#tabKeyNavigation-prop">tabKeyNavigation</a>.</p>
<h3 class="fn"><a name="model" /><a href="qabstractitemmodel.html">QAbstractItemModel</a> QAbstractItemView.model (<i>self</i>)</h3><p>Returns the model that this view is presenting.</p>
<p><b>See also</b> <a href="qabstractitemview.html#setModel">setModel</a>().</p>
<h3 class="fn"><a name="mouseDoubleClickEvent" />QAbstractItemView.mouseDoubleClickEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a> <i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#mouseDoubleClickEvent">QWidget.mouseDoubleClickEvent</a>().</p>
<p>This function is called with the given <i>event</i> when a mouse
button is double clicked inside the widget. If the double-click is
on a valid item it emits the <a href="qabstractitemview.html#doubleClicked">doubleClicked</a>() signal
and calls <a href="qabstractitemview.html#edit">edit</a>() on the
item.</p>
<h3 class="fn"><a name="mouseMoveEvent" />QAbstractItemView.mouseMoveEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a> <i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#mouseMoveEvent">QWidget.mouseMoveEvent</a>().</p>
<p>This function is called with the given <i>event</i> when a mouse
move event is sent to the widget. If a selection is in progress and
new items are moved over the selection is extended; if a drag is in
progress it is continued.</p>
<h3 class="fn"><a name="mousePressEvent" />QAbstractItemView.mousePressEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a> <i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#mousePressEvent">QWidget.mousePressEvent</a>().</p>
<p>This function is called with the given <i>event</i> when a mouse
button is pressed while the cursor is inside the widget. If a valid
item is pressed on it is made into the current item. This function
emits the <a href="qabstractitemview.html#pressed">pressed</a>()
signal.</p>
<h3 class="fn"><a name="mouseReleaseEvent" />QAbstractItemView.mouseReleaseEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a> <i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#mouseReleaseEvent">QWidget.mouseReleaseEvent</a>().</p>
<p>This function is called with the given <i>event</i> when a mouse
button is released, after a mouse press event on the widget. If a
user presses the mouse inside your widget and then drags the mouse
to another location before releasing the mouse button, your widget
receives the release event. The function will emit the <a href="qabstractitemview.html#clicked">clicked</a>() signal if an item
was being pressed.</p>
<h3 class="fn"><a name="moveCursor" /><a href="qmodelindex.html">QModelIndex</a> QAbstractItemView.moveCursor (<i>self</i>, <a href="qabstractitemview.html#CursorAction-enum">CursorAction</a> <i>cursorAction</i>, <a href="qt-keyboardmodifiers.html">Qt.KeyboardModifiers</a> <i>modifiers</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns a <a href="qmodelindex.html">QModelIndex</a> object
pointing to the next object in the view, based on the given
<i>cursorAction</i> and keyboard modifiers specified by
<i>modifiers</i>.</p>
<p>In the base class this is a pure virtual function.</p>
<h3 class="fn"><a name="openPersistentEditor" />QAbstractItemView.openPersistentEditor (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>index</i>)</h3><p>Opens a persistent editor on the item at the given <i>index</i>.
If no editor exists, the delegate will create a new editor.</p>
<p><b>See also</b> <a href="qabstractitemview.html#closePersistentEditor">closePersistentEditor</a>().</p>
<h3 class="fn"><a name="reset" />QAbstractItemView.reset (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void reset()</tt>.</p><p>Reset the internal state of the view.</p>
<p><b>Warning:</b> This function will reset open editors, scroll
bar positions, selections, etc. Existing changes will not be
committed. If you would like to save your changes when resetting
the view, you can reimplement this function, commit your changes,
and then call the superclass' implementation.</p>
<h3 class="fn"><a name="resizeEvent" />QAbstractItemView.resizeEvent (<i>self</i>, <a href="qresizeevent.html">QResizeEvent</a> <i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#resizeEvent">QWidget.resizeEvent</a>().</p>
<p>This function is called with the given <i>event</i> when a
resize event is sent to the widget.</p>
<p><b>See also</b> <a href="qwidget.html#resizeEvent">QWidget.resizeEvent</a>().</p>
<h3 class="fn"><a name="rootIndex" /><a href="qmodelindex.html">QModelIndex</a> QAbstractItemView.rootIndex (<i>self</i>)</h3><p>Returns the model index of the model's root item. The root item
is the parent item to the view's toplevel items. The root can be
invalid.</p>
<p><b>See also</b> <a href="qabstractitemview.html#setRootIndex">setRootIndex</a>().</p>
<h3 class="fn"><a name="rowsAboutToBeRemoved" />QAbstractItemView.rowsAboutToBeRemoved (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>parent</i>, int <i>start</i>, int <i>end</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void rowsAboutToBeRemoved(const QModelIndex&,int,int)</tt>.</p><p>This slot is called when rows are about to be removed. The
deleted rows are those under the given <i>parent</i> from
<i>start</i> to <i>end</i> inclusive.</p>
<p><b>See also</b> <a href="qabstractitemview.html#rowsInserted">rowsInserted</a>().</p>
<h3 class="fn"><a name="rowsInserted" />QAbstractItemView.rowsInserted (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>parent</i>, int <i>start</i>, int <i>end</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void rowsInserted(const QModelIndex&,int,int)</tt>.</p><p>This slot is called when rows are inserted. The new rows are
those under the given <i>parent</i> from <i>start</i> to <i>end</i>
inclusive. The base class implementation calls fetchMore() on the
model to check for more data.</p>
<p><b>See also</b> <a href="qabstractitemview.html#rowsAboutToBeRemoved">rowsAboutToBeRemoved</a>().</p>
<h3 class="fn"><a name="scheduleDelayedItemsLayout" />QAbstractItemView.scheduleDelayedItemsLayout (<i>self</i>)</h3><p>Schedules a layout of the items in the view to be executed when
the event processing starts.</p>
<p>Even if scheduleDelayedItemsLayout() is called multiple times
before events are processed, the view will only do the layout
once.</p>
<p><b>See also</b> <a href="qabstractitemview.html#executeDelayedItemsLayout">executeDelayedItemsLayout</a>().</p>
<h3 class="fn"><a name="scrollDirtyRegion" />QAbstractItemView.scrollDirtyRegion (<i>self</i>, int <i>dx</i>, int <i>dy</i>)</h3><p>Prepares the view for scrolling by (<i>dx</i>,<i>dy</i>) pixels
by moving the dirty regions in the opposite direction. You only
need to call this function if you are implementing a scrolling
viewport in your view subclass.</p>
<p>If you implement <a href="qabstractscrollarea.html#scrollContentsBy">scrollContentsBy</a>()
in a subclass of <a href="qabstractitemview.html">QAbstractItemView</a>, call this function
before you call <a href="qwidget.html#scroll">QWidget.scroll</a>()
on the viewport. Alternatively, just call <a href="qabstractitemview.html#update">update</a>().</p>
<p><b>See also</b> <a href="qabstractscrollarea.html#scrollContentsBy">scrollContentsBy</a>(),
<a href="qabstractitemview.html#dirtyRegionOffset">dirtyRegionOffset</a>(),
and <a href="qabstractitemview.html#setDirtyRegion">setDirtyRegion</a>().</p>
<h3 class="fn"><a name="scrollTo" />QAbstractItemView.scrollTo (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>index</i>, <a href="qabstractitemview.html#ScrollHint-enum">ScrollHint</a> <i>hint</i> = QAbstractItemView.EnsureVisible)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Scrolls the view if necessary to ensure that the item at
<i>index</i> is visible. The view will try to position the item
according to the given <i>hint</i>.</p>
<p>In the base class this is a pure virtual function.</p>
<h3 class="fn"><a name="scrollToBottom" />QAbstractItemView.scrollToBottom (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void scrollToBottom()</tt>.</p><p>Scrolls the view to the bottom.</p>
<p>This function was introduced in Qt 4.1.</p>
<p><b>See also</b> <a href="qabstractitemview.html#scrollTo">scrollTo</a>() and <a href="qabstractitemview.html#scrollToTop">scrollToTop</a>().</p>
<h3 class="fn"><a name="scrollToTop" />QAbstractItemView.scrollToTop (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void scrollToTop()</tt>.</p><p>Scrolls the view to the top.</p>
<p>This function was introduced in Qt 4.1.</p>
<p><b>See also</b> <a href="qabstractitemview.html#scrollTo">scrollTo</a>() and <a href="qabstractitemview.html#scrollToBottom">scrollToBottom</a>().</p>
<h3 class="fn"><a name="selectAll" />QAbstractItemView.selectAll (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void selectAll()</tt>.</p><p>Selects all items in the view. This function will use the
selection behavior set on the view when selecting.</p>
<p><b>See also</b> <a href="qabstractitemview.html#setSelection">setSelection</a>(), <a href="qabstractitemview.html#selectedIndexes">selectedIndexes</a>(), and
<a href="qabstractitemview.html#clearSelection">clearSelection</a>().</p>
<h3 class="fn"><a name="selectedIndexes" />list-of-QModelIndex QAbstractItemView.selectedIndexes (<i>self</i>)</h3><p>This convenience function returns a list of all selected and
non-hidden item indexes in the view. The list contains no
duplicates, and is not sorted.</p>
<p><b>See also</b> <a href="qitemselectionmodel.html#selectedIndexes">QItemSelectionModel.selectedIndexes</a>().</p>
<h3 class="fn"><a name="selectionBehavior" /><a href="qabstractitemview.html#SelectionBehavior-enum">SelectionBehavior</a> QAbstractItemView.selectionBehavior (<i>self</i>)</h3><h3 class="fn"><a name="selectionChanged" />QAbstractItemView.selectionChanged (<i>self</i>, <a href="qitemselection.html">QItemSelection</a> <i>selected</i>, <a href="qitemselection.html">QItemSelection</a> <i>deselected</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void selectionChanged(const QItemSelection&,const QItemSelection&)</tt>.</p><p>This slot is called when the selection is changed. The previous
selection (which may be empty), is specified by <i>deselected</i>,
and the new selection by <i>selected</i>.</p>
<p><b>See also</b> <a href="qabstractitemview.html#setSelection">setSelection</a>().</p>
<h3 class="fn"><a name="selectionCommand" /><a href="qitemselectionmodel-selectionflags.html">QItemSelectionModel.SelectionFlags</a> QAbstractItemView.selectionCommand (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>index</i>, <a href="qevent.html">QEvent</a> <i>event</i> = None)</h3><p>Returns the SelectionFlags to be used when updating a selection
with to include the <i>index</i> specified. The <i>event</i> is a
user input event, such as a mouse or keyboard event.</p>
<p>Reimplement this function to define your own selection
behavior.</p>
<p><b>See also</b> <a href="qabstractitemview.html#setSelection">setSelection</a>().</p>
<h3 class="fn"><a name="selectionMode" /><a href="qabstractitemview.html#SelectionMode-enum">SelectionMode</a> QAbstractItemView.selectionMode (<i>self</i>)</h3><h3 class="fn"><a name="selectionModel" /><a href="qitemselectionmodel.html">QItemSelectionModel</a> QAbstractItemView.selectionModel (<i>self</i>)</h3><p>Returns the current selection model.</p>
<p><b>See also</b> <a href="qabstractitemview.html#setSelectionModel">setSelectionModel</a>()
and <a href="qabstractitemview.html#selectedIndexes">selectedIndexes</a>().</p>
<h3 class="fn"><a name="setAlternatingRowColors" />QAbstractItemView.setAlternatingRowColors (<i>self</i>, bool <i>enable</i>)</h3><h3 class="fn"><a name="setAutoScroll" />QAbstractItemView.setAutoScroll (<i>self</i>, bool <i>enable</i>)</h3><h3 class="fn"><a name="setAutoScrollMargin" />QAbstractItemView.setAutoScrollMargin (<i>self</i>, int <i>margin</i>)</h3><h3 class="fn"><a name="setCurrentIndex" />QAbstractItemView.setCurrentIndex (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>index</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setCurrentIndex(const QModelIndex&)</tt>.</p><p>Sets the current item to be the item at <i>index</i>.</p>
<p>Unless the current selection mode is <a href="qabstractitemview.html#SelectionMode-enum">NoSelection</a>, the
item is also be selected. Note that this function also updates the
starting position for any new selections the user performs.</p>
<p>To set an item as the current item without selecting it,
call</p>
<p><tt>selectionModel()->setCurrentIndex(index,
QItemSelectionModel.NoUpdate);</tt></p>
<p><b>See also</b> <a href="qabstractitemview.html#currentIndex">currentIndex</a>(), <a href="qabstractitemview.html#currentChanged">currentChanged</a>(), and
<a href="qabstractitemview.html#selectionMode-prop">selectionMode</a>.</p>
<h3 class="fn"><a name="setDefaultDropAction" />QAbstractItemView.setDefaultDropAction (<i>self</i>, <a href="qt.html#DropAction-enum">Qt.DropAction</a> <i>dropAction</i>)</h3><h3 class="fn"><a name="setDirtyRegion" />QAbstractItemView.setDirtyRegion (<i>self</i>, <a href="qregion.html">QRegion</a> <i>region</i>)</h3><p>Marks the given <i>region</i> as dirty and schedules it to be
updated. You only need to call this function if you are
implementing your own view subclass.</p>
<p>This function was introduced in Qt 4.1.</p>
<p><b>See also</b> <a href="qabstractitemview.html#scrollDirtyRegion">scrollDirtyRegion</a>()
and <a href="qabstractitemview.html#dirtyRegionOffset">dirtyRegionOffset</a>().</p>
<h3 class="fn"><a name="setDragDropMode" />QAbstractItemView.setDragDropMode (<i>self</i>, <a href="qabstractitemview.html#DragDropMode-enum">DragDropMode</a> <i>behavior</i>)</h3><h3 class="fn"><a name="setDragDropOverwriteMode" />QAbstractItemView.setDragDropOverwriteMode (<i>self</i>, bool <i>overwrite</i>)</h3><h3 class="fn"><a name="setDragEnabled" />QAbstractItemView.setDragEnabled (<i>self</i>, bool <i>enable</i>)</h3><h3 class="fn"><a name="setDropIndicatorShown" />QAbstractItemView.setDropIndicatorShown (<i>self</i>, bool <i>enable</i>)</h3><h3 class="fn"><a name="setEditTriggers" />QAbstractItemView.setEditTriggers (<i>self</i>, <a href="qabstractitemview-edittriggers.html">EditTriggers</a> <i>triggers</i>)</h3><h3 class="fn"><a name="setHorizontalScrollMode" />QAbstractItemView.setHorizontalScrollMode (<i>self</i>, <a href="qabstractitemview.html#ScrollMode-enum">ScrollMode</a> <i>mode</i>)</h3><h3 class="fn"><a name="setHorizontalStepsPerItem" />QAbstractItemView.setHorizontalStepsPerItem (<i>self</i>, int <i>steps</i>)</h3><h3 class="fn"><a name="setIconSize" />QAbstractItemView.setIconSize (<i>self</i>, <a href="qsize.html">QSize</a> <i>size</i>)</h3><h3 class="fn"><a name="setIndexWidget" />QAbstractItemView.setIndexWidget (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>index</i>, <a href="qwidget.html">QWidget</a> <i>widget</i>)</h3><p>The <i>widget</i> argument has it's ownership transferred to Qt.</p><p>Sets the given <i>widget</i> on the item at the given
<i>index</i>, passing the ownership of the widget to the
viewport.</p>
<p>If <i>index</i> is invalid (e.g., if you pass the root index),
this function will do nothing.</p>
<p>The given <i>widget</i>'s <a href="qwidget.html">autoFillBackground</a> property must be set to true,
otherwise the widget's background will be transparent, showing both
the model data and the item at the given <i>index</i>.</p>
<p>If index widget A is replaced with index widget B, index widget
A will be deleted. For example, in the code snippet below, the
<a href="qlineedit.html">QLineEdit</a> object will be deleted.</p>
<pre class="cpp">
setIndexWidget(index<span class="operator">,</span> <span class="keyword">new</span> <span class="type"><a href="qlineedit.html">QLineEdit</a></span>);
<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
setIndexWidget(index<span class="operator">,</span> <span class="keyword">new</span> <span class="type"><a href="qtextedit.html">QTextEdit</a></span>);
</pre>
<p>This function should only be used to display static content
within the visible area corresponding to an item of data. If you
want to display custom dynamic content or implement a custom editor
widget, subclass <a href="qitemdelegate.html">QItemDelegate</a>
instead.</p>
<p>This function was introduced in Qt 4.1.</p>
<p><b>See also</b> <a href="qabstractitemview.html#indexWidget">indexWidget</a>() and <a href="model-view-programming.html#delegate-classes">Delegate
Classes</a>.</p>
<h3 class="fn"><a name="setItemDelegate" />QAbstractItemView.setItemDelegate (<i>self</i>, <a href="qabstractitemdelegate.html">QAbstractItemDelegate</a> <i>delegate</i>)</h3><p>Sets the item delegate for this view and its model to
<i>delegate</i>. This is useful if you want complete control over
the editing and display of items.</p>
<p>Any existing delegate will be removed, but not deleted. <a href="qabstractitemview.html">QAbstractItemView</a> does not take
ownership of <i>delegate</i>.</p>
<p><b>Warning:</b> You should not share the same instance of a
delegate between views. Doing so can cause incorrect or unintuitive
editing behavior since each view connected to a given delegate may
receive the <a href="qabstractitemdelegate.html#closeEditor">closeEditor()</a> signal,
and attempt to access, modify or close an editor that has already
been closed.</p>
<p><b>See also</b> <a href="qabstractitemview.html#itemDelegate">itemDelegate</a>().</p>
<h3 class="fn"><a name="setItemDelegateForColumn" />QAbstractItemView.setItemDelegateForColumn (<i>self</i>, int <i>column</i>, <a href="qabstractitemdelegate.html">QAbstractItemDelegate</a> <i>delegate</i>)</h3><p>Sets the given item <i>delegate</i> used by this view and model
for the given <i>column</i>. All items on <i>column</i> will be
drawn and managed by <i>delegate</i> instead of using the default
delegate (i.e., <a href="qabstractitemview.html#itemDelegate">itemDelegate</a>()).</p>
<p>Any existing column delegate for <i>column</i> will be removed,
but not deleted. <a href="qabstractitemview.html">QAbstractItemView</a> does not take
ownership of <i>delegate</i>.</p>
<p><b>Note:</b> If a delegate has been assigned to both a row and a
column, the row delegate will take precedence and manage the
intersecting cell index.</p>
<p><b>Warning:</b> You should not share the same instance of a
delegate between views. Doing so can cause incorrect or unintuitive
editing behavior since each view connected to a given delegate may
receive the <a href="qabstractitemdelegate.html#closeEditor">closeEditor()</a> signal,
and attempt to access, modify or close an editor that has already
been closed.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qabstractitemview.html#itemDelegateForColumn">itemDelegateForColumn</a>(),
<a href="qabstractitemview.html#setItemDelegateForRow">setItemDelegateForRow</a>(),
and <a href="qabstractitemview.html#itemDelegate">itemDelegate</a>().</p>
<h3 class="fn"><a name="setItemDelegateForRow" />QAbstractItemView.setItemDelegateForRow (<i>self</i>, int <i>row</i>, <a href="qabstractitemdelegate.html">QAbstractItemDelegate</a> <i>delegate</i>)</h3><p>Sets the given item <i>delegate</i> used by this view and model
for the given <i>row</i>. All items on <i>row</i> will be drawn and
managed by <i>delegate</i> instead of using the default delegate
(i.e., <a href="qabstractitemview.html#itemDelegate">itemDelegate</a>()).</p>
<p>Any existing row delegate for <i>row</i> will be removed, but
not deleted. <a href="qabstractitemview.html">QAbstractItemView</a>
does not take ownership of <i>delegate</i>.</p>
<p><b>Note:</b> If a delegate has been assigned to both a row and a
column, the row delegate (i.e., this delegate) will take precedence
and manage the intersecting cell index.</p>
<p><b>Warning:</b> You should not share the same instance of a
delegate between views. Doing so can cause incorrect or unintuitive
editing behavior since each view connected to a given delegate may
receive the <a href="qabstractitemdelegate.html#closeEditor">closeEditor()</a> signal,
and attempt to access, modify or close an editor that has already
been closed.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qabstractitemview.html#itemDelegateForRow">itemDelegateForRow</a>(),
<a href="qabstractitemview.html#setItemDelegateForColumn">setItemDelegateForColumn</a>(),
and <a href="qabstractitemview.html#itemDelegate">itemDelegate</a>().</p>
<h3 class="fn"><a name="setModel" />QAbstractItemView.setModel (<i>self</i>, <a href="qabstractitemmodel.html">QAbstractItemModel</a> <i>model</i>)</h3><p>Sets the <i>model</i> for the view to present.</p>
<p>This function will create and set a new selection model,
replacing any model that was previously set with <a href="qabstractitemview.html#setSelectionModel">setSelectionModel</a>().
However, the old selection model will not be deleted as it may be
shared between several views. We recommend that you delete the old
selection model if it is no longer required. This is done with the
following code:</p>
<pre class="cpp">
<span class="type"><a href="qitemselectionmodel.html">QItemSelectionModel</a></span> <span class="operator">*</span>m <span class="operator">=</span> view<span class="operator">-</span><span class="operator">></span><a href="qabstractitemview.html#selectionModel">selectionModel</a>();
view<span class="operator">-</span><span class="operator">></span>setModel(<span class="keyword">new</span> model);
<span class="keyword">delete</span> m;
</pre>
<p>If both the old model and the old selection model do not have
parents, or if their parents are long-lived objects, it may be
preferable to call their <a href="qobject.html#deleteLater">deleteLater</a>() functions to
explicitly delete them.</p>
<p>The view <i>does not</i> take ownership of the model unless it
is the model's parent object because the model may be shared
between many different views.</p>
<p><b>See also</b> <a href="qabstractitemview.html#model">model</a>(), <a href="qabstractitemview.html#selectionModel">selectionModel</a>(), and
<a href="qabstractitemview.html#setSelectionModel">setSelectionModel</a>().</p>
<h3 class="fn"><a name="setRootIndex" />QAbstractItemView.setRootIndex (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>index</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setRootIndex(const QModelIndex&)</tt>.</p><p>Sets the root item to the item at the given <i>index</i>.</p>
<p><b>See also</b> <a href="qabstractitemview.html#rootIndex">rootIndex</a>().</p>
<h3 class="fn"><a name="setSelection" />QAbstractItemView.setSelection (<i>self</i>, <a href="qrect.html">QRect</a> <i>rect</i>, <a href="qitemselectionmodel-selectionflags.html">QItemSelectionModel.SelectionFlags</a> <i>command</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Applies the selection <i>flags</i> to the items in or touched by
the rectangle, <i>rect</i>.</p>
<p>When implementing your own itemview setSelection should call
<a href="qabstractitemview.html#selectionModel">selectionModel</a>()->select(selection,
flags) where selection is either an empty <a href="qmodelindex.html">QModelIndex</a> or a <a href="qitemselection.html">QItemSelection</a> that contains all items
that are contained in <i>rect</i>.</p>
<p><b>See also</b> <a href="qabstractitemview.html#selectionCommand">selectionCommand</a>()
and <a href="qabstractitemview.html#selectedIndexes">selectedIndexes</a>().</p>
<h3 class="fn"><a name="setSelectionBehavior" />QAbstractItemView.setSelectionBehavior (<i>self</i>, <a href="qabstractitemview.html#SelectionBehavior-enum">SelectionBehavior</a> <i>behavior</i>)</h3><h3 class="fn"><a name="setSelectionMode" />QAbstractItemView.setSelectionMode (<i>self</i>, <a href="qabstractitemview.html#SelectionMode-enum">SelectionMode</a> <i>mode</i>)</h3><h3 class="fn"><a name="setSelectionModel" />QAbstractItemView.setSelectionModel (<i>self</i>, <a href="qitemselectionmodel.html">QItemSelectionModel</a> <i>selectionModel</i>)</h3><p>Sets the current selection model to the given
<i>selectionModel</i>.</p>
<p>Note that, if you call <a href="qabstractitemview.html#setModel">setModel</a>() after this
function, the given <i>selectionModel</i> will be replaced by one
created by the view.</p>
<p><b>Note:</b> It is up to the application to delete the old
selection model if it is no longer needed; i.e., if it is not being
used by other views. This will happen automatically when its parent
object is deleted. However, if it does not have a parent, or if the
parent is a long-lived object, it may be preferable to call its
<a href="qobject.html#deleteLater">deleteLater</a>() function to
explicitly delete it.</p>
<p><b>See also</b> <a href="qabstractitemview.html#selectionModel">selectionModel</a>(),
<a href="qabstractitemview.html#setModel">setModel</a>(), and
<a href="qabstractitemview.html#clearSelection">clearSelection</a>().</p>
<h3 class="fn"><a name="setState" />QAbstractItemView.setState (<i>self</i>, <a href="qabstractitemview.html#State-enum">State</a> <i>state</i>)</h3><p>Sets the item view's state to the given <i>state</i>.</p>
<p><b>See also</b> <a href="qabstractitemview.html#state">state</a>().</p>
<h3 class="fn"><a name="setTabKeyNavigation" />QAbstractItemView.setTabKeyNavigation (<i>self</i>, bool <i>enable</i>)</h3><h3 class="fn"><a name="setTextElideMode" />QAbstractItemView.setTextElideMode (<i>self</i>, <a href="qt.html#TextElideMode-enum">Qt.TextElideMode</a> <i>mode</i>)</h3><h3 class="fn"><a name="setVerticalScrollMode" />QAbstractItemView.setVerticalScrollMode (<i>self</i>, <a href="qabstractitemview.html#ScrollMode-enum">ScrollMode</a> <i>mode</i>)</h3><h3 class="fn"><a name="setVerticalStepsPerItem" />QAbstractItemView.setVerticalStepsPerItem (<i>self</i>, int <i>steps</i>)</h3><h3 class="fn"><a name="showDropIndicator" />bool QAbstractItemView.showDropIndicator (<i>self</i>)</h3><h3 class="fn"><a name="sizeHintForColumn" />int QAbstractItemView.sizeHintForColumn (<i>self</i>, int <i>column</i>)</h3><p>Returns the width size hint for the specified <i>column</i> or
-1 if there is no model.</p>
<p>This function is used in views with a horizontal header to find
the size hint for a header section based on the contents of the
given <i>column</i>.</p>
<p><b>See also</b> <a href="qabstractitemview.html#sizeHintForRow">sizeHintForRow</a>().</p>
<h3 class="fn"><a name="sizeHintForIndex" /><a href="qsize.html">QSize</a> QAbstractItemView.sizeHintForIndex (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>index</i>)</h3><p>Returns the size hint for the item with the specified
<i>index</i> or an invalid size for invalid indexes.</p>
<p><b>See also</b> <a href="qabstractitemview.html#sizeHintForRow">sizeHintForRow</a>() and
<a href="qabstractitemview.html#sizeHintForColumn">sizeHintForColumn</a>().</p>
<h3 class="fn"><a name="sizeHintForRow" />int QAbstractItemView.sizeHintForRow (<i>self</i>, int <i>row</i>)</h3><p>Returns the height size hint for the specified <i>row</i> or -1
if there is no model.</p>
<p>The returned height is calculated using the size hints of the
given <i>row</i>'s items, i.e. the returned value is the maximum
height among the items. Note that to control the height of a row,
you must reimplement the <a href="qabstractitemdelegate.html#sizeHint">QAbstractItemDelegate.sizeHint</a>()
function.</p>
<p>This function is used in views with a vertical header to find
the size hint for a header section based on the contents of the
given <i>row</i>.</p>
<p><b>See also</b> <a href="qabstractitemview.html#sizeHintForColumn">sizeHintForColumn</a>().</p>
<h3 class="fn"><a name="startDrag" />QAbstractItemView.startDrag (<i>self</i>, <a href="qt-dropactions.html">Qt.DropActions</a> <i>supportedActions</i>)</h3><p>Starts a drag by calling drag->exec() using the given
<i>supportedActions</i>.</p>
<h3 class="fn"><a name="state" /><a href="qabstractitemview.html#State-enum">State</a> QAbstractItemView.state (<i>self</i>)</h3><p>Returns the item view's state.</p>
<p><b>See also</b> <a href="qabstractitemview.html#setState">setState</a>().</p>
<h3 class="fn"><a name="tabKeyNavigation" />bool QAbstractItemView.tabKeyNavigation (<i>self</i>)</h3><h3 class="fn"><a name="textElideMode" /><a href="qt.html#TextElideMode-enum">Qt.TextElideMode</a> QAbstractItemView.textElideMode (<i>self</i>)</h3><h3 class="fn"><a name="timerEvent" />QAbstractItemView.timerEvent (<i>self</i>, <a href="qtimerevent.html">QTimerEvent</a> <i>e</i>)</h3><p>Reimplemented from <a href="qobject.html#timerEvent">QObject.timerEvent</a>().</p>
<p>This function is called with the given <i>event</i> when a timer
event is sent to the widget.</p>
<p><b>See also</b> <a href="qobject.html#timerEvent">QObject.timerEvent</a>().</p>
<h3 class="fn"><a name="update" />QAbstractItemView.update (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void update()</tt>.</p><p>Updates the area occupied by the given <i>index</i>.</p>
<p>This function was introduced in Qt 4.3.</p>
<h3 class="fn"><a name="update-2" />QAbstractItemView.update (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>index</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void update(const QModelIndex&)</tt>.</p><h3 class="fn"><a name="updateEditorData" />QAbstractItemView.updateEditorData (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void updateEditorData()</tt>.</p><h3 class="fn"><a name="updateEditorGeometries" />QAbstractItemView.updateEditorGeometries (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void updateEditorGeometries()</tt>.</p><h3 class="fn"><a name="updateGeometries" />QAbstractItemView.updateGeometries (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void updateGeometries()</tt>.</p><p>Updates the geometry of the child widgets of the view.</p>
<p>This function was introduced in Qt 4.4.</p>
<h3 class="fn"><a name="verticalOffset" />int QAbstractItemView.verticalOffset (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the vertical offset of the view.</p>
<p>In the base class this is a pure virtual function.</p>
<p><b>See also</b> <a href="qabstractitemview.html#horizontalOffset">horizontalOffset</a>().</p>
<h3 class="fn"><a name="verticalScrollbarAction" />QAbstractItemView.verticalScrollbarAction (<i>self</i>, int <i>action</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void verticalScrollbarAction(int)</tt>.</p><h3 class="fn"><a name="verticalScrollbarValueChanged" />QAbstractItemView.verticalScrollbarValueChanged (<i>self</i>, int <i>value</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void verticalScrollbarValueChanged(int)</tt>.</p><h3 class="fn"><a name="verticalScrollMode" /><a href="qabstractitemview.html#ScrollMode-enum">ScrollMode</a> QAbstractItemView.verticalScrollMode (<i>self</i>)</h3><h3 class="fn"><a name="verticalStepsPerItem" />int QAbstractItemView.verticalStepsPerItem (<i>self</i>)</h3><h3 class="fn"><a name="viewOptions" /><a href="qstyleoptionviewitem.html">QStyleOptionViewItem</a> QAbstractItemView.viewOptions (<i>self</i>)</h3><p>Returns a <a href="qstyleoptionviewitem.html">QStyleOptionViewItem</a> structure
populated with the view's palette, font, state, alignments etc.</p>
<h3 class="fn"><a name="viewportEvent" />bool QAbstractItemView.viewportEvent (<i>self</i>, <a href="qevent.html">QEvent</a> <i>e</i>)</h3><p>Reimplemented from <a href="qabstractscrollarea.html#viewportEvent">QAbstractScrollArea.viewportEvent</a>().</p>
<p>This function is used to handle tool tips, and What's This?
mode, if the given <i>event</i> is a <a href="qevent.html#Type-enum">QEvent.ToolTip</a>,or a <a href="qevent.html#Type-enum">QEvent.WhatsThis</a>. It passes all other
events on to its base class viewportEvent() handler.</p>
<h3 class="fn"><a name="visualRect" /><a href="qrect.html">QRect</a> QAbstractItemView.visualRect (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>index</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the rectangle on the viewport occupied by the item at
<i>index</i>.</p>
<p>If your item is displayed in several areas then visualRect
should return the primary area that contains index and not the
complete area that index might encompasses, touch or cause
drawing.</p>
<p>In the base class this is a pure virtual function.</p>
<p><b>See also</b> <a href="qabstractitemview.html#indexAt">indexAt</a>() and <a href="qabstractitemview.html#visualRegionForSelection">visualRegionForSelection</a>().</p>
<h3 class="fn"><a name="visualRegionForSelection" /><a href="qregion.html">QRegion</a> QAbstractItemView.visualRegionForSelection (<i>self</i>, <a href="qitemselection.html">QItemSelection</a> <i>selection</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the region from the viewport of the items in the given
<i>selection</i>.</p>
<p>In the base class this is a pure virtual function.</p>
<p><b>See also</b> <a href="qabstractitemview.html#visualRect">visualRect</a>() and <a href="qabstractitemview.html#selectedIndexes">selectedIndexes</a>().</p>
<hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="activated" />void activated (const QModelIndex&)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when the item specified by <i>index</i>
is activated by the user. How to activate items depends on the
platform; e.g., by single- or double-clicking the item, or by
pressing the Return or Enter key when the item is current.</p>
<p><b>See also</b> <a href="qabstractitemview.html#clicked">clicked</a>(), <a href="qabstractitemview.html#doubleClicked">doubleClicked</a>(),
<a href="qabstractitemview.html#entered">entered</a>(), and
<a href="qabstractitemview.html#pressed">pressed</a>().</p>
<h3 class="fn"><a name="clicked" />void clicked (const QModelIndex&)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when a mouse button is clicked. The item
the mouse was clicked on is specified by <i>index</i>. The signal
is only emitted when the index is valid.</p>
<p><b>See also</b> <a href="qabstractitemview.html#activated">activated</a>(), <a href="qabstractitemview.html#doubleClicked">doubleClicked</a>(),
<a href="qabstractitemview.html#entered">entered</a>(), and
<a href="qabstractitemview.html#pressed">pressed</a>().</p>
<h3 class="fn"><a name="doubleClicked" />void doubleClicked (const QModelIndex&)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when a mouse button is double-clicked.
The item the mouse was double-clicked on is specified by
<i>index</i>. The signal is only emitted when the index is
valid.</p>
<p><b>See also</b> <a href="qabstractitemview.html#clicked">clicked</a>() and <a href="qabstractitemview.html#activated">activated</a>().</p>
<h3 class="fn"><a name="entered" />void entered (const QModelIndex&)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when the mouse cursor enters the item
specified by <i>index</i>. Mouse tracking needs to be enabled for
this feature to work.</p>
<p><b>See also</b> <a href="qabstractitemview.html#viewportEntered">viewportEntered</a>(),
<a href="qabstractitemview.html#activated">activated</a>(),
<a href="qabstractitemview.html#clicked">clicked</a>(), <a href="qabstractitemview.html#doubleClicked">doubleClicked</a>(), and
<a href="qabstractitemview.html#pressed">pressed</a>().</p>
<h3 class="fn"><a name="pressed" />void pressed (const QModelIndex&)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when a mouse button is pressed. The item
the mouse was pressed on is specified by <i>index</i>. The signal
is only emitted when the index is valid.</p>
<p>Use the <a href="qapplication.html#mouseButtons">QApplication.mouseButtons</a>()
function to get the state of the mouse buttons.</p>
<p><b>See also</b> <a href="qabstractitemview.html#activated">activated</a>(), <a href="qabstractitemview.html#clicked">clicked</a>(), <a href="qabstractitemview.html#doubleClicked">doubleClicked</a>(), and
<a href="qabstractitemview.html#entered">entered</a>().</p>
<h3 class="fn"><a name="viewportEntered" />void viewportEntered ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when the mouse cursor enters the
viewport. Mouse tracking needs to be enabled for this feature to
work.</p>
<p><b>See also</b> <a href="qabstractitemview.html#entered">entered</a>().</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.9.3 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt 4.8.2</td></tr></table></div></address></body></html>
|