1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151
|
<?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>QGraphicsItem 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">QGraphicsItem Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QGraphicsItem class is the base class for all graphical
items in a <a href="qgraphicsscene.html">QGraphicsScene</a>.
<a href="#details">More...</a></p>
<p>Inherited by <a href="qabstractgraphicsshapeitem.html">QAbstractGraphicsShapeItem</a>, <a href="qgraphicsitemgroup.html">QGraphicsItemGroup</a>, <a href="qgraphicslineitem.html">QGraphicsLineItem</a>, <a href="qgraphicsobject.html">QGraphicsObject</a> and <a href="qgraphicspixmapitem.html">QGraphicsPixmapItem</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qgraphicsitem.html#CacheMode-enum">CacheMode</a></b> { NoCache, ItemCoordinateCache, DeviceCoordinateCache }</li><li><div class="fn" />enum <b><a href="qgraphicsitem.html#GraphicsItemChange-enum">GraphicsItemChange</a></b> { ItemPositionChange, ItemMatrixChange, ItemVisibleChange, ItemEnabledChange, ..., ItemTransformOriginPointHasChanged }</li><li><div class="fn" />enum <b><a href="qgraphicsitem.html#GraphicsItemFlag-enum">GraphicsItemFlag</a></b> { ItemIsMovable, ItemIsSelectable, ItemIsFocusable, ItemClipsToShape, ..., ItemSendsScenePositionChanges }</li><li><div class="fn" />class <b><a href="qgraphicsitem-graphicsitemflags.html">GraphicsItemFlags</a></b></li><li><div class="fn" />enum <b><a href="qgraphicsitem.html#PanelModality-enum">PanelModality</a></b> { NonModal, PanelModal, SceneModal }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qgraphicsitem.html#QGraphicsItem">__init__</a></b> (<i>self</i>, QGraphicsItem <i>parent</i> = None, QGraphicsScene <i>scene</i> = None)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#acceptDrops">acceptDrops</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.MouseButtons <b><a href="qgraphicsitem.html#acceptedMouseButtons">acceptedMouseButtons</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#acceptHoverEvents">acceptHoverEvents</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#acceptsHoverEvents">acceptsHoverEvents</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#acceptTouchEvents">acceptTouchEvents</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#advance">advance</a></b> (<i>self</i>, int <i>phase</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicsitem.html#boundingRect">boundingRect</a></b> (<i>self</i>)</li><li><div class="fn" />QRegion <b><a href="qgraphicsitem.html#boundingRegion">boundingRegion</a></b> (<i>self</i>, QTransform <i>itemToDeviceTransform</i>)</li><li><div class="fn" />float <b><a href="qgraphicsitem.html#boundingRegionGranularity">boundingRegionGranularity</a></b> (<i>self</i>)</li><li><div class="fn" />CacheMode <b><a href="qgraphicsitem.html#cacheMode">cacheMode</a></b> (<i>self</i>)</li><li><div class="fn" />unknown-type <b><a href="qgraphicsitem.html#childItems">childItems</a></b> (<i>self</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicsitem.html#childrenBoundingRect">childrenBoundingRect</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#clearFocus">clearFocus</a></b> (<i>self</i>)</li><li><div class="fn" />QPainterPath <b><a href="qgraphicsitem.html#clipPath">clipPath</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#collidesWithItem">collidesWithItem</a></b> (<i>self</i>, QGraphicsItem <i>other</i>, Qt.ItemSelectionMode <i>mode</i> = Qt.IntersectsItemShape)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#collidesWithPath">collidesWithPath</a></b> (<i>self</i>, QPainterPath <i>path</i>, Qt.ItemSelectionMode <i>mode</i> = Qt.IntersectsItemShape)</li><li><div class="fn" />unknown-type <b><a href="qgraphicsitem.html#collidingItems">collidingItems</a></b> (<i>self</i>, Qt.ItemSelectionMode <i>mode</i> = Qt.IntersectsItemShape)</li><li><div class="fn" />QGraphicsItem <b><a href="qgraphicsitem.html#commonAncestorItem">commonAncestorItem</a></b> (<i>self</i>, QGraphicsItem <i>other</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#contains">contains</a></b> (<i>self</i>, QPointF <i>point</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#contextMenuEvent">contextMenuEvent</a></b> (<i>self</i>, QGraphicsSceneContextMenuEvent <i>event</i>)</li><li><div class="fn" />QCursor <b><a href="qgraphicsitem.html#cursor">cursor</a></b> (<i>self</i>)</li><li><div class="fn" />QVariant <b><a href="qgraphicsitem.html#data">data</a></b> (<i>self</i>, int <i>key</i>)</li><li><div class="fn" />QTransform <b><a href="qgraphicsitem.html#deviceTransform">deviceTransform</a></b> (<i>self</i>, QTransform <i>viewportTransform</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#dragEnterEvent">dragEnterEvent</a></b> (<i>self</i>, QGraphicsSceneDragDropEvent <i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#dragLeaveEvent">dragLeaveEvent</a></b> (<i>self</i>, QGraphicsSceneDragDropEvent <i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#dragMoveEvent">dragMoveEvent</a></b> (<i>self</i>, QGraphicsSceneDragDropEvent <i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#dropEvent">dropEvent</a></b> (<i>self</i>, QGraphicsSceneDragDropEvent <i>event</i>)</li><li><div class="fn" />float <b><a href="qgraphicsitem.html#effectiveOpacity">effectiveOpacity</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#ensureVisible">ensureVisible</a></b> (<i>self</i>, QRectF <i>rect</i> = QRectF(), int <i>xMargin</i> = 50, int <i>yMargin</i> = 50)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#ensureVisible-2">ensureVisible</a></b> (<i>self</i>, float <i>x</i>, float <i>y</i>, float <i>w</i>, float <i>h</i>, int <i>xMargin</i> = 50, int <i>yMargin</i> = 50)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#filtersChildEvents">filtersChildEvents</a></b> (<i>self</i>)</li><li><div class="fn" />GraphicsItemFlags <b><a href="qgraphicsitem.html#flags">flags</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#focusInEvent">focusInEvent</a></b> (<i>self</i>, QFocusEvent <i>event</i>)</li><li><div class="fn" />QGraphicsItem <b><a href="qgraphicsitem.html#focusItem">focusItem</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#focusOutEvent">focusOutEvent</a></b> (<i>self</i>, QFocusEvent <i>event</i>)</li><li><div class="fn" />QGraphicsItem <b><a href="qgraphicsitem.html#focusProxy">focusProxy</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#grabKeyboard">grabKeyboard</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#grabMouse">grabMouse</a></b> (<i>self</i>)</li><li><div class="fn" />QGraphicsEffect <b><a href="qgraphicsitem.html#graphicsEffect">graphicsEffect</a></b> (<i>self</i>)</li><li><div class="fn" />QGraphicsItemGroup <b><a href="qgraphicsitem.html#group">group</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#handlesChildEvents">handlesChildEvents</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#hasCursor">hasCursor</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#hasFocus">hasFocus</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#hide">hide</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#hoverEnterEvent">hoverEnterEvent</a></b> (<i>self</i>, QGraphicsSceneHoverEvent <i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#hoverLeaveEvent">hoverLeaveEvent</a></b> (<i>self</i>, QGraphicsSceneHoverEvent <i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#hoverMoveEvent">hoverMoveEvent</a></b> (<i>self</i>, QGraphicsSceneHoverEvent <i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#inputMethodEvent">inputMethodEvent</a></b> (<i>self</i>, QInputMethodEvent <i>event</i>)</li><li><div class="fn" />Qt.InputMethodHints <b><a href="qgraphicsitem.html#inputMethodHints">inputMethodHints</a></b> (<i>self</i>)</li><li><div class="fn" />QVariant <b><a href="qgraphicsitem.html#inputMethodQuery">inputMethodQuery</a></b> (<i>self</i>, Qt.InputMethodQuery <i>query</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#installSceneEventFilter">installSceneEventFilter</a></b> (<i>self</i>, QGraphicsItem <i>filterItem</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#isActive">isActive</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#isAncestorOf">isAncestorOf</a></b> (<i>self</i>, QGraphicsItem <i>child</i>)</li><li><div class="fn" />(bool, QGraphicsItem <i>blockingPanel</i>) <b><a href="qgraphicsitem.html#isBlockedByModalPanel">isBlockedByModalPanel</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#isClipped">isClipped</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#isEnabled">isEnabled</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#isObscured">isObscured</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#isObscured-2">isObscured</a></b> (<i>self</i>, QRectF <i>rect</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#isObscured-3">isObscured</a></b> (<i>self</i>, float <i>ax</i>, float <i>ay</i>, float <i>w</i>, float <i>h</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#isObscuredBy">isObscuredBy</a></b> (<i>self</i>, QGraphicsItem <i>item</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#isPanel">isPanel</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#isSelected">isSelected</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#isUnderMouse">isUnderMouse</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#isVisible">isVisible</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#isVisibleTo">isVisibleTo</a></b> (<i>self</i>, QGraphicsItem <i>parent</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#isWidget">isWidget</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#isWindow">isWindow</a></b> (<i>self</i>)</li><li><div class="fn" />QVariant <b><a href="qgraphicsitem.html#itemChange">itemChange</a></b> (<i>self</i>, GraphicsItemChange <i>change</i>, QVariant <i>value</i>)</li><li><div class="fn" />(QTransform, bool <i>ok</i>) <b><a href="qgraphicsitem.html#itemTransform">itemTransform</a></b> (<i>self</i>, QGraphicsItem <i>other</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#keyPressEvent">keyPressEvent</a></b> (<i>self</i>, QKeyEvent <i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#keyReleaseEvent">keyReleaseEvent</a></b> (<i>self</i>, QKeyEvent <i>event</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitem.html#mapFromItem">mapFromItem</a></b> (<i>self</i>, QGraphicsItem <i>item</i>, QPointF <i>point</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapFromItem-2">mapFromItem</a></b> (<i>self</i>, QGraphicsItem <i>item</i>, QRectF <i>rect</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapFromItem-3">mapFromItem</a></b> (<i>self</i>, QGraphicsItem <i>item</i>, QPolygonF <i>polygon</i>)</li><li><div class="fn" />QPainterPath <b><a href="qgraphicsitem.html#mapFromItem-4">mapFromItem</a></b> (<i>self</i>, QGraphicsItem <i>item</i>, QPainterPath <i>path</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitem.html#mapFromItem-5">mapFromItem</a></b> (<i>self</i>, QGraphicsItem <i>item</i>, float <i>ax</i>, float <i>ay</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapFromItem-6">mapFromItem</a></b> (<i>self</i>, QGraphicsItem <i>item</i>, float <i>ax</i>, float <i>ay</i>, float <i>w</i>, float <i>h</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitem.html#mapFromParent">mapFromParent</a></b> (<i>self</i>, QPointF <i>point</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapFromParent-2">mapFromParent</a></b> (<i>self</i>, QRectF <i>rect</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapFromParent-3">mapFromParent</a></b> (<i>self</i>, QPolygonF <i>polygon</i>)</li><li><div class="fn" />QPainterPath <b><a href="qgraphicsitem.html#mapFromParent-4">mapFromParent</a></b> (<i>self</i>, QPainterPath <i>path</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitem.html#mapFromParent-5">mapFromParent</a></b> (<i>self</i>, float <i>ax</i>, float <i>ay</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapFromParent-6">mapFromParent</a></b> (<i>self</i>, float <i>ax</i>, float <i>ay</i>, float <i>w</i>, float <i>h</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitem.html#mapFromScene">mapFromScene</a></b> (<i>self</i>, QPointF <i>point</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapFromScene-2">mapFromScene</a></b> (<i>self</i>, QRectF <i>rect</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapFromScene-3">mapFromScene</a></b> (<i>self</i>, QPolygonF <i>polygon</i>)</li><li><div class="fn" />QPainterPath <b><a href="qgraphicsitem.html#mapFromScene-4">mapFromScene</a></b> (<i>self</i>, QPainterPath <i>path</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitem.html#mapFromScene-5">mapFromScene</a></b> (<i>self</i>, float <i>ax</i>, float <i>ay</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapFromScene-6">mapFromScene</a></b> (<i>self</i>, float <i>ax</i>, float <i>ay</i>, float <i>w</i>, float <i>h</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicsitem.html#mapRectFromItem">mapRectFromItem</a></b> (<i>self</i>, QGraphicsItem <i>item</i>, QRectF <i>rect</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicsitem.html#mapRectFromItem-2">mapRectFromItem</a></b> (<i>self</i>, QGraphicsItem <i>item</i>, float <i>ax</i>, float <i>ay</i>, float <i>w</i>, float <i>h</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicsitem.html#mapRectFromParent">mapRectFromParent</a></b> (<i>self</i>, QRectF <i>rect</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicsitem.html#mapRectFromParent-2">mapRectFromParent</a></b> (<i>self</i>, float <i>ax</i>, float <i>ay</i>, float <i>w</i>, float <i>h</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicsitem.html#mapRectFromScene">mapRectFromScene</a></b> (<i>self</i>, QRectF <i>rect</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicsitem.html#mapRectFromScene-2">mapRectFromScene</a></b> (<i>self</i>, float <i>ax</i>, float <i>ay</i>, float <i>w</i>, float <i>h</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicsitem.html#mapRectToItem">mapRectToItem</a></b> (<i>self</i>, QGraphicsItem <i>item</i>, QRectF <i>rect</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicsitem.html#mapRectToItem-2">mapRectToItem</a></b> (<i>self</i>, QGraphicsItem <i>item</i>, float <i>ax</i>, float <i>ay</i>, float <i>w</i>, float <i>h</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicsitem.html#mapRectToParent">mapRectToParent</a></b> (<i>self</i>, QRectF <i>rect</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicsitem.html#mapRectToParent-2">mapRectToParent</a></b> (<i>self</i>, float <i>ax</i>, float <i>ay</i>, float <i>w</i>, float <i>h</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicsitem.html#mapRectToScene">mapRectToScene</a></b> (<i>self</i>, QRectF <i>rect</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicsitem.html#mapRectToScene-2">mapRectToScene</a></b> (<i>self</i>, float <i>ax</i>, float <i>ay</i>, float <i>w</i>, float <i>h</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitem.html#mapToItem">mapToItem</a></b> (<i>self</i>, QGraphicsItem <i>item</i>, QPointF <i>point</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapToItem-2">mapToItem</a></b> (<i>self</i>, QGraphicsItem <i>item</i>, QRectF <i>rect</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapToItem-3">mapToItem</a></b> (<i>self</i>, QGraphicsItem <i>item</i>, QPolygonF <i>polygon</i>)</li><li><div class="fn" />QPainterPath <b><a href="qgraphicsitem.html#mapToItem-4">mapToItem</a></b> (<i>self</i>, QGraphicsItem <i>item</i>, QPainterPath <i>path</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitem.html#mapToItem-5">mapToItem</a></b> (<i>self</i>, QGraphicsItem <i>item</i>, float <i>ax</i>, float <i>ay</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapToItem-6">mapToItem</a></b> (<i>self</i>, QGraphicsItem <i>item</i>, float <i>ax</i>, float <i>ay</i>, float <i>w</i>, float <i>h</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitem.html#mapToParent">mapToParent</a></b> (<i>self</i>, QPointF <i>point</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapToParent-2">mapToParent</a></b> (<i>self</i>, QRectF <i>rect</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapToParent-3">mapToParent</a></b> (<i>self</i>, QPolygonF <i>polygon</i>)</li><li><div class="fn" />QPainterPath <b><a href="qgraphicsitem.html#mapToParent-4">mapToParent</a></b> (<i>self</i>, QPainterPath <i>path</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitem.html#mapToParent-5">mapToParent</a></b> (<i>self</i>, float <i>ax</i>, float <i>ay</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapToParent-6">mapToParent</a></b> (<i>self</i>, float <i>ax</i>, float <i>ay</i>, float <i>w</i>, float <i>h</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitem.html#mapToScene">mapToScene</a></b> (<i>self</i>, QPointF <i>point</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapToScene-2">mapToScene</a></b> (<i>self</i>, QRectF <i>rect</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapToScene-3">mapToScene</a></b> (<i>self</i>, QPolygonF <i>polygon</i>)</li><li><div class="fn" />QPainterPath <b><a href="qgraphicsitem.html#mapToScene-4">mapToScene</a></b> (<i>self</i>, QPainterPath <i>path</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitem.html#mapToScene-5">mapToScene</a></b> (<i>self</i>, float <i>ax</i>, float <i>ay</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapToScene-6">mapToScene</a></b> (<i>self</i>, float <i>ax</i>, float <i>ay</i>, float <i>w</i>, float <i>h</i>)</li><li><div class="fn" />QMatrix <b><a href="qgraphicsitem.html#matrix">matrix</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a></b> (<i>self</i>, QGraphicsSceneMouseEvent <i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#mouseMoveEvent">mouseMoveEvent</a></b> (<i>self</i>, QGraphicsSceneMouseEvent <i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a></b> (<i>self</i>, QGraphicsSceneMouseEvent <i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#mouseReleaseEvent">mouseReleaseEvent</a></b> (<i>self</i>, QGraphicsSceneMouseEvent <i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#moveBy">moveBy</a></b> (<i>self</i>, float <i>dx</i>, float <i>dy</i>)</li><li><div class="fn" />float <b><a href="qgraphicsitem.html#opacity">opacity</a></b> (<i>self</i>)</li><li><div class="fn" />QPainterPath <b><a href="qgraphicsitem.html#opaqueArea">opaqueArea</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#paint">paint</a></b> (<i>self</i>, QPainter <i>painter</i>, QStyleOptionGraphicsItem <i>option</i>, QWidget <i>widget</i> = None)</li><li><div class="fn" />QGraphicsItem <b><a href="qgraphicsitem.html#panel">panel</a></b> (<i>self</i>)</li><li><div class="fn" />PanelModality <b><a href="qgraphicsitem.html#panelModality">panelModality</a></b> (<i>self</i>)</li><li><div class="fn" />QGraphicsItem <b><a href="qgraphicsitem.html#parentItem">parentItem</a></b> (<i>self</i>)</li><li><div class="fn" />QGraphicsObject <b><a href="qgraphicsitem.html#parentObject">parentObject</a></b> (<i>self</i>)</li><li><div class="fn" />QGraphicsWidget <b><a href="qgraphicsitem.html#parentWidget">parentWidget</a></b> (<i>self</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitem.html#pos">pos</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#prepareGeometryChange">prepareGeometryChange</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#removeSceneEventFilter">removeSceneEventFilter</a></b> (<i>self</i>, QGraphicsItem <i>filterItem</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#resetMatrix">resetMatrix</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#resetTransform">resetTransform</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#rotate">rotate</a></b> (<i>self</i>, float <i>angle</i>)</li><li><div class="fn" />float <b><a href="qgraphicsitem.html#rotation">rotation</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#scale">scale</a></b> (<i>self</i>, float <i>sx</i>, float <i>sy</i>)</li><li><div class="fn" />float <b><a href="qgraphicsitem.html#scale-2">scale</a></b> (<i>self</i>)</li><li><div class="fn" />QGraphicsScene <b><a href="qgraphicsitem.html#scene">scene</a></b> (<i>self</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicsitem.html#sceneBoundingRect">sceneBoundingRect</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#sceneEvent">sceneEvent</a></b> (<i>self</i>, QEvent <i>event</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#sceneEventFilter">sceneEventFilter</a></b> (<i>self</i>, QGraphicsItem <i>watched</i>, QEvent <i>event</i>)</li><li><div class="fn" />QMatrix <b><a href="qgraphicsitem.html#sceneMatrix">sceneMatrix</a></b> (<i>self</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitem.html#scenePos">scenePos</a></b> (<i>self</i>)</li><li><div class="fn" />QTransform <b><a href="qgraphicsitem.html#sceneTransform">sceneTransform</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#scroll">scroll</a></b> (<i>self</i>, float <i>dx</i>, float <i>dy</i>, QRectF <i>rect</i> = QRectF())</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setAcceptDrops">setAcceptDrops</a></b> (<i>self</i>, bool <i>on</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setAcceptedMouseButtons">setAcceptedMouseButtons</a></b> (<i>self</i>, Qt.MouseButtons <i>buttons</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setAcceptHoverEvents">setAcceptHoverEvents</a></b> (<i>self</i>, bool <i>enabled</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setAcceptsHoverEvents">setAcceptsHoverEvents</a></b> (<i>self</i>, bool <i>enabled</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setAcceptTouchEvents">setAcceptTouchEvents</a></b> (<i>self</i>, bool <i>enabled</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setActive">setActive</a></b> (<i>self</i>, bool <i>active</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setBoundingRegionGranularity">setBoundingRegionGranularity</a></b> (<i>self</i>, float <i>granularity</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setCacheMode">setCacheMode</a></b> (<i>self</i>, CacheMode <i>mode</i>, QSize <i>logicalCacheSize</i> = QSize())</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setCursor">setCursor</a></b> (<i>self</i>, QCursor <i>cursor</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setData">setData</a></b> (<i>self</i>, int <i>key</i>, QVariant <i>value</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setEnabled">setEnabled</a></b> (<i>self</i>, bool <i>enabled</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setFiltersChildEvents">setFiltersChildEvents</a></b> (<i>self</i>, bool <i>enabled</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setFlag">setFlag</a></b> (<i>self</i>, GraphicsItemFlag <i>flag</i>, bool <i>enabled</i> = True)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setFlags">setFlags</a></b> (<i>self</i>, GraphicsItemFlags <i>flags</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setFocus">setFocus</a></b> (<i>self</i>, Qt.FocusReason <i>focusReason</i> = Qt.OtherFocusReason)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setFocusProxy">setFocusProxy</a></b> (<i>self</i>, QGraphicsItem <i>item</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setGraphicsEffect">setGraphicsEffect</a></b> (<i>self</i>, QGraphicsEffect <i>effect</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setGroup">setGroup</a></b> (<i>self</i>, QGraphicsItemGroup <i>group</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setHandlesChildEvents">setHandlesChildEvents</a></b> (<i>self</i>, bool <i>enabled</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setInputMethodHints">setInputMethodHints</a></b> (<i>self</i>, Qt.InputMethodHints <i>hints</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setMatrix">setMatrix</a></b> (<i>self</i>, QMatrix <i>matrix</i>, bool <i>combine</i> = False)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setOpacity">setOpacity</a></b> (<i>self</i>, float <i>opacity</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setPanelModality">setPanelModality</a></b> (<i>self</i>, PanelModality <i>panelModality</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setParentItem">setParentItem</a></b> (<i>self</i>, QGraphicsItem <i>parent</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setPos">setPos</a></b> (<i>self</i>, QPointF <i>pos</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setPos-2">setPos</a></b> (<i>self</i>, float <i>ax</i>, float <i>ay</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setRotation">setRotation</a></b> (<i>self</i>, float <i>angle</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setScale">setScale</a></b> (<i>self</i>, float <i>scale</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setSelected">setSelected</a></b> (<i>self</i>, bool <i>selected</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setToolTip">setToolTip</a></b> (<i>self</i>, QString <i>toolTip</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setTransform">setTransform</a></b> (<i>self</i>, QTransform <i>matrix</i>, bool <i>combine</i> = False)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setTransformations">setTransformations</a></b> (<i>self</i>, unknown-type <i>transformations</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a></b> (<i>self</i>, QPointF <i>origin</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setTransformOriginPoint-2">setTransformOriginPoint</a></b> (<i>self</i>, float <i>ax</i>, float <i>ay</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setVisible">setVisible</a></b> (<i>self</i>, bool <i>visible</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setX">setX</a></b> (<i>self</i>, float <i>x</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setY">setY</a></b> (<i>self</i>, float <i>y</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setZValue">setZValue</a></b> (<i>self</i>, float <i>z</i>)</li><li><div class="fn" />QPainterPath <b><a href="qgraphicsitem.html#shape">shape</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#shear">shear</a></b> (<i>self</i>, float <i>sh</i>, float <i>sv</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#show">show</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#stackBefore">stackBefore</a></b> (<i>self</i>, QGraphicsItem <i>sibling</i>)</li><li><div class="fn" />QGraphicsObject <b><a href="qgraphicsitem.html#toGraphicsObject">toGraphicsObject</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qgraphicsitem.html#toolTip">toolTip</a></b> (<i>self</i>)</li><li><div class="fn" />QGraphicsItem <b><a href="qgraphicsitem.html#topLevelItem">topLevelItem</a></b> (<i>self</i>)</li><li><div class="fn" />QGraphicsWidget <b><a href="qgraphicsitem.html#topLevelWidget">topLevelWidget</a></b> (<i>self</i>)</li><li><div class="fn" />QTransform <b><a href="qgraphicsitem.html#transform">transform</a></b> (<i>self</i>)</li><li><div class="fn" />unknown-type <b><a href="qgraphicsitem.html#transformations">transformations</a></b> (<i>self</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitem.html#transformOriginPoint">transformOriginPoint</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#translate">translate</a></b> (<i>self</i>, float <i>dx</i>, float <i>dy</i>)</li><li><div class="fn" />int <b><a href="qgraphicsitem.html#type">type</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#ungrabKeyboard">ungrabKeyboard</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#ungrabMouse">ungrabMouse</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#unsetCursor">unsetCursor</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#update">update</a></b> (<i>self</i>, QRectF <i>rect</i> = QRectF())</li><li><div class="fn" /><b><a href="qgraphicsitem.html#update-2">update</a></b> (<i>self</i>, float <i>ax</i>, float <i>ay</i>, float <i>width</i>, float <i>height</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#updateMicroFocus">updateMicroFocus</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#wheelEvent">wheelEvent</a></b> (<i>self</i>, QGraphicsSceneWheelEvent <i>event</i>)</li><li><div class="fn" />QGraphicsWidget <b><a href="qgraphicsitem.html#window">window</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qgraphicsitem.html#x">x</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qgraphicsitem.html#y">y</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qgraphicsitem.html#zValue">zValue</a></b> (<i>self</i>)</li></ul><h3>Static Members</h3><ul><li><div class="fn" />int <b><a href="qgraphicsitem.html#UserType-var">UserType</a></b></li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QGraphicsItem class is the base class for all graphical
items in a <a href="qgraphicsscene.html">QGraphicsScene</a>.</p>
<p>It provides a light-weight foundation for writing your own
custom items. This includes defining the item's geometry, collision
detection, its painting implementation and item interaction through
its event handlers. QGraphicsItem is part of the <a href="graphicsview.html">Graphics View Framework</a></p>
<p class="centerAlign"><img alt="" src="images/graphicsview-items.png" /></p>
<p>For convenience, Qt provides a set of standard graphics items
for the most common shapes. These are:</p>
<ul>
<li><a href="qgraphicsellipseitem.html">QGraphicsEllipseItem</a>
provides an ellipse item</li>
<li><a href="qgraphicslineitem.html">QGraphicsLineItem</a> provides
a line item</li>
<li><a href="qgraphicspathitem.html">QGraphicsPathItem</a> provides
an arbitrary path item</li>
<li><a href="qgraphicspixmapitem.html">QGraphicsPixmapItem</a>
provides a pixmap item</li>
<li><a href="qgraphicspolygonitem.html">QGraphicsPolygonItem</a>
provides a polygon item</li>
<li><a href="qgraphicsrectitem.html">QGraphicsRectItem</a> provides
a rectangular item</li>
<li><a href="qgraphicssimpletextitem.html">QGraphicsSimpleTextItem</a> provides
a simple text label item</li>
<li><a href="qgraphicstextitem.html">QGraphicsTextItem</a> provides
an advanced text browser item</li>
</ul>
<p>All of an item's geometric information is based on its local
coordinate system. The item's position, <a href="qgraphicsitem.html#pos">pos</a>(), is the only function that does
not operate in local coordinates, as it returns a position in
parent coordinates. <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a> describes the coordinate system
in detail.</p>
<p>You can set whether an item should be visible (i.e., drawn, and
accepting events), by calling <a href="qgraphicsitem.html#setVisible">setVisible</a>(). Hiding an item
will also hide its children. Similarly, you can enable or disable
an item by calling <a href="qgraphicsitem.html#setEnabled">setEnabled</a>(). If you disable an
item, all its children will also be disabled. By default, items are
both visible and enabled. To toggle whether an item is selected or
not, first enable selection by setting the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsSelectable</a>
flag, and then call <a href="qgraphicsitem.html#setSelected">setSelected</a>(). Normally,
selection is toggled by the scene, as a result of user
interaction.</p>
<p>To write your own graphics item, you first create a subclass of
QGraphicsItem, and then start by implementing its two pure virtual
public functions: <a href="qgraphicsitem.html#boundingRect">boundingRect</a>(), which returns
an estimate of the area painted by the item, and <a href="qgraphicsitem.html#paint">paint</a>(), which implements the actual
painting. For example:</p>
<pre class="cpp">
<span class="keyword">class</span> SimpleItem : <span class="keyword">public</span> <span class="type">QGraphicsItem</span>
{
<span class="keyword">public</span>:
<span class="type"><a href="qrectf.html">QRectF</a></span> boundingRect() <span class="keyword">const</span>
{
<span class="type"><a href="qtcore.html#qreal-typedef">qreal</a></span> penWidth <span class="operator">=</span> <span class="number">1</span>;
<span class="keyword">return</span> <span class="type"><a href="qrectf.html">QRectF</a></span>(<span class="operator">-</span><span class="number">10</span> <span class="operator">-</span> penWidth <span class="operator">/</span> <span class="number">2</span><span class="operator">,</span> <span class="operator">-</span><span class="number">10</span> <span class="operator">-</span> penWidth <span class="operator">/</span> <span class="number">2</span><span class="operator">,</span>
<span class="number">20</span> <span class="operator">+</span> penWidth<span class="operator">,</span> <span class="number">20</span> <span class="operator">+</span> penWidth);
}
<span class="type">void</span> paint(<span class="type"><a href="qpainter.html">QPainter</a></span> <span class="operator">*</span>painter<span class="operator">,</span> <span class="keyword">const</span> <span class="type"><a href="qstyleoptiongraphicsitem.html">QStyleOptionGraphicsItem</a></span> <span class="operator">*</span>option<span class="operator">,</span>
<span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>widget)
{
painter<span class="operator">-</span><span class="operator">></span>drawRoundedRect(<span class="operator">-</span><span class="number">10</span><span class="operator">,</span> <span class="operator">-</span><span class="number">10</span><span class="operator">,</span> <span class="number">20</span><span class="operator">,</span> <span class="number">20</span><span class="operator">,</span> <span class="number">5</span><span class="operator">,</span> <span class="number">5</span>);
}
};
</pre>
<p>The <a href="qgraphicsitem.html#boundingRect">boundingRect</a>()
function has many different purposes. <a href="qgraphicsscene.html">QGraphicsScene</a> bases its item index on
<a href="qgraphicsitem.html#boundingRect">boundingRect</a>(), and
<a href="qgraphicsview.html">QGraphicsView</a> uses it both for
culling invisible items, and for determining the area that needs to
be recomposed when drawing overlapping items. In addition,
QGraphicsItem's collision detection mechanisms use <a href="qgraphicsitem.html#boundingRect">boundingRect</a>() to provide an
efficient cut-off. The fine grained collision algorithm in <a href="qgraphicsitem.html#collidesWithItem">collidesWithItem</a>() is
based on calling <a href="qgraphicsitem.html#shape">shape</a>(),
which returns an accurate outline of the item's shape as a <a href="qpainterpath.html">QPainterPath</a>.</p>
<p><a href="qgraphicsscene.html">QGraphicsScene</a> expects all
items <a href="qgraphicsitem.html#boundingRect">boundingRect</a>()
and <a href="qgraphicsitem.html#shape">shape</a>() to remain
unchanged unless it is notified. If you want to change an item's
geometry in any way, you must first call <a href="qgraphicsitem.html#prepareGeometryChange">prepareGeometryChange</a>()
to allow <a href="qgraphicsscene.html">QGraphicsScene</a> to update
its bookkeeping.</p>
<p>Collision detection can be done in two ways:</p>
<ol class="1">
<li>Reimplement <a href="qgraphicsitem.html#shape">shape</a>() to
return an accurate shape for your item, and rely on the default
implementation of <a href="qgraphicsitem.html#collidesWithItem">collidesWithItem</a>() to do
shape-shape intersection. This can be rather expensive if the
shapes are complex.</li>
<li>Reimplement <a href="qgraphicsitem.html#collidesWithItem">collidesWithItem</a>() to
provide your own custom item and shape collision algorithm.</li>
</ol>
<p>The <a href="qgraphicsitem.html#contains">contains</a>()
function can be called to determine whether the item
<i>contains</i> a point or not. This function can also be
reimplemented by the item. The default behavior of <a href="qgraphicsitem.html#contains">contains</a>() is based on calling
<a href="qgraphicsitem.html#shape">shape</a>().</p>
<p>Items can contain other items, and also be contained by other
items. All items can have a parent item and a list of children.
Unless the item has no parent, its position is in <i>parent</i>
coordinates (i.e., the parent's local coordinates). Parent items
propagate both their position and their transformation to all
children.</p>
<p class="centerAlign"><img alt="" src="images/graphicsview-parentchild.png" /></p>
<a id="transformations" name="transformations" /><a id="transformations" name="transformations" />
<h3>Transformations</h3>
<p>QGraphicsItem supports projective transformations in addition to
its base position, <a href="qgraphicsitem.html#pos">pos</a>().
There are several ways to change an item's transformation. For
simple transformations, you can call either of the convenience
functions <a href="qgraphicsitem.html#setRotation">setRotation</a>() or <a href="qgraphicsitem.html#setScale">setScale</a>(), or you can pass any
transformation matrix to <a href="qgraphicsitem.html#setTransform">setTransform</a>(). For advanced
transformation control you also have the option of setting several
combined transformations by calling <a href="qgraphicsitem.html#setTransformations">setTransformations</a>().</p>
<p>Item transformations accumulate from parent to child, so if both
a parent and child item are rotated 90 degrees, the child's total
transformation will be 180 degrees. Similarly, if the item's parent
is scaled to 2x its original size, its children will also be twice
as large. An item's transformation does not affect its own local
geometry; all geometry functions (e.g., <a href="qgraphicsitem.html#contains">contains</a>(), <a href="qgraphicsitem.html#update">update</a>(), and all the mapping
functions) still operate in local coordinates. For convenience,
QGraphicsItem provides the functions <a href="qgraphicsitem.html#sceneTransform">sceneTransform</a>(), which
returns the item's total transformation matrix (including its
position and all parents' positions and transformations), and
<a href="qgraphicsitem.html#scenePos">scenePos</a>(), which returns
its position in scene coordinates. To reset an item's matrix, call
<a href="qgraphicsitem.html#resetTransform">resetTransform</a>().</p>
<p>Certain transformation operations produce a different outcome
depending on the order in which they are applied. For example, if
you scale an transform, and then rotate it, you may get a different
result than if the transform was rotated first. However, the order
you set the transformation properties on QGraphicsItem does not
affect the resulting transformation; QGraphicsItem always applies
the properties in a fixed, defined order:</p>
<ul>
<li>The item's base transform is applied (<a href="qgraphicsitem.html#transform">transform</a>())</li>
<li>The item's transformations list is applied in order (<a href="qgraphicsitem.html#transformations">transformations</a>())</li>
<li>The item is rotated relative to its transform origin point
(<a href="qgraphicsitem.html#rotation">rotation</a>(), <a href="qgraphicsitem.html#transformOriginPoint">transformOriginPoint</a>())</li>
<li>The item is scaled relative to its transform origin point
(<a href="qgraphicsitem.html#scale">scale</a>(), <a href="qgraphicsitem.html#transformOriginPoint">transformOriginPoint</a>())</li>
</ul>
<a id="painting" name="painting" />
<h3>Painting</h3>
<p>The <a href="qgraphicsitem.html#paint">paint</a>() function is
called by <a href="qgraphicsview.html">QGraphicsView</a> to paint
the item's contents. The item has no background or default fill of
its own; whatever is behind the item will shine through all areas
that are not explicitly painted in this function. You can call
<a href="qgraphicsitem.html#update">update</a>() to schedule a
repaint, optionally passing the rectangle that needs a repaint.
Depending on whether or not the item is visible in a view, the item
may or may not be repainted; there is no equivalent to <a href="qwidget.html#repaint">QWidget.repaint</a>() in QGraphicsItem.</p>
<p>Items are painted by the view, starting with the parent items
and then drawing children, in ascending stacking order. You can set
an item's stacking order by calling <a href="qgraphicsitem.html#setZValue">setZValue</a>(), and test it by
calling <a href="qgraphicsitem.html#zValue">zValue</a>(), where
items with low z-values are painted before items with high
z-values. Stacking order applies to sibling items; parents are
always drawn before their children.</p>
<a id="sorting" name="sorting" />
<h3>Sorting</h3>
<p>All items are drawn in a defined, stable order, and this same
order decides which items will receive mouse input first when you
click on the scene. Normally you don't have to worry about sorting,
as the items follow a "natural order", following the logical
structure of the scene.</p>
<p>An item's children are stacked on top of the parent, and sibling
items are stacked by insertion order (i.e., in the same order that
they were either added to the scene, or added to the same parent).
If you add item A, and then B, then B will be on top of A. If you
then add C, the items' stacking order will be A, then B, then
C.</p>
<p class="centerAlign"><img alt="" src="images/graphicsview-zorder.png" /></p>
<p>This example shows the stacking order of all limbs of the robot
from the <a href="graphicsview-dragdroprobot.html">Drag and Drop
Robot</a> example. The torso is the root item (all other items are
children or descendants of the torso), so it is drawn first. Next,
the head is drawn, as it is the first item in the torso's list of
children. Then the upper left arm is drawn. As the lower arm is a
child of the upper arm, the lower arm is then drawn, followed by
the upper arm's next sibling, which is the upper right arm, and so
on.</p>
<p>For advanced users, there are ways to alter how your items are
sorted:</p>
<ul>
<li>You can call <a href="qgraphicsitem.html#setZValue">setZValue</a>() on an item to
explicitly stack it on top of, or under, other sibling items. The
default Z value for an item is 0. Items with the same Z value are
stacked by insertion order.</li>
<li>You can call <a href="qgraphicsitem.html#stackBefore">stackBefore</a>() to reorder the
list of children. This will directly modify the insertion
order.</li>
<li>You can set the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemStacksBehindParent</a>
flag to stack a child item behind its parent.</li>
</ul>
<p>The stacking order of two sibling items also counts for each
item's children and descendant items. So if one item is on top of
another, then all its children will also be on top of all the other
item's children as well.</p>
<a id="events" name="events" />
<h3>Events</h3>
<p>QGraphicsItem receives events from <a href="qgraphicsscene.html">QGraphicsScene</a> through the virtual
function <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().
This function distributes the most common events to a set of
convenience event handlers:</p>
<ul>
<li><a href="qgraphicsitem.html#contextMenuEvent">contextMenuEvent</a>()
handles context menu events</li>
<li><a href="qgraphicsitem.html#focusInEvent">focusInEvent</a>()
and <a href="qgraphicsitem.html#focusOutEvent">focusOutEvent</a>()
handle focus in and out events</li>
<li><a href="qgraphicsitem.html#hoverEnterEvent">hoverEnterEvent</a>(),
<a href="qgraphicsitem.html#hoverMoveEvent">hoverMoveEvent</a>(),
and <a href="qgraphicsitem.html#hoverLeaveEvent">hoverLeaveEvent</a>() handles
hover enter, move and leave events</li>
<li><a href="qgraphicsitem.html#inputMethodEvent">inputMethodEvent</a>()
handles input events, for accessibility support</li>
<li><a href="qgraphicsitem.html#keyPressEvent">keyPressEvent</a>()
and <a href="qgraphicsitem.html#keyReleaseEvent">keyReleaseEvent</a>() handle
key press and release events</li>
<li><a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>(),
<a href="qgraphicsitem.html#mouseMoveEvent">mouseMoveEvent</a>(),
<a href="qgraphicsitem.html#mouseReleaseEvent">mouseReleaseEvent</a>(), and
<a href="qgraphicsitem.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a>()
handles mouse press, move, release, click and doubleclick
events</li>
</ul>
<p>You can filter events for any other item by installing event
filters. This functionality is separate from Qt's regular event
filters (see <a href="qobject.html#installEventFilter">QObject.installEventFilter</a>()),
which only work on subclasses of <a href="qobject.html">QObject</a>. After installing your item as an event
filter for another item by calling <a href="qgraphicsitem.html#installSceneEventFilter">installSceneEventFilter</a>(),
the filtered events will be received by the virtual function
<a href="qgraphicsitem.html#sceneEventFilter">sceneEventFilter</a>(). You
can remove item event filters by calling <a href="qgraphicsitem.html#removeSceneEventFilter">removeSceneEventFilter</a>().</p>
<a id="custom-data" name="custom-data" />
<h3>Custom Data</h3>
<p>Sometimes it's useful to register custom data with an item, be
it a custom item, or a standard item. You can call <a href="qgraphicsitem.html#setData">setData</a>() on any item to store
data in it using a key-value pair (the key being an integer, and
the value is a <a href="qvariant.html">QVariant</a>). To get custom
data from an item, call <a href="qgraphicsitem.html#data">data</a>(). This functionality is
completely untouched by Qt itself; it is provided for the user's
convenience.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="CacheMode-enum" />QGraphicsItem.CacheMode</h3><p>This enum describes <a href="qgraphicsitem.html">QGraphicsItem</a>'s cache modes. Caching is
used to speed up rendering by allocating and rendering to an
off-screen pixel buffer, which can be reused when the item requires
redrawing. For some paint devices, the cache is stored directly in
graphics memory, which makes rendering very quick.</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>QGraphicsItem.NoCache</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The default; all item caching is disabled.
<a href="qgraphicsitem.html#paint">QGraphicsItem.paint</a>() is
called every time the item needs redrawing.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemCoordinateCache</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">Caching is enabled for the item's logical
(local) coordinate system. <a href="qgraphicsitem.html">QGraphicsItem</a> creates an off-screen pixel
buffer with a configurable size / resolution that you can pass to
<a href="qgraphicsitem.html#setCacheMode">QGraphicsItem.setCacheMode</a>().
Rendering quality will typically degrade, depending on the
resolution of the cache and the item transformation. The first time
the item is redrawn, it will render itself into the cache, and the
cache is then reused for every subsequent expose. The cache is also
reused as the item is transformed. To adjust the resolution of the
cache, you can call <a href="qgraphicsitem.html#setCacheMode">setCacheMode</a>() again.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.DeviceCoordinateCache</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">Caching is enabled at the paint device level,
in device coordinates. This mode is for items that can move, but
are not rotated, scaled or sheared. If the item is transformed
directly or indirectly, the cache will be regenerated
automatically. Unlike ItemCoordinateCacheMode,
DeviceCoordinateCache always renders at maximum quality.</td>
</tr>
</table>
<p>This enum was introduced or modified in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setCacheMode">QGraphicsItem.setCacheMode</a>().</p>
<h3 class="fn"><a name="GraphicsItemChange-enum" />QGraphicsItem.GraphicsItemChange</h3><p>This enum describes the state changes that are notified by
<a href="qgraphicsitem.html#itemChange">QGraphicsItem.itemChange</a>().
The notifications are sent as the state changes, and in some cases,
adjustments can be made (see the documentation for each change for
details).</p>
<p>Note: Be careful with calling functions on the <a href="qgraphicsitem.html">QGraphicsItem</a> itself inside <a href="qgraphicsitem.html#itemChange">itemChange</a>(), as certain
function calls can lead to unwanted recursion. For example, you
cannot call <a href="qgraphicsitem.html#setPos">setPos</a>() in
<a href="qgraphicsitem.html#itemChange">itemChange</a>() on an
ItemPositionChange notification, as the <a href="qgraphicsitem.html#setPos">setPos</a>() function will again call
itemChange(ItemPositionChange). Instead, you can return the new,
adjusted position from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemEnabledChange</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign">The item's enabled state changes. If the item
is presently enabled, it will become disabled, and vice verca. The
value argument is the new enabled state (i.e., true or false). Do
not call <a href="qgraphicsitem.html#setEnabled">setEnabled</a>()
in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered. Instead, you can return the new state
from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemEnabledHasChanged</tt></td>
<td class="topAlign"><tt>13</tt></td>
<td class="topAlign">The item's enabled state has changed. The
value argument is the new enabled state (i.e., true or false). Do
not call <a href="qgraphicsitem.html#setEnabled">setEnabled</a>()
in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered. The return value is ignored.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemMatrixChange</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The item's affine transformation matrix is
changing. This value is obsolete; you can use ItemTransformChange
instead.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemPositionChange</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The item's position changes. This notification
is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a>
flag is enabled, and when the item's local position changes,
relative to its parent (i.e., as a result of calling <a href="qgraphicsitem.html#setPos">setPos</a>() or <a href="qgraphicsitem.html#moveBy">moveBy</a>()). The value argument is
the new position (i.e., a <a href="qpointf.html">QPointF</a>). You
can call <a href="qgraphicsitem.html#pos">pos</a>() to get the
original position. Do not call <a href="qgraphicsitem.html#setPos">setPos</a>() or <a href="qgraphicsitem.html#moveBy">moveBy</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered; instead, you can return the new,
adjusted position from <a href="qgraphicsitem.html#itemChange">itemChange</a>(). After this
notification, <a href="qgraphicsitem.html">QGraphicsItem</a>
immediately sends the ItemPositionHasChanged notification if the
position changed.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemPositionHasChanged</tt></td>
<td class="topAlign"><tt>9</tt></td>
<td class="topAlign">The item's position has changed. This
notification is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a>
flag is enabled, and after the item's local position, relative to
its parent, has changed. The value argument is the new position
(the same as <a href="qgraphicsitem.html#pos">pos</a>()), and
<a href="qgraphicsitem.html">QGraphicsItem</a> ignores the return
value for this notification (i.e., a read-only notification).</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemTransformChange</tt></td>
<td class="topAlign"><tt>8</tt></td>
<td class="topAlign">The item's transformation matrix changes. This
notification is send if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a>
flag is enabled, and when the item's local transformation matrix
changes (i.e., as a result of calling <a href="qgraphicsitem.html#setTransform">setTransform</a>(). The value
argument is the new matrix (i.e., a <a href="qtransform.html">QTransform</a>); to get the old matrix, call
<a href="qgraphicsitem.html#transform">transform</a>(). Do not call
<a href="qgraphicsitem.html#setTransform">setTransform</a>() or set
any of the transformation properties in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered; instead, you can return the new matrix
from <a href="qgraphicsitem.html#itemChange">itemChange</a>(). This
notification is not sent if you change the transformation
properties.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemTransformHasChanged</tt></td>
<td class="topAlign"><tt>10</tt></td>
<td class="topAlign">The item's transformation matrix has changed
either because setTransform is called, or one of the transformation
properties is changed. This notification is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a>
flag is enabled, and after the item's local transformation matrix
has changed. The value argument is the new matrix (same as <a href="qgraphicsitem.html#transform">transform</a>()), and <a href="qgraphicsitem.html">QGraphicsItem</a> ignores the return value for
this notification (i.e., a read-only notification).</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemRotationChange</tt></td>
<td class="topAlign"><tt>28</tt></td>
<td class="topAlign">The item's rotation property changes. This
notification is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a>
flag is enabled, and when the item's rotation property changes
(i.e., as a result of calling <a href="qgraphicsitem.html#setRotation">setRotation</a>()). The value
argument is the new rotation (i.e., a double); to get the old
rotation, call <a href="qgraphicsitem.html#rotation">rotation</a>(). Do not call <a href="qgraphicsitem.html#setRotation">setRotation</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered; instead, you can return the new rotation
from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemRotationHasChanged</tt></td>
<td class="topAlign"><tt>29</tt></td>
<td class="topAlign">The item's rotation property has changed. This
notification is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a>
flag is enabled, and after the item's rotation property has
changed. The value argument is the new rotation (i.e., a double),
and <a href="qgraphicsitem.html">QGraphicsItem</a> ignores the
return value for this notification (i.e., a read-only
notification). Do not call <a href="qgraphicsitem.html#setRotation">setRotation</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemScaleChange</tt></td>
<td class="topAlign"><tt>30</tt></td>
<td class="topAlign">The item's scale property changes. This
notification is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a>
flag is enabled, and when the item's scale property changes (i.e.,
as a result of calling <a href="qgraphicsitem.html#setScale">setScale</a>()). The value argument
is the new scale (i.e., a double); to get the old scale, call
<a href="qgraphicsitem.html#scale">scale</a>(). Do not call
<a href="qgraphicsitem.html#setScale">setScale</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered; instead, you can return the new scale
from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemScaleHasChanged</tt></td>
<td class="topAlign"><tt>31</tt></td>
<td class="topAlign">The item's scale property has changed. This
notification is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a>
flag is enabled, and after the item's scale property has changed.
The value argument is the new scale (i.e., a double), and <a href="qgraphicsitem.html">QGraphicsItem</a> ignores the return value for
this notification (i.e., a read-only notification). Do not call
<a href="qgraphicsitem.html#setScale">setScale</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemTransformOriginPointChange</tt></td>
<td class="topAlign"><tt>32</tt></td>
<td class="topAlign">The item's transform origin point property
changes. This notification is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a>
flag is enabled, and when the item's transform origin point
property changes (i.e., as a result of calling <a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>()).
The value argument is the new origin point (i.e., a <a href="qpointf.html">QPointF</a>); to get the old origin point, call
<a href="qgraphicsitem.html#transformOriginPoint">transformOriginPoint</a>().
Do not call <a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>()
in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered; instead, you can return the new
transform origin point from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemTransformOriginPointHasChanged</tt></td>
<td class="topAlign"><tt>33</tt></td>
<td class="topAlign">The item's transform origin point property has
changed. This notification is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a>
flag is enabled, and after the item's transform origin point
property has changed. The value argument is the new origin point
(i.e., a <a href="qpointf.html">QPointF</a>), and <a href="qgraphicsitem.html">QGraphicsItem</a> ignores the return value for
this notification (i.e., a read-only notification). Do not call
<a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>()
in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemSelectedChange</tt></td>
<td class="topAlign"><tt>4</tt></td>
<td class="topAlign">The item's selected state changes. If the item
is presently selected, it will become unselected, and vice verca.
The value argument is the new selected state (i.e., true or false).
Do not call <a href="qgraphicsitem.html#setSelected">setSelected</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered; instead, you can return the new selected
state from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemSelectedHasChanged</tt></td>
<td class="topAlign"><tt>14</tt></td>
<td class="topAlign">The item's selected state has changed. The
value argument is the new selected state (i.e., true or false). Do
not call <a href="qgraphicsitem.html#setSelected">setSelected</a>()
in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered. The return value is ignored.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemVisibleChange</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">The item's visible state changes. If the item
is presently visible, it will become invisible, and vice verca. The
value argument is the new visible state (i.e., true or false). Do
not call <a href="qgraphicsitem.html#setVisible">setVisible</a>()
in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered; instead, you can return the new visible
state from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemVisibleHasChanged</tt></td>
<td class="topAlign"><tt>12</tt></td>
<td class="topAlign">The item's visible state has changed. The
value argument is the new visible state (i.e., true or false). Do
not call <a href="qgraphicsitem.html#setVisible">setVisible</a>()
in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered. The return value is ignored.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemParentChange</tt></td>
<td class="topAlign"><tt>5</tt></td>
<td class="topAlign">The item's parent changes. The value argument
is the new parent item (i.e., a <a href="qgraphicsitem.html">QGraphicsItem</a> pointer). Do not call
<a href="qgraphicsitem.html#setParentItem">setParentItem</a>() in
<a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered; instead, you can return the new parent
from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemParentHasChanged</tt></td>
<td class="topAlign"><tt>15</tt></td>
<td class="topAlign">The item's parent has changed. The value
argument is the new parent (i.e., a pointer to a <a href="qgraphicsitem.html">QGraphicsItem</a>). Do not call <a href="qgraphicsitem.html#setParentItem">setParentItem</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered. The return value is ignored.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemChildAddedChange</tt></td>
<td class="topAlign"><tt>6</tt></td>
<td class="topAlign">A child is added to this item. The value
argument is the new child item (i.e., a <a href="qgraphicsitem.html">QGraphicsItem</a> pointer). Do not pass this
item to any item's <a href="qgraphicsitem.html#setParentItem">setParentItem</a>() function as
this notification is delivered. The return value is unused; you
cannot adjust anything in this notification. Note that the new
child might not be fully constructed when this notification is
sent; calling pure virtual functions on the child can lead to a
crash.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemChildRemovedChange</tt></td>
<td class="topAlign"><tt>7</tt></td>
<td class="topAlign">A child is removed from this item. The value
argument is the child item that is about to be removed (i.e., a
<a href="qgraphicsitem.html">QGraphicsItem</a> pointer). The return
value is unused; you cannot adjust anything in this
notification.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemSceneChange</tt></td>
<td class="topAlign"><tt>11</tt></td>
<td class="topAlign">The item is moved to a new scene. This
notification is also sent when the item is added to its initial
scene, and when it is removed. The item's <a href="qgraphicsitem.html#scene">scene</a>() is the old scene (or 0 if
the item has not been added to a scene yet). The value argument is
the new scene (i.e., a <a href="qgraphicsscene.html">QGraphicsScene</a> pointer), or a null
pointer if the item is removed from a scene. Do not override this
change by passing this item to <a href="qgraphicsscene.html#addItem">QGraphicsScene.addItem</a>() as this
notification is delivered; instead, you can return the new scene
from <a href="qgraphicsitem.html#itemChange">itemChange</a>(). Use
this feature with caution; objecting to a scene change can quickly
lead to unwanted recursion.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemSceneHasChanged</tt></td>
<td class="topAlign"><tt>16</tt></td>
<td class="topAlign">The item's scene has changed. The item's
<a href="qgraphicsitem.html#scene">scene</a>() is the new scene.
This notification is also sent when the item is added to its
initial scene, and when it is removed.The value argument is the new
scene (i.e., a pointer to a <a href="qgraphicsscene.html">QGraphicsScene</a>). Do not call setScene()
in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered. The return value is ignored.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemCursorChange</tt></td>
<td class="topAlign"><tt>17</tt></td>
<td class="topAlign">The item's cursor changes. The value argument
is the new cursor (i.e., a <a href="qcursor.html">QCursor</a>). Do
not call <a href="qgraphicsitem.html#setCursor">setCursor</a>() in
<a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered. Instead, you can return a new cursor
from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemCursorHasChanged</tt></td>
<td class="topAlign"><tt>18</tt></td>
<td class="topAlign">The item's cursor has changed. The value
argument is the new cursor (i.e., a <a href="qcursor.html">QCursor</a>). Do not call <a href="qgraphicsitem.html#setCursor">setCursor</a>() as this notification
is delivered. The return value is ignored.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemToolTipChange</tt></td>
<td class="topAlign"><tt>19</tt></td>
<td class="topAlign">The item's tooltip changes. The value argument
is the new tooltip (i.e., a <a href="qtooltip.html">QToolTip</a>).
Do not call <a href="qgraphicsitem.html#setToolTip">setToolTip</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered. Instead, you can return a new tooltip
from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemToolTipHasChanged</tt></td>
<td class="topAlign"><tt>20</tt></td>
<td class="topAlign">The item's tooltip has changed. The value
argument is the new tooltip (i.e., a <a href="qtooltip.html">QToolTip</a>). Do not call <a href="qgraphicsitem.html#setToolTip">setToolTip</a>() as this
notification is delivered. The return value is ignored.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemFlagsChange</tt></td>
<td class="topAlign"><tt>21</tt></td>
<td class="topAlign">The item's flags change. The value argument is
the new flags (i.e., a quint32). Do not call <a href="qgraphicsitem.html#setFlags">setFlags</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered. Instead, you can return the new flags
from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemFlagsHaveChanged</tt></td>
<td class="topAlign"><tt>22</tt></td>
<td class="topAlign">The item's flags have changed. The value
argument is the new flags (i.e., a quint32). Do not call <a href="qgraphicsitem.html#setFlags">setFlags</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered. The return value is ignored.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemZValueChange</tt></td>
<td class="topAlign"><tt>23</tt></td>
<td class="topAlign">The item's Z-value changes. The value argument
is the new Z-value (i.e., a double). Do not call <a href="qgraphicsitem.html#setZValue">setZValue</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered. Instead, you can return a new Z-value
from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemZValueHasChanged</tt></td>
<td class="topAlign"><tt>24</tt></td>
<td class="topAlign">The item's Z-value has changed. The value
argument is the new Z-value (i.e., a double). Do not call <a href="qgraphicsitem.html#setZValue">setZValue</a>() as this notification
is delivered. The return value is ignored.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemOpacityChange</tt></td>
<td class="topAlign"><tt>25</tt></td>
<td class="topAlign">The item's opacity changes. The value argument
is the new opacity (i.e., a double). Do not call <a href="qgraphicsitem.html#setOpacity">setOpacity</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered. Instead, you can return a new opacity
from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemOpacityHasChanged</tt></td>
<td class="topAlign"><tt>26</tt></td>
<td class="topAlign">The item's opacity has changed. The value
argument is the new opacity (i.e., a double). Do not call <a href="qgraphicsitem.html#setOpacity">setOpacity</a>() as this
notification is delivered. The return value is ignored.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemScenePositionHasChanged</tt></td>
<td class="topAlign"><tt>27</tt></td>
<td class="topAlign">The item's scene position has changed. This
notification is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsScenePositionChanges</a>
flag is enabled, and after the item's scene position has changed
(i.e., the position or transformation of the item itself or the
position or transformation of any ancestor has changed). The value
argument is the new scene position (the same as <a href="qgraphicsitem.html#scenePos">scenePos</a>()), and <a href="qgraphicsitem.html">QGraphicsItem</a> ignores the return value for
this notification (i.e., a read-only notification).</td>
</tr>
</table>
<h3 class="fn"><a name="GraphicsItemFlag-enum" />QGraphicsItem.GraphicsItemFlag</h3><p>This enum describes different flags that you can set on an item
to toggle different features in the item's behavior.</p>
<p>All flags are disabled by default.</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>QGraphicsItem.ItemIsMovable</tt></td>
<td class="topAlign"><tt>0x1</tt></td>
<td class="topAlign">The item supports interactive movement using
the mouse. By clicking on the item and then dragging, the item will
move together with the mouse cursor. If the item has children, all
children are also moved. If the item is part of a selection, all
selected items are also moved. This feature is provided as a
convenience through the base implementation of <a href="qgraphicsitem.html">QGraphicsItem</a>'s mouse event handlers.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemIsSelectable</tt></td>
<td class="topAlign"><tt>0x2</tt></td>
<td class="topAlign">The item supports selection. Enabling this
feature will enable <a href="qgraphicsitem.html#setSelected">setSelected</a>() to toggle
selection for the item. It will also let the item be selected
automatically as a result of calling <a href="qgraphicsscene.html#setSelectionArea">QGraphicsScene.setSelectionArea</a>(),
by clicking on an item, or by using rubber band selection in
<a href="qgraphicsview.html">QGraphicsView</a>.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemIsFocusable</tt></td>
<td class="topAlign"><tt>0x4</tt></td>
<td class="topAlign">The item supports keyboard input focus (i.e.,
it is an input item). Enabling this flag will allow the item to
accept focus, which again allows the delivery of key events to
<a href="qgraphicsitem.html#keyPressEvent">QGraphicsItem.keyPressEvent</a>()
and <a href="qgraphicsitem.html#keyReleaseEvent">QGraphicsItem.keyReleaseEvent</a>().</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemClipsToShape</tt></td>
<td class="topAlign"><tt>0x8</tt></td>
<td class="topAlign">The item clips to its own shape. The item
cannot draw or receive mouse, tablet, drag and drop or hover events
outside its shape. It is disabled by default. This behavior is
enforced by <a class="obsolete" href="qgraphicsview-obsolete.html#drawItems">QGraphicsView.drawItems</a>() or <a class="obsolete" href="qgraphicsscene-obsolete.html#drawItems">QGraphicsScene.drawItems</a>(). This flag was
introduced in Qt 4.3.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemClipsChildrenToShape</tt></td>
<td class="topAlign"><tt>0x10</tt></td>
<td class="topAlign">The item clips the painting of all its
descendants to its own shape. Items that are either direct or
indirect children of this item cannot draw outside this item's
shape. By default, this flag is disabled; children can draw
anywhere. This behavior is enforced by <a class="obsolete" href="qgraphicsview-obsolete.html#drawItems">QGraphicsView.drawItems</a>() or <a class="obsolete" href="qgraphicsscene-obsolete.html#drawItems">QGraphicsScene.drawItems</a>(). This flag was
introduced in Qt 4.3.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemIgnoresTransformations</tt></td>
<td class="topAlign"><tt>0x20</tt></td>
<td class="topAlign">The item ignores inherited transformations
(i.e., its position is still anchored to its parent, but the parent
or view rotation, zoom or shear transformations are ignored). This
flag is useful for keeping text label items horizontal and
unscaled, so they will still be readable if the view is
transformed. When set, the item's view geometry and scene geometry
will be maintained separately. You must call <a href="qgraphicsitem.html#deviceTransform">deviceTransform</a>() to map
coordinates and detect collisions in the view. By default, this
flag is disabled. This flag was introduced in Qt 4.3. <b>Note:</b>
With this flag set you can still scale the item itself, and that
scale transformation will influence the item's children.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemIgnoresParentOpacity</tt></td>
<td class="topAlign"><tt>0x40</tt></td>
<td class="topAlign">The item ignores its parent's opacity. The
item's effective opacity is the same as its own; it does not
combine with the parent's opacity. This flags allows your item to
keep its absolute opacity even if the parent is semitransparent.
This flag was introduced in Qt 4.5.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemDoesntPropagateOpacityToChildren</tt></td>
<td class="topAlign"><tt>0x80</tt></td>
<td class="topAlign">The item doesn't propagate its opacity to its
children. This flag allows you to create a semitransparent item
that does not affect the opacity of its children. This flag was
introduced in Qt 4.5.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemStacksBehindParent</tt></td>
<td class="topAlign"><tt>0x100</tt></td>
<td class="topAlign">The item is stacked behind its parent. By
default, child items are stacked on top of the parent item. But
setting this flag, the child will be stacked behind it. This flag
is useful for drop shadow effects and for decoration objects that
follow the parent item's geometry without drawing on top of it.
This flag was introduced in Qt 4.5.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemUsesExtendedStyleOption</tt></td>
<td class="topAlign"><tt>0x200</tt></td>
<td class="topAlign">The item makes use of either <a href="qstyleoptiongraphicsitem.html#exposedRect-var">exposedRect</a> or
<a class="obsolete" href="qstyleoptiongraphicsitem-obsolete.html#matrix-var">matrix<sup>(obsolete)</sup></a> in <a href="qstyleoptiongraphicsitem.html">QStyleOptionGraphicsItem</a>. By
default, the <a href="qstyleoptiongraphicsitem.html#exposedRect-var">exposedRect</a> is
initialized to the item's <a href="qgraphicsitem.html#boundingRect">boundingRect</a>() and the
<a class="obsolete" href="qstyleoptiongraphicsitem-obsolete.html#matrix-var">matrix<sup>(obsolete)</sup></a> is untransformed. You
can enable this flag for the style options to be set up with more
fine-grained values. Note that <a class="obsolete" href="qstyleoptiongraphicsitem-obsolete.html#levelOfDetail-var">QStyleOptionGraphicsItem.levelOfDetail<sup>(obsolete)</sup></a>
is unaffected by this flag and always initialized to 1. Use
<a href="qstyleoptiongraphicsitem.html#levelOfDetailFromTransform">QStyleOptionGraphicsItem.levelOfDetailFromTransform</a>()
if you need a higher value. This flag was introduced in Qt
4.6.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemHasNoContents</tt></td>
<td class="topAlign"><tt>0x400</tt></td>
<td class="topAlign">The item does not paint anything (i.e.,
calling <a href="qgraphicsitem.html#paint">paint</a>() on the item
has no effect). You should set this flag on items that do not need
to be painted to ensure that Graphics View avoids unnecessary
painting preparations. This flag was introduced in Qt 4.6.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemSendsGeometryChanges</tt></td>
<td class="topAlign"><tt>0x800</tt></td>
<td class="topAlign">The item enables <a href="qgraphicsitem.html#itemChange">itemChange</a>() notifications for
<a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemPositionChange</a>,
<a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemPositionHasChanged</a>,
<a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemMatrixChange</a>,
<a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemTransformChange</a>,
<a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemTransformHasChanged</a>,
<a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemRotationChange</a>,
<a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemRotationHasChanged</a>,
<a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemScaleChange</a>,
<a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemScaleHasChanged</a>,
<a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemTransformOriginPointChange</a>,
and <a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemTransformOriginPointHasChanged</a>.
For performance reasons, these notifications are disabled by
default. You must enable this flag to receive notifications for
position and transform changes. This flag was introduced in Qt
4.6.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemAcceptsInputMethod</tt></td>
<td class="topAlign"><tt>0x1000</tt></td>
<td class="topAlign">The item supports input methods typically used
for Asian languages. This flag was introduced in Qt 4.6.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemNegativeZStacksBehindParent</tt></td>
<td class="topAlign"><tt>0x2000</tt></td>
<td class="topAlign">The item automatically stacks behind it's
parent if it's z-value is negative. This flag enables <a href="qgraphicsitem.html#setZValue">setZValue</a>() to toggle
ItemStacksBehindParent. This flag was introduced in Qt 4.6.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemIsPanel</tt></td>
<td class="topAlign"><tt>0x4000</tt></td>
<td class="topAlign">The item is a panel. A panel provides
activation and contained focus handling. Only one panel can be
active at a time (see <a href="qgraphicsitem.html#isActive">QGraphicsItem.isActive</a>()). When
no panel is active, <a href="qgraphicsscene.html">QGraphicsScene</a> activates all non-panel
items. Window items (i.e., <a href="qgraphicsitem.html#isWindow">QGraphicsItem.isWindow</a>() returns
true) are panels. This flag was introduced in Qt 4.6.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemSendsScenePositionChanges</tt></td>
<td class="topAlign"><tt>0x10000</tt></td>
<td class="topAlign">The item enables <a href="qgraphicsitem.html#itemChange">itemChange</a>() notifications for
<a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemScenePositionHasChanged</a>.
For performance reasons, these notifications are disabled by
default. You must enable this flag to receive notifications for
scene position changes. This flag was introduced in Qt 4.6.</td>
</tr>
</table>
<p>The GraphicsItemFlags type is a typedef for <a href="qflags.html">QFlags</a><GraphicsItemFlag>. It stores an OR
combination of GraphicsItemFlag values.</p>
<h3 class="fn"><a name="PanelModality-enum" />QGraphicsItem.PanelModality</h3><p>This enum specifies the behavior of a modal panel. A modal panel
is one that blocks input to other panels. Note that items that are
children of a modal panel are not blocked.</p>
<p>The values are:</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>QGraphicsItem.NonModal</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The panel is not modal and does not block
input to other panels. This is the default value for panels.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.PanelModal</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The panel is modal to a single item hierarchy
and blocks input to its parent pane, all grandparent panels, and
all siblings of its parent and grandparent panels.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.SceneModal</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">The window is modal to the entire scene and
blocks input to all panels.</td>
</tr>
</table>
<p>This enum was introduced or modified in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setPanelModality">QGraphicsItem.setPanelModality</a>(),
<a href="qgraphicsitem.html#panelModality">QGraphicsItem.panelModality</a>(),
and <a href="qgraphicsitem.html#GraphicsItemFlag-enum">QGraphicsItem.ItemIsPanel</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QGraphicsItem" />QGraphicsItem.__init__ (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>parent</i> = None, <a href="qgraphicsscene.html">QGraphicsScene</a> <i>scene</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>The <i>scene</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a <a href="qgraphicsitem.html">QGraphicsItem</a> with
the given <i>parent</i> item. It does not modify the parent object
returned by <a href="qobject.html#parent">QObject.parent</a>().</p>
<p>If <i>parent</i> is 0, you can add the item to a scene by
calling <a href="qgraphicsscene.html#addItem">QGraphicsScene.addItem</a>(). The
item will then become a top-level item.</p>
<p><b>See also</b> <a href="qgraphicsscene.html#addItem">QGraphicsScene.addItem</a>() and
<a href="qgraphicsitem.html#setParentItem">setParentItem</a>().</p>
<h3 class="fn"><a name="acceptDrops" />bool QGraphicsItem.acceptDrops (<i>self</i>)</h3><p>Returns true if this item can accept drag and drop events;
otherwise, returns false. By default, items do not accept drag and
drop events; items are transparent to drag and drop.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setAcceptDrops">setAcceptDrops</a>().</p>
<h3 class="fn"><a name="acceptedMouseButtons" /><a href="qt-mousebuttons.html">Qt.MouseButtons</a> QGraphicsItem.acceptedMouseButtons (<i>self</i>)</h3><p>Returns the mouse buttons that this item accepts mouse events
for. By default, all mouse buttons are accepted.</p>
<p>If an item accepts a mouse button, it will become the mouse
grabber item when a mouse press event is delivered for that mouse
button. However, if the item does not accept the button, <a href="qgraphicsscene.html">QGraphicsScene</a> will forward the mouse
events to the first item beneath it that does.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setAcceptedMouseButtons">setAcceptedMouseButtons</a>()
and <a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>().</p>
<h3 class="fn"><a name="acceptHoverEvents" />bool QGraphicsItem.acceptHoverEvents (<i>self</i>)</h3><p>Returns true if an item accepts hover events (<a href="qgraphicsscenehoverevent.html">QGraphicsSceneHoverEvent</a>);
otherwise, returns false. By default, items do not accept hover
events.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setAcceptHoverEvents">setAcceptHoverEvents</a>()
and <a href="qgraphicsitem.html#setAcceptedMouseButtons">setAcceptedMouseButtons</a>().</p>
<h3 class="fn"><a name="acceptsHoverEvents" />bool QGraphicsItem.acceptsHoverEvents (<i>self</i>)</h3><h3 class="fn"><a name="acceptTouchEvents" />bool QGraphicsItem.acceptTouchEvents (<i>self</i>)</h3><p>Returns true if an item accepts <a href="qtouchevent.html">touch
events</a>; otherwise, returns false. By default, items do not
accept touch events.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setAcceptTouchEvents">setAcceptTouchEvents</a>().</p>
<h3 class="fn"><a name="advance" />QGraphicsItem.advance (<i>self</i>, int <i>phase</i>)</h3><p>This virtual function is called twice for all items by the
<a href="qgraphicsscene.html#advance">QGraphicsScene.advance</a>()
slot. In the first phase, all items are called with <i>phase</i> ==
0, indicating that items on the scene are about to advance, and
then all items are called with <i>phase</i> == 1. Reimplement this
function to update your item if you need simple scene-controlled
animation.</p>
<p>The default implementation does nothing.</p>
<p>For individual item animation, an alternative to this function
is to either use <a href="qgraphicsitemanimation.html">QGraphicsItemAnimation</a>, or to
multiple-inherit from <a href="qobject.html">QObject</a> and
<a href="qgraphicsitem.html">QGraphicsItem</a>, and animate your
item using <a href="qobject.html#startTimer">QObject.startTimer</a>() and <a href="qobject.html#timerEvent">QObject.timerEvent</a>().</p>
<p><b>See also</b> <a href="qgraphicsitemanimation.html">QGraphicsItemAnimation</a> and
<a href="qtimeline.html">QTimeLine</a>.</p>
<h3 class="fn"><a name="boundingRect" /><a href="qrectf.html">QRectF</a> QGraphicsItem.boundingRect (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>This pure virtual function defines the outer bounds of the item
as a rectangle; all painting must be restricted to inside an item's
bounding rect. <a href="qgraphicsview.html">QGraphicsView</a> uses
this to determine whether the item requires redrawing.</p>
<p>Although the item's shape can be arbitrary, the bounding rect is
always rectangular, and it is unaffected by the items'
transformation.</p>
<p>If you want to change the item's bounding rectangle, you must
first call <a href="qgraphicsitem.html#prepareGeometryChange">prepareGeometryChange</a>().
This notifies the scene of the imminent change, so that its can
update its item geometry index; otherwise, the scene will be
unaware of the item's new geometry, and the results are undefined
(typically, rendering artifacts are left around in the view).</p>
<p>Reimplement this function to let <a href="qgraphicsview.html">QGraphicsView</a> determine what parts of the
widget, if any, need to be redrawn.</p>
<p>Note: For shapes that paint an outline / stroke, it is important
to include half the pen width in the bounding rect. It is not
necessary to compensate for antialiasing, though.</p>
<p>Example:</p>
<pre class="cpp">
<span class="type"><a href="qrectf.html">QRectF</a></span> CircleItem<span class="operator">.</span>boundingRect() <span class="keyword">const</span>
{
<span class="type"><a href="qtcore.html#qreal-typedef">qreal</a></span> penWidth <span class="operator">=</span> <span class="number">1</span>;
<span class="keyword">return</span> <span class="type"><a href="qrectf.html">QRectF</a></span>(<span class="operator">-</span>radius <span class="operator">-</span> penWidth <span class="operator">/</span> <span class="number">2</span><span class="operator">,</span> <span class="operator">-</span>radius <span class="operator">-</span> penWidth <span class="operator">/</span> <span class="number">2</span><span class="operator">,</span>
diameter <span class="operator">+</span> penWidth<span class="operator">,</span> diameter <span class="operator">+</span> penWidth);
}
</pre>
<p><b>See also</b> <a href="qgraphicsitem.html#boundingRegion">boundingRegion</a>(), <a href="qgraphicsitem.html#shape">shape</a>(), <a href="qgraphicsitem.html#contains">contains</a>(), <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>, and <a href="qgraphicsitem.html#prepareGeometryChange">prepareGeometryChange</a>().</p>
<h3 class="fn"><a name="boundingRegion" /><a href="qregion.html">QRegion</a> QGraphicsItem.boundingRegion (<i>self</i>, <a href="qtransform.html">QTransform</a> <i>itemToDeviceTransform</i>)</h3><p>Returns the bounding region for this item. The coordinate space
of the returned region depends on <i>itemToDeviceTransform</i>. If
you pass an identity <a href="qtransform.html">QTransform</a> as a
parameter, this function will return a local coordinate region.</p>
<p>The bounding region describes a coarse outline of the item's
visual contents. Although it's expensive to calculate, it's also
more precise than <a href="qgraphicsitem.html#boundingRect">boundingRect</a>(), and it can
help to avoid unnecessary repainting when an item is updated. This
is particularly efficient for thin items (e.g., lines or simple
polygons). You can tune the granularity for the bounding region by
calling <a href="qgraphicsitem.html#setBoundingRegionGranularity">setBoundingRegionGranularity</a>().
The default granularity is 0; in which the item's bounding region
is the same as its bounding rect.</p>
<p><i>itemToDeviceTransform</i> is the transformation from item
coordinates to device coordinates. If you want this function to
return a <a href="qregion.html">QRegion</a> in scene coordinates,
you can pass <a href="qgraphicsitem.html#sceneTransform">sceneTransform</a>() as an
argument.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#boundingRegionGranularity">boundingRegionGranularity</a>().</p>
<h3 class="fn"><a name="boundingRegionGranularity" />float QGraphicsItem.boundingRegionGranularity (<i>self</i>)</h3><p>Returns the item's bounding region granularity; a value between
and including 0 and 1. The default value is 0 (i.e., the lowest
granularity, where the bounding region corresponds to the item's
bounding rectangle).</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setBoundingRegionGranularity">setBoundingRegionGranularity</a>().</p>
<h3 class="fn"><a name="cacheMode" /><a href="qgraphicsitem.html#CacheMode-enum">CacheMode</a> QGraphicsItem.cacheMode (<i>self</i>)</h3><p>Returns the cache mode for this item. The default mode is
<a href="qgraphicsitem.html#CacheMode-enum">NoCache</a> (i.e.,
cache is disabled and all painting is immediate).</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setCacheMode">setCacheMode</a>().</p>
<h3 class="fn"><a name="childItems" />unknown-type QGraphicsItem.childItems (<i>self</i>)</h3><p>Returns a list of this item's children.</p>
<p>The items are sorted by stacking order. This takes into account
both the items' insertion order and their Z-values.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setParentItem">setParentItem</a>(), <a href="qgraphicsitem.html#zValue">zValue</a>(), and <a href="qgraphicsitem.html#sorting">Sorting</a>.</p>
<h3 class="fn"><a name="childrenBoundingRect" /><a href="qrectf.html">QRectF</a> QGraphicsItem.childrenBoundingRect (<i>self</i>)</h3><p>Returns the bounding rect of this item's descendants (i.e., its
children, their children, etc.) in local coordinates. The rectangle
will contain all descendants after they have been mapped to local
coordinates. If the item has no children, this function returns an
empty <a href="qrectf.html">QRectF</a>.</p>
<p>This does not include this item's own bounding rect; it only
returns its descendants' accumulated bounding rect. If you need to
include this item's bounding rect, you can add <a href="qgraphicsitem.html#boundingRect">boundingRect</a>() to
childrenBoundingRect() using QRectF.operator|().</p>
<p>This function is linear in complexity; it determines the size of
the returned bounding rect by iterating through all
descendants.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#boundingRect">boundingRect</a>() and <a href="qgraphicsitem.html#sceneBoundingRect">sceneBoundingRect</a>().</p>
<h3 class="fn"><a name="clearFocus" />QGraphicsItem.clearFocus (<i>self</i>)</h3><p>Takes keyboard input focus from the item.</p>
<p>If it has focus, a <a href="qgraphicsitem.html#focusOutEvent">focus out event</a> is sent to
this item to tell it that it is about to lose the focus.</p>
<p>Only items that set the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsFocusable</a>
flag, or widgets that set an appropriate focus policy, can accept
keyboard focus.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setFocus">setFocus</a>(), <a href="qgraphicsitem.html#hasFocus">hasFocus</a>(), and <a href="qgraphicswidget.html#focusPolicy-prop">QGraphicsWidget.focusPolicy</a>.</p>
<h3 class="fn"><a name="clipPath" /><a href="qpainterpath.html">QPainterPath</a> QGraphicsItem.clipPath (<i>self</i>)</h3><p>Returns this item's clip path, or an empty <a href="qpainterpath.html">QPainterPath</a> if this item is not clipped.
The clip path constrains the item's appearance and interaction
(i.e., restricts the area the item can draw, and it also restricts
the area that the item receives events).</p>
<p>You can enable clipping by setting the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemClipsToShape</a> or
<a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemClipsChildrenToShape</a>
flags. The item's clip path is calculated by intersecting all
clipping ancestors' shapes. If the item sets <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemClipsToShape</a>,
the final clip is intersected with the item's own shape.</p>
<p><b>Note:</b> Clipping introduces a performance penalty for all
items involved; you should generally avoid using clipping if you
can (e.g., if your items always draw inside <a href="qgraphicsitem.html#boundingRect">boundingRect</a>() or <a href="qgraphicsitem.html#shape">shape</a>() boundaries, clipping is not
necessary).</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#isClipped">isClipped</a>(), <a href="qgraphicsitem.html#shape">shape</a>(), and <a href="qgraphicsitem.html#setFlags">setFlags</a>().</p>
<h3 class="fn"><a name="collidesWithItem" />bool QGraphicsItem.collidesWithItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>other</i>, <a href="qt.html#ItemSelectionMode-enum">Qt.ItemSelectionMode</a> <i>mode</i> = Qt.IntersectsItemShape)</h3><p>Returns true if this item collides with <i>other</i>; otherwise
returns false.</p>
<p>The <i>mode</i> is applied to <i>other</i>, and the resulting
shape or bounding rectangle is then compared to this item's shape.
The default value for <i>mode</i> is <a href="qt.html#ItemSelectionMode-enum">Qt.IntersectsItemShape</a>;
<i>other</i> collides with this item if it either intersects,
contains, or is contained by this item's shape (see <a href="qt.html#ItemSelectionMode-enum">Qt.ItemSelectionMode</a> for
details).</p>
<p>The default implementation is based on shape intersection, and
it calls <a href="qgraphicsitem.html#shape">shape</a>() on both
items. Because the complexity of arbitrary shape-shape intersection
grows with an order of magnitude when the shapes are complex, this
operation can be noticably time consuming. You have the option of
reimplementing this function in a subclass of <a href="qgraphicsitem.html">QGraphicsItem</a> to provide a custom
algorithm. This allows you to make use of natural constraints in
the shapes of your own items, in order to improve the performance
of the collision detection. For instance, two untransformed
perfectly circular items' collision can be determined very
efficiently by comparing their positions and radii.</p>
<p>Keep in mind that when reimplementing this function and calling
<a href="qgraphicsitem.html#shape">shape</a>() or <a href="qgraphicsitem.html#boundingRect">boundingRect</a>() on
<i>other</i>, the returned coordinates must be mapped to this
item's coordinate system before any intersection can take
place.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#contains">contains</a>() and <a href="qgraphicsitem.html#shape">shape</a>().</p>
<h3 class="fn"><a name="collidesWithPath" />bool QGraphicsItem.collidesWithPath (<i>self</i>, <a href="qpainterpath.html">QPainterPath</a> <i>path</i>, <a href="qt.html#ItemSelectionMode-enum">Qt.ItemSelectionMode</a> <i>mode</i> = Qt.IntersectsItemShape)</h3><p>Returns true if this item collides with <i>path</i>.</p>
<p>The collision is determined by <i>mode</i>. The default value
for <i>mode</i> is <a href="qt.html#ItemSelectionMode-enum">Qt.IntersectsItemShape</a>;
<i>path</i> collides with this item if it either intersects,
contains, or is contained by this item's shape.</p>
<p>Note that this function checks whether the item's shape or
bounding rectangle (depending on <i>mode</i>) is contained within
<i>path</i>, and not whether <i>path</i> is contained within the
items shape or bounding rectangle.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#collidesWithItem">collidesWithItem</a>(),
<a href="qgraphicsitem.html#contains">contains</a>(), and <a href="qgraphicsitem.html#shape">shape</a>().</p>
<h3 class="fn"><a name="collidingItems" />unknown-type QGraphicsItem.collidingItems (<i>self</i>, <a href="qt.html#ItemSelectionMode-enum">Qt.ItemSelectionMode</a> <i>mode</i> = Qt.IntersectsItemShape)</h3><p>Returns a list of all items that collide with this item.</p>
<p>The way collisions are detected is determined by applying
<i>mode</i> to items that are compared to this item, i.e., each
item's shape or bounding rectangle is checked against this item's
shape. The default value for <i>mode</i> is <a href="qt.html#ItemSelectionMode-enum">Qt.IntersectsItemShape</a>.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#collidesWithItem">collidesWithItem</a>().</p>
<h3 class="fn"><a name="commonAncestorItem" /><a href="qgraphicsitem.html">QGraphicsItem</a> QGraphicsItem.commonAncestorItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>other</i>)</h3><p>Returns the closest common ancestor item of this item and
<i>other</i>, or 0 if either <i>other</i> is 0, or there is no
common ancestor.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#isAncestorOf">isAncestorOf</a>().</p>
<h3 class="fn"><a name="contains" />bool QGraphicsItem.contains (<i>self</i>, <a href="qpointf.html">QPointF</a> <i>point</i>)</h3><p>Returns true if this item contains <i>point</i>, which is in
local coordinates; otherwise, false is returned. It is most often
called from <a href="qgraphicsview.html">QGraphicsView</a> to
determine what item is under the cursor, and for that reason, the
implementation of this function should be as light-weight as
possible.</p>
<p>By default, this function calls <a href="qgraphicsitem.html#shape">shape</a>(), but you can reimplement it
in a subclass to provide a (perhaps more efficient)
implementation.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#shape">shape</a>(),
<a href="qgraphicsitem.html#boundingRect">boundingRect</a>(), and
<a href="qgraphicsitem.html#collidesWithPath">collidesWithPath</a>().</p>
<h3 class="fn"><a name="contextMenuEvent" />QGraphicsItem.contextMenuEvent (<i>self</i>, <a href="qgraphicsscenecontextmenuevent.html">QGraphicsSceneContextMenuEvent</a> <i>event</i>)</h3><p>This event handler can be reimplemented in a subclass to process
context menu events. The <i>event</i> parameter contains details
about the event to be handled.</p>
<p>If you ignore the event, (i.e., by calling <a href="qevent.html#ignore">QEvent.ignore</a>(),) <i>event</i> will
propagate to any item beneath this item. If no items accept the
event, it will be ignored by the scene, and propagate to the
view.</p>
<p>It's common to open a <a href="qmenu.html">QMenu</a> in response
to receiving a context menu event. Example:</p>
<pre class="cpp">
<span class="type">void</span> CustomItem<span class="operator">.</span>contextMenuEvent(<span class="type"><a href="qgraphicsscenecontextmenuevent.html">QGraphicsSceneContextMenuEvent</a></span> <span class="operator">*</span>event)
{
<span class="type"><a href="qmenu.html">QMenu</a></span> menu;
<span class="type"><a href="qaction.html">QAction</a></span> <span class="operator">*</span>removeAction <span class="operator">=</span> menu<span class="operator">.</span>addAction(<span class="string">"Remove"</span>);
<span class="type"><a href="qaction.html">QAction</a></span> <span class="operator">*</span>markAction <span class="operator">=</span> menu<span class="operator">.</span>addAction(<span class="string">"Mark"</span>);
<span class="type"><a href="qaction.html">QAction</a></span> <span class="operator">*</span>selectedAction <span class="operator">=</span> menu<span class="operator">.</span>exec(event<span class="operator">-</span><span class="operator">></span>screenPos());
<span class="comment">// ...</span>
}
</pre>
<p>The default implementation ignores the event.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().</p>
<h3 class="fn"><a name="cursor" /><a href="qcursor.html">QCursor</a> QGraphicsItem.cursor (<i>self</i>)</h3><p>Returns the current cursor shape for the item. The mouse cursor
will assume this shape when it's over this item. See the <a href="qt.html#CursorShape-enum">list of predefined cursor objects</a>
for a range of useful shapes.</p>
<p>An editor item might want to use an I-beam cursor:</p>
<pre class="cpp">
item<span class="operator">-</span><span class="operator">></span><a href="qgraphicsitem.html#setCursor">setCursor</a>(<span class="type"><a href="qt.html">Qt</a></span><span class="operator">.</span>IBeamCursor);
</pre>
<p>If no cursor has been set, the cursor of the item beneath is
used.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setCursor">setCursor</a>(), <a href="qgraphicsitem.html#hasCursor">hasCursor</a>(), <a href="qgraphicsitem.html#unsetCursor">unsetCursor</a>(), <a href="qwidget.html#cursor-prop">QWidget.cursor</a>, and <a href="qapplication.html#overrideCursor">QApplication.overrideCursor</a>().</p>
<h3 class="fn"><a name="data" />QVariant QGraphicsItem.data (<i>self</i>, int <i>key</i>)</h3><p>Returns this item's custom data for the key <i>key</i> as a
<a href="qvariant.html">QVariant</a>.</p>
<p>Custom item data is useful for storing arbitrary properties in
any item. Example:</p>
<pre class="cpp">
<span class="keyword">static</span> <span class="keyword">const</span> <span class="type">int</span> ObjectName <span class="operator">=</span> <span class="number">0</span>;
<span class="type"><a href="qgraphicsitem.html">QGraphicsItem</a></span> <span class="operator">*</span>item <span class="operator">=</span> scene<span class="operator">.</span>itemAt(<span class="number">100</span><span class="operator">,</span> <span class="number">50</span>);
<span class="keyword">if</span> (item<span class="operator">-</span><span class="operator">></span>data(ObjectName)<span class="operator">.</span>toString()<span class="operator">.</span>isEmpty()) {
<span class="keyword">if</span> (qgraphicsitem_cast<span class="operator"><</span>ButtonItem <span class="operator">*</span><span class="operator">></span>(item))
item<span class="operator">-</span><span class="operator">></span>setData(ObjectName<span class="operator">,</span> <span class="string">"Button"</span>);
}
</pre>
<p>Qt does not use this feature for storing data; it is provided
solely for the convenience of the user.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setData">setData</a>().</p>
<h3 class="fn"><a name="deviceTransform" /><a href="qtransform.html">QTransform</a> QGraphicsItem.deviceTransform (<i>self</i>, <a href="qtransform.html">QTransform</a> <i>viewportTransform</i>)</h3><p>Returns this item's device transformation matrix, using
<i>viewportTransform</i> to map from scene to device coordinates.
This matrix can be used to map coordinates and geometrical shapes
from this item's local coordinate system to the viewport's (or any
device's) coordinate system. To map coordinates from the viewport,
you must first invert the returned matrix.</p>
<p>Example:</p>
<pre class="cpp">
<span class="type"><a href="qgraphicsrectitem.html">QGraphicsRectItem</a></span> rect;
rect<span class="operator">.</span><a href="qgraphicsitem.html#setPos">setPos</a>(<span class="number">100</span><span class="operator">,</span> <span class="number">100</span>);
rect<span class="operator">.</span>deviceTransform(view<span class="operator">-</span><span class="operator">></span>viewportTransform())<span class="operator">.</span>map(<span class="type"><a href="qpointf.html">QPointF</a></span>(<span class="number">0</span><span class="operator">,</span> <span class="number">0</span>));
<span class="comment">// returns the item's (0, 0) point in view's viewport coordinates</span>
rect<span class="operator">.</span>deviceTransform(view<span class="operator">-</span><span class="operator">></span>viewportTransform())<span class="operator">.</span>inverted()<span class="operator">.</span>map(<span class="type"><a href="qpointf.html">QPointF</a></span>(<span class="number">100</span><span class="operator">,</span> <span class="number">100</span>));
<span class="comment">// returns view's viewport's (100, 100) coordinate in item coordinates</span>
</pre>
<p>This function is the same as combining this item's scene
transform with the view's viewport transform, but it also
understands the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIgnoresTransformations</a>
flag. The device transform can be used to do accurate coordinate
mapping (and collision detection) for untransformable items.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#transform">transform</a>(), <a href="qgraphicsitem.html#setTransform">setTransform</a>(), <a href="qgraphicsitem.html#scenePos">scenePos</a>(), <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>, and <a href="qgraphicsitem.html#itemTransform">itemTransform</a>().</p>
<h3 class="fn"><a name="dragEnterEvent" />QGraphicsItem.dragEnterEvent (<i>self</i>, <a href="qgraphicsscenedragdropevent.html">QGraphicsSceneDragDropEvent</a> <i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive drag enter events for this item. Drag enter events are
generated as the cursor enters the item's area.</p>
<p>By accepting the event, (i.e., by calling <a href="qevent.html#accept">QEvent.accept</a>(),) the item will accept
drop events, in addition to receiving drag move and drag leave.
Otherwise, the event will be ignored and propagate to the item
beneath. If the event is accepted, the item will receive a drag
move event before control goes back to the event loop.</p>
<p>A common implementation of dragEnterEvent accepts or ignores
<i>event</i> depending on the associated mime data in <i>event</i>.
Example:</p>
<pre class="cpp">
CustomItem<span class="operator">.</span>CustomItem()
{
setAcceptDrops(<span class="keyword">true</span>);
<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
}
<span class="type">void</span> CustomItem<span class="operator">.</span>dragEnterEvent(<span class="type"><a href="qgraphicsscenedragdropevent.html">QGraphicsSceneDragDropEvent</a></span> <span class="operator">*</span>event)
{
event<span class="operator">-</span><span class="operator">></span>setAccepted(event<span class="operator">-</span><span class="operator">></span>mimeData()<span class="operator">-</span><span class="operator">></span>hasFormat(<span class="string">"text/plain"</span>));
}
</pre>
<p>Items do not receive drag and drop events by default; to enable
this feature, call <tt>setAcceptDrops(true)</tt>.</p>
<p>The default implementation does nothing.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#dropEvent">dropEvent</a>(), <a href="qgraphicsitem.html#dragMoveEvent">dragMoveEvent</a>(), and
<a href="qgraphicsitem.html#dragLeaveEvent">dragLeaveEvent</a>().</p>
<h3 class="fn"><a name="dragLeaveEvent" />QGraphicsItem.dragLeaveEvent (<i>self</i>, <a href="qgraphicsscenedragdropevent.html">QGraphicsSceneDragDropEvent</a> <i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive drag leave events for this item. Drag leave events are
generated as the cursor leaves the item's area. Most often you will
not need to reimplement this function, but it can be useful for
resetting state in your item (e.g., highlighting).</p>
<p>Calling <a href="qevent.html#ignore">QEvent.ignore</a>() or
<a href="qevent.html#accept">QEvent.accept</a>() on <i>event</i>
has no effect.</p>
<p>Items do not receive drag and drop events by default; to enable
this feature, call <tt>setAcceptDrops(true)</tt>.</p>
<p>The default implementation does nothing.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#dragEnterEvent">dragEnterEvent</a>(), <a href="qgraphicsitem.html#dropEvent">dropEvent</a>(), and <a href="qgraphicsitem.html#dragMoveEvent">dragMoveEvent</a>().</p>
<h3 class="fn"><a name="dragMoveEvent" />QGraphicsItem.dragMoveEvent (<i>self</i>, <a href="qgraphicsscenedragdropevent.html">QGraphicsSceneDragDropEvent</a> <i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive drag move events for this item. Drag move events are
generated as the cursor moves around inside the item's area. Most
often you will not need to reimplement this function; it is used to
indicate that only parts of the item can accept drops.</p>
<p>Calling <a href="qevent.html#ignore">QEvent.ignore</a>() or
<a href="qevent.html#accept">QEvent.accept</a>() on <i>event</i>
toggles whether or not the item will accept drops at the position
from the event. By default, <i>event</i> is accepted, indicating
that the item allows drops at the specified position.</p>
<p>Items do not receive drag and drop events by default; to enable
this feature, call <tt>setAcceptDrops(true)</tt>.</p>
<p>The default implementation does nothing.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#dropEvent">dropEvent</a>(), <a href="qgraphicsitem.html#dragEnterEvent">dragEnterEvent</a>(), and
<a href="qgraphicsitem.html#dragLeaveEvent">dragLeaveEvent</a>().</p>
<h3 class="fn"><a name="dropEvent" />QGraphicsItem.dropEvent (<i>self</i>, <a href="qgraphicsscenedragdropevent.html">QGraphicsSceneDragDropEvent</a> <i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive drop events for this item. Items can only receive drop
events if the last drag move event was accepted.</p>
<p>Calling <a href="qevent.html#ignore">QEvent.ignore</a>() or
<a href="qevent.html#accept">QEvent.accept</a>() on <i>event</i>
has no effect.</p>
<p>Items do not receive drag and drop events by default; to enable
this feature, call <tt>setAcceptDrops(true)</tt>.</p>
<p>The default implementation does nothing.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#dragEnterEvent">dragEnterEvent</a>(), <a href="qgraphicsitem.html#dragMoveEvent">dragMoveEvent</a>(), and
<a href="qgraphicsitem.html#dragLeaveEvent">dragLeaveEvent</a>().</p>
<h3 class="fn"><a name="effectiveOpacity" />float QGraphicsItem.effectiveOpacity (<i>self</i>)</h3><p>Returns this item's <i>effective</i> opacity, which is between
0.0 (transparent) and 1.0 (opaque). This value is a combination of
this item's local opacity, and its parent and ancestors' opacities.
The effective opacity decides how the item is rendered.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#opacity">opacity</a>(), <a href="qgraphicsitem.html#setOpacity">setOpacity</a>(), <a href="qgraphicsitem.html#paint">paint</a>(), <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIgnoresParentOpacity</a>,
and <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemDoesntPropagateOpacityToChildren</a>.</p>
<h3 class="fn"><a name="ensureVisible" />QGraphicsItem.ensureVisible (<i>self</i>, <a href="qrectf.html">QRectF</a> <i>rect</i> = QRectF(), int <i>xMargin</i> = 50, int <i>yMargin</i> = 50)</h3><p>If this item is part of a scene that is viewed by a <a href="qgraphicsview.html">QGraphicsView</a>, this convenience function
will attempt to scroll the view to ensure that <i>rect</i> is
visible inside the view's viewport. If <i>rect</i> is a null rect
(the default), <a href="qgraphicsitem.html">QGraphicsItem</a> will
default to the item's bounding rect. <i>xmargin</i> and
<i>ymargin</i> are the number of pixels the view should use for
margins.</p>
<p>If the specified rect cannot be reached, the contents are
scrolled to the nearest valid position.</p>
<p>If this item is not viewed by a <a href="qgraphicsview.html">QGraphicsView</a>, this function does
nothing.</p>
<p><b>See also</b> <a href="qgraphicsview.html#ensureVisible">QGraphicsView.ensureVisible</a>().</p>
<h3 class="fn"><a name="ensureVisible-2" />QGraphicsItem.ensureVisible (<i>self</i>, float <i>x</i>, float <i>y</i>, float <i>w</i>, float <i>h</i>, int <i>xMargin</i> = 50, int <i>yMargin</i> = 50)</h3><p>This convenience function is equivalent to calling
ensureVisible(<a href="qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>,
<i>w</i>, <i>h</i>), <i>xmargin</i>, <i>ymargin</i>):</p>
<h3 class="fn"><a name="filtersChildEvents" />bool QGraphicsItem.filtersChildEvents (<i>self</i>)</h3><p>Returns true if this item filters child events (i.e., all events
intended for any of its children are instead sent to this item);
otherwise, false is returned.</p>
<p>The default value is false; child events are not filtered.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setFiltersChildEvents">setFiltersChildEvents</a>().</p>
<h3 class="fn"><a name="flags" /><a href="qgraphicsitem-graphicsitemflags.html">GraphicsItemFlags</a> QGraphicsItem.flags (<i>self</i>)</h3><p>Returns this item's flags. The flags describe what configurable
features of the item are enabled and not. For example, if the flags
include <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsFocusable</a>, the
item can accept input focus.</p>
<p>By default, no flags are enabled.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setFlags">setFlags</a>() and <a href="qgraphicsitem.html#setFlag">setFlag</a>().</p>
<h3 class="fn"><a name="focusInEvent" />QGraphicsItem.focusInEvent (<i>self</i>, <a href="qfocusevent.html">QFocusEvent</a> <i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive focus in events for this item. The default
implementation calls <a href="qgraphicsitem.html#ensureVisible">ensureVisible</a>().</p>
<p><b>See also</b> <a href="qgraphicsitem.html#focusOutEvent">focusOutEvent</a>(), <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>(), and <a href="qgraphicsitem.html#setFocus">setFocus</a>().</p>
<h3 class="fn"><a name="focusItem" /><a href="qgraphicsitem.html">QGraphicsItem</a> QGraphicsItem.focusItem (<i>self</i>)</h3><p>If this item, a child or descendant of this item currently has
input focus, this function will return a pointer to that item. If
no descendant has input focus, 0 is returned.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#hasFocus">hasFocus</a>(), <a href="qgraphicsitem.html#setFocus">setFocus</a>(), and <a href="qwidget.html#focusWidget">QWidget.focusWidget</a>().</p>
<h3 class="fn"><a name="focusOutEvent" />QGraphicsItem.focusOutEvent (<i>self</i>, <a href="qfocusevent.html">QFocusEvent</a> <i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive focus out events for this item. The default
implementation does nothing.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#focusInEvent">focusInEvent</a>(), <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>(), and <a href="qgraphicsitem.html#setFocus">setFocus</a>().</p>
<h3 class="fn"><a name="focusProxy" /><a href="qgraphicsitem.html">QGraphicsItem</a> QGraphicsItem.focusProxy (<i>self</i>)</h3><p>Returns this item's focus proxy, or 0 if this item has no focus
proxy.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setFocusProxy">setFocusProxy</a>(), <a href="qgraphicsitem.html#setFocus">setFocus</a>(), and <a href="qgraphicsitem.html#hasFocus">hasFocus</a>().</p>
<h3 class="fn"><a name="grabKeyboard" />QGraphicsItem.grabKeyboard (<i>self</i>)</h3><p>Grabs the keyboard input.</p>
<p>The item will receive all keyboard input to the scene until one
of the following events occur:</p>
<ul>
<li>The item becomes invisible</li>
<li>The item is removed from the scene</li>
<li>The item is deleted</li>
<li>The item calls <a href="qgraphicsitem.html#ungrabKeyboard">ungrabKeyboard</a>()</li>
<li>Another item calls grabKeyboard(); the item will regain the
keyboard grab when the other item calls <a href="qgraphicsitem.html#ungrabKeyboard">ungrabKeyboard</a>().</li>
</ul>
<p>When an item gains the keyboard grab, it receives a <a href="qevent.html#Type-enum">QEvent.GrabKeyboard</a> event. When it
loses the keyboard grab, it receives a <a href="qevent.html#Type-enum">QEvent.UngrabKeyboard</a> event. These
events can be used to detect when your item gains or loses the
keyboard grab through other means than gaining input focus.</p>
<p>It is almost never necessary to explicitly grab the keyboard in
Qt, as Qt grabs and releases it sensibly. In particular, Qt grabs
the keyboard when your item gains input focus, and releases it when
your item loses input focus, or when the item is hidden.</p>
<p>Note that only visible items can grab keyboard input. Calling
grabKeyboard() on an invisible item has no effect.</p>
<p>Keyboard events are not affected.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#ungrabKeyboard">ungrabKeyboard</a>(), <a href="qgraphicsitem.html#grabMouse">grabMouse</a>(), and <a href="qgraphicsitem.html#setFocus">setFocus</a>().</p>
<h3 class="fn"><a name="grabMouse" />QGraphicsItem.grabMouse (<i>self</i>)</h3><p>Grabs the mouse input.</p>
<p>This item will receive all mouse events for the scene until any
of the following events occurs:</p>
<ul>
<li>The item becomes invisible</li>
<li>The item is removed from the scene</li>
<li>The item is deleted</li>
<li>The item call <a href="qgraphicsitem.html#ungrabMouse">ungrabMouse</a>()</li>
<li>Another item calls grabMouse(); the item will regain the mouse
grab when the other item calls <a href="qgraphicsitem.html#ungrabMouse">ungrabMouse</a>().</li>
</ul>
<p>When an item gains the mouse grab, it receives a <a href="qevent.html#Type-enum">QEvent.GrabMouse</a> event. When it loses
the mouse grab, it receives a <a href="qevent.html#Type-enum">QEvent.UngrabMouse</a> event. These events
can be used to detect when your item gains or loses the mouse grab
through other means than receiving mouse button events.</p>
<p>It is almost never necessary to explicitly grab the mouse in Qt,
as Qt grabs and releases it sensibly. In particular, Qt grabs the
mouse when you press a mouse button, and keeps the mouse grabbed
until you release the last mouse button. Also, <a href="qt.html#WindowType-enum">Qt.Popup</a> widgets implicitly call
grabMouse() when shown, and <a href="qgraphicsitem.html#ungrabMouse">ungrabMouse</a>() when hidden.</p>
<p>Note that only visible items can grab mouse input. Calling
grabMouse() on an invisible item has no effect.</p>
<p>Keyboard events are not affected.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsscene.html#mouseGrabberItem">QGraphicsScene.mouseGrabberItem</a>(),
<a href="qgraphicsitem.html#ungrabMouse">ungrabMouse</a>(), and
<a href="qgraphicsitem.html#grabKeyboard">grabKeyboard</a>().</p>
<h3 class="fn"><a name="graphicsEffect" /><a href="qgraphicseffect.html">QGraphicsEffect</a> QGraphicsItem.graphicsEffect (<i>self</i>)</h3><p>Returns a pointer to this item's effect if it has one; otherwise
0.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setGraphicsEffect">setGraphicsEffect</a>().</p>
<h3 class="fn"><a name="group" /><a href="qgraphicsitemgroup.html">QGraphicsItemGroup</a> QGraphicsItem.group (<i>self</i>)</h3><p>Returns a pointer to this item's item group, or 0 if this item
is not member of a group.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setGroup">setGroup</a>(), <a href="qgraphicsitemgroup.html">QGraphicsItemGroup</a>, and <a href="qgraphicsscene.html#createItemGroup">QGraphicsScene.createItemGroup</a>().</p>
<h3 class="fn"><a name="handlesChildEvents" />bool QGraphicsItem.handlesChildEvents (<i>self</i>)</h3><h3 class="fn"><a name="hasCursor" />bool QGraphicsItem.hasCursor (<i>self</i>)</h3><p>Returns true if this item has a cursor set; otherwise, false is
returned.</p>
<p>By default, items don't have any cursor set. <a href="qgraphicsitem.html#cursor">cursor</a>() will return a standard
pointing arrow cursor.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#unsetCursor">unsetCursor</a>().</p>
<h3 class="fn"><a name="hasFocus" />bool QGraphicsItem.hasFocus (<i>self</i>)</h3><p>Returns true if this item is active, and it or its <a href="qgraphicsitem.html#focusProxy">focus proxy</a> has keyboard input
focus; otherwise, returns false.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#focusItem">focusItem</a>(), <a href="qgraphicsitem.html#setFocus">setFocus</a>(), <a href="qgraphicsscene.html#setFocusItem">QGraphicsScene.setFocusItem</a>(),
and <a href="qgraphicsitem.html#isActive">isActive</a>().</p>
<h3 class="fn"><a name="hide" />QGraphicsItem.hide (<i>self</i>)</h3><p>Hides the item. (Items are visible by default.)</p>
<p>This convenience function is equivalent to calling
<tt>setVisible(false)</tt>.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#show">show</a>() and
<a href="qgraphicsitem.html#setVisible">setVisible</a>().</p>
<h3 class="fn"><a name="hoverEnterEvent" />QGraphicsItem.hoverEnterEvent (<i>self</i>, <a href="qgraphicsscenehoverevent.html">QGraphicsSceneHoverEvent</a> <i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive hover enter events for this item. The default
implementation calls <a href="qgraphicsitem.html#update">update</a>(); otherwise it does
nothing.</p>
<p>Calling <a href="qevent.html#ignore">QEvent.ignore</a>() or
<a href="qevent.html#accept">QEvent.accept</a>() on <i>event</i>
has no effect.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#hoverMoveEvent">hoverMoveEvent</a>(), <a href="qgraphicsitem.html#hoverLeaveEvent">hoverLeaveEvent</a>(),
<a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>(), and
<a href="qgraphicsitem.html#setAcceptHoverEvents">setAcceptHoverEvents</a>().</p>
<h3 class="fn"><a name="hoverLeaveEvent" />QGraphicsItem.hoverLeaveEvent (<i>self</i>, <a href="qgraphicsscenehoverevent.html">QGraphicsSceneHoverEvent</a> <i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive hover leave events for this item. The default
implementation calls <a href="qgraphicsitem.html#update">update</a>(); otherwise it does
nothing.</p>
<p>Calling <a href="qevent.html#ignore">QEvent.ignore</a>() or
<a href="qevent.html#accept">QEvent.accept</a>() on <i>event</i>
has no effect.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#hoverEnterEvent">hoverEnterEvent</a>(),
<a href="qgraphicsitem.html#hoverMoveEvent">hoverMoveEvent</a>(),
<a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>(), and
<a href="qgraphicsitem.html#setAcceptHoverEvents">setAcceptHoverEvents</a>().</p>
<h3 class="fn"><a name="hoverMoveEvent" />QGraphicsItem.hoverMoveEvent (<i>self</i>, <a href="qgraphicsscenehoverevent.html">QGraphicsSceneHoverEvent</a> <i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive hover move events for this item. The default
implementation does nothing.</p>
<p>Calling <a href="qevent.html#ignore">QEvent.ignore</a>() or
<a href="qevent.html#accept">QEvent.accept</a>() on <i>event</i>
has no effect.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#hoverEnterEvent">hoverEnterEvent</a>(),
<a href="qgraphicsitem.html#hoverLeaveEvent">hoverLeaveEvent</a>(),
<a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>(), and
<a href="qgraphicsitem.html#setAcceptHoverEvents">setAcceptHoverEvents</a>().</p>
<h3 class="fn"><a name="inputMethodEvent" />QGraphicsItem.inputMethodEvent (<i>self</i>, <a href="qinputmethodevent.html">QInputMethodEvent</a> <i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive input method events for this item. The default
implementation ignores the event.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#inputMethodQuery">inputMethodQuery</a>() and
<a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().</p>
<h3 class="fn"><a name="inputMethodHints" /><a href="qt-inputmethodhints.html">Qt.InputMethodHints</a> QGraphicsItem.inputMethodHints (<i>self</i>)</h3><p>Returns the current input method hints of this item.</p>
<p>Input method hints are only relevant for input items. The hints
are used by the input method to indicate how it should operate. For
example, if the Qt.ImhNumbersOnly flag is set, the input method
may change its visual components to reflect that only numbers can
be entered.</p>
<p>The effect may vary between input method implementations.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setInputMethodHints">setInputMethodHints</a>(),
<a href="qgraphicsitem.html#inputMethodQuery">inputMethodQuery</a>(), and
<a href="qinputcontext.html">QInputContext</a>.</p>
<h3 class="fn"><a name="inputMethodQuery" />QVariant QGraphicsItem.inputMethodQuery (<i>self</i>, <a href="qt.html#InputMethodQuery-enum">Qt.InputMethodQuery</a> <i>query</i>)</h3><p>This method is only relevant for input items. It is used by the
input method to query a set of properties of the item to be able to
support complex input method operations, such as support for
surrounding text and reconversions. <i>query</i> specifies which
property is queried.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#inputMethodEvent">inputMethodEvent</a>(),
<a href="qinputmethodevent.html">QInputMethodEvent</a>, and
<a href="qinputcontext.html">QInputContext</a>.</p>
<h3 class="fn"><a name="installSceneEventFilter" />QGraphicsItem.installSceneEventFilter (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>filterItem</i>)</h3><p>Installs an event filter for this item on <i>filterItem</i>,
causing all events for this item to first pass through
<i>filterItem</i>'s <a href="qgraphicsitem.html#sceneEventFilter">sceneEventFilter</a>()
function.</p>
<p>To filter another item's events, install this item as an event
filter for the other item. Example:</p>
<pre class="cpp">
<span class="type"><a href="qgraphicsscene.html">QGraphicsScene</a></span> scene;
<span class="type"><a href="qgraphicsellipseitem.html">QGraphicsEllipseItem</a></span> <span class="operator">*</span>ellipse <span class="operator">=</span> scene<span class="operator">.</span>addEllipse(<span class="type"><a href="qrectf.html">QRectF</a></span>(<span class="operator">-</span><span class="number">10</span><span class="operator">,</span> <span class="operator">-</span><span class="number">10</span><span class="operator">,</span> <span class="number">20</span><span class="operator">,</span> <span class="number">20</span>));
<span class="type"><a href="qgraphicslineitem.html">QGraphicsLineItem</a></span> <span class="operator">*</span>line <span class="operator">=</span> scene<span class="operator">.</span>addLine(<span class="type"><a href="qlinef.html">QLineF</a></span>(<span class="operator">-</span><span class="number">10</span><span class="operator">,</span> <span class="operator">-</span><span class="number">10</span><span class="operator">,</span> <span class="number">20</span><span class="operator">,</span> <span class="number">20</span>));
line<span class="operator">-</span><span class="operator">></span>installSceneEventFilter(ellipse);
<span class="comment">// line's events are filtered by ellipse's sceneEventFilter() function.</span>
ellipse<span class="operator">-</span><span class="operator">></span>installSceneEventFilter(line);
<span class="comment">// ellipse's events are filtered by line's sceneEventFilter() function.</span>
</pre>
<p>An item can only filter events for other items in the same
scene. Also, an item cannot filter its own events; instead, you can
reimplement <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>() directly.</p>
<p>Items must belong to a scene for scene event filters to be
installed and used.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#removeSceneEventFilter">removeSceneEventFilter</a>(),
<a href="qgraphicsitem.html#sceneEventFilter">sceneEventFilter</a>(), and
<a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().</p>
<h3 class="fn"><a name="isActive" />bool QGraphicsItem.isActive (<i>self</i>)</h3><p>Returns true if this item is active; otherwise returns
false.</p>
<p>An item can only be active if the scene is active. An item is
active if it is, or is a descendent of, an active panel. Items in
non-active panels are not active.</p>
<p>Items that are not part of a panel follow scene activation when
the scene has no active panel.</p>
<p>Only active items can gain input focus.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsscene.html#isActive">QGraphicsScene.isActive</a>(),
<a href="qgraphicsscene.html#activePanel">QGraphicsScene.activePanel</a>(),
<a href="qgraphicsitem.html#panel">panel</a>(), and <a href="qgraphicsitem.html#isPanel">isPanel</a>().</p>
<h3 class="fn"><a name="isAncestorOf" />bool QGraphicsItem.isAncestorOf (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>child</i>)</h3><p>Returns true if this item is an ancestor of <i>child</i> (i.e.,
if this item is <i>child</i>'s parent, or one of <i>child</i>'s
parent's ancestors).</p>
<p><b>See also</b> <a href="qgraphicsitem.html#parentItem">parentItem</a>().</p>
<h3 class="fn"><a name="isBlockedByModalPanel" />(bool, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>blockingPanel</i>) QGraphicsItem.isBlockedByModalPanel (<i>self</i>)</h3><p>Returns true if this item is blocked by a modal panel, false
otherwise. If <i>blockingPanel</i> is non-zero,
<i>blockingPanel</i> will be set to the modal panel that is
blocking this item. If this item is not blocked,
<i>blockingPanel</i> will not be set by this function.</p>
<p>This function always returns false for items not in a scene.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#panelModality">panelModality</a>(), <a href="qgraphicsitem.html#setPanelModality">setPanelModality</a>(), and
<a href="qgraphicsitem.html#PanelModality-enum">PanelModality</a>.</p>
<h3 class="fn"><a name="isClipped" />bool QGraphicsItem.isClipped (<i>self</i>)</h3><p>Returns true if this item is clipped. An item is clipped if it
has either set the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemClipsToShape</a>
flag, or if it or any of its ancestors has set the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemClipsChildrenToShape</a>
flag.</p>
<p>Clipping affects the item's appearance (i.e., painting), as well
as mouse and hover event delivery.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#clipPath">clipPath</a>(), <a href="qgraphicsitem.html#shape">shape</a>(), and <a href="qgraphicsitem.html#setFlags">setFlags</a>().</p>
<h3 class="fn"><a name="isEnabled" />bool QGraphicsItem.isEnabled (<i>self</i>)</h3><p>Returns true if the item is enabled; otherwise, false is
returned.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setEnabled">setEnabled</a>().</p>
<h3 class="fn"><a name="isObscured" />bool QGraphicsItem.isObscured (<i>self</i>)</h3><p>Returns true if this item's bounding rect is completely obscured
by the opaque shape of any of colliding items above it (i.e., with
a higher Z value than this item).</p>
<p>Its implementation is based on calling <a href="qgraphicsitem.html#isObscuredBy">isObscuredBy</a>(), which you can
reimplement to provide a custom obscurity algorithm.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#opaqueArea">opaqueArea</a>().</p>
<h3 class="fn"><a name="isObscured-2" />bool QGraphicsItem.isObscured (<i>self</i>, <a href="qrectf.html">QRectF</a> <i>rect</i>)</h3><p>This convenience function is equivalent to calling
isObscured(<a href="qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>,
<i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in Qt 4.3.</p>
<h3 class="fn"><a name="isObscured-3" />bool QGraphicsItem.isObscured (<i>self</i>, float <i>ax</i>, float <i>ay</i>, float <i>w</i>, float <i>h</i>)</h3><p>This is an overloaded function.</p>
<p>Returns true if <i>rect</i> is completely obscured by the opaque
shape of any of colliding items above it (i.e., with a higher Z
value than this item).</p>
<p>Unlike the default <a href="qgraphicsitem.html#isObscured">isObscured</a>() function, this
function does not call <a href="qgraphicsitem.html#isObscuredBy">isObscuredBy</a>().</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#opaqueArea">opaqueArea</a>().</p>
<h3 class="fn"><a name="isObscuredBy" />bool QGraphicsItem.isObscuredBy (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>item</i>)</h3><p>Returns true if this item's bounding rect is completely obscured
by the opaque shape of <i>item</i>.</p>
<p>The base implementation maps <i>item</i>'s <a href="qgraphicsitem.html#opaqueArea">opaqueArea</a>() to this item's
coordinate system, and then checks if this item's <a href="qgraphicsitem.html#boundingRect">boundingRect</a>() is fully
contained within the mapped shape.</p>
<p>You can reimplement this function to provide a custom algorithm
for determining whether this item is obscured by <i>item</i>.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#opaqueArea">opaqueArea</a>() and <a href="qgraphicsitem.html#isObscured">isObscured</a>().</p>
<h3 class="fn"><a name="isPanel" />bool QGraphicsItem.isPanel (<i>self</i>)</h3><p>Returns true if the item is a panel; otherwise returns
false.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#panel">QGraphicsItem.panel</a>() and <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsPanel</a>.</p>
<h3 class="fn"><a name="isSelected" />bool QGraphicsItem.isSelected (<i>self</i>)</h3><p>Returns true if this item is selected; otherwise, false is
returned.</p>
<p>Items that are in a group inherit the group's selected
state.</p>
<p>Items are not selected by default.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setSelected">setSelected</a>() and <a href="qgraphicsscene.html#setSelectionArea">QGraphicsScene.setSelectionArea</a>().</p>
<h3 class="fn"><a name="isUnderMouse" />bool QGraphicsItem.isUnderMouse (<i>self</i>)</h3><p>Returns true if this item is currently under the mouse cursor in
one of the views; otherwise, false is returned.</p>
<p>This function was introduced in Qt 4,4.</p>
<p><b>See also</b> <a href="qgraphicsscene.html#views">QGraphicsScene.views</a>() and
<a href="qcursor.html#pos">QCursor.pos</a>().</p>
<h3 class="fn"><a name="isVisible" />bool QGraphicsItem.isVisible (<i>self</i>)</h3><p>Returns true if the item is visible; otherwise, false is
returned.</p>
<p>Note that the item's general visibility is unrelated to whether
or not it is actually being visualized by a <a href="qgraphicsview.html">QGraphicsView</a>.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setVisible">setVisible</a>().</p>
<h3 class="fn"><a name="isVisibleTo" />bool QGraphicsItem.isVisibleTo (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>parent</i>)</h3><p>Returns true if the item is visible to <i>parent</i>; otherwise,
false is returned. <i>parent</i> can be 0, in which case this
function will return whether the item is visible to the scene or
not.</p>
<p>An item may not be visible to its ancestors even if <a href="qgraphicsitem.html#isVisible">isVisible</a>() is true. It may also
be visible to its ancestors even if <a href="qgraphicsitem.html#isVisible">isVisible</a>() is false. If any
ancestor is hidden, the item itself will be implicitly hidden, in
which case this function will return false.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#isVisible">isVisible</a>() and <a href="qgraphicsitem.html#setVisible">setVisible</a>().</p>
<h3 class="fn"><a name="isWidget" />bool QGraphicsItem.isWidget (<i>self</i>)</h3><p>Returns true if this item is a widget (i.e., <a href="qgraphicswidget.html">QGraphicsWidget</a>); otherwise, returns
false.</p>
<p>This function was introduced in Qt 4.4.</p>
<h3 class="fn"><a name="isWindow" />bool QGraphicsItem.isWindow (<i>self</i>)</h3><p>Returns true if the item is a <a href="qgraphicswidget.html">QGraphicsWidget</a> window, otherwise
returns false.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicswidget.html#windowFlags-prop">QGraphicsWidget.windowFlags</a>().</p>
<h3 class="fn"><a name="itemChange" />QVariant QGraphicsItem.itemChange (<i>self</i>, <a href="qgraphicsitem.html#GraphicsItemChange-enum">GraphicsItemChange</a> <i>change</i>, QVariant <i>value</i>)</h3><p>This virtual function is called by <a href="qgraphicsitem.html">QGraphicsItem</a> to notify custom items that
some part of the item's state changes. By reimplementing this
function, your can react to a change, and in some cases, (depending
on <i>change</i>,) adjustments can be made.</p>
<p><i>change</i> is the parameter of the item that is changing.
<i>value</i> is the new value; the type of the value depends on
<i>change</i>.</p>
<p>Example:</p>
<pre class="cpp">
<span class="type"><a href="qvariant.html">QVariant</a></span> Component<span class="operator">.</span>itemChange(GraphicsItemChange change<span class="operator">,</span> <span class="keyword">const</span> <span class="type"><a href="qvariant.html">QVariant</a></span> <span class="operator">&</span>value)
{
<span class="keyword">if</span> (change <span class="operator">=</span><span class="operator">=</span> ItemPositionChange <span class="operator">&</span><span class="operator">&</span> scene()) {
<span class="comment">// value is the new position.</span>
<span class="type"><a href="qpointf.html">QPointF</a></span> newPos <span class="operator">=</span> value<span class="operator">.</span>toPointF();
<span class="type"><a href="qrectf.html">QRectF</a></span> rect <span class="operator">=</span> scene()<span class="operator">-</span><span class="operator">></span>sceneRect();
<span class="keyword">if</span> (<span class="operator">!</span>rect<span class="operator">.</span>contains(newPos)) {
<span class="comment">// Keep the item inside the scene rect.</span>
newPos<span class="operator">.</span>setX(<a href="qtcore.html#qMin">qMin</a>(rect<span class="operator">.</span>right()<span class="operator">,</span> <a href="qtcore.html#qMax">qMax</a>(newPos<span class="operator">.</span>x()<span class="operator">,</span> rect<span class="operator">.</span>left())));
newPos<span class="operator">.</span>setY(<a href="qtcore.html#qMin">qMin</a>(rect<span class="operator">.</span>bottom()<span class="operator">,</span> <a href="qtcore.html#qMax">qMax</a>(newPos<span class="operator">.</span>y()<span class="operator">,</span> rect<span class="operator">.</span>top())));
<span class="keyword">return</span> newPos;
}
}
<span class="keyword">return</span> <span class="type"><a href="qgraphicsitem.html">QGraphicsItem</a></span><span class="operator">.</span>itemChange(change<span class="operator">,</span> value);
}
</pre>
<p>The default implementation does nothing, and returns
<i>value</i>.</p>
<p>Note: Certain <a href="qgraphicsitem.html">QGraphicsItem</a>
functions cannot be called in a reimplementation of this function;
see the <a href="qgraphicsitem.html#GraphicsItemChange-enum">GraphicsItemChange</a>
documentation for details.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#GraphicsItemChange-enum">GraphicsItemChange</a>.</p>
<h3 class="fn"><a name="itemTransform" />(<a href="qtransform.html">QTransform</a>, bool <i>ok</i>) QGraphicsItem.itemTransform (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>other</i>)</h3><p>Returns a <a href="qtransform.html">QTransform</a> that maps
coordinates from this item to <i>other</i>. If <i>ok</i> is not
null, and if there is no such transform, the boolean pointed to by
<i>ok</i> will be set to false; otherwise it will be set to
true.</p>
<p>This transform provides an alternative to the <a href="qgraphicsitem.html#mapToItem">mapToItem</a>() or <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>() functions, by
returning the appropriate transform so that you can map shapes and
coordinates yourself. It also helps you write more efficient code
when repeatedly mapping between the same two items.</p>
<p><b>Note:</b> In rare circumstances, there is no transform that
maps between two items.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="qgraphicsitem.html#deviceTransform">deviceTransform</a>().</p>
<h3 class="fn"><a name="keyPressEvent" />QGraphicsItem.keyPressEvent (<i>self</i>, <a href="qkeyevent.html">QKeyEvent</a> <i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive key press events for this item. The default
implementation ignores the event. If you reimplement this handler,
the event will by default be accepted.</p>
<p>Note that key events are only received for items that set the
<a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsFocusable</a>
flag, and that have keyboard input focus.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#keyReleaseEvent">keyReleaseEvent</a>(),
<a href="qgraphicsitem.html#setFocus">setFocus</a>(), <a href="qgraphicsscene.html#setFocusItem">QGraphicsScene.setFocusItem</a>(),
and <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().</p>
<h3 class="fn"><a name="keyReleaseEvent" />QGraphicsItem.keyReleaseEvent (<i>self</i>, <a href="qkeyevent.html">QKeyEvent</a> <i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive key release events for this item. The default
implementation ignores the event. If you reimplement this handler,
the event will by default be accepted.</p>
<p>Note that key events are only received for items that set the
<a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsFocusable</a>
flag, and that have keyboard input focus.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#keyPressEvent">keyPressEvent</a>(), <a href="qgraphicsitem.html#setFocus">setFocus</a>(), <a href="qgraphicsscene.html#setFocusItem">QGraphicsScene.setFocusItem</a>(),
and <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().</p>
<h3 class="fn"><a name="mapFromItem" /><a href="qpointf.html">QPointF</a> QGraphicsItem.mapFromItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>item</i>, <a href="qpointf.html">QPointF</a> <i>point</i>)</h3><p>Maps the point <i>point</i>, which is in <i>item</i>'s
coordinate system, to this item's coordinate system, and returns
the mapped coordinate.</p>
<p>If <i>item</i> is 0, this function returns the same as <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>().</p>
<p><b>See also</b> <a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="mapFromItem-2" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapFromItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>item</i>, <a href="qrectf.html">QRectF</a> <i>rect</i>)</h3><p>Maps the rectangle <i>rect</i>, which is in <i>item</i>'s
coordinate system, to this item's coordinate system, and returns
the mapped rectangle as a polygon.</p>
<p>If <i>item</i> is 0, this function returns the same as <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>()</p>
<p><b>See also</b> <a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="mapFromItem-3" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapFromItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>item</i>, <a href="qpolygonf.html">QPolygonF</a> <i>polygon</i>)</h3><p>Maps the polygon <i>polygon</i>, which is in <i>item</i>'s
coordinate system, to this item's coordinate system, and returns
the mapped polygon.</p>
<p>If <i>item</i> is 0, this function returns the same as <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>().</p>
<p><b>See also</b> <a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="mapFromItem-4" /><a href="qpainterpath.html">QPainterPath</a> QGraphicsItem.mapFromItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>item</i>, <a href="qpainterpath.html">QPainterPath</a> <i>path</i>)</h3><p>Maps the path <i>path</i>, which is in <i>item</i>'s coordinate
system, to this item's coordinate system, and returns the mapped
path.</p>
<p>If <i>item</i> is 0, this function returns the same as <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>().</p>
<p><b>See also</b> <a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="mapFromItem-5" /><a href="qpointf.html">QPointF</a> QGraphicsItem.mapFromItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>item</i>, float <i>ax</i>, float <i>ay</i>)</h3><p>This convenience function is equivalent to calling
mapFromItem(item, <a href="qrectf.html">QRectF</a>(<i>x</i>,
<i>y</i>, <i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in Qt 4.3.</p>
<h3 class="fn"><a name="mapFromItem-6" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapFromItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>item</i>, float <i>ax</i>, float <i>ay</i>, float <i>w</i>, float <i>h</i>)</h3><p>This is an overloaded function.</p>
<p>This convenience function is equivalent to calling
mapFromItem(<i>item</i>, <a href="qpointf.html">QPointF</a>(<i>x</i>, <i>y</i>)).</p>
<h3 class="fn"><a name="mapFromParent" /><a href="qpointf.html">QPointF</a> QGraphicsItem.mapFromParent (<i>self</i>, <a href="qpointf.html">QPointF</a> <i>point</i>)</h3><p>Maps the point <i>point</i>, which is in this item's parent's
coordinate system, to this item's coordinate system, and returns
the mapped coordinate.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="mapFromParent-2" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapFromParent (<i>self</i>, <a href="qrectf.html">QRectF</a> <i>rect</i>)</h3><p>Maps the rectangle <i>rect</i>, which is in this item's parent's
coordinate system, to this item's coordinate system, and returns
the mapped rectangle as a polygon.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="mapFromParent-3" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapFromParent (<i>self</i>, <a href="qpolygonf.html">QPolygonF</a> <i>polygon</i>)</h3><p>Maps the polygon <i>polygon</i>, which is in this item's
parent's coordinate system, to this item's coordinate system, and
returns the mapped polygon.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="mapFromParent-4" /><a href="qpainterpath.html">QPainterPath</a> QGraphicsItem.mapFromParent (<i>self</i>, <a href="qpainterpath.html">QPainterPath</a> <i>path</i>)</h3><p>Maps the path <i>path</i>, which is in this item's parent's
coordinate system, to this item's coordinate system, and returns
the mapped path.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="mapFromParent-5" /><a href="qpointf.html">QPointF</a> QGraphicsItem.mapFromParent (<i>self</i>, float <i>ax</i>, float <i>ay</i>)</h3><p>This convenience function is equivalent to calling
mapFromItem(<a href="qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>,
<i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in Qt 4.3.</p>
<h3 class="fn"><a name="mapFromParent-6" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapFromParent (<i>self</i>, float <i>ax</i>, float <i>ay</i>, float <i>w</i>, float <i>h</i>)</h3><p>This is an overloaded function.</p>
<p>This convenience function is equivalent to calling
mapFromParent(<a href="qpointf.html">QPointF</a>(<i>x</i>,
<i>y</i>)).</p>
<h3 class="fn"><a name="mapFromScene" /><a href="qpointf.html">QPointF</a> QGraphicsItem.mapFromScene (<i>self</i>, <a href="qpointf.html">QPointF</a> <i>point</i>)</h3><p>Maps the point <i>point</i>, which is in this item's scene's
coordinate system, to this item's coordinate system, and returns
the mapped coordinate.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="mapFromScene-2" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapFromScene (<i>self</i>, <a href="qrectf.html">QRectF</a> <i>rect</i>)</h3><p>Maps the rectangle <i>rect</i>, which is in this item's scene's
coordinate system, to this item's coordinate system, and returns
the mapped rectangle as a polygon.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="mapFromScene-3" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapFromScene (<i>self</i>, <a href="qpolygonf.html">QPolygonF</a> <i>polygon</i>)</h3><p>Maps the polygon <i>polygon</i>, which is in this item's scene's
coordinate system, to this item's coordinate system, and returns
the mapped polygon.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="mapFromScene-4" /><a href="qpainterpath.html">QPainterPath</a> QGraphicsItem.mapFromScene (<i>self</i>, <a href="qpainterpath.html">QPainterPath</a> <i>path</i>)</h3><p>Maps the path <i>path</i>, which is in this item's scene's
coordinate system, to this item's coordinate system, and returns
the mapped path.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="mapFromScene-5" /><a href="qpointf.html">QPointF</a> QGraphicsItem.mapFromScene (<i>self</i>, float <i>ax</i>, float <i>ay</i>)</h3><p>This convenience function is equivalent to calling
mapFromScene(<a href="qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>,
<i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in Qt 4.3.</p>
<h3 class="fn"><a name="mapFromScene-6" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapFromScene (<i>self</i>, float <i>ax</i>, float <i>ay</i>, float <i>w</i>, float <i>h</i>)</h3><p>This is an overloaded function.</p>
<p>This convenience function is equivalent to calling
mapFromScene(<a href="qpointf.html">QPointF</a>(<i>x</i>,
<i>y</i>)).</p>
<h3 class="fn"><a name="mapRectFromItem" /><a href="qrectf.html">QRectF</a> QGraphicsItem.mapRectFromItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>item</i>, <a href="qrectf.html">QRectF</a> <i>rect</i>)</h3><p>Maps the rectangle <i>rect</i>, which is in <i>item</i>'s
coordinate system, to this item's coordinate system, and returns
the mapped rectangle as a new rectangle (i.e., the bounding
rectangle of the resulting polygon).</p>
<p>If <i>item</i> is 0, this function returns the same as <a href="qgraphicsitem.html#mapRectFromScene">mapRectFromScene</a>().</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="mapRectFromItem-2" /><a href="qrectf.html">QRectF</a> QGraphicsItem.mapRectFromItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>item</i>, float <i>ax</i>, float <i>ay</i>, float <i>w</i>, float <i>h</i>)</h3><p>This convenience function is equivalent to calling
mapRectFromItem(item, <a href="qrectf.html">QRectF</a>(<i>x</i>,
<i>y</i>, <i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in Qt 4.5.</p>
<h3 class="fn"><a name="mapRectFromParent" /><a href="qrectf.html">QRectF</a> QGraphicsItem.mapRectFromParent (<i>self</i>, <a href="qrectf.html">QRectF</a> <i>rect</i>)</h3><p>Maps the rectangle <i>rect</i>, which is in this item's parent's
coordinate system, to this item's coordinate system, and returns
the mapped rectangle as a new rectangle (i.e., the bounding
rectangle of the resulting polygon).</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="mapRectFromParent-2" /><a href="qrectf.html">QRectF</a> QGraphicsItem.mapRectFromParent (<i>self</i>, float <i>ax</i>, float <i>ay</i>, float <i>w</i>, float <i>h</i>)</h3><p>This convenience function is equivalent to calling
mapRectFromParent(<a href="qrectf.html">QRectF</a>(<i>x</i>,
<i>y</i>, <i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in Qt 4.5.</p>
<h3 class="fn"><a name="mapRectFromScene" /><a href="qrectf.html">QRectF</a> QGraphicsItem.mapRectFromScene (<i>self</i>, <a href="qrectf.html">QRectF</a> <i>rect</i>)</h3><p>Maps the rectangle <i>rect</i>, which is in scene coordinates,
to this item's coordinate system, and returns the mapped rectangle
as a new rectangle (i.e., the bounding rectangle of the resulting
polygon).</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="mapRectFromScene-2" /><a href="qrectf.html">QRectF</a> QGraphicsItem.mapRectFromScene (<i>self</i>, float <i>ax</i>, float <i>ay</i>, float <i>w</i>, float <i>h</i>)</h3><p>This convenience function is equivalent to calling
mapRectFromScene(<a href="qrectf.html">QRectF</a>(<i>x</i>,
<i>y</i>, <i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in Qt 4.5.</p>
<h3 class="fn"><a name="mapRectToItem" /><a href="qrectf.html">QRectF</a> QGraphicsItem.mapRectToItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>item</i>, <a href="qrectf.html">QRectF</a> <i>rect</i>)</h3><p>Maps the rectangle <i>rect</i>, which is in this item's
coordinate system, to <i>item</i>'s coordinate system, and returns
the mapped rectangle as a new rectangle (i.e., the bounding
rectangle of the resulting polygon).</p>
<p>If <i>item</i> is 0, this function returns the same as <a href="qgraphicsitem.html#mapRectToScene">mapRectToScene</a>().</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="mapRectToItem-2" /><a href="qrectf.html">QRectF</a> QGraphicsItem.mapRectToItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>item</i>, float <i>ax</i>, float <i>ay</i>, float <i>w</i>, float <i>h</i>)</h3><p>This convenience function is equivalent to calling
mapRectToItem(item, <a href="qrectf.html">QRectF</a>(<i>x</i>,
<i>y</i>, <i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in Qt 4.5.</p>
<h3 class="fn"><a name="mapRectToParent" /><a href="qrectf.html">QRectF</a> QGraphicsItem.mapRectToParent (<i>self</i>, <a href="qrectf.html">QRectF</a> <i>rect</i>)</h3><p>Maps the rectangle <i>rect</i>, which is in this item's
coordinate system, to its parent's coordinate system, and returns
the mapped rectangle as a new rectangle (i.e., the bounding
rectangle of the resulting polygon).</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="mapRectToParent-2" /><a href="qrectf.html">QRectF</a> QGraphicsItem.mapRectToParent (<i>self</i>, float <i>ax</i>, float <i>ay</i>, float <i>w</i>, float <i>h</i>)</h3><p>This convenience function is equivalent to calling
mapRectToParent(<a href="qrectf.html">QRectF</a>(<i>x</i>,
<i>y</i>, <i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in Qt 4.5.</p>
<h3 class="fn"><a name="mapRectToScene" /><a href="qrectf.html">QRectF</a> QGraphicsItem.mapRectToScene (<i>self</i>, <a href="qrectf.html">QRectF</a> <i>rect</i>)</h3><p>Maps the rectangle <i>rect</i>, which is in this item's
coordinate system, to the scene coordinate system, and returns the
mapped rectangle as a new rectangle (i.e., the bounding rectangle
of the resulting polygon).</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="mapRectToScene-2" /><a href="qrectf.html">QRectF</a> QGraphicsItem.mapRectToScene (<i>self</i>, float <i>ax</i>, float <i>ay</i>, float <i>w</i>, float <i>h</i>)</h3><p>This convenience function is equivalent to calling
mapRectToScene(<a href="qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>,
<i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in Qt 4.5.</p>
<h3 class="fn"><a name="mapToItem" /><a href="qpointf.html">QPointF</a> QGraphicsItem.mapToItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>item</i>, <a href="qpointf.html">QPointF</a> <i>point</i>)</h3><p>Maps the point <i>point</i>, which is in this item's coordinate
system, to <i>item</i>'s coordinate system, and returns the mapped
coordinate.</p>
<p>If <i>item</i> is 0, this function returns the same as <a href="qgraphicsitem.html#mapToScene">mapToScene</a>().</p>
<p><b>See also</b> <a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="mapToItem-2" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapToItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>item</i>, <a href="qrectf.html">QRectF</a> <i>rect</i>)</h3><p>Maps the rectangle <i>rect</i>, which is in this item's
coordinate system, to <i>item</i>'s coordinate system, and returns
the mapped rectangle as a polygon.</p>
<p>If <i>item</i> is 0, this function returns the same as <a href="qgraphicsitem.html#mapToScene">mapToScene</a>().</p>
<p><b>See also</b> <a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="mapToItem-3" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapToItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>item</i>, <a href="qpolygonf.html">QPolygonF</a> <i>polygon</i>)</h3><p>Maps the polygon <i>polygon</i>, which is in this item's
coordinate system, to <i>item</i>'s coordinate system, and returns
the mapped polygon.</p>
<p>If <i>item</i> is 0, this function returns the same as <a href="qgraphicsitem.html#mapToScene">mapToScene</a>().</p>
<p><b>See also</b> <a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="mapToItem-4" /><a href="qpainterpath.html">QPainterPath</a> QGraphicsItem.mapToItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>item</i>, <a href="qpainterpath.html">QPainterPath</a> <i>path</i>)</h3><p>Maps the path <i>path</i>, which is in this item's coordinate
system, to <i>item</i>'s coordinate system, and returns the mapped
path.</p>
<p>If <i>item</i> is 0, this function returns the same as <a href="qgraphicsitem.html#mapToScene">mapToScene</a>().</p>
<p><b>See also</b> <a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="mapToItem-5" /><a href="qpointf.html">QPointF</a> QGraphicsItem.mapToItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>item</i>, float <i>ax</i>, float <i>ay</i>)</h3><p>This convenience function is equivalent to calling
mapToItem(item, <a href="qrectf.html">QRectF</a>(<i>x</i>,
<i>y</i>, <i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in Qt 4.3.</p>
<h3 class="fn"><a name="mapToItem-6" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapToItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>item</i>, float <i>ax</i>, float <i>ay</i>, float <i>w</i>, float <i>h</i>)</h3><p>This is an overloaded function.</p>
<p>This convenience function is equivalent to calling
mapToItem(<i>item</i>, <a href="qpointf.html">QPointF</a>(<i>x</i>,
<i>y</i>)).</p>
<h3 class="fn"><a name="mapToParent" /><a href="qpointf.html">QPointF</a> QGraphicsItem.mapToParent (<i>self</i>, <a href="qpointf.html">QPointF</a> <i>point</i>)</h3><p>Maps the point <i>point</i>, which is in this item's coordinate
system, to its parent's coordinate system, and returns the mapped
coordinate. If the item has no parent, <i>point</i> will be mapped
to the scene's coordinate system.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), and
<a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="mapToParent-2" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapToParent (<i>self</i>, <a href="qrectf.html">QRectF</a> <i>rect</i>)</h3><p>Maps the rectangle <i>rect</i>, which is in this item's
coordinate system, to its parent's coordinate system, and returns
the mapped rectangle as a polygon. If the item has no parent,
<i>rect</i> will be mapped to the scene's coordinate system.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), and
<a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="mapToParent-3" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapToParent (<i>self</i>, <a href="qpolygonf.html">QPolygonF</a> <i>polygon</i>)</h3><p>Maps the polygon <i>polygon</i>, which is in this item's
coordinate system, to its parent's coordinate system, and returns
the mapped polygon. If the item has no parent, <i>polygon</i> will
be mapped to the scene's coordinate system.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), and
<a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="mapToParent-4" /><a href="qpainterpath.html">QPainterPath</a> QGraphicsItem.mapToParent (<i>self</i>, <a href="qpainterpath.html">QPainterPath</a> <i>path</i>)</h3><p>Maps the path <i>path</i>, which is in this item's coordinate
system, to its parent's coordinate system, and returns the mapped
path. If the item has no parent, <i>path</i> will be mapped to the
scene's coordinate system.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), and
<a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="mapToParent-5" /><a href="qpointf.html">QPointF</a> QGraphicsItem.mapToParent (<i>self</i>, float <i>ax</i>, float <i>ay</i>)</h3><p>This convenience function is equivalent to calling
mapToParent(<a href="qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>,
<i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in Qt 4.3.</p>
<h3 class="fn"><a name="mapToParent-6" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapToParent (<i>self</i>, float <i>ax</i>, float <i>ay</i>, float <i>w</i>, float <i>h</i>)</h3><p>This is an overloaded function.</p>
<p>This convenience function is equivalent to calling
mapToParent(<a href="qpointf.html">QPointF</a>(<i>x</i>,
<i>y</i>)).</p>
<h3 class="fn"><a name="mapToScene" /><a href="qpointf.html">QPointF</a> QGraphicsItem.mapToScene (<i>self</i>, <a href="qpointf.html">QPointF</a> <i>point</i>)</h3><p>Maps the point <i>point</i>, which is in this item's coordinate
system, to the scene's coordinate system, and returns the mapped
coordinate.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="mapToScene-2" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapToScene (<i>self</i>, <a href="qrectf.html">QRectF</a> <i>rect</i>)</h3><p>Maps the rectangle <i>rect</i>, which is in this item's
coordinate system, to the scene's coordinate system, and returns
the mapped rectangle as a polygon.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="mapToScene-3" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapToScene (<i>self</i>, <a href="qpolygonf.html">QPolygonF</a> <i>polygon</i>)</h3><p>Maps the polygon <i>polygon</i>, which is in this item's
coordinate system, to the scene's coordinate system, and returns
the mapped polygon.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="mapToScene-4" /><a href="qpainterpath.html">QPainterPath</a> QGraphicsItem.mapToScene (<i>self</i>, <a href="qpainterpath.html">QPainterPath</a> <i>path</i>)</h3><p>Maps the path <i>path</i>, which is in this item's coordinate
system, to the scene's coordinate system, and returns the mapped
path.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="mapToScene-5" /><a href="qpointf.html">QPointF</a> QGraphicsItem.mapToScene (<i>self</i>, float <i>ax</i>, float <i>ay</i>)</h3><p>This convenience function is equivalent to calling
mapToScene(<a href="qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>,
<i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in Qt 4.3.</p>
<h3 class="fn"><a name="mapToScene-6" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapToScene (<i>self</i>, float <i>ax</i>, float <i>ay</i>, float <i>w</i>, float <i>h</i>)</h3><p>This is an overloaded function.</p>
<p>This convenience function is equivalent to calling
mapToScene(<a href="qpointf.html">QPointF</a>(<i>x</i>,
<i>y</i>)).</p>
<h3 class="fn"><a name="matrix" /><a href="qmatrix.html">QMatrix</a> QGraphicsItem.matrix (<i>self</i>)</h3><h3 class="fn"><a name="mouseDoubleClickEvent" />QGraphicsItem.mouseDoubleClickEvent (<i>self</i>, <a href="qgraphicsscenemouseevent.html">QGraphicsSceneMouseEvent</a> <i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive mouse doubleclick events for this item.</p>
<p>When doubleclicking an item, the item will first receive a mouse
press event, followed by a release event (i.e., a click), then a
doubleclick event, and finally a release event.</p>
<p>Calling <a href="qevent.html#ignore">QEvent.ignore</a>() or
<a href="qevent.html#accept">QEvent.accept</a>() on <i>event</i>
has no effect.</p>
<p>The default implementation calls <a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>(). If you
want to keep the base implementation when reimplementing this
function, call QGraphicsItem.mouseDoubleClickEvent() in your
reimplementation.</p>
<p>Note that an item will not receive double click events if it is
neither <a href="qgraphicsitem.html#GraphicsItemFlag-enum">selectable</a> nor
<a href="qgraphicsitem.html#GraphicsItemFlag-enum">movable</a>
(single mouse clicks are ignored in this case, and that stops the
generation of double clicks).</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>(),
<a href="qgraphicsitem.html#mouseMoveEvent">mouseMoveEvent</a>(),
<a href="qgraphicsitem.html#mouseReleaseEvent">mouseReleaseEvent</a>(), and
<a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().</p>
<h3 class="fn"><a name="mouseMoveEvent" />QGraphicsItem.mouseMoveEvent (<i>self</i>, <a href="qgraphicsscenemouseevent.html">QGraphicsSceneMouseEvent</a> <i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive mouse move events for this item. If you do receive this
event, you can be certain that this item also received a mouse
press event, and that this item is the current mouse grabber.</p>
<p>Calling <a href="qevent.html#ignore">QEvent.ignore</a>() or
<a href="qevent.html#accept">QEvent.accept</a>() on <i>event</i>
has no effect.</p>
<p>The default implementation handles basic item interaction, such
as selection and moving. If you want to keep the base
implementation when reimplementing this function, call
QGraphicsItem.mouseMoveEvent() in your reimplementation.</p>
<p>Please note that <a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>() decides
which graphics item it is that receives mouse events. See the
<a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>()
description for details.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>(),
<a href="qgraphicsitem.html#mouseReleaseEvent">mouseReleaseEvent</a>(),
<a href="qgraphicsitem.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a>(),
and <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().</p>
<h3 class="fn"><a name="mousePressEvent" />QGraphicsItem.mousePressEvent (<i>self</i>, <a href="qgraphicsscenemouseevent.html">QGraphicsSceneMouseEvent</a> <i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive mouse press events for this item. Mouse press events are
only delivered to items that accept the mouse button that is
pressed. By default, an item accepts all mouse buttons, but you can
change this by calling <a href="qgraphicsitem.html#setAcceptedMouseButtons">setAcceptedMouseButtons</a>().</p>
<p>The mouse press event decides which item should become the mouse
grabber (see <a href="qgraphicsscene.html#mouseGrabberItem">QGraphicsScene.mouseGrabberItem</a>()).
If you do not reimplement this function, the press event will
propagate to any topmost item beneath this item, and no other mouse
events will be delivered to this item.</p>
<p>If you do reimplement this function, <i>event</i> will by
default be accepted (see <a href="qevent.html#accept">QEvent.accept</a>()), and this item is then
the mouse grabber. This allows the item to receive future move,
release and doubleclick events. If you call <a href="qevent.html#ignore">QEvent.ignore</a>() on <i>event</i>, this
item will lose the mouse grab, and <i>event</i> will propagate to
any topmost item beneath. No further mouse events will be delivered
to this item unless a new mouse press event is received.</p>
<p>The default implementation handles basic item interaction, such
as selection and moving. If you want to keep the base
implementation when reimplementing this function, call
QGraphicsItem.mousePressEvent() in your reimplementation.</p>
<p>The event is <a href="qevent.html#ignore">QEvent.ignore</a>()d
for items that are neither <a href="qgraphicsitem.html#GraphicsItemFlag-enum">movable</a> nor <a href="qgraphicsitem.html#GraphicsItemFlag-enum">selectable</a>.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mouseMoveEvent">mouseMoveEvent</a>(), <a href="qgraphicsitem.html#mouseReleaseEvent">mouseReleaseEvent</a>(),
<a href="qgraphicsitem.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a>(),
and <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().</p>
<h3 class="fn"><a name="mouseReleaseEvent" />QGraphicsItem.mouseReleaseEvent (<i>self</i>, <a href="qgraphicsscenemouseevent.html">QGraphicsSceneMouseEvent</a> <i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive mouse release events for this item.</p>
<p>Calling <a href="qevent.html#ignore">QEvent.ignore</a>() or
<a href="qevent.html#accept">QEvent.accept</a>() on <i>event</i>
has no effect.</p>
<p>The default implementation handles basic item interaction, such
as selection and moving. If you want to keep the base
implementation when reimplementing this function, call
QGraphicsItem.mouseReleaseEvent() in your reimplementation.</p>
<p>Please note that <a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>() decides
which graphics item it is that receives mouse events. See the
<a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>()
description for details.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>(),
<a href="qgraphicsitem.html#mouseMoveEvent">mouseMoveEvent</a>(),
<a href="qgraphicsitem.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a>(),
and <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().</p>
<h3 class="fn"><a name="moveBy" />QGraphicsItem.moveBy (<i>self</i>, float <i>dx</i>, float <i>dy</i>)</h3><p>Moves the item by <i>dx</i> points horizontally, and <i>dy</i>
point vertically. This function is equivalent to calling
setPos(<a href="qgraphicsitem.html#pos">pos</a>() + <a href="qpointf.html">QPointF</a>(<i>dx</i>, <i>dy</i>)).</p>
<h3 class="fn"><a name="opacity" />float QGraphicsItem.opacity (<i>self</i>)</h3><p>Returns this item's local opacity, which is between 0.0
(transparent) and 1.0 (opaque). This value is combined with parent
and ancestor values into the <a href="qgraphicsitem.html#effectiveOpacity">effectiveOpacity</a>(). The
effective opacity decides how the item is rendered.</p>
<p>The opacity property decides the state of the painter passed to
the <a href="qgraphicsitem.html#paint">paint</a>() function. If the
item is cached, i.e., <a href="qgraphicsitem.html#CacheMode-enum">ItemCoordinateCache</a> or
<a href="qgraphicsitem.html#CacheMode-enum">DeviceCoordinateCache</a>, the
effective property will be applied to the item's cache as it is
rendered.</p>
<p>The default opacity is 1.0; fully opaque.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setOpacity">setOpacity</a>(), <a href="qgraphicsitem.html#paint">paint</a>(), <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIgnoresParentOpacity</a>,
and <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemDoesntPropagateOpacityToChildren</a>.</p>
<h3 class="fn"><a name="opaqueArea" /><a href="qpainterpath.html">QPainterPath</a> QGraphicsItem.opaqueArea (<i>self</i>)</h3><p>This virtual function returns a shape representing the area
where this item is opaque. An area is opaque if it is filled using
an opaque brush or color (i.e., not transparent).</p>
<p>This function is used by <a href="qgraphicsitem.html#isObscuredBy">isObscuredBy</a>(), which is
called by underlying items to determine if they are obscured by
this item.</p>
<p>The default implementation returns an empty <a href="qpainterpath.html">QPainterPath</a>, indicating that this item is
completely transparent and does not obscure any other items.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#isObscuredBy">isObscuredBy</a>(), <a href="qgraphicsitem.html#isObscured">isObscured</a>(), and <a href="qgraphicsitem.html#shape">shape</a>().</p>
<h3 class="fn"><a name="paint" />QGraphicsItem.paint (<i>self</i>, <a href="qpainter.html">QPainter</a> <i>painter</i>, <a href="qstyleoptiongraphicsitem.html">QStyleOptionGraphicsItem</a> <i>option</i>, <a href="qwidget.html">QWidget</a> <i>widget</i> = None)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>This function, which is usually called by <a href="qgraphicsview.html">QGraphicsView</a>, paints the contents of an
item in local coordinates.</p>
<p>Reimplement this function in a <a href="qgraphicsitem.html">QGraphicsItem</a> subclass to provide the
item's painting implementation, using <i>painter</i>. The
<i>option</i> parameter provides style options for the item, such
as its state, exposed area and its level-of-detail hints. The
<i>widget</i> argument is optional. If provided, it points to the
widget that is being painted on; otherwise, it is 0. For cached
painting, <i>widget</i> is always 0.</p>
<pre class="cpp">
<span class="type">void</span> RoundRectItem<span class="operator">.</span>paint(<span class="type"><a href="qpainter.html">QPainter</a></span> <span class="operator">*</span>painter<span class="operator">,</span>
<span class="keyword">const</span> <span class="type"><a href="qstyleoptiongraphicsitem.html">QStyleOptionGraphicsItem</a></span> <span class="operator">*</span>option<span class="operator">,</span>
<span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>widget)
{
painter<span class="operator">-</span><span class="operator">></span>drawRoundedRect(<span class="operator">-</span><span class="number">10</span><span class="operator">,</span> <span class="operator">-</span><span class="number">10</span><span class="operator">,</span> <span class="number">20</span><span class="operator">,</span> <span class="number">20</span><span class="operator">,</span> <span class="number">5</span><span class="operator">,</span> <span class="number">5</span>);
}
</pre>
<p>The painter's pen is 0-width by default, and its pen is
initialized to the <a href="qpalette.html#ColorRole-enum">QPalette.Text</a> brush from the
paint device's palette. The brush is initialized to <a href="qpalette.html#ColorRole-enum">QPalette.Window</a>.</p>
<p>Make sure to constrain all painting inside the boundaries of
<a href="qgraphicsitem.html#boundingRect">boundingRect</a>() to
avoid rendering artifacts (as <a href="qgraphicsview.html">QGraphicsView</a> does not clip the painter
for you). In particular, when <a href="qpainter.html">QPainter</a>
renders the outline of a shape using an assigned <a href="qpen.html">QPen</a>, half of the outline will be drawn outside,
and half inside, the shape you're rendering (e.g., with a pen width
of 2 units, you must draw outlines 1 unit inside <a href="qgraphicsitem.html#boundingRect">boundingRect</a>()). <a href="qgraphicsitem.html">QGraphicsItem</a> does not support use of
cosmetic pens with a non-zero width.</p>
<p>All painting is done in local coordinates.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setCacheMode">setCacheMode</a>(), <a href="qpen.html#width">QPen.width</a>(), <a href="graphicsview.html#item-coordinates">Item Coordinates</a>, and
<a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemUsesExtendedStyleOption</a>.</p>
<h3 class="fn"><a name="panel" /><a href="qgraphicsitem.html">QGraphicsItem</a> QGraphicsItem.panel (<i>self</i>)</h3><p>Returns the item's panel, or 0 if this item does not have a
panel. If the item is a panel, it will return itself. Otherwise it
will return the closest ancestor that is a panel.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#isPanel">isPanel</a>() and <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsPanel</a>.</p>
<h3 class="fn"><a name="panelModality" /><a href="qgraphicsitem.html#PanelModality-enum">PanelModality</a> QGraphicsItem.panelModality (<i>self</i>)</h3><p>Returns the modality for this item.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setPanelModality">setPanelModality</a>().</p>
<h3 class="fn"><a name="parentItem" /><a href="qgraphicsitem.html">QGraphicsItem</a> QGraphicsItem.parentItem (<i>self</i>)</h3><p>Returns a pointer to this item's parent item. If this item does
not have a parent, 0 is returned.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setParentItem">setParentItem</a>() and <a href="qgraphicsitem.html#childItems">childItems</a>().</p>
<h3 class="fn"><a name="parentObject" /><a href="qgraphicsobject.html">QGraphicsObject</a> QGraphicsItem.parentObject (<i>self</i>)</h3><p>Returns a pointer to the item's parent, cast to a <a href="qgraphicsobject.html">QGraphicsObject</a>. returns 0 if the parent
item is not a <a href="qgraphicsobject.html">QGraphicsObject</a>.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#parentItem">parentItem</a>() and <a href="qgraphicsitem.html#childItems">childItems</a>().</p>
<h3 class="fn"><a name="parentWidget" /><a href="qgraphicswidget.html">QGraphicsWidget</a> QGraphicsItem.parentWidget (<i>self</i>)</h3><p>Returns a pointer to the item's parent widget. The item's parent
widget is the closest parent item that is a widget.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#parentItem">parentItem</a>() and <a href="qgraphicsitem.html#childItems">childItems</a>().</p>
<h3 class="fn"><a name="pos" /><a href="qpointf.html">QPointF</a> QGraphicsItem.pos (<i>self</i>)</h3><p>Returns the position of the item in parent coordinates. If the
item has no parent, its position is given in scene coordinates.</p>
<p>The position of the item describes its origin (local coordinate
(0, 0)) in parent coordinates; this function returns the same as
mapToParent(0, 0).</p>
<p>For convenience, you can also call <a href="qgraphicsitem.html#scenePos">scenePos</a>() to determine the
item's position in scene coordinates, regardless of its parent.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#x">x</a>(), <a href="qgraphicsitem.html#y">y</a>(), <a href="qgraphicsitem.html#setPos">setPos</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="prepareGeometryChange" />QGraphicsItem.prepareGeometryChange (<i>self</i>)</h3><p>Prepares the item for a geometry change. Call this function
before changing the bounding rect of an item to keep <a href="qgraphicsscene.html">QGraphicsScene</a>'s index up to date.</p>
<p>prepareGeometryChange() will call <a href="qgraphicsitem.html#update">update</a>() if this is necessary.</p>
<p>Example:</p>
<pre class="cpp">
<span class="type">void</span> CircleItem<span class="operator">.</span>setRadius(<span class="type"><a href="qtcore.html#qreal-typedef">qreal</a></span> newRadius)
{
<span class="keyword">if</span> (radius <span class="operator">!</span><span class="operator">=</span> newRadius) {
prepareGeometryChange();
radius <span class="operator">=</span> newRadius;
}
}
</pre>
<p><b>See also</b> <a href="qgraphicsitem.html#boundingRect">boundingRect</a>().</p>
<h3 class="fn"><a name="removeSceneEventFilter" />QGraphicsItem.removeSceneEventFilter (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>filterItem</i>)</h3><p>Removes an event filter on this item from <i>filterItem</i>.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#installSceneEventFilter">installSceneEventFilter</a>().</p>
<h3 class="fn"><a name="resetMatrix" />QGraphicsItem.resetMatrix (<i>self</i>)</h3><h3 class="fn"><a name="resetTransform" />QGraphicsItem.resetTransform (<i>self</i>)</h3><p>Resets this item's transformation matrix to the identity matrix
or all the transformation properties to their default values. This
is equivalent to calling <tt>setTransform(QTransform())</tt>.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setTransform">setTransform</a>() and <a href="qgraphicsitem.html#transform">transform</a>().</p>
<h3 class="fn"><a name="rotate" />QGraphicsItem.rotate (<i>self</i>, float <i>angle</i>)</h3><h3 class="fn"><a name="rotation" />float QGraphicsItem.rotation (<i>self</i>)</h3><p>Returns the clockwise rotation, in degrees, around the Z axis.
The default value is 0 (i.e., the item is not rotated).</p>
<p>The rotation is combined with the item's <a href="qgraphicsitem.html#scale">scale</a>(), <a href="qgraphicsitem.html#transform">transform</a>() and <a href="qgraphicsitem.html#transformations">transformations</a>() to map
the item's coordinate system to the parent item.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setRotation">setRotation</a>(), <a href="qgraphicsitem.html#transformOriginPoint">transformOriginPoint</a>(),
and <a href="qgraphicsitem.html#transformations">Transformations</a>.</p>
<h3 class="fn"><a name="scale" />QGraphicsItem.scale (<i>self</i>, float <i>sx</i>, float <i>sy</i>)</h3><p>Returns the scale factor of the item. The default scale factor
is 1.0 (i.e., the item is not scaled).</p>
<p>The scale is combined with the item's <a href="qgraphicsitem.html#rotation">rotation</a>(), <a href="qgraphicsitem.html#transform">transform</a>() and <a href="qgraphicsitem.html#transformations">transformations</a>() to map
the item's coordinate system to the parent item.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setScale">setScale</a>(), <a href="qgraphicsitem.html#rotation">rotation</a>(), and <a href="qgraphicsitem.html#transformations">Transformations</a>.</p>
<h3 class="fn"><a name="scale-2" />float QGraphicsItem.scale (<i>self</i>)</h3><h3 class="fn"><a name="scene" /><a href="qgraphicsscene.html">QGraphicsScene</a> QGraphicsItem.scene (<i>self</i>)</h3><p>Returns the current scene for the item, or 0 if the item is not
stored in a scene.</p>
<p>To add or move an item to a scene, call <a href="qgraphicsscene.html#addItem">QGraphicsScene.addItem</a>().</p>
<h3 class="fn"><a name="sceneBoundingRect" /><a href="qrectf.html">QRectF</a> QGraphicsItem.sceneBoundingRect (<i>self</i>)</h3><p>Returns the bounding rect of this item in scene coordinates, by
combining <a href="qgraphicsitem.html#sceneTransform">sceneTransform</a>() with
<a href="qgraphicsitem.html#boundingRect">boundingRect</a>().</p>
<p><b>See also</b> <a href="qgraphicsitem.html#boundingRect">boundingRect</a>() and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="sceneEvent" />bool QGraphicsItem.sceneEvent (<i>self</i>, <a href="qevent.html">QEvent</a> <i>event</i>)</h3><p>This virtual function receives events to this item. Reimplement
this function to intercept events before they are dispatched to the
specialized event handlers <a href="qgraphicsitem.html#contextMenuEvent">contextMenuEvent</a>(),
<a href="qgraphicsitem.html#focusInEvent">focusInEvent</a>(),
<a href="qgraphicsitem.html#focusOutEvent">focusOutEvent</a>(),
<a href="qgraphicsitem.html#hoverEnterEvent">hoverEnterEvent</a>(),
<a href="qgraphicsitem.html#hoverMoveEvent">hoverMoveEvent</a>(),
<a href="qgraphicsitem.html#hoverLeaveEvent">hoverLeaveEvent</a>(),
<a href="qgraphicsitem.html#keyPressEvent">keyPressEvent</a>(),
<a href="qgraphicsitem.html#keyReleaseEvent">keyReleaseEvent</a>(),
<a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>(),
<a href="qgraphicsitem.html#mouseReleaseEvent">mouseReleaseEvent</a>(),
<a href="qgraphicsitem.html#mouseMoveEvent">mouseMoveEvent</a>(),
and <a href="qgraphicsitem.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a>().</p>
<p>Returns true if the event was recognized and handled; otherwise,
(e.g., if the event type was not recognized,) false is
returned.</p>
<p><i>event</i> is the intercepted event.</p>
<h3 class="fn"><a name="sceneEventFilter" />bool QGraphicsItem.sceneEventFilter (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>watched</i>, <a href="qevent.html">QEvent</a> <i>event</i>)</h3><p>Filters events for the item <i>watched</i>. <i>event</i> is the
filtered event.</p>
<p>Reimplementing this function in a subclass makes it possible for
the item to be used as an event filter for other items,
intercepting all the events send to those items before they are
able to respond.</p>
<p>Reimplementations must return true to prevent further processing
of a given event, ensuring that it will not be delivered to the
watched item, or return false to indicate that the event should be
propagated further by the event system.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#installSceneEventFilter">installSceneEventFilter</a>().</p>
<h3 class="fn"><a name="sceneMatrix" /><a href="qmatrix.html">QMatrix</a> QGraphicsItem.sceneMatrix (<i>self</i>)</h3><h3 class="fn"><a name="scenePos" /><a href="qpointf.html">QPointF</a> QGraphicsItem.scenePos (<i>self</i>)</h3><p>Returns the item's position in scene coordinates. This is
equivalent to calling <tt>mapToScene(0, 0)</tt>.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#pos">pos</a>(),
<a href="qgraphicsitem.html#sceneTransform">sceneTransform</a>(),
and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="sceneTransform" /><a href="qtransform.html">QTransform</a> QGraphicsItem.sceneTransform (<i>self</i>)</h3><p>Returns this item's scene transformation matrix. This matrix can
be used to map coordinates and geometrical shapes from this item's
local coordinate system to the scene's coordinate system. To map
coordinates from the scene, you must first invert the returned
matrix.</p>
<p>Example:</p>
<pre class="cpp">
<span class="type"><a href="qgraphicsrectitem.html">QGraphicsRectItem</a></span> rect;
rect<span class="operator">.</span><a href="qgraphicsitem.html#setPos">setPos</a>(<span class="number">100</span><span class="operator">,</span> <span class="number">100</span>);
rect<span class="operator">.</span>sceneTransform()<span class="operator">.</span>map(<span class="type"><a href="qpointf.html">QPointF</a></span>(<span class="number">0</span><span class="operator">,</span> <span class="number">0</span>));
<span class="comment">// returns QPointF(100, 100);</span>
rect<span class="operator">.</span>sceneTransform()<span class="operator">.</span>inverted()<span class="operator">.</span>map(<span class="type"><a href="qpointf.html">QPointF</a></span>(<span class="number">100</span><span class="operator">,</span> <span class="number">100</span>));
<span class="comment">// returns QPointF(0, 0);</span>
</pre>
<p>Unlike <a href="qgraphicsitem.html#transform">transform</a>(),
which returns only an item's local transformation, this function
includes the item's (and any parents') position, and all the
transfomation properties.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#transform">transform</a>(), <a href="qgraphicsitem.html#setTransform">setTransform</a>(), <a href="qgraphicsitem.html#scenePos">scenePos</a>(), <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>, and <a href="qgraphicsitem.html#transformations">Transformations</a>.</p>
<h3 class="fn"><a name="scroll" />QGraphicsItem.scroll (<i>self</i>, float <i>dx</i>, float <i>dy</i>, <a href="qrectf.html">QRectF</a> <i>rect</i> = QRectF())</h3><p>Scrolls the contents of <i>rect</i> by <i>dx</i>, <i>dy</i>. If
<i>rect</i> is a null rect (the default), the item's bounding rect
is scrolled.</p>
<p>Scrolling provides a fast alternative to simply redrawing when
the contents of the item (or parts of the item) are shifted
vertically or horizontally. Depending on the current transformation
and the capabilities of the paint device (i.e., the viewport), this
operation may consist of simply moving pixels from one location to
another using memmove(). In most cases this is faster than
rerendering the entire area.</p>
<p>After scrolling, the item will issue an update for the newly
exposed areas. If scrolling is not supported (e.g., you are
rendering to an OpenGL viewport, which does not benefit from scroll
optimizations), this function is equivalent to calling
update(<i>rect</i>).</p>
<p><b>Note:</b> Scrolling is only supported when <a href="qgraphicsitem.html#CacheMode-enum">QGraphicsItem.ItemCoordinateCache</a>
is enabled; in all other cases calling this function is equivalent
to calling update(<i>rect</i>). If you for sure know that the item
is opaque and not overlapped by other items, you can map the
<i>rect</i> to viewport coordinates and scroll the viewport.</p>
<pre class="cpp">
<span class="type"><a href="qtransform.html">QTransform</a></span> xform <span class="operator">=</span> item<span class="operator">-</span><span class="operator">></span><a href="qgraphicsitem.html#deviceTransform">deviceTransform</a>(view<span class="operator">-</span><span class="operator">></span>viewportTransform());
<span class="type"><a href="qrect.html">QRect</a></span> deviceRect <span class="operator">=</span> xform<span class="operator">.</span>mapRect(rect)<span class="operator">.</span>toAlignedRect();
view<span class="operator">-</span><span class="operator">></span>viewport()<span class="operator">-</span><span class="operator">></span>scroll(dx<span class="operator">,</span> dy<span class="operator">,</span> deviceRect);
</pre>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#boundingRect">boundingRect</a>().</p>
<h3 class="fn"><a name="setAcceptDrops" />QGraphicsItem.setAcceptDrops (<i>self</i>, bool <i>on</i>)</h3><p>If <i>on</i> is true, this item will accept drag and drop
events; otherwise, it is transparent for drag and drop events. By
default, items do not accept drag and drop events.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#acceptDrops">acceptDrops</a>().</p>
<h3 class="fn"><a name="setAcceptedMouseButtons" />QGraphicsItem.setAcceptedMouseButtons (<i>self</i>, <a href="qt-mousebuttons.html">Qt.MouseButtons</a> <i>buttons</i>)</h3><p>Sets the mouse <i>buttons</i> that this item accepts mouse
events for.</p>
<p>By default, all mouse buttons are accepted. If an item accepts a
mouse button, it will become the mouse grabber item when a mouse
press event is delivered for that button. However, if the item does
not accept the mouse button, <a href="qgraphicsscene.html">QGraphicsScene</a> will forward the mouse
events to the first item beneath it that does.</p>
<p>To disable mouse events for an item (i.e., make it transparent
for mouse events), call setAcceptedMouseButtons(0).</p>
<p><b>See also</b> <a href="qgraphicsitem.html#acceptedMouseButtons">acceptedMouseButtons</a>()
and <a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>().</p>
<h3 class="fn"><a name="setAcceptHoverEvents" />QGraphicsItem.setAcceptHoverEvents (<i>self</i>, bool <i>enabled</i>)</h3><p>If <i>enabled</i> is true, this item will accept hover events;
otherwise, it will ignore them. By default, items do not accept
hover events.</p>
<p>Hover events are delivered when there is no current mouse
grabber item. They are sent when the mouse cursor enters an item,
when it moves around inside the item, and when the cursor leaves an
item. Hover events are commonly used to highlight an item when it's
entered, and for tracking the mouse cursor as it hovers over the
item (equivalent to <a href="qwidget.html#mouseTracking-prop">QWidget.mouseTracking</a>).</p>
<p>Parent items receive hover enter events before their children,
and leave events after their children. The parent does not receive
a hover leave event if the cursor enters a child, though; the
parent stays "hovered" until the cursor leaves its area, including
its children's areas.</p>
<p>If a parent item handles child events, it will receive hover
move, drag move, and drop events as the cursor passes through its
children, but it does not receive hover enter and hover leave, nor
drag enter and drag leave events on behalf of its children.</p>
<p>A <a href="qgraphicswidget.html">QGraphicsWidget</a> with window
decorations will accept hover events regardless of the value of
<a href="qgraphicsitem.html#acceptHoverEvents">acceptHoverEvents</a>().</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#acceptHoverEvents">acceptHoverEvents</a>(),
<a href="qgraphicsitem.html#hoverEnterEvent">hoverEnterEvent</a>(),
<a href="qgraphicsitem.html#hoverMoveEvent">hoverMoveEvent</a>(),
and <a href="qgraphicsitem.html#hoverLeaveEvent">hoverLeaveEvent</a>().</p>
<h3 class="fn"><a name="setAcceptsHoverEvents" />QGraphicsItem.setAcceptsHoverEvents (<i>self</i>, bool <i>enabled</i>)</h3><h3 class="fn"><a name="setAcceptTouchEvents" />QGraphicsItem.setAcceptTouchEvents (<i>self</i>, bool <i>enabled</i>)</h3><p>If <i>enabled</i> is true, this item will accept <a href="qtouchevent.html">touch events</a>; otherwise, it will ignore
them. By default, items do not accept touch events.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#acceptTouchEvents">acceptTouchEvents</a>().</p>
<h3 class="fn"><a name="setActive" />QGraphicsItem.setActive (<i>self</i>, bool <i>active</i>)</h3><p>If <i>active</i> is true, and the scene is active, this item's
panel will be activated. Otherwise, the panel is deactivated.</p>
<p>If the item is not part of an active scene, <i>active</i> will
decide what happens to the panel when the scene becomes active or
the item is added to the scene. If true, the item's panel will be
activated when the item is either added to the scene or the scene
is activated. Otherwise, the item will stay inactive independent of
the scene's activated state.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#isPanel">isPanel</a>(), <a href="qgraphicsscene.html#setActivePanel">QGraphicsScene.setActivePanel</a>(),
and <a href="qgraphicsscene.html#isActive">QGraphicsScene.isActive</a>().</p>
<h3 class="fn"><a name="setBoundingRegionGranularity" />QGraphicsItem.setBoundingRegionGranularity (<i>self</i>, float <i>granularity</i>)</h3><p>Sets the bounding region granularity to <i>granularity</i>; a
value between and including 0 and 1. The default value is 0 (i.e.,
the lowest granularity, where the bounding region corresponds to
the item's bounding rectangle).</p>
<p>The granularity is used by <a href="qgraphicsitem.html#boundingRegion">boundingRegion</a>() to
calculate how fine the bounding region of the item should be. The
highest achievable granularity is 1, where <a href="qgraphicsitem.html#boundingRegion">boundingRegion</a>() will
return the finest outline possible for the respective device (e.g.,
for a <a href="qgraphicsview.html">QGraphicsView</a> viewport, this
gives you a pixel-perfect bounding region). The lowest possible
granularity is 0. The value of <i>granularity</i> describes the
ratio between device resolution and the resolution of the bounding
region (e.g., a value of 0.25 will provide a region where each
chunk corresponds to 4x4 device units / pixels).</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#boundingRegionGranularity">boundingRegionGranularity</a>().</p>
<h3 class="fn"><a name="setCacheMode" />QGraphicsItem.setCacheMode (<i>self</i>, <a href="qgraphicsitem.html#CacheMode-enum">CacheMode</a> <i>mode</i>, <a href="qsize.html">QSize</a> <i>logicalCacheSize</i> = QSize())</h3><p>Sets the item's cache mode to <i>mode</i>.</p>
<p>The optional <i>logicalCacheSize</i> argument is used only by
<a href="qgraphicsitem.html#CacheMode-enum">ItemCoordinateCache</a>
mode, and describes the resolution of the cache buffer; if
<i>logicalCacheSize</i> is (100, 100), <a href="qgraphicsitem.html">QGraphicsItem</a> will fit the item into
100x100 pixels in graphics memory, regardless of the logical size
of the item itself. By default <a href="qgraphicsitem.html">QGraphicsItem</a> uses the size of <a href="qgraphicsitem.html#boundingRect">boundingRect</a>(). For all other
cache modes than <a href="qgraphicsitem.html#CacheMode-enum">ItemCoordinateCache</a>,
<i>logicalCacheSize</i> is ignored.</p>
<p>Caching can speed up rendering if your item spends a significant
time redrawing itself. In some cases the cache can also slow down
rendering, in particular when the item spends less time redrawing
than <a href="qgraphicsitem.html">QGraphicsItem</a> spends
redrawing from the cache. When enabled, the item's <a href="qgraphicsitem.html#paint">paint</a>() function will be called only
once for each call to <a href="qgraphicsitem.html#update">update</a>(); for any subsequent
repaint requests, the Graphics View framework will redraw from the
cache. This approach works particularly well with <a href="qglwidget.html">QGLWidget</a>, which stores all the cache as
OpenGL textures.</p>
<p>Be aware that <a href="qpixmapcache.html">QPixmapCache</a>'s
cache limit may need to be changed to obtain optimal
performance.</p>
<p>You can read more about the different cache modes in the
<a href="qgraphicsitem.html#CacheMode-enum">CacheMode</a>
documentation.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#cacheMode">cacheMode</a>(), <a href="qgraphicsitem.html#CacheMode-enum">CacheMode</a>, and <a href="qpixmapcache.html#setCacheLimit">QPixmapCache.setCacheLimit</a>().</p>
<h3 class="fn"><a name="setCursor" />QGraphicsItem.setCursor (<i>self</i>, <a href="qcursor.html">QCursor</a> <i>cursor</i>)</h3><p>Sets the current cursor shape for the item to <i>cursor</i>. The
mouse cursor will assume this shape when it's over this item. See
the <a href="qt.html#CursorShape-enum">list of predefined cursor
objects</a> for a range of useful shapes.</p>
<p>An editor item might want to use an I-beam cursor:</p>
<pre class="cpp">
item<span class="operator">-</span><span class="operator">></span>setCursor(<span class="type"><a href="qt.html">Qt</a></span><span class="operator">.</span>IBeamCursor);
</pre>
<p>If no cursor has been set, the cursor of the item beneath is
used.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#cursor">cursor</a>(), <a href="qgraphicsitem.html#hasCursor">hasCursor</a>(), <a href="qgraphicsitem.html#unsetCursor">unsetCursor</a>(), <a href="qwidget.html#cursor-prop">QWidget.cursor</a>, and <a href="qapplication.html#overrideCursor">QApplication.overrideCursor</a>().</p>
<h3 class="fn"><a name="setData" />QGraphicsItem.setData (<i>self</i>, int <i>key</i>, QVariant <i>value</i>)</h3><p>Sets this item's custom data for the key <i>key</i> to
<i>value</i>.</p>
<p>Custom item data is useful for storing arbitrary properties for
any item. Qt does not use this feature for storing data; it is
provided solely for the convenience of the user.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#data">data</a>().</p>
<h3 class="fn"><a name="setEnabled" />QGraphicsItem.setEnabled (<i>self</i>, bool <i>enabled</i>)</h3><p>If <i>enabled</i> is true, the item is enabled; otherwise, it is
disabled.</p>
<p>Disabled items are visible, but they do not receive any events,
and cannot take focus nor be selected. Mouse events are discarded;
they are not propagated unless the item is also invisible, or if it
does not accept mouse events (see <a href="qgraphicsitem.html#acceptedMouseButtons">acceptedMouseButtons</a>()).
A disabled item cannot become the mouse grabber, and as a result of
this, an item loses the grab if it becomes disabled when grabbing
the mouse, just like it loses focus if it had focus when it was
disabled.</p>
<p>Disabled items are traditionally drawn using grayed-out colors
(see <a href="qpalette.html#ColorGroup-enum">QPalette.Disabled</a>).</p>
<p>If you disable a parent item, all its children will also be
disabled. If you enable a parent item, all children will be
enabled, unless they have been explicitly disabled (i.e., if you
call setEnabled(false) on a child, it will not be reenabled if its
parent is disabled, and then enabled again).</p>
<p>Items are enabled by default.</p>
<p><b>Note:</b> If you install an event filter, you can still
intercept events before they are delivered to items; this mechanism
disregards the item's enabled state.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#isEnabled">isEnabled</a>().</p>
<h3 class="fn"><a name="setFiltersChildEvents" />QGraphicsItem.setFiltersChildEvents (<i>self</i>, bool <i>enabled</i>)</h3><p>If <i>enabled</i> is true, this item is set to filter all events
for all its children (i.e., all events intented for any of its
children are instead sent to this item); otherwise, if
<i>enabled</i> is false, this item will only handle its own events.
The default value is false.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#filtersChildEvents">filtersChildEvents</a>().</p>
<h3 class="fn"><a name="setFlag" />QGraphicsItem.setFlag (<i>self</i>, <a href="qgraphicsitem.html#GraphicsItemFlag-enum">GraphicsItemFlag</a> <i>flag</i>, bool <i>enabled</i> = True)</h3><p>If <i>enabled</i> is true, the item flag <i>flag</i> is enabled;
otherwise, it is disabled.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#flags">flags</a>()
and <a href="qgraphicsitem.html#setFlags">setFlags</a>().</p>
<h3 class="fn"><a name="setFlags" />QGraphicsItem.setFlags (<i>self</i>, <a href="qgraphicsitem-graphicsitemflags.html">GraphicsItemFlags</a> <i>flags</i>)</h3><p>Sets the item flags to <i>flags</i>. All flags in <i>flags</i>
are enabled; all flags not in <i>flags</i> are disabled.</p>
<p>If the item had focus and <i>flags</i> does not enable <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsFocusable</a>, the
item loses focus as a result of calling this function. Similarly,
if the item was selected, and <i>flags</i> does not enabled
<a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsSelectable</a>,
the item is automatically unselected.</p>
<p>By default, no flags are enabled. (<a href="qgraphicswidget.html">QGraphicsWidget</a> enables the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a>
flag by default in order to track position changes.)</p>
<p><b>See also</b> <a href="qgraphicsitem.html#flags">flags</a>()
and <a href="qgraphicsitem.html#setFlag">setFlag</a>().</p>
<h3 class="fn"><a name="setFocus" />QGraphicsItem.setFocus (<i>self</i>, <a href="qt.html#FocusReason-enum">Qt.FocusReason</a> <i>focusReason</i> = Qt.OtherFocusReason)</h3><p>Gives keyboard input focus to this item. The <i>focusReason</i>
argument will be passed into any <a href="qfocusevent.html">focus
event</a> generated by this function; it is used to give an
explanation of what caused the item to get focus.</p>
<p>Only enabled items that set the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsFocusable</a> flag
can accept keyboard focus.</p>
<p>If this item is not visible, not active, or not associated with
a scene, it will not gain immediate input focus. However, it will
be registered as the preferred focus item for its subtree of items,
should it later become visible.</p>
<p>As a result of calling this function, this item will receive a
<a href="qgraphicsitem.html#focusInEvent">focus in event</a> with
<i>focusReason</i>. If another item already has focus, that item
will first receive a <a href="qgraphicsitem.html#focusOutEvent">focus out event</a> indicating
that it has lost input focus.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#clearFocus">clearFocus</a>(), <a href="qgraphicsitem.html#hasFocus">hasFocus</a>(), <a href="qgraphicsitem.html#focusItem">focusItem</a>(), and <a href="qgraphicsitem.html#focusProxy">focusProxy</a>().</p>
<h3 class="fn"><a name="setFocusProxy" />QGraphicsItem.setFocusProxy (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>item</i>)</h3><p>Sets the item's focus proxy to <i>item</i>.</p>
<p>If an item has a focus proxy, the focus proxy will receive input
focus when the item gains input focus. The item itself will still
have focus (i.e., <a href="qgraphicsitem.html#hasFocus">hasFocus</a>() will return true), but
only the focus proxy will receive the keyboard input.</p>
<p>A focus proxy can itself have a focus proxy, and so on. In such
case, keyboard input will be handled by the outermost focus
proxy.</p>
<p>The focus proxy <i>item</i> must belong to the same scene as
this item.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#focusProxy">focusProxy</a>(), <a href="qgraphicsitem.html#setFocus">setFocus</a>(), and <a href="qgraphicsitem.html#hasFocus">hasFocus</a>().</p>
<h3 class="fn"><a name="setGraphicsEffect" />QGraphicsItem.setGraphicsEffect (<i>self</i>, <a href="qgraphicseffect.html">QGraphicsEffect</a> <i>effect</i>)</h3><p>The <i>effect</i> argument has it's ownership transferred to Qt.</p><p>Sets <i>effect</i> as the item's effect. If there already is an
effect installed on this item, <a href="qgraphicsitem.html">QGraphicsItem</a> will delete the existing
effect before installing the new <i>effect</i>.</p>
<p>If <i>effect</i> is the installed on a different item,
setGraphicsEffect() will remove the effect from the item and
install it on this item.</p>
<p><a href="qgraphicsitem.html">QGraphicsItem</a> takes ownership
of <i>effect</i>.</p>
<p><b>Note:</b> This function will apply the effect on itself and
all its children.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#graphicsEffect">graphicsEffect</a>().</p>
<h3 class="fn"><a name="setGroup" />QGraphicsItem.setGroup (<i>self</i>, <a href="qgraphicsitemgroup.html">QGraphicsItemGroup</a> <i>group</i>)</h3><p>Adds this item to the item group <i>group</i>. If <i>group</i>
is 0, this item is removed from any current group and added as a
child of the previous group's parent.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#group">group</a>()
and <a href="qgraphicsscene.html#createItemGroup">QGraphicsScene.createItemGroup</a>().</p>
<h3 class="fn"><a name="setHandlesChildEvents" />QGraphicsItem.setHandlesChildEvents (<i>self</i>, bool <i>enabled</i>)</h3><h3 class="fn"><a name="setInputMethodHints" />QGraphicsItem.setInputMethodHints (<i>self</i>, <a href="qt-inputmethodhints.html">Qt.InputMethodHints</a> <i>hints</i>)</h3><p>Sets the current input method hints of this item to
<i>hints</i>.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#inputMethodHints">inputMethodHints</a>(),
<a href="qgraphicsitem.html#inputMethodQuery">inputMethodQuery</a>(), and
<a href="qinputcontext.html">QInputContext</a>.</p>
<h3 class="fn"><a name="setMatrix" />QGraphicsItem.setMatrix (<i>self</i>, <a href="qmatrix.html">QMatrix</a> <i>matrix</i>, bool <i>combine</i> = False)</h3><h3 class="fn"><a name="setOpacity" />QGraphicsItem.setOpacity (<i>self</i>, float <i>opacity</i>)</h3><p>Sets this item's local <i>opacity</i>, between 0.0 (transparent)
and 1.0 (opaque). The item's local opacity is combined with parent
and ancestor opacities into the <a href="qgraphicsitem.html#effectiveOpacity">effectiveOpacity</a>().</p>
<p>By default, opacity propagates from parent to child, so if a
parent's opacity is 0.5 and the child is also 0.5, the child's
effective opacity will be 0.25.</p>
<p>The opacity property decides the state of the painter passed to
the <a href="qgraphicsitem.html#paint">paint</a>() function. If the
item is cached, i.e., <a href="qgraphicsitem.html#CacheMode-enum">ItemCoordinateCache</a> or
<a href="qgraphicsitem.html#CacheMode-enum">DeviceCoordinateCache</a>, the
effective property will be applied to the item's cache as it is
rendered.</p>
<p>There are two item flags that affect how the item's opacity is
combined with the parent: <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIgnoresParentOpacity</a>
and <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemDoesntPropagateOpacityToChildren</a>.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#opacity">opacity</a>() and <a href="qgraphicsitem.html#effectiveOpacity">effectiveOpacity</a>().</p>
<h3 class="fn"><a name="setPanelModality" />QGraphicsItem.setPanelModality (<i>self</i>, <a href="qgraphicsitem.html#PanelModality-enum">PanelModality</a> <i>panelModality</i>)</h3><p>Sets the modality for this item to <i>panelModality</i>.</p>
<p>Changing the modality of a visible item takes effect
immediately.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#panelModality">panelModality</a>().</p>
<h3 class="fn"><a name="setParentItem" />QGraphicsItem.setParentItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>parent</i>)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Sets this item's parent item to <i>newParent</i>. If this item
already has a parent, it is first removed from the previous parent.
If <i>newParent</i> is 0, this item will become a top-level
item.</p>
<p>Note that this implicitly adds this graphics item to the scene
of the parent. You should not <a href="qgraphicsscene.html#addItem">add</a> the item to the scene
yourself.</p>
<p>Calling this function on an item that is an ancestor of
<i>newParent</i> have undefined behaviour.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#parentItem">parentItem</a>() and <a href="qgraphicsitem.html#childItems">childItems</a>().</p>
<h3 class="fn"><a name="setPos" />QGraphicsItem.setPos (<i>self</i>, <a href="qpointf.html">QPointF</a> <i>pos</i>)</h3><p>Sets the position of the item to <i>pos</i>, which is in parent
coordinates. For items with no parent, <i>pos</i> is in scene
coordinates.</p>
<p>The position of the item describes its origin (local coordinate
(0, 0)) in parent coordinates.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#pos">pos</a>(),
<a href="qgraphicsitem.html#scenePos">scenePos</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>
<h3 class="fn"><a name="setPos-2" />QGraphicsItem.setPos (<i>self</i>, float <i>ax</i>, float <i>ay</i>)</h3><p>This is an overloaded function.</p>
<p>This convenience function is equivalent to calling
setPos(<a href="qpointf.html">QPointF</a>(<i>x</i>, <i>y</i>)).</p>
<h3 class="fn"><a name="setRotation" />QGraphicsItem.setRotation (<i>self</i>, float <i>angle</i>)</h3><p>Sets the clockwise rotation <i>angle</i>, in degrees, around the
Z axis. The default value is 0 (i.e., the item is not rotated).
Assigning a negative value will rotate the item counter-clockwise.
Normally the rotation angle is in the range (-360, 360), but it's
also possible to assign values outside of this range (e.g., a
rotation of 370 degrees is the same as a rotation of 10
degrees).</p>
<p>The item is rotated around its transform origin point, which by
default is (0, 0). You can select a different transformation origin
by calling <a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>().</p>
<p>The rotation is combined with the item's <a href="qgraphicsitem.html#scale">scale</a>(), <a href="qgraphicsitem.html#transform">transform</a>() and <a href="qgraphicsitem.html#transformations">transformations</a>() to map
the item's coordinate system to the parent item.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#rotation">rotation</a>(), <a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>(),
and <a href="qgraphicsitem.html#transformations">Transformations</a>.</p>
<h3 class="fn"><a name="setScale" />QGraphicsItem.setScale (<i>self</i>, float <i>scale</i>)</h3><p>Sets the scale <i>factor</i> of the item. The default scale
factor is 1.0 (i.e., the item is not scaled). A scale factor of 0.0
will collapse the item to a single point. If you provide a negative
scale factor, the item will be flipped and mirrored (i.e., rotated
180 degrees).</p>
<p>The item is scaled around its transform origin point, which by
default is (0, 0). You can select a different transformation origin
by calling <a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>().</p>
<p>The scale is combined with the item's <a href="qgraphicsitem.html#rotation">rotation</a>(), <a href="qgraphicsitem.html#transform">transform</a>() and <a href="qgraphicsitem.html#transformations">transformations</a>() to map
the item's coordinate system to the parent item.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#scale">scale</a>(),
<a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>(),
and <a href="painting-transformations.html">Transformations
Example</a>.</p>
<h3 class="fn"><a name="setSelected" />QGraphicsItem.setSelected (<i>self</i>, bool <i>selected</i>)</h3><p>If <i>selected</i> is true and this item is selectable, this
item is selected; otherwise, it is unselected.</p>
<p>If the item is in a group, the whole group's selected state is
toggled by this function. If the group is selected, all items in
the group are also selected, and if the group is not selected, no
item in the group is selected.</p>
<p>Only visible, enabled, selectable items can be selected. If
<i>selected</i> is true and this item is either invisible or
disabled or unselectable, this function does nothing.</p>
<p>By default, items cannot be selected. To enable selection, set
the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsSelectable</a>
flag.</p>
<p>This function is provided for convenience, allowing individual
toggling of the selected state of an item. However, a more common
way of selecting items is to call <a href="qgraphicsscene.html#setSelectionArea">QGraphicsScene.setSelectionArea</a>(),
which will call this function for all visible, enabled, and
selectable items within a specified area on the scene.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#isSelected">isSelected</a>() and <a href="qgraphicsscene.html#selectedItems">QGraphicsScene.selectedItems</a>().</p>
<h3 class="fn"><a name="setToolTip" />QGraphicsItem.setToolTip (<i>self</i>, QString <i>toolTip</i>)</h3><p>Sets the item's tool tip to <i>toolTip</i>. If <i>toolTip</i> is
empty, the item's tool tip is cleared.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#toolTip">toolTip</a>() and <a href="qtooltip.html">QToolTip</a>.</p>
<h3 class="fn"><a name="setTransform" />QGraphicsItem.setTransform (<i>self</i>, <a href="qtransform.html">QTransform</a> <i>matrix</i>, bool <i>combine</i> = False)</h3><p>Sets the item's current transformation matrix to
<i>matrix</i>.</p>
<p>If <i>combine</i> is true, then <i>matrix</i> is combined with
the current matrix; otherwise, <i>matrix</i> <i>replaces</i> the
current matrix. <i>combine</i> is false by default.</p>
<p>To simplify interation with items using a transformed view,
<a href="qgraphicsitem.html">QGraphicsItem</a> provides mapTo...
and mapFrom... functions that can translate between items' and the
scene's coordinates. For example, you can call <a href="qgraphicsitem.html#mapToScene">mapToScene</a>() to map an item
coordiate to a scene coordinate, or <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>() to map from
scene coordinates to item coordinates.</p>
<p>The transformation matrix is combined with the item's <a href="qgraphicsitem.html#rotation">rotation</a>(), <a href="qgraphicsitem.html#scale">scale</a>() and <a href="qgraphicsitem.html#transformations">transformations</a>() into a
combined transformation that maps the item's coordinate system to
its parent.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#transform">transform</a>(), <a href="qgraphicsitem.html#setRotation">setRotation</a>(), <a href="qgraphicsitem.html#setScale">setScale</a>(), <a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>(),
<a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>, and <a href="qgraphicsitem.html#transformations">Transformations</a>.</p>
<h3 class="fn"><a name="setTransformations" />QGraphicsItem.setTransformations (<i>self</i>, unknown-type <i>transformations</i>)</h3><p>Sets a list of graphics <i>transformations</i> (<a href="qgraphicstransform.html">QGraphicsTransform</a>) that currently
apply to this item.</p>
<p>If all you want is to rotate or scale an item, you should call
<a href="qgraphicsitem.html#setRotation">setRotation</a>() or
<a href="qgraphicsitem.html#setScale">setScale</a>() instead. If
you want to set an arbitrary transformation on an item, you can
call <a href="qgraphicsitem.html#setTransform">setTransform</a>().</p>
<p><a href="qgraphicstransform.html">QGraphicsTransform</a> is for
applying and controlling a chain of individual transformation
operations on an item. It's particularly useful in animations,
where each transform operation needs to be interpolated
independently, or differently.</p>
<p>The transformations are combined with the item's <a href="qgraphicsitem.html#rotation">rotation</a>(), <a href="qgraphicsitem.html#scale">scale</a>() and <a href="qgraphicsitem.html#transform">transform</a>() to map the item's
coordinate system to the parent item.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#transformations">transformations</a>(),
<a href="qgraphicsitem.html#scale">scale</a>(), <a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>(),
and <a href="qgraphicsitem.html#transformations">Transformations</a>.</p>
<h3 class="fn"><a name="setTransformOriginPoint" />QGraphicsItem.setTransformOriginPoint (<i>self</i>, <a href="qpointf.html">QPointF</a> <i>origin</i>)</h3><p>Sets the <i>origin</i> point for the transformation in item
coordinates.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#transformOriginPoint">transformOriginPoint</a>()
and <a href="qgraphicsitem.html#transformations">Transformations</a>.</p>
<h3 class="fn"><a name="setTransformOriginPoint-2" />QGraphicsItem.setTransformOriginPoint (<i>self</i>, float <i>ax</i>, float <i>ay</i>)</h3><p>This is an overloaded function.</p>
<p>Sets the origin point for the transformation in item
coordinates. This is equivalent to calling
setTransformOriginPoint(<a href="qpointf.html">QPointF</a>(<i>x</i>, <i>y</i>)).</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>()
and <a href="qgraphicsitem.html#transformations">Transformations</a>.</p>
<h3 class="fn"><a name="setVisible" />QGraphicsItem.setVisible (<i>self</i>, bool <i>visible</i>)</h3><p>If <i>visible</i> is true, the item is made visible. Otherwise,
the item is made invisible. Invisible items are not painted, nor do
they receive any events. In particular, mouse events pass right
through invisible items, and are delivered to any item that may be
behind. Invisible items are also unselectable, they cannot take
input focus, and are not detected by <a href="qgraphicsscene.html">QGraphicsScene</a>'s item location
functions.</p>
<p>If an item becomes invisible while grabbing the mouse, (i.e.,
while it is receiving mouse events,) it will automatically lose the
mouse grab, and the grab is not regained by making the item visible
again; it must receive a new mouse press to regain the mouse
grab.</p>
<p>Similarly, an invisible item cannot have focus, so if the item
has focus when it becomes invisible, it will lose focus, and the
focus is not regained by simply making the item visible again.</p>
<p>If you hide a parent item, all its children will also be hidden.
If you show a parent item, all children will be shown, unless they
have been explicitly hidden (i.e., if you call setVisible(false) on
a child, it will not be reshown even if its parent is hidden, and
then shown again).</p>
<p>Items are visible by default; it is unnecessary to call
setVisible() on a new item.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#isVisible">isVisible</a>(), <a href="qgraphicsitem.html#show">show</a>(), and <a href="qgraphicsitem.html#hide">hide</a>().</p>
<h3 class="fn"><a name="setX" />QGraphicsItem.setX (<i>self</i>, float <i>x</i>)</h3><p>Set's the <i>x</i> coordinate of the item's position. Equivalent
to calling setPos(x, <a href="qgraphicsitem.html#y">y</a>()).</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#x">x</a>() and
<a href="qgraphicsitem.html#setPos">setPos</a>().</p>
<h3 class="fn"><a name="setY" />QGraphicsItem.setY (<i>self</i>, float <i>y</i>)</h3><p>Set's the <i>y</i> coordinate of the item's position. Equivalent
to calling setPos(<a href="qgraphicsitem.html#x">x</a>(), y).</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#y">y</a>(), <a href="qgraphicsitem.html#x">x</a>(), and <a href="qgraphicsitem.html#setPos">setPos</a>().</p>
<h3 class="fn"><a name="setZValue" />QGraphicsItem.setZValue (<i>self</i>, float <i>z</i>)</h3><p>Sets the Z-value of the item to <i>z</i>. The Z value decides
the stacking order of sibling (neighboring) items. A sibling item
of high Z value will always be drawn on top of another sibling item
with a lower Z value.</p>
<p>If you restore the Z value, the item's insertion order will
decide its stacking order.</p>
<p>The Z-value does not affect the item's size in any way.</p>
<p>The default Z-value is 0.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#zValue">zValue</a>(), <a href="qgraphicsitem.html#sorting">Sorting</a>, <a href="qgraphicsitem.html#stackBefore">stackBefore</a>(), and <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemStacksBehindParent</a>.</p>
<h3 class="fn"><a name="shape" /><a href="qpainterpath.html">QPainterPath</a> QGraphicsItem.shape (<i>self</i>)</h3><p>Returns the shape of this item as a <a href="qpainterpath.html">QPainterPath</a> in local coordinates. The
shape is used for many things, including collision detection, hit
tests, and for the <a href="qgraphicsscene.html#items">QGraphicsScene.items</a>()
functions.</p>
<p>The default implementation calls <a href="qgraphicsitem.html#boundingRect">boundingRect</a>() to return a
simple rectangular shape, but subclasses can reimplement this
function to return a more accurate shape for non-rectangular items.
For example, a round item may choose to return an elliptic shape
for better collision detection. For example:</p>
<pre class="cpp">
<span class="type"><a href="qpainterpath.html">QPainterPath</a></span> RoundItem<span class="operator">.</span>shape() <span class="keyword">const</span>
{
<span class="type"><a href="qpainterpath.html">QPainterPath</a></span> path;
path<span class="operator">.</span>addEllipse(boundingRect());
<span class="keyword">return</span> path;
}
</pre>
<p>The outline of a shape can vary depending on the width and style
of the pen used when drawing. If you want to include this outline
in the item's shape, you can create a shape from the stroke using
<a href="qpainterpathstroker.html">QPainterPathStroker</a>.</p>
<p>This function is called by the default implementations of
<a href="qgraphicsitem.html#contains">contains</a>() and <a href="qgraphicsitem.html#collidesWithPath">collidesWithPath</a>().</p>
<p><b>See also</b> <a href="qgraphicsitem.html#boundingRect">boundingRect</a>(), <a href="qgraphicsitem.html#contains">contains</a>(), <a href="qgraphicsitem.html#prepareGeometryChange">prepareGeometryChange</a>(),
and <a href="qpainterpathstroker.html">QPainterPathStroker</a>.</p>
<h3 class="fn"><a name="shear" />QGraphicsItem.shear (<i>self</i>, float <i>sh</i>, float <i>sv</i>)</h3><h3 class="fn"><a name="show" />QGraphicsItem.show (<i>self</i>)</h3><p>Shows the item. (Items are visible by default.)</p>
<p>This convenience function is equivalent to calling
<tt>setVisible(true)</tt>.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#hide">hide</a>() and
<a href="qgraphicsitem.html#setVisible">setVisible</a>().</p>
<h3 class="fn"><a name="stackBefore" />QGraphicsItem.stackBefore (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>sibling</i>)</h3><p>Stacks this item before <i>sibling</i>, which must be a sibling
item (i.e., the two items must share the same parent item, or must
both be toplevel items). The <i>sibling</i> must have the same Z
value as this item, otherwise calling this function will have no
effect.</p>
<p>By default, all sibling items are stacked by insertion order
(i.e., the first item you add is drawn before the next item you
add). If two items' Z values are different, then the item with the
highest Z value is drawn on top. When the Z values are the same,
the insertion order will decide the stacking order.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setZValue">setZValue</a>(), <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemStacksBehindParent</a>,
and <a href="qgraphicsitem.html#sorting">Sorting</a>.</p>
<h3 class="fn"><a name="toGraphicsObject" /><a href="qgraphicsobject.html">QGraphicsObject</a> QGraphicsItem.toGraphicsObject (<i>self</i>)</h3><p>Return the graphics item cast to a <a href="qgraphicsobject.html">QGraphicsObject</a>, if the class is
actually a graphics object, 0 otherwise.</p>
<p>This function was introduced in Qt 4.6.</p>
<h3 class="fn"><a name="toolTip" />QString QGraphicsItem.toolTip (<i>self</i>)</h3><p>Returns the item's tool tip, or an empty <a href="qstring.html">QString</a> if no tool tip has been set.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setToolTip">setToolTip</a>() and <a href="qtooltip.html">QToolTip</a>.</p>
<h3 class="fn"><a name="topLevelItem" /><a href="qgraphicsitem.html">QGraphicsItem</a> QGraphicsItem.topLevelItem (<i>self</i>)</h3><p>Returns this item's top-level item. The top-level item is the
item's topmost ancestor item whose parent is 0. If an item has no
parent, its own pointer is returned (i.e., a top-level item is its
own top-level item).</p>
<p><b>See also</b> <a href="qgraphicsitem.html#parentItem">parentItem</a>().</p>
<h3 class="fn"><a name="topLevelWidget" /><a href="qgraphicswidget.html">QGraphicsWidget</a> QGraphicsItem.topLevelWidget (<i>self</i>)</h3><p>Returns a pointer to the item's top level widget (i.e., the
item's ancestor whose parent is 0, or whose parent is not a
widget), or 0 if this item does not have a top level widget. If the
item is its own top level widget, this function returns a pointer
to the item itself.</p>
<p>This function was introduced in Qt 4.4.</p>
<h3 class="fn"><a name="transform" /><a href="qtransform.html">QTransform</a> QGraphicsItem.transform (<i>self</i>)</h3><p>Returns this item's transformation matrix.</p>
<p>The transformation matrix is combined with the item's <a href="qgraphicsitem.html#rotation">rotation</a>(), <a href="qgraphicsitem.html#scale">scale</a>() and <a href="qgraphicsitem.html#transformations">transformations</a>() into a
combined transformations for the item.</p>
<p>The default transformation matrix is an identity matrix.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setTransform">setTransform</a>() and <a href="qgraphicsitem.html#sceneTransform">sceneTransform</a>().</p>
<h3 class="fn"><a name="transformations" />unknown-type QGraphicsItem.transformations (<i>self</i>)</h3><p>Returns a list of graphics transforms that currently apply to
this item.</p>
<p><a href="qgraphicstransform.html">QGraphicsTransform</a> is for
applying and controlling a chain of individual transformation
operations on an item. It's particularly useful in animations,
where each transform operation needs to be interpolated
independently, or differently.</p>
<p>The transformations are combined with the item's <a href="qgraphicsitem.html#rotation">rotation</a>(), <a href="qgraphicsitem.html#scale">scale</a>() and <a href="qgraphicsitem.html#transform">transform</a>() to map the item's
coordinate system to the parent item.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setTransformations">setTransformations</a>(),
<a href="qgraphicsitem.html#scale">scale</a>(), <a href="qgraphicsitem.html#rotation">rotation</a>(), <a href="qgraphicsitem.html#transformOriginPoint">transformOriginPoint</a>(),
and <a href="qgraphicsitem.html#transformations">Transformations</a>.</p>
<h3 class="fn"><a name="transformOriginPoint" /><a href="qpointf.html">QPointF</a> QGraphicsItem.transformOriginPoint (<i>self</i>)</h3><p>Returns the origin point for the transformation in item
coordinates.</p>
<p>The default is <a href="qpointf.html">QPointF</a>(0,0).</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>()
and <a href="qgraphicsitem.html#transformations">Transformations</a>.</p>
<h3 class="fn"><a name="translate" />QGraphicsItem.translate (<i>self</i>, float <i>dx</i>, float <i>dy</i>)</h3><h3 class="fn"><a name="type" />int QGraphicsItem.type (<i>self</i>)</h3><p>Returns the type of an item as an int. All standard graphicsitem
classes are associated with a unique value; see <a href="qgraphicsitem.html#Type-varx">QGraphicsItem.Type</a>. This type
information is used by <a href="qgraphicsitem.html#qgraphicsitem_cast">qgraphicsitem_cast</a>() to
distinguish between types.</p>
<p>The default implementation (in <a href="qgraphicsitem.html">QGraphicsItem</a>) returns <a href="qgraphicsitem.html#UserType-var">UserType</a>.</p>
<p>To enable use of <a href="qgraphicsitem.html#qgraphicsitem_cast">qgraphicsitem_cast</a>()
with a custom item, reimplement this function and declare a Type
enum value equal to your custom item's type. Custom items must
return a value larger than or equal to <a href="qgraphicsitem.html#UserType-var">UserType</a> (65536).</p>
<p>For example:</p>
<pre class="cpp">
<span class="keyword">class</span> CustomItem : <span class="keyword">public</span> <span class="type"><a href="qgraphicsitem.html">QGraphicsItem</a></span>
{
<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
<span class="keyword">enum</span> { Type <span class="operator">=</span> UserType <span class="operator">+</span> <span class="number">1</span> };
<span class="type">int</span> type() <span class="keyword">const</span>
{
<span class="comment">// Enable the use of qgraphicsitem_cast with this item.</span>
<span class="keyword">return</span> Type;
}
<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
};
</pre>
<p><b>See also</b> <a href="qgraphicsitem.html#UserType-var">UserType</a>.</p>
<h3 class="fn"><a name="ungrabKeyboard" />QGraphicsItem.ungrabKeyboard (<i>self</i>)</h3><p>Releases the keyboard grab.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#grabKeyboard">grabKeyboard</a>() and <a href="qgraphicsitem.html#ungrabMouse">ungrabMouse</a>().</p>
<h3 class="fn"><a name="ungrabMouse" />QGraphicsItem.ungrabMouse (<i>self</i>)</h3><p>Releases the mouse grab.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#grabMouse">grabMouse</a>() and <a href="qgraphicsitem.html#ungrabKeyboard">ungrabKeyboard</a>().</p>
<h3 class="fn"><a name="unsetCursor" />QGraphicsItem.unsetCursor (<i>self</i>)</h3><p>Clears the cursor from this item.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#hasCursor">hasCursor</a>() and <a href="qgraphicsitem.html#setCursor">setCursor</a>().</p>
<h3 class="fn"><a name="update" />QGraphicsItem.update (<i>self</i>, <a href="qrectf.html">QRectF</a> <i>rect</i> = QRectF())</h3><p>Schedules a redraw of the area covered by <i>rect</i> in this
item. You can call this function whenever your item needs to be
redrawn, such as if it changes appearance or size.</p>
<p>This function does not cause an immediate paint; instead it
schedules a paint request that is processed by <a href="qgraphicsview.html">QGraphicsView</a> after control reaches the
event loop. The item will only be redrawn if it is visible in any
associated view.</p>
<p>As a side effect of the item being repainted, other items that
overlap the area <i>rect</i> may also be repainted.</p>
<p>If the item is invisible (i.e., <a href="qgraphicsitem.html#isVisible">isVisible</a>() returns false), this
function does nothing.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#paint">paint</a>()
and <a href="qgraphicsitem.html#boundingRect">boundingRect</a>().</p>
<h3 class="fn"><a name="update-2" />QGraphicsItem.update (<i>self</i>, float <i>ax</i>, float <i>ay</i>, float <i>width</i>, float <i>height</i>)</h3><p>This is an overloaded function.</p>
<p>This convenience function is equivalent to calling
update(<a href="qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>,
<i>width</i>, <i>height</i>)).</p>
<h3 class="fn"><a name="updateMicroFocus" />QGraphicsItem.updateMicroFocus (<i>self</i>)</h3><p>Updates the item's micro focus.</p>
<p>This function was introduced in Qt 4.7.</p>
<p><b>See also</b> <a href="qinputcontext.html">QInputContext</a>.</p>
<h3 class="fn"><a name="wheelEvent" />QGraphicsItem.wheelEvent (<i>self</i>, <a href="qgraphicsscenewheelevent.html">QGraphicsSceneWheelEvent</a> <i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive wheel events for this item. If you reimplement this
function, <i>event</i> will be accepted by default.</p>
<p>If you ignore the event, (i.e., by calling <a href="qevent.html#ignore">QEvent.ignore</a>(),) it will propagate to
any item beneath this item. If no items accept the event, it will
be ignored by the scene, and propagate to the view (e.g., the
view's vertical scroll bar).</p>
<p>The default implementation ignores the event.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().</p>
<h3 class="fn"><a name="window" /><a href="qgraphicswidget.html">QGraphicsWidget</a> QGraphicsItem.window (<i>self</i>)</h3><p>Returns the item's window, or 0 if this item does not have a
window. If the item is a window, it will return itself. Otherwise
it will return the closest ancestor that is a window.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#isWindow">QGraphicsWidget.isWindow</a>().</p>
<h3 class="fn"><a name="x" />float QGraphicsItem.x (<i>self</i>)</h3><p>This convenience function is equivalent to calling <a href="qgraphicsitem.html#pos">pos</a>().x().</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setX">setX</a>() and
<a href="qgraphicsitem.html#y">y</a>().</p>
<h3 class="fn"><a name="y" />float QGraphicsItem.y (<i>self</i>)</h3><p>This convenience function is equivalent to calling <a href="qgraphicsitem.html#pos">pos</a>().y().</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setY">setY</a>() and
<a href="qgraphicsitem.html#x">x</a>().</p>
<h3 class="fn"><a name="zValue" />float QGraphicsItem.zValue (<i>self</i>)</h3><p>Returns the Z-value of the item. The Z-value affects the
stacking order of sibling (neighboring) items.</p>
<p>The default Z-value is 0.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setZValue">setZValue</a>(), <a href="qgraphicsitem.html#sorting">Sorting</a>, <a href="qgraphicsitem.html#stackBefore">stackBefore</a>(), and <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemStacksBehindParent</a>.</p>
<hr /><h2>Member Documentation</h2><h3 class="fn"><a name="UserType-var" />int UserType</h3><p>This member should be treated as a constant.</p><p>The lowest permitted type value for custom items (subclasses of
<a href="qgraphicsitem.html">QGraphicsItem</a> or any of the
standard items). This value is used in conjunction with a
reimplementation of <a href="qgraphicsitem.html#type">QGraphicsItem.type</a>() and declaring a
Type enum value. Example:</p>
<pre class="cpp">
<span class="keyword">class</span> CustomItem : <span class="keyword">public</span> <span class="type"><a href="qgraphicsitem.html">QGraphicsItem</a></span>
{
<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
<span class="keyword">enum</span> { Type <span class="operator">=</span> UserType <span class="operator">+</span> <span class="number">1</span> };
<span class="type">int</span> type() <span class="keyword">const</span>
{
<span class="comment">// Enable the use of qgraphicsitem_cast with this item.</span>
<span class="keyword">return</span> Type;
}
<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
};
</pre>
<p><b>Note:</b> UserType = 65536</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.12.1 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qt.io">The Qt Company</a> 2015</td><td align="right" width="25%">Qt 4.8.7</td></tr></table></div></address></body></html>
|