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
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- porting4.qdoc -->
<title>Qt 4.8: Porting to Qt 4</title>
<link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="content">
<a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
</div>
<div class="breadcrumb toolblock">
<ul>
<li class="first"><a href="index.html">Home</a></li>
<!-- Breadcrumbs go here -->
<li>Porting to Qt 4</li>
</ul>
</div>
</div>
<div class="content mainContent">
<link rel="prev" href="porting.html" />
<link rel="next" href="porting4-virtual-functions.html" />
<p class="naviNextPrevious headerNavi">
<a class="prevPage" href="porting.html">Porting Guides</a>
<a class="nextPage" href="porting4-virtual-functions.html">Porting to Qt 4 - Virtual Functions</a>
</p><p/>
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#casting-and-object-types">Casting and Object Types</a></li>
<li class="level1"><a href="#type-names">Type Names</a></li>
<li class="level1"><a href="#enum-values">Enum Values</a></li>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#explicit-sharing">Explicit Sharing</a></li>
<li class="level1"><a href="#painting-and-redrawing-widgets">Painting and Redrawing Widgets</a></li>
<li class="level1"><a href="#compatibility-signals-and-slots">Compatibility Signals and Slots</a></li>
<li class="level1"><a href="#qaccel">QAccel</a></li>
<li class="level1"><a href="#qaccessibleinterface">QAccessibleInterface</a></li>
<li class="level1"><a href="#qaccessibletitlebar">QAccessibleTitleBar</a></li>
<li class="level1"><a href="#qaction">QAction</a></li>
<li class="level1"><a href="#qactiongroup">QActionGroup</a></li>
<li class="level1"><a href="#qapplication">QApplication</a></li>
<li class="level1"><a href="#qaquastyle">QAquaStyle</a></li>
<li class="level1"><a href="#qasciicache-t">QAsciiCache<T></a></li>
<li class="level1"><a href="#qasciidict-t">QAsciiDict<T></a></li>
<li class="level1"><a href="#qasyncio">QAsyncIO</a></li>
<li class="level1"><a href="#qbackinsertiterator">QBackInsertIterator</a></li>
<li class="level1"><a href="#qbitarray">QBitArray</a></li>
<li class="level1"><a href="#qbutton">QButton</a></li>
<li class="level1"><a href="#qbuttongroup">QButtonGroup</a></li>
<li class="level1"><a href="#qbytearray">QByteArray</a></li>
<li class="level1"><a href="#qcache-t">QCache<T></a></li>
<li class="level1"><a href="#qcanvas">QCanvas</a></li>
<li class="level1"><a href="#qcolor">QColor</a></li>
<li class="level1"><a href="#qcolorgroup">QColorGroup</a></li>
<li class="level1"><a href="#qcolordrag">QColorDrag</a></li>
<li class="level1"><a href="#qcombobox">QComboBox</a></li>
<li class="level1"><a href="#qcstring">QCString</a></li>
<li class="level1"><a href="#qcustomevent">QCustomEvent</a></li>
<li class="level1"><a href="#qdatabrowser">QDataBrowser</a></li>
<li class="level1"><a href="#qdatapump">QDataPump</a></li>
<li class="level1"><a href="#qdatasink">QDataSink</a></li>
<li class="level1"><a href="#qdatasource">QDataSource</a></li>
<li class="level1"><a href="#qdatatable">QDataTable</a></li>
<li class="level1"><a href="#qdataview">QDataView</a></li>
<li class="level1"><a href="#qdateedit">QDateEdit</a></li>
<li class="level1"><a href="#qdatetimeeditbase">QDateTimeEditBase</a></li>
<li class="level1"><a href="#qdatetimeedit">QDateTimeEdit</a></li>
<li class="level1"><a href="#qdeepcopy-t">QDeepCopy<T></a></li>
<li class="level1"><a href="#qdial">QDial</a></li>
<li class="level1"><a href="#qdict-t">QDict<T></a></li>
<li class="level1"><a href="#qdir">QDir</a></li>
<li class="level1"><a href="#qdns">QDns</a></li>
<li class="level1"><a href="#qdockarea">QDockArea</a></li>
<li class="level1"><a href="#qdockwindow">QDockWindow</a></li>
<li class="level1"><a href="#qdragobject">QDragObject</a></li>
<li class="level1"><a href="#qdropsite">QDropSite</a></li>
<li class="level1"><a href="#qeditorfactory">QEditorFactory</a></li>
<li class="level1"><a href="#qeventloop">QEventLoop</a></li>
<li class="level1"><a href="#qfiledialog">QFileDialog</a></li>
<li class="level1"><a href="#qfocusdata">QFocusData</a></li>
<li class="level1"><a href="#qfocusevent">QFocusEvent</a></li>
<li class="level1"><a href="#qfont">QFont</a></li>
<li class="level1"><a href="#qframe">QFrame</a></li>
<li class="level1"><a href="#qftp">QFtp</a></li>
<li class="level1"><a href="#qglayoutiterator">QGLayoutIterator</a></li>
<li class="level1"><a href="#qgrid">QGrid</a></li>
<li class="level1"><a href="#qgridlayout">QGridLayout</a></li>
<li class="level1"><a href="#qgridview">QGridView</a></li>
<li class="level1"><a href="#qgroupbox">QGroupBox</a></li>
<li class="level1"><a href="#qhbox">QHBox</a></li>
<li class="level1"><a href="#qheader">QHeader</a></li>
<li class="level1"><a href="#qhgroupbox">QHGroupBox</a></li>
<li class="level1"><a href="#qhttp">QHttp</a></li>
<li class="level1"><a href="#qiconfactory">QIconFactory</a></li>
<li class="level1"><a href="#qiconset">QIconSet</a></li>
<li class="level1"><a href="#qiconview">QIconView</a></li>
<li class="level1"><a href="#qimagedrag">QImageDrag</a></li>
<li class="level1"><a href="#qimageio">QImageIO</a></li>
<li class="level1"><a href="#qintcache-t">QIntCache<T></a></li>
<li class="level1"><a href="#qintdict-t">QIntDict<T></a></li>
<li class="level1"><a href="#qiodevice">QIODevice</a></li>
<li class="level1"><a href="#qiodevicesource">QIODeviceSource</a></li>
<li class="level1"><a href="#qlabel">QLabel</a></li>
<li class="level1"><a href="#qlayout">QLayout</a></li>
<li class="level1"><a href="#qlayoutiterator">QLayoutIterator</a></li>
<li class="level1"><a href="#qlineedit">QLineEdit</a></li>
<li class="level1"><a href="#qlistbox">QListBox</a></li>
<li class="level1"><a href="#qlistview">QListView</a></li>
<li class="level1"><a href="#qlocalfs">QLocalFs</a></li>
<li class="level1"><a href="#qmainwindow">QMainWindow</a></li>
<li class="level1"><a href="#qmemarray-t">QMemArray<T></a></li>
<li class="level1"><a href="#qmenubar">QMenuBar</a></li>
<li class="level1"><a href="#qmenudata">QMenuData</a></li>
<li class="level1"><a href="#qmessagebox">QMessageBox</a></li>
<li class="level1"><a href="#qmimesourcefactory">QMimeSourceFactory</a></li>
<li class="level1"><a href="#qmovie">QMovie</a></li>
<li class="level1"><a href="#qmultilineedit">QMultiLineEdit</a></li>
<li class="level1"><a href="#qnetworkprotocol">QNetworkProtocol</a></li>
<li class="level1"><a href="#qobject">QObject</a></li>
<li class="level1"><a href="#qobjectdictionary">QObjectDictionary</a></li>
<li class="level1"><a href="#qobjectlist">QObjectList</a></li>
<li class="level1"><a href="#qpaintdevice">QPaintDevice</a></li>
<li class="level1"><a href="#qpaintdevicemetrics">QPaintDeviceMetrics</a></li>
<li class="level1"><a href="#qpainter">QPainter</a></li>
<li class="level1"><a href="#qpicture">QPicture</a></li>
<li class="level1"><a href="#qpixmap">QPixmap</a></li>
<li class="level1"><a href="#qpointarray">QPointArray</a></li>
<li class="level1"><a href="#qpopupmenu">QPopupMenu</a></li>
<li class="level1"><a href="#qprinter">QPrinter</a></li>
<li class="level1"><a href="#qprocess">QProcess</a></li>
<li class="level1"><a href="#qprogressbar">QProgressBar</a></li>
<li class="level1"><a href="#qprogressdialog">QProgressDialog</a></li>
<li class="level1"><a href="#qptrcollection-t">QPtrCollection<T></a></li>
<li class="level1"><a href="#qptrdict-t">QPtrDict<T></a></li>
<li class="level1"><a href="#qptrlist-t">QPtrList<T></a></li>
<li class="level1"><a href="#qptrqueue-t">QPtrQueue<T></a></li>
<li class="level1"><a href="#qptrstack-t">QPtrStack<T></a></li>
<li class="level1"><a href="#qptrvector-t">QPtrVector<T></a></li>
<li class="level1"><a href="#qpushbutton">QPushButton</a></li>
<li class="level1"><a href="#qrangecontrol">QRangeControl</a></li>
<li class="level1"><a href="#qregexp">QRegExp</a></li>
<li class="level1"><a href="#qregion">QRegion</a></li>
<li class="level1"><a href="#qscrollbar">QScrollBar</a></li>
<li class="level1"><a href="#qscrollview">QScrollView</a></li>
<li class="level1"><a href="#qserversocket">QServerSocket</a></li>
<li class="level1"><a href="#qsettings">QSettings</a></li>
<li class="level1"><a href="#qshared">QShared</a></li>
<li class="level1"><a href="#qsignal">QSignal</a></li>
<li class="level1"><a href="#qsimplerichtext">QSimpleRichText</a></li>
<li class="level1"><a href="#qslider">QSlider</a></li>
<li class="level1"><a href="#qsocket">QSocket</a></li>
<li class="level1"><a href="#qsocketdevice">QSocketDevice</a></li>
<li class="level1"><a href="#qsortedlist">QSortedList</a></li>
<li class="level1"><a href="#qsplitter">QSplitter</a></li>
<li class="level1"><a href="#qspinbox">QSpinBox</a></li>
<li class="level1"><a href="#qsqlcursor">QSqlCursor</a></li>
<li class="level1"><a href="#qsqldatabase">QSqlDatabase</a></li>
<li class="level1"><a href="#qsqleditorfactory">QSqlEditorFactory</a></li>
<li class="level1"><a href="#qsqlerror">QSqlError</a></li>
<li class="level1"><a href="#qsqlfieldinfo">QSqlFieldInfo</a></li>
<li class="level1"><a href="#qsqlform">QSqlForm</a></li>
<li class="level1"><a href="#qsqlpropertymap">QSqlPropertyMap</a></li>
<li class="level1"><a href="#qsqlquery">QSqlQuery</a></li>
<li class="level1"><a href="#qsqlrecord">QSqlRecord</a></li>
<li class="level1"><a href="#qsqlrecordinfo">QSqlRecordInfo</a></li>
<li class="level1"><a href="#qsqlselectcursor">QSqlSelectCursor</a></li>
<li class="level1"><a href="#qstoreddrag">QStoredDrag</a></li>
<li class="level1"><a href="#qstr-i-list">QStr(I)List</a></li>
<li class="level1"><a href="#qstr-i-vec">QStr(I)Vec</a></li>
<li class="level1"><a href="#qstring">QString</a></li>
<li class="level1"><a href="#qstringlist">QStringList</a></li>
<li class="level1"><a href="#qstyle">QStyle</a></li>
<li class="level1"><a href="#qstylesheet">QStyleSheet</a></li>
<li class="level1"><a href="#qsyntaxhighlighter">QSyntaxHighlighter</a></li>
<li class="level1"><a href="#qtabbar">QTabBar</a></li>
<li class="level1"><a href="#qtabdialog">QTabDialog</a></li>
<li class="level1"><a href="#qtabwidget">QTabWidget</a></li>
<li class="level1"><a href="#qtable">QTable</a></li>
<li class="level1"><a href="#qtextcodec">QTextCodec</a></li>
<li class="level1"><a href="#qtextdrag">QTextDrag</a></li>
<li class="level1"><a href="#qtextedit">QTextEdit</a></li>
<li class="level1"><a href="#qtextistream">QTextIStream</a></li>
<li class="level1"><a href="#qtextostream">QTextOStream</a></li>
<li class="level1"><a href="#qtextostreamiterator">QTextOStreamIterator</a></li>
<li class="level1"><a href="#qtextstream">QTextStream</a></li>
<li class="level1"><a href="#qtextview">QTextView</a></li>
<li class="level1"><a href="#qtimeedit">QTimeEdit</a></li>
<li class="level1"><a href="#qtimer">QTimer</a></li>
<li class="level1"><a href="#qtoolbar">QToolBar</a></li>
<li class="level1"><a href="#qtoolbutton">QToolButton</a></li>
<li class="level1"><a href="#qtooltip">QToolTip</a></li>
<li class="level1"><a href="#quridrag">QUriDrag</a></li>
<li class="level1"><a href="#qurl">QUrl</a></li>
<li class="level1"><a href="#qurloperator">QUrlOperator</a></li>
<li class="level1"><a href="#qvaluelist-t">QValueList<T></a></li>
<li class="level1"><a href="#qvaluevector-t">QValueVector<T></a></li>
<li class="level1"><a href="#qvariant">QVariant</a></li>
<li class="level1"><a href="#qvbox">QVBox</a></li>
<li class="level1"><a href="#qvgroupbox">QVGroupBox</a></li>
<li class="level1"><a href="#qwhatsthis">QWhatsThis</a></li>
<li class="level1"><a href="#qwidget">QWidget</a></li>
<li class="level1"><a href="#qwidgetfactory">QWidgetFactory</a></li>
<li class="level1"><a href="#qwidgetintdict">QWidgetIntDict</a></li>
<li class="level1"><a href="#qwidgetlist">QWidgetList</a></li>
<li class="level1"><a href="#qwidgetplugin">QWidgetPlugin</a></li>
<li class="level1"><a href="#qwidgetstack">QWidgetStack</a></li>
<li class="level1"><a href="#qwizard">QWizard</a></li>
<li class="level1"><a href="#qworkspace">QWorkspace</a></li>
</ul>
</div>
<h1 class="title">Porting to Qt 4</h1>
<span class="subtitle"></span>
<!-- $$$porting4.html-description -->
<div class="descr"> <a name="details"></a>
<p>This document describes the process of porting applications from Qt 3 to Qt 4. If you haven't yet made the decision about porting, or are unsure about whether it is worth it, take a look at the <a href="qt4-intro.html">key features</a> offered by Qt 4. See also <a href="porting4-overview.html">Moving from Qt 3 to Qt 4</a> for tips on how to write Qt 3 code that is easy to port to Qt 4.</p>
<p><b>Other porting guides:</b></p>
<ul>
<li><a href="porting4-overview.html">Moving from Qt 3 to Qt 4</a> — covers some high level topics relevant to developers porting from Qt 3 to Qt 4.</li>
<li><a href="porting4-dnd.html">Porting to Qt 4 - Drag and Drop</a> — covers differences in the way drag and drop is handled between Qt 3 and Qt 4.</li>
<li><a href="porting4-designer.html">Porting UI Files to Qt 4</a> — describes the new format used to describe forms created with <i>Qt Designer</i>.</li>
<li><a href="graphicsview-porting.html">Porting to Graphics View</a> — provides a class-by-class overview of the differences between Qt 3's canvas API and Qt 4's Graphics View framework.</li>
<li><a href="qt3to4.html">qt3to4 - The Qt 3 to 4 Porting Tool</a> — provides an overview of a tool aimed at helping developers start the process of porting an application to Qt 4.</li>
</ul>
<p>The Qt 4 series is not binary compatible with the 3 series. This means programs compiled for Qt 3 must be recompiled to work with Qt 4. Qt 4 is also not completely <i>source</i> compatible with 3, however nearly all points of incompatibility cause compiler errors or run-time messages (rather than mysterious results). Qt 4 includes many additional features and discards obsolete functionality. Porting from Qt 3 to Qt 4 requires some effort, but once completed the considerable additional power and flexibility of Qt 4 is available for use in your applications.</p>
<p>To port code from Qt 3 to Qt 4:</p>
<ol class="1">
<li>Briefly read the porting notes below to get an idea of what to expect.</li>
<li>Be sure that your code compiles and runs well on all your target platforms with Qt 3.</li>
<li>Add the line <tt>QT += qt3support</tt> to your <tt>.pro</tt> file if you use <tt>qmake</tt>; otherwise, edit your makefile or project file to link against the <a href="qt3support.html">Qt3Support</a> library and add <tt>-DQT3_SUPPORT</tt> to your compiler flags. (You might also need to specify other libraries. See <a href="qt4-intro.html">What's New in Qt 4</a> for details.)</li>
<li>Run the <a href="qt3to4.html#qt3to4">qt3to4</a> porting tool. The tool will go through your source code and adapt it to Qt 4.</li>
<li>Follow the instructions in the <a href="porting4-designer.html">Porting UI Files to Qt 4</a> page to port Qt Designer files.</li>
<li>Recompile with Qt 4. For each error, search below for related identifiers (e.g., function names, class names). This document mentions all relevant identifiers to help you get the information you need at the cost of being a little verbose.</li>
</ol>
<p>The <a href="qt3to4.html#qt3to4">qt3to4</a> porting tool replaces occurrences of Qt 3 classes that don't exist anymore in Qt 4 with the corresponding Qt 3 support class; for example, <tt>QListBox</tt> is turned into <tt>Q3ListBox</tt>.</p>
<p>At some point, you might want to stop linking against the Qt 3 support library (<a href="qt3support.html">Qt3Support</a>) and take advantage of Qt 4's new features. The instructions below explain how to do that for each compatibility class.</p>
<p>In addition to the <a href="qt3support.html">Qt3Support</a> classes (such as <tt>Q3Action</tt>, <tt>Q3ListBox</tt>, and <tt>Q3ValueList</tt>), Qt 4 provides compatibility functions when it's possible for an old API to cohabit with the new one. For example, <a href="qstring.html">QString</a> provides a <a href="qstring-qt3.html#simplifyWhiteSpace" class="compat">QString::simplifyWhiteSpace</a>() compatibility function that's implemented inline and that simply calls <a href="qstring.html#simplified">QString::simplified</a>(). <b>The compatibility functions are not documented here; instead, they are documented for each class.</b></p>
<p>If you have the line <tt>QT += qt3support</tt> in your <tt>.pro</tt> file, <tt>qmake</tt> will automatically define the <tt>QT3_SUPPORT</tt> symbol, turning on compatibility function support. You can also define the symbol manually (e.g., if you don't want to link against the <tt>Qt3Support</tt> library), or you can define <tt>QT3_SUPPORT_WARNINGS</tt> instead, telling the compiler to emit a warning when a compatibility function is called. (This works only with GCC 3.2+ and MSVC 7.)</p>
<p>If you get stuck, ask on the <a href="http://qt.nokia.com/lists/qt-interest/">qt-interest</a> mailing list. If you are a licensed customer, you can also contact Qt's technical support team.</p>
<p>Table of contents:</p>
<a name="casting-and-object-types"></a>
<h2>Casting and Object Types</h2>
<p>In Qt 3, it was possible to use the <tt>qt_cast()</tt> function to determine whether instances of <a href="qobject.html">QObject</a> subclasses could be safely cast to derived types of those subclasses. For example, if a <a href="qframe.html">QFrame</a> instance is passed to a function whose signature specifies a <a href="qwidget.html">QWidget</a> pointer as its argument, <tt>qt_cast()</tt> could be used to obtain a <a href="qframe.html">QFrame</a> pointer so that the instance's functions can be accessed.</p>
<p>In Qt 4, much of this functionality is provided by the <a href="qobject.html#qobject_cast">qobject_cast</a>() function, and additional functions also provide similar functionality for certain non-<a href="qobject.html">QObject</a> types:</p>
<table class="generic">
<thead><tr class="qt-style"><th >Qt 3 function</th><th >Qt 4 function</th></tr></thead>
<tr valign="top" class="odd"><td >T *qt_cast<T *>(<a href="qobject.html">QObject</a> *)</td><td ><a href="qobject.html#qobject_cast">T *qobject_cast<T *></a>(<a href="qobject.html">QObject</a> *)</td></tr>
<tr valign="top" class="even"><td ></td><td ><a href="qgraphicsitem.html#qgraphicsitem_cast">T qgraphicsitem_cast<T></a>(<a href="qgraphicsitem.html">QGraphicsItem</a> *)</td></tr>
<tr valign="top" class="odd"><td ></td><td ><a href="qstyleoption.html#qstyleoption_cast">T qstyleoption_cast<T></a>(<a href="qstyleoption.html">QStyleOption</a> *)</td></tr>
<tr valign="top" class="even"><td ></td><td ><a href="qvariant.html#qvariant_cast">T qvariant_cast<T></a>(const <a href="qvariant.html">QVariant</a> &)</td></tr>
<tr valign="top" class="odd"><td ></td><td ><a href="qdbusargument.html#qdbus_cast">T qdbus_cast(const QDBusArgument &)</a></td></tr>
</table>
<a name="type-names"></a>
<h2>Type Names</h2>
<p>The table below lists the classes that have been renamed in Qt 4. If you compile your applications with <tt>QT3_SUPPORT</tt> defined, the old names will be available.</p>
<p>Whenever you see an occurrence of the name on the left, you can safely replace it with the Qt 4 equivalent in your program. The <a href="qt3to4.html#qt3to4">qt3to4</a> tool performs the conversion automatically.</p>
<table class="generic">
<thead><tr class="qt-style"><th >Qt 3 class name</th><th >Qt 4 class name</th></tr></thead>
<tr valign="top" class="odd"><td >QIconSet</td><td ><a href="qicon.html">QIcon</a></td></tr>
<tr valign="top" class="even"><td >QWMatrix</td><td ><a href="qmatrix.html" class="obsolete">QMatrix</a></td></tr>
<tr valign="top" class="odd"><td >QGuardedPtr</td><td ><a href="qpointer.html">QPointer</a></td></tr>
</table>
<p>The table below lists the enums and typedefs that have been renamed in Qt 4. If you compile your applications with <tt>QT3_SUPPORT</tt> defined, the old names will be available.</p>
<p>Whenever you see an occurrence of the name on the left, you can safely replace it with the Qt 4 equivalent in your program. The <a href="qt3to4.html#qt3to4">qt3to4</a> tool performs the conversion automatically.</p>
<table class="generic">
<thead><tr class="qt-style"><th >Qt 3 type name</th><th >Qt 4 type name</th></tr></thead>
<tr valign="top" class="odd"><td ><a href="qapplication-qt3.html#ColorMode-typedef" class="compat">QApplication::ColorMode</a></td><td ><a href="qapplication.html#ColorSpec-enum">QApplication::ColorSpec</a></td></tr>
<tr valign="top" class="even"><td >QButton::ToggleState</td><td ><a href="qcheckbox-qt3.html#ToggleState-enum" class="compat">QCheckBox::ToggleState</a></td></tr>
<tr valign="top" class="odd"><td >QCursorShape</td><td ><a href="qt.html#CursorShape-enum">Qt::CursorShape</a></td></tr>
<tr valign="top" class="even"><td >QFile::FilterSpec</td><td >QFile::Filters</td></tr>
<tr valign="top" class="odd"><td ><a href="qfile.html#PermissionSpec-typedef">QFile::PermissionSpec</a></td><td ><a href="qfile.html#Permission-enum">QFile::Permission</a></td></tr>
<tr valign="top" class="even"><td >QFile::SortSpec</td><td >QFile::SortFlags</td></tr>
<tr valign="top" class="odd"><td ><a href="qiodevice-qt3.html#Status-typedef" class="compat">QFile::Status</a></td><td >QFile::Error</td></tr>
<tr valign="top" class="even"><td ><a href="qfileinfo.html#Permission-enum">QFileInfo::PermissionSpec</a></td><td ><a href="qfile.html#Permission-enum">QFile::Permission</a></td></tr>
<tr valign="top" class="odd"><td >QGrid::Direction</td><td ><a href="qt.html#Orientation-enum">Qt::Orientation</a></td></tr>
<tr valign="top" class="even"><td >QGridWidget::Direction</td><td ><a href="qt.html#Orientation-enum">Qt::Orientation</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qiodevice-qt3.html#Offset-typedef" class="compat">QIODevice::Offset</a></td><td >qlonglong</td></tr>
<tr valign="top" class="even"><td >QImage::ScaleMode</td><td ><a href="qt.html#AspectRatioMode-enum">Qt::AspectRatioMode</a></td></tr>
<tr valign="top" class="odd"><td >QSize::ScaleMode</td><td ><a href="qt.html#AspectRatioMode-enum">Qt::AspectRatioMode</a></td></tr>
<tr valign="top" class="even"><td >QSocket::Error</td><td ><a href="q3socket.html#Error-enum">Q3Socket::Error</a></td></tr>
<tr valign="top" class="odd"><td >QSocket::State</td><td ><a href="q3socket.html#State-enum">Q3Socket::State</a></td></tr>
<tr valign="top" class="even"><td >QStyle::SCFlags</td><td ><a href="qstyle.html#SubControl-enum">QStyle::SubControls</a></td></tr>
<tr valign="top" class="odd"><td >QStyle::SFlags</td><td ><a href="qstyle.html#StateFlag-enum">QStyle::State</a></td></tr>
<tr valign="top" class="even"><td >QTS</td><td ><a href="qtextstream.html">QTextStream</a></td></tr>
<tr valign="top" class="odd"><td >QUrlDrag</td><td ><a href="#quridrag">QUriDrag</a></td></tr>
<tr valign="top" class="even"><td >QWidget::FocusPolicy</td><td ><a href="qt.html#FocusPolicy-enum">Qt::FocusPolicy</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qtglobal-qt3.html#Q_LLONG-typedef" class="compat">Q_LLONG</a></td><td >qlonglong</td></tr>
<tr valign="top" class="even"><td ><a href="qtglobal-qt3.html#Q_ULLONG-typedef" class="compat">Q_ULLONG</a></td><td >qulonglong</td></tr>
<tr valign="top" class="odd"><td ><a href="qt-qt3.html#Dock-enum" class="compat">Qt::Dock</a></td><td ><a href="qt-qt3.html#ToolBarDock-typedef" class="compat">Qt::ToolBarDock</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt-qt3.html#MacintoshVersion-enum" class="compat">Qt::MacintoshVersion</a></td><td ><a href="qsysinfo.html#MacVersion-enum">QSysInfo::MacVersion</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt-qt3.html#TextFlags-typedef" class="compat">Qt::TextFlags</a></td><td ><a href="qt.html#TextFlag-enum">Qt::TextFlag</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt-qt3.html#WindowsVersion-enum" class="compat">Qt::WindowsVersion</a></td><td ><a href="qsysinfo.html#WinVersion-enum">QSysInfo::WinVersion</a></td></tr>
</table>
<a name="enum-values"></a>
<h2>Enum Values</h2>
<p>The table below lists the enum values that have been renamed in Qt 4. If you compile your applications with <tt>QT3_SUPPORT</tt> defined, the old names will be available.</p>
<p>Whenever you see an occurrence of the name on the left, you can safely replace it with the Qt 4 equivalent in your program. The <a href="qt3to4.html#qt3to4">qt3to4</a> tool performs the conversion automatically.</p>
<table class="generic">
<thead><tr class="qt-style"><th >Qt 3 enum value name</th><th >Qt 4 enum value name</th></tr></thead>
<tr valign="top" class="odd"><td >IO_Append</td><td ><a href="qiodevice.html#OpenModeFlag-enum">QIODevice::Append</a></td></tr>
<tr valign="top" class="even"><td >IO_ReadOnly</td><td ><a href="qiodevice.html#OpenModeFlag-enum">QIODevice::ReadOnly</a></td></tr>
<tr valign="top" class="odd"><td >IO_ReadWrite</td><td ><a href="qiodevice.html#OpenModeFlag-enum">QIODevice::ReadWrite</a></td></tr>
<tr valign="top" class="even"><td >IO_Translate</td><td ><a href="qiodevice.html#OpenModeFlag-enum">QIODevice::Text</a></td></tr>
<tr valign="top" class="odd"><td >IO_Truncate</td><td ><a href="qiodevice.html#OpenModeFlag-enum">QIODevice::Truncate</a></td></tr>
<tr valign="top" class="even"><td >IO_WriteOnly</td><td ><a href="qiodevice.html#OpenModeFlag-enum">QIODevice::WriteOnly</a></td></tr>
<tr valign="top" class="odd"><td >IO_Raw</td><td ><a href="qiodevice.html#OpenModeFlag-enum">QIODevice::Unbuffered</a></td></tr>
<tr valign="top" class="even"><td ><a href="qaccessible.html#StateFlag-enum">QAccessible::Moveable</a></td><td ><a href="qaccessible.html#StateFlag-enum">QAccessible::Movable</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qapplication-qt3.html#CustomColors-var" class="compat">QApplication::CustomColors</a></td><td ><a href="qapplication.html#ColorSpec-enum">QApplication::CustomColor</a></td></tr>
<tr valign="top" class="even"><td ><a href="qapplication-qt3.html#NormalColors-var" class="compat">QApplication::NormalColors</a></td><td ><a href="qapplication.html#ColorSpec-enum">QApplication::NormalColor</a></td></tr>
<tr valign="top" class="odd"><td >QButton::NoChange</td><td ><a href="qcheckbox-qt3.html#ToggleState-enum" class="compat">QCheckBox::NoChange</a></td></tr>
<tr valign="top" class="even"><td >QButton::Off</td><td ><a href="qcheckbox-qt3.html#ToggleState-enum" class="compat">QCheckBox::Off</a></td></tr>
<tr valign="top" class="odd"><td >QButton::On</td><td ><a href="qcheckbox-qt3.html#ToggleState-enum" class="compat">QCheckBox::On</a></td></tr>
<tr valign="top" class="even"><td ><a href="qchar.html#Decomposition-enum">QChar::Single</a></td><td ><a href="qchar.html#Decomposition-enum">QChar::NoDecomposition</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qchar.html#SpecialCharacter-enum">QChar::byteOrderMark</a></td><td ><a href="qchar.html#SpecialCharacter-enum">QChar::ByteOrderMark</a></td></tr>
<tr valign="top" class="even"><td ><a href="qchar.html#SpecialCharacter-enum">QChar::byteOrderSwapped</a></td><td ><a href="qchar.html#SpecialCharacter-enum">QChar::ByteOrderSwapped</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qchar.html#SpecialCharacter-enum">QChar::nbsp</a></td><td ><a href="qchar.html#SpecialCharacter-enum">QChar::Nbsp</a></td></tr>
<tr valign="top" class="even"><td ><a href="qchar.html#SpecialCharacter-enum">QChar::null</a></td><td ><a href="qchar.html#SpecialCharacter-enum">QChar::Null</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qchar.html#SpecialCharacter-enum">QChar::replacement</a></td><td ><a href="qchar.html#SpecialCharacter-enum">QChar::ReplacementCharacter</a></td></tr>
<tr valign="top" class="even"><td ><a href="qcombobox.html#InsertPolicy-enum">QComboBox::AfterCurrent</a></td><td ><a href="qcombobox.html#InsertPolicy-enum">QComboBox::InsertAfterCurrent</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qcombobox.html#InsertPolicy-enum">QComboBox::AtBottom</a></td><td ><a href="qcombobox.html#InsertPolicy-enum">QComboBox::InsertAtBottom</a></td></tr>
<tr valign="top" class="even"><td ><a href="qcombobox.html#InsertPolicy-enum">QComboBox::AtCurrent</a></td><td ><a href="qcombobox.html#InsertPolicy-enum">QComboBox::InsertAtCurrent</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qcombobox.html#InsertPolicy-enum">QComboBox::AtTop</a></td><td ><a href="qcombobox.html#InsertPolicy-enum">QComboBox::InsertAtTop</a></td></tr>
<tr valign="top" class="even"><td ><a href="qcombobox.html#InsertPolicy-enum">QComboBox::BeforeCurrent</a></td><td ><a href="qcombobox.html#InsertPolicy-enum">QComboBox::InsertBeforeCurrent</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qcombobox.html#InsertPolicy-enum">QComboBox::NoInsertion</a></td><td ><a href="qcombobox.html#InsertPolicy-enum">QComboBox::NoInsert</a></td></tr>
<tr valign="top" class="even"><td ><a href="qdir.html#Filter-enum">QDir::DefaultFilter</a></td><td ><a href="qdir.html#Filter-enum">QDir::NoFilter</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qdir.html#SortFlag-enum">QDir::DefaultSort</a></td><td ><a href="qdir.html#SortFlag-enum">QDir::NoSort</a></td></tr>
<tr valign="top" class="even"><td ><a href="qevent.html#Type-enum">QEvent::Accel</a></td><td ><a href="qevent.html#Type-enum">QEvent::Shortcut</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qevent.html#Type-enum">QEvent::AccelOverride</a></td><td ><a href="qevent.html#Type-enum">QEvent::ShortcutOverride</a></td></tr>
<tr valign="top" class="even"><td ><a href="qevent.html#Type-enum">QEvent::CaptionChange</a></td><td ><a href="qevent.html#Type-enum">QEvent::WindowTitleChange</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qevent.html#Type-enum">QEvent::ChildInserted</a></td><td ><a href="qevent.html#Type-enum">QEvent::ChildAdded</a></td></tr>
<tr valign="top" class="even"><td >QEvent::IMCompose</td><td >QEvent::InputMethodCompose</td></tr>
<tr valign="top" class="odd"><td >QEvent::IMEnd</td><td >QEvent::InputMethodEnd</td></tr>
<tr valign="top" class="even"><td >QEvent::IMStart</td><td >QEvent::InputMethodStart</td></tr>
<tr valign="top" class="odd"><td ><a href="qevent.html#Type-enum">QEvent::IconChange</a></td><td ><a href="qevent.html#Type-enum">QEvent::WindowIconChange</a></td></tr>
<tr valign="top" class="even"><td ><a href="qevent.html#Type-enum">QEvent::LayoutHint</a></td><td ><a href="qevent.html#Type-enum">QEvent::LayoutRequest</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qevent.html#Type-enum">QEvent::Reparent</a></td><td ><a href="qevent.html#Type-enum">QEvent::ParentChange</a></td></tr>
<tr valign="top" class="even"><td ><a href="qfileinfo-qt3.html#Permission-enum" class="compat">QFileInfo::ExeGroup</a></td><td ><a href="qfile.html#Permission-enum">QFile::ExeGroup</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qfileinfo-qt3.html#Permission-enum" class="compat">QFileInfo::ExeOther</a></td><td ><a href="qfile.html#Permission-enum">QFile::ExeOther</a></td></tr>
<tr valign="top" class="even"><td ><a href="qfileinfo-qt3.html#Permission-enum" class="compat">QFileInfo::ExeOwner</a></td><td ><a href="qfile.html#Permission-enum">QFile::ExeOwner</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qfileinfo-qt3.html#Permission-enum" class="compat">QFileInfo::ExeUser</a></td><td ><a href="qfile.html#Permission-enum">QFile::ExeUser</a></td></tr>
<tr valign="top" class="even"><td ><a href="qfileinfo-qt3.html#Permission-enum" class="compat">QFileInfo::ReadGroup</a></td><td ><a href="qfile.html#Permission-enum">QFile::ReadGroup</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qfileinfo-qt3.html#Permission-enum" class="compat">QFileInfo::ReadOther</a></td><td ><a href="qfile.html#Permission-enum">QFile::ReadOther</a></td></tr>
<tr valign="top" class="even"><td ><a href="qfileinfo-qt3.html#Permission-enum" class="compat">QFileInfo::ReadOwner</a></td><td ><a href="qfile.html#Permission-enum">QFile::ReadOwner</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qfileinfo-qt3.html#Permission-enum" class="compat">QFileInfo::ReadUser</a></td><td ><a href="qfile.html#Permission-enum">QFile::ReadUser</a></td></tr>
<tr valign="top" class="even"><td ><a href="qfileinfo-qt3.html#Permission-enum" class="compat">QFileInfo::WriteGroup</a></td><td ><a href="qfile.html#Permission-enum">QFile::WriteGroup</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qfileinfo-qt3.html#Permission-enum" class="compat">QFileInfo::WriteOther</a></td><td ><a href="qfile.html#Permission-enum">QFile::WriteOther</a></td></tr>
<tr valign="top" class="even"><td ><a href="qfileinfo-qt3.html#Permission-enum" class="compat">QFileInfo::WriteOwner</a></td><td ><a href="qfile.html#Permission-enum">QFile::WriteOwner</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qfileinfo-qt3.html#Permission-enum" class="compat">QFileInfo::WriteUser</a></td><td ><a href="qfile.html#Permission-enum">QFile::WriteUser</a></td></tr>
<tr valign="top" class="even"><td ><a href="qframe.html#Shape-enum">QFrame::GroupBoxPanel</a></td><td ><a href="qframe.html#Shape-enum">QFrame::StyledPanel</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qframe.html#Shape-enum">QFrame::LineEditPanel</a></td><td ><a href="qframe.html#Shape-enum">QFrame::StyledPanel</a></td></tr>
<tr valign="top" class="even"><td ><a href="qframe.html#Shape-enum">QFrame::MenuBarPanel</a></td><td ><a href="qframe.html#Shape-enum">QFrame::StyledPanel</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qframe.html#Shape-enum">QFrame::PopupPanel</a></td><td ><a href="qframe.html#Shape-enum">QFrame::StyledPanel</a></td></tr>
<tr valign="top" class="even"><td ><a href="qframe.html#Shape-enum">QFrame::TabWidgetPanel</a></td><td ><a href="qframe.html#Shape-enum">QFrame::StyledPanel</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qframe.html#Shape-enum">QFrame::ToolBarPanel</a></td><td ><a href="qframe.html#Shape-enum">QFrame::StyledPanel</a></td></tr>
<tr valign="top" class="even"><td >QImage::ScaleFree</td><td ><a href="qt.html#AspectRatioMode-enum">Qt::IgnoreAspectRatio</a></td></tr>
<tr valign="top" class="odd"><td >QImage::ScaleMax</td><td ><a href="qt.html#AspectRatioMode-enum">Qt::KeepAspectRatioByExpanding</a></td></tr>
<tr valign="top" class="even"><td >QImage::ScaleMin</td><td ><a href="qt.html#AspectRatioMode-enum">Qt::KeepAspectRatio</a></td></tr>
<tr valign="top" class="odd"><td >Qt::Identical</td><td ><a href="qkeysequence.html#SequenceMatch-enum">QKeySequence::ExactMatch</a></td></tr>
<tr valign="top" class="even"><td >Qt::NoMatch</td><td ><a href="qkeysequence.html#SequenceMatch-enum">QKeySequence::NoMatch</a></td></tr>
<tr valign="top" class="odd"><td >Qt::PartialMatch</td><td ><a href="qkeysequence.html#SequenceMatch-enum">QKeySequence::PartialMatch</a></td></tr>
<tr valign="top" class="even"><td ><a href="qlayout.html#SizeConstraint-enum">QLayout::Auto</a></td><td ><a href="qlayout.html#SizeConstraint-enum">QLayout::SetDefaultConstraint</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qlayout.html#SizeConstraint-enum">QLayout::Fixed</a></td><td ><a href="qlayout.html#SizeConstraint-enum">QLayout::SetFixedSize</a></td></tr>
<tr valign="top" class="even"><td ><a href="qlayout.html#SizeConstraint-enum">QLayout::FreeResize</a></td><td ><a href="qlayout.html#SizeConstraint-enum">QLayout::SetNoConstraint</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qlayout.html#SizeConstraint-enum">QLayout::Minimum</a></td><td ><a href="qlayout.html#SizeConstraint-enum">QLayout::SetMinimumSize</a></td></tr>
<tr valign="top" class="even"><td ><a href="qmacstyle.html#WidgetSizePolicy-enum">QMacStyle::SizeNone</a></td><td ><a href="qmacstyle.html#WidgetSizePolicy-enum">QMacStyle::SizeDefault</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qsettings.html#Scope-enum">QSettings::Global</a></td><td ><a href="qsettings.html#Scope-enum">QSettings::SystemScope</a></td></tr>
<tr valign="top" class="even"><td ><a href="qsettings.html#Scope-enum">QSettings::User</a></td><td ><a href="qsettings.html#Scope-enum">QSettings::UserScope</a></td></tr>
<tr valign="top" class="odd"><td >QSize::ScaleFree</td><td ><a href="qt.html#AspectRatioMode-enum">Qt::IgnoreAspectRatio</a></td></tr>
<tr valign="top" class="even"><td >QSize::ScaleMax</td><td ><a href="qt.html#AspectRatioMode-enum">Qt::KeepAspectRatioByExpanding</a></td></tr>
<tr valign="top" class="odd"><td >QSize::ScaleMin</td><td ><a href="qt.html#AspectRatioMode-enum">Qt::KeepAspectRatio</a></td></tr>
<tr valign="top" class="even"><td >QSizePolicy::Horizontal</td><td ><a href="qsizepolicy-qt3.html#ExpandData-enum" class="compat">QSizePolicy::Horizontally</a></td></tr>
<tr valign="top" class="odd"><td >QSizePolicy::Vertical</td><td ><a href="qsizepolicy-qt3.html#ExpandData-enum" class="compat">QSizePolicy::Vertically</a></td></tr>
<tr valign="top" class="even"><td ><a href="qslider.html#TickPosition-enum">QSlider::Above</a></td><td ><a href="qslider.html#TickPosition-enum">QSlider::TicksAbove</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qslider.html#TickPosition-enum">QSlider::Below</a></td><td ><a href="qslider.html#TickPosition-enum">QSlider::TicksBelow</a></td></tr>
<tr valign="top" class="even"><td ><a href="qslider.html#TickPosition-enum">QSlider::Both</a></td><td ><a href="qslider.html#TickPosition-enum">QSlider::TicksBothSides</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qslider.html#TickPosition-enum">QSlider::Left</a></td><td ><a href="qslider.html#TickPosition-enum">QSlider::TicksLeft</a></td></tr>
<tr valign="top" class="even"><td ><a href="qslider.html#TickPosition-enum">QSlider::NoMarks</a></td><td ><a href="qslider.html#TickPosition-enum">QSlider::NoTicks</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qslider.html#TickPosition-enum">QSlider::Right</a></td><td ><a href="qslider.html#TickPosition-enum">QSlider::TicksRight</a></td></tr>
<tr valign="top" class="even"><td >QSocket::Closing</td><td ><a href="q3socket.html#State-enum">Q3Socket::Closing</a></td></tr>
<tr valign="top" class="odd"><td >QSocket::Connected</td><td ><a href="q3socket.html#State-enum">Q3Socket::Connected</a></td></tr>
<tr valign="top" class="even"><td >QSocket::Connecting</td><td ><a href="q3socket.html#State-enum">Q3Socket::Connecting</a></td></tr>
<tr valign="top" class="odd"><td >QSocket::Connection</td><td ><a href="q3socket.html#State-enum">Q3Socket::Connection</a></td></tr>
<tr valign="top" class="even"><td >QSocket::ErrConnectionRefused</td><td ><a href="q3socket.html#Error-enum">Q3Socket::ErrConnectionRefused</a></td></tr>
<tr valign="top" class="odd"><td >QSocket::ErrHostNotFound</td><td ><a href="q3socket.html#Error-enum">Q3Socket::ErrHostNotFound</a></td></tr>
<tr valign="top" class="even"><td >QSocket::ErrSocketRead</td><td ><a href="q3socket.html#Error-enum">Q3Socket::ErrSocketRead</a></td></tr>
<tr valign="top" class="odd"><td >QSocket::HostLookup</td><td ><a href="qabstractsocket.html#SocketState-enum">QAbstractSocket::HostLookupState</a></td></tr>
<tr valign="top" class="even"><td >QSocket::Idle</td><td ><a href="qabstractsocket.html#SocketState-enum">QAbstractSocket::UnconnectedState</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qsqlerror.html#ErrorType-enum">QSqlError::Connection</a></td><td ><a href="qsqlerror.html#ErrorType-enum">QSqlError::ConnectionError</a></td></tr>
<tr valign="top" class="even"><td ><a href="qsqlerror.html#ErrorType-enum">QSqlError::None</a></td><td ><a href="qsqlerror.html#ErrorType-enum">QSqlError::NoError</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qsqlerror.html#ErrorType-enum">QSqlError::Statement</a></td><td ><a href="qsqlerror.html#ErrorType-enum">QSqlError::StatementError</a></td></tr>
<tr valign="top" class="even"><td ><a href="qsqlerror.html#ErrorType-enum">QSqlError::Transaction</a></td><td ><a href="qsqlerror.html#ErrorType-enum">QSqlError::TransactionError</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qsqlerror.html#ErrorType-enum">QSqlError::Unknown</a></td><td ><a href="qsqlerror.html#ErrorType-enum">QSqlError::UnknownError</a></td></tr>
<tr valign="top" class="even"><td >QStyle::CC_ListView</td><td ><a href="qstyle.html#ComplexControl-enum">QStyle::CC_Q3ListView</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qstyle.html#StyleHint-enum">QStyle::SH_UnderlineAccelerator</a></td><td ><a href="qstyle.html#StyleHint-enum">QStyle::SH_UnderlineShortcut</a></td></tr>
<tr valign="top" class="even"><td >QStyle::Style_Active</td><td ><a href="qstyle.html#StateFlag-enum">QStyle::State_Active</a></td></tr>
<tr valign="top" class="odd"><td >QStyle::Style_AutoRaise</td><td ><a href="qstyle.html#StateFlag-enum">QStyle::State_AutoRaise</a></td></tr>
<tr valign="top" class="even"><td >QStyle::Style_Bottom</td><td ><a href="qstyle.html#StateFlag-enum">QStyle::State_Bottom</a></td></tr>
<tr valign="top" class="odd"><td >QStyle::Style_Children</td><td ><a href="qstyle.html#StateFlag-enum">QStyle::State_Children</a></td></tr>
<tr valign="top" class="even"><td >QStyle::Style_Default</td><td ><a href="qstyle.html#StateFlag-enum">QStyle::State_None</a></td></tr>
<tr valign="top" class="odd"><td >QStyle::Style_Down</td><td ><a href="qstyle.html#StateFlag-enum">QStyle::State_DownArrow</a></td></tr>
<tr valign="top" class="even"><td >QStyle::Style_Editing</td><td ><a href="qstyle.html#StateFlag-enum">QStyle::State_Editing</a></td></tr>
<tr valign="top" class="odd"><td >QStyle::Style_Enabled</td><td ><a href="qstyle.html#StateFlag-enum">QStyle::State_Enabled</a></td></tr>
<tr valign="top" class="even"><td >QStyle::Style_FocusAtBorder</td><td ><a href="qstyle.html#StateFlag-enum">QStyle::State_FocusAtBorder</a></td></tr>
<tr valign="top" class="odd"><td >QStyle::Style_HasFocus</td><td ><a href="qstyle.html#StateFlag-enum">QStyle::State_HasFocus</a></td></tr>
<tr valign="top" class="even"><td >QStyle::Style_Horizontal</td><td ><a href="qstyle.html#StateFlag-enum">QStyle::State_Horizontal</a></td></tr>
<tr valign="top" class="odd"><td >QStyle::Style_Item</td><td ><a href="qstyle.html#StateFlag-enum">QStyle::State_Item</a></td></tr>
<tr valign="top" class="even"><td >QStyle::Style_MouseOver</td><td ><a href="qstyle.html#StateFlag-enum">QStyle::State_MouseOver</a></td></tr>
<tr valign="top" class="odd"><td >QStyle::Style_NoChange</td><td ><a href="qstyle.html#StateFlag-enum">QStyle::State_NoChange</a></td></tr>
<tr valign="top" class="even"><td >QStyle::Style_None</td><td ><a href="qstyle.html#StateFlag-enum">QStyle::State_None</a></td></tr>
<tr valign="top" class="odd"><td >QStyle::Style_Off</td><td ><a href="qstyle.html#StateFlag-enum">QStyle::State_Off</a></td></tr>
<tr valign="top" class="even"><td >QStyle::Style_On</td><td ><a href="qstyle.html#StateFlag-enum">QStyle::State_On</a></td></tr>
<tr valign="top" class="odd"><td >QStyle::Style_Open</td><td ><a href="qstyle.html#StateFlag-enum">QStyle::State_Open</a></td></tr>
<tr valign="top" class="even"><td >QStyle::Style_Raised</td><td ><a href="qstyle.html#StateFlag-enum">QStyle::State_Raised</a></td></tr>
<tr valign="top" class="odd"><td >QStyle::Style_Rectangle</td><td >QStyle::State_Rectangle</td></tr>
<tr valign="top" class="even"><td >QStyle::Style_Selected</td><td ><a href="qstyle.html#StateFlag-enum">QStyle::State_Selected</a></td></tr>
<tr valign="top" class="odd"><td >QStyle::Style_Sibling</td><td ><a href="qstyle.html#StateFlag-enum">QStyle::State_Sibling</a></td></tr>
<tr valign="top" class="even"><td >QStyle::Style_Sunken</td><td ><a href="qstyle.html#StateFlag-enum">QStyle::State_Sunken</a></td></tr>
<tr valign="top" class="odd"><td >QStyle::Style_Top</td><td ><a href="qstyle.html#StateFlag-enum">QStyle::State_Top</a></td></tr>
<tr valign="top" class="even"><td >QStyle::Style_Up</td><td >QStyle::State_Up</td></tr>
<tr valign="top" class="odd"><td ><a href="qtabbar.html#Shape-enum">QTabBar::RoundedAbove</a></td><td ><a href="qtabbar.html#Shape-enum">QTabBar::RoundedNorth</a></td></tr>
<tr valign="top" class="even"><td ><a href="qtabbar.html#Shape-enum">QTabBar::RoundedBelow</a></td><td ><a href="#qtabbar">QTabBar::</a> RoundedSouth</td></tr>
<tr valign="top" class="odd"><td ><a href="qtabbar.html#Shape-enum">QTabBar::TriangularAbove</a></td><td ><a href="#qtabbar">QTabBar::</a> TriangularNorth</td></tr>
<tr valign="top" class="even"><td ><a href="qtabbar.html#Shape-enum">QTabBar::TriangularBelow</a></td><td ><a href="#qtabbar">QTabBar::</a> TriangularSouth</td></tr>
<tr valign="top" class="odd"><td ><a href="qtextedit-qt3.html#CursorAction-enum" class="compat">QTextEdit::MovePgDown</a></td><td ><a href="qtextedit-qt3.html#CursorAction-enum" class="compat">QTextEdit::MovePageDown</a></td></tr>
<tr valign="top" class="even"><td ><a href="qtextedit-qt3.html#CursorAction-enum" class="compat">QTextEdit::MovePgUp</a></td><td ><a href="qtextedit-qt3.html#CursorAction-enum" class="compat">QTextEdit::MovePageUp</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qtoolbutton-qt3.html#TextPosition-enum" class="compat">QToolButton::Right</a></td><td ><a href="qtoolbutton-qt3.html#TextPosition-enum" class="compat">QToolButton::BesideIcon</a></td></tr>
<tr valign="top" class="even"><td ><a href="qtoolbutton-qt3.html#TextPosition-enum" class="compat">QToolButton::Under</a></td><td ><a href="qtoolbutton-qt3.html#TextPosition-enum" class="compat">QToolButton::BelowIcon</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qvalidator.html#State-enum">QValidator::Valid</a></td><td ><a href="qvalidator.html#State-enum">QValidator::Intermediate</a></td></tr>
<tr valign="top" class="even"><td ><a href="qvariant.html#Type-enum">QVariant::IconSet</a></td><td >QCoreVariant::Icon</td></tr>
<tr valign="top" class="odd"><td >QWidget::ClickFocus</td><td ><a href="qt.html#FocusPolicy-enum">Qt::ClickFocus</a></td></tr>
<tr valign="top" class="even"><td >QWidget::NoFocus</td><td ><a href="qt.html#FocusPolicy-enum">Qt::NoFocus</a></td></tr>
<tr valign="top" class="odd"><td >QWidget::StrongFocus</td><td ><a href="qt.html#FocusPolicy-enum">Qt::StrongFocus</a></td></tr>
<tr valign="top" class="even"><td >QWidget::TabFocus</td><td ><a href="qt.html#FocusPolicy-enum">Qt::TabFocus</a></td></tr>
<tr valign="top" class="odd"><td >QWidget::WheelFocus</td><td ><a href="qt.html#FocusPolicy-enum">Qt::WheelFocus</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#AlignmentFlag-enum">Qt::AlignAuto</a></td><td ><a href="qt.html#AlignmentFlag-enum">Qt::AlignLeft</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt-qt3.html#ButtonState_enum-enum" class="compat">Qt::AltButton</a></td><td ><a href="qt.html#KeyboardModifier-enum">Qt::AltModifier</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#SortOrder-enum">Qt::Ascending</a></td><td ><a href="qt.html#SortOrder-enum">Qt::AscendingOrder</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt-qt3.html#Dock-enum" class="compat">Qt::Bottom</a></td><td ><a href="qt-qt3.html#Dock-enum" class="compat">Qt::DockBottom</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#Corner-enum">Qt::BottomLeft</a></td><td ><a href="qt.html#Corner-enum">Qt::BottomLeftCorner</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#Corner-enum">Qt::BottomRight</a></td><td ><a href="qt.html#Corner-enum">Qt::BottomRightCorner</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#TextFlag-enum">Qt::BreakAnywhere</a></td><td ><a href="qt.html#TextFlag-enum">Qt::TextWrapAnywhere</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt-qt3.html#ButtonState_enum-enum" class="compat">Qt::ControlButton</a></td><td ><a href="qt.html#KeyboardModifier-enum">Qt::ControlModifier</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#BrushStyle-enum">Qt::CustomPattern</a></td><td ><a href="qt.html#BrushStyle-enum">Qt::TexturePattern</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#SortOrder-enum">Qt::Descending</a></td><td ><a href="qt.html#SortOrder-enum">Qt::DescendingOrder</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#TextFlag-enum">Qt::DontClip</a></td><td ><a href="qt.html#TextFlag-enum">Qt::TextDontClip</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#TextFlag-enum">Qt::DontPrint</a></td><td ><a href="qt.html#TextFlag-enum">Qt::TextDontPrint</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#TextFlag-enum">Qt::ExpandTabs</a></td><td ><a href="qt.html#TextFlag-enum">Qt::TextExpandTabs</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#TextFlag-enum">Qt::IncludeTrailingSpaces</a></td><td ><a href="qt.html#TextFlag-enum">Qt::TextIncludeTrailingSpaces</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt-qt3.html#ButtonState_enum-enum" class="compat">Qt::KeyButtonMask</a></td><td ><a href="qt.html#KeyboardModifier-enum">Qt::KeyboardModifierMask</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#Key-enum">Qt::Key_BackSpace</a></td><td ><a href="qt.html#Key-enum">Qt::Key_Backspace</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#Key-enum">Qt::Key_BackTab</a></td><td ><a href="qt.html#Key-enum">Qt::Key_Backtab</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#Key-enum">Qt::Key_MediaPrev</a></td><td ><a href="qt.html#Key-enum">Qt::Key_MediaPrevious</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#Key-enum">Qt::Key_Next</a></td><td ><a href="qt.html#Key-enum">Qt::Key_PageDown</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#Key-enum">Qt::Key_Prior</a></td><td ><a href="qt.html#Key-enum">Qt::Key_PageUp</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#Key-enum">Qt::Key_aacute</a></td><td ><a href="qt.html#Key-enum">Qt::Key_Aacute</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#Key-enum">Qt::Key_acircumflex</a></td><td ><a href="qt.html#Key-enum">Qt::Key_Acircumflex</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#Key-enum">Qt::Key_adiaeresis</a></td><td ><a href="qt.html#Key-enum">Qt::Key_Adiaeresis</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#Key-enum">Qt::Key_ae</a></td><td ><a href="qt.html#Key-enum">Qt::Key_AE</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#Key-enum">Qt::Key_agrave</a></td><td ><a href="qt.html#Key-enum">Qt::Key_Agrave</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#Key-enum">Qt::Key_aring</a></td><td ><a href="qt.html#Key-enum">Qt::Key_Aring</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#Key-enum">Qt::Key_atilde</a></td><td ><a href="qt.html#Key-enum">Qt::Key_Atilde</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#Key-enum">Qt::Key_ccedilla</a></td><td ><a href="qt.html#Key-enum">Qt::Key_Ccedilla</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#Key-enum">Qt::Key_eacute</a></td><td ><a href="qt.html#Key-enum">Qt::Key_Eacute</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#Key-enum">Qt::Key_ecircumflex</a></td><td ><a href="qt.html#Key-enum">Qt::Key_Ecircumflex</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#Key-enum">Qt::Key_ediaeresis</a></td><td ><a href="qt.html#Key-enum">Qt::Key_Ediaeresis</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#Key-enum">Qt::Key_egrave</a></td><td ><a href="qt.html#Key-enum">Qt::Key_Egrave</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#Key-enum">Qt::Key_eth</a></td><td ><a href="qt.html#Key-enum">Qt::Key_ETH</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#Key-enum">Qt::Key_iacute</a></td><td ><a href="qt.html#Key-enum">Qt::Key_Iacute</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#Key-enum">Qt::Key_icircumflex</a></td><td ><a href="qt.html#Key-enum">Qt::Key_Icircumflex</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#Key-enum">Qt::Key_idiaeresis</a></td><td ><a href="qt.html#Key-enum">Qt::Key_Idiaeresis</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#Key-enum">Qt::Key_igrave</a></td><td ><a href="qt.html#Key-enum">Qt::Key_Igrave</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#Key-enum">Qt::Key_ntilde</a></td><td ><a href="qt.html#Key-enum">Qt::Key_Ntilde</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#Key-enum">Qt::Key_oacute</a></td><td ><a href="qt.html#Key-enum">Qt::Key_Oacute</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#Key-enum">Qt::Key_ocircumflex</a></td><td ><a href="qt.html#Key-enum">Qt::Key_Ocircumflex</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#Key-enum">Qt::Key_odiaeresis</a></td><td ><a href="qt.html#Key-enum">Qt::Key_Odiaeresis</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#Key-enum">Qt::Key_ograve</a></td><td ><a href="qt.html#Key-enum">Qt::Key_Ograve</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#Key-enum">Qt::Key_oslash</a></td><td ><a href="qt.html#Key-enum">Qt::Key_Ooblique</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#Key-enum">Qt::Key_otilde</a></td><td ><a href="qt.html#Key-enum">Qt::Key_Otilde</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#Key-enum">Qt::Key_thorn</a></td><td ><a href="qt.html#Key-enum">Qt::Key_THORN</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#Key-enum">Qt::Key_uacute</a></td><td ><a href="qt.html#Key-enum">Qt::Key_Uacute</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#Key-enum">Qt::Key_ucircumflex</a></td><td ><a href="qt.html#Key-enum">Qt::Key_Ucircumflex</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#Key-enum">Qt::Key_udiaeresis</a></td><td ><a href="qt.html#Key-enum">Qt::Key_Udiaeresis</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#Key-enum">Qt::Key_ugrave</a></td><td ><a href="qt.html#Key-enum">Qt::Key_Ugrave</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#Key-enum">Qt::Key_yacute</a></td><td ><a href="qt.html#Key-enum">Qt::Key_Yacute</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt-qt3.html#ButtonState_enum-enum" class="compat">Qt::Keypad</a></td><td ><a href="qt.html#KeyboardModifier-enum">Qt::KeypadModifier</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt-qt3.html#Dock-enum" class="compat">Qt::Left</a></td><td ><a href="qt-qt3.html#Dock-enum" class="compat">Qt::DockLeft</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt-qt3.html#MacintoshVersion-enum" class="compat">Qt::MV_10_DOT_0</a></td><td ><a href="qsysinfo.html#MacVersion-enum">QSysInfo::MV_10_0</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt-qt3.html#MacintoshVersion-enum" class="compat">Qt::MV_10_DOT_1</a></td><td ><a href="qsysinfo.html#MacVersion-enum">QSysInfo::MV_10_1</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt-qt3.html#MacintoshVersion-enum" class="compat">Qt::MV_10_DOT_2</a></td><td ><a href="qsysinfo.html#MacVersion-enum">QSysInfo::MV_10_2</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt-qt3.html#MacintoshVersion-enum" class="compat">Qt::MV_10_DOT_3</a></td><td ><a href="qsysinfo.html#MacVersion-enum">QSysInfo::MV_10_3</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt-qt3.html#MacintoshVersion-enum" class="compat">Qt::MV_10_DOT_4</a></td><td ><a href="qsysinfo.html#MacVersion-enum">QSysInfo::MV_10_4</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt-qt3.html#MacintoshVersion-enum" class="compat">Qt::MV_9</a></td><td ><a href="qsysinfo.html#MacVersion-enum">QSysInfo::MV_9</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt-qt3.html#MacintoshVersion-enum" class="compat">Qt::MV_CHEETAH</a></td><td ><a href="qsysinfo.html#MacVersion-enum">QSysInfo::MV_10_0</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt-qt3.html#MacintoshVersion-enum" class="compat">Qt::MV_JAGUAR</a></td><td ><a href="qsysinfo.html#MacVersion-enum">QSysInfo::MV_10_2</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt-qt3.html#MacintoshVersion-enum" class="compat">Qt::MV_PANTHER</a></td><td ><a href="qsysinfo.html#MacVersion-enum">QSysInfo::MV_10_3</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt-qt3.html#MacintoshVersion-enum" class="compat">Qt::MV_PUMA</a></td><td ><a href="qsysinfo.html#MacVersion-enum">QSysInfo::MV_10_1</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt-qt3.html#MacintoshVersion-enum" class="compat">Qt::MV_TIGER</a></td><td ><a href="qsysinfo.html#MacVersion-enum">QSysInfo::MV_10_4</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt-qt3.html#MacintoshVersion-enum" class="compat">Qt::MV_Unknown</a></td><td ><a href="qsysinfo.html#MacVersion-enum">QSysInfo::MV_Unknown</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt-qt3.html#ButtonState_enum-enum" class="compat">Qt::MetaButton</a></td><td ><a href="qt.html#KeyboardModifier-enum">Qt::MetaModifier</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt-qt3.html#Dock-enum" class="compat">Qt::Minimized</a></td><td ><a href="qt-qt3.html#Dock-enum" class="compat">Qt::DockMinimized</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#TextFlag-enum">Qt::NoAccel</a></td><td ><a href="qt.html#TextFlag-enum">Qt::TextHideMnemonic</a></td></tr>
<tr valign="top" class="odd"><td >Qt::Overline</td><td >Qt::TextOverline</td></tr>
<tr valign="top" class="even"><td ><a href="qt-qt3.html#Dock-enum" class="compat">Qt::Right</a></td><td ><a href="qt-qt3.html#Dock-enum" class="compat">Qt::DockRight</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt-qt3.html#ButtonState_enum-enum" class="compat">Qt::ShiftButton</a></td><td ><a href="qt.html#KeyboardModifier-enum">Qt::ShiftModifier</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#TextFlag-enum">Qt::ShowPrefix</a></td><td ><a href="qt.html#TextFlag-enum">Qt::TextShowMnemonic</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#TextFlag-enum">Qt::SingleLine</a></td><td ><a href="qt.html#TextFlag-enum">Qt::TextSingleLine</a></td></tr>
<tr valign="top" class="even"><td >Qt::StrikeOut</td><td >Qt::TextStrikeOut</td></tr>
<tr valign="top" class="odd"><td ><a href="qt-qt3.html#Dock-enum" class="compat">Qt::Top</a></td><td ><a href="qt-qt3.html#Dock-enum" class="compat">Qt::DockTop</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#Corner-enum">Qt::TopLeft</a></td><td ><a href="qt.html#Corner-enum">Qt::TopLeftCorner</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#Corner-enum">Qt::TopRight</a></td><td ><a href="qt.html#Corner-enum">Qt::TopRightCorner</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt-qt3.html#Dock-enum" class="compat">Qt::TornOff</a></td><td ><a href="qt-qt3.html#Dock-enum" class="compat">Qt::DockTornOff</a></td></tr>
<tr valign="top" class="odd"><td >Qt::Underline</td><td >Qt::TextUnderline</td></tr>
<tr valign="top" class="even"><td ><a href="qt-qt3.html#Dock-enum" class="compat">Qt::Unmanaged</a></td><td ><a href="qt-qt3.html#Dock-enum" class="compat">Qt::DockUnmanaged</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#WindowType-enum">Qt::WNorthWestGravity</a></td><td ><a href="qt.html#WindowType-enum">Qt::WStaticContents</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#WindowType-enum">Qt::WRepaintNoErase</a></td><td ><a href="qt.html#WindowType-enum">Qt::WNoAutoErase</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#WindowType-enum">Qt::WStyle_Dialog</a></td><td ><a href="qt.html#WindowType-enum">Qt::WType_Dialog</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#WindowType-enum">Qt::WStyle_NoBorderEx</a></td><td ><a href="qt.html#WindowType-enum">Qt::WStyle_NoBorder</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#WindowType-enum">Qt::WType_Modal</a></td><td >(<a href="qt.html#WindowType-enum">Qt::WType_Dialog</a> | <a href="qt.html#WindowType-enum">Qt::WShowModal</a>)</td></tr>
<tr valign="top" class="even"><td ><a href="qt-qt3.html#WindowsVersion-enum" class="compat">Qt::WV_2000</a></td><td ><a href="qsysinfo.html#WinVersion-enum">QSysInfo::WV_2000</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt-qt3.html#WindowsVersion-enum" class="compat">Qt::WV_2003</a></td><td ><a href="qsysinfo.html#WinVersion-enum">QSysInfo::WV_2003</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt-qt3.html#WindowsVersion-enum" class="compat">Qt::WV_32s</a></td><td ><a href="qsysinfo.html#WinVersion-enum">QSysInfo::WV_32s</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt-qt3.html#WindowsVersion-enum" class="compat">Qt::WV_95</a></td><td ><a href="qsysinfo.html#WinVersion-enum">QSysInfo::WV_95</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt-qt3.html#WindowsVersion-enum" class="compat">Qt::WV_98</a></td><td ><a href="qsysinfo.html#WinVersion-enum">QSysInfo::WV_98</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt-qt3.html#WindowsVersion-enum" class="compat">Qt::WV_CE</a></td><td ><a href="qsysinfo.html#WinVersion-enum">QSysInfo::WV_CE</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt-qt3.html#WindowsVersion-enum" class="compat">Qt::WV_CENET</a></td><td ><a href="qsysinfo.html#WinVersion-enum">QSysInfo::WV_CENET</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt-qt3.html#WindowsVersion-enum" class="compat">Qt::WV_CE_based</a></td><td ><a href="qsysinfo.html#WinVersion-enum">QSysInfo::WV_CE_based</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt-qt3.html#WindowsVersion-enum" class="compat">Qt::WV_DOS_based</a></td><td ><a href="qsysinfo.html#WinVersion-enum">QSysInfo::WV_DOS_based</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt-qt3.html#WindowsVersion-enum" class="compat">Qt::WV_Me</a></td><td ><a href="qsysinfo.html#WinVersion-enum">QSysInfo::WV_Me</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt-qt3.html#WindowsVersion-enum" class="compat">Qt::WV_NT</a></td><td ><a href="qsysinfo.html#WinVersion-enum">QSysInfo::WV_NT</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt-qt3.html#WindowsVersion-enum" class="compat">Qt::WV_NT_based</a></td><td ><a href="qsysinfo.html#WinVersion-enum">QSysInfo::WV_NT_based</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt-qt3.html#WindowsVersion-enum" class="compat">Qt::WV_XP</a></td><td ><a href="qsysinfo.html#WinVersion-enum">QSysInfo::WV_XP</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#TextFlag-enum">Qt::WordBreak</a></td><td ><a href="qt.html#TextFlag-enum">Qt::TextWordWrap</a></td></tr>
<tr valign="top" class="even"><td >Qt::IbeamCursor</td><td ><a href="qt.html#CursorShape-enum">Qt::IBeamCursor</a></td></tr>
</table>
<p>In addition, the following <a href="qt.html#WindowType-enum">window flags</a> have been either replaced with <a href="qt.html#WidgetAttribute-enum">widget attributes</a> or have been deprecated:</p>
<table class="generic">
<thead><tr class="qt-style"><th >Qt 3 type</th><th >Qt 4 equivalent</th></tr></thead>
<tr valign="top" class="odd"><td ><a href="qt.html#WindowType-enum">Qt::WDestructiveClose</a></td><td >Use QWidget::setAttribute(<a href="qt.html#WidgetAttribute-enum">Qt::WA_DeleteOnClose</a>) instead.</td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#WindowType-enum">Qt::WStaticContents</a></td><td rowspan="2">Use QWidget::setAttribute(<a href="qt.html#WidgetAttribute-enum">Qt::WA_StaticContents</a>) instead.</td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#WindowType-enum">Qt::WNorthWestGravity</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#WindowType-enum">Qt::WNoAutoErase</a></td><td rowspan="3">Use QWidget::setAttribute(<a href="qt.html#WidgetAttribute-enum">Qt::WA_NoBackground</a>) instead.</td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#WindowType-enum">Qt::WResizeNoErase</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#WindowType-enum">Qt::WRepaintNoErase</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#WindowType-enum">Qt::WPaintClever</a></td><td >Unnecessary in Qt 4.</td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#WindowType-enum">Qt::WMacNoSheet</a></td><td >Unnecessary in Qt 4.</td></tr>
</table>
<p>In Qt 4.1, the widget flags used to determine window modality were replaced by a single enum that can be used to specify the modal behavior of top-level widgets:</p>
<table class="generic">
<thead><tr class="qt-style"><th >Qt 3 type</th><th >Qt 4 equivalent</th></tr></thead>
<tr valign="top" class="odd"><td ><a href="qt.html#WindowType-enum">Qt::WShowModal</a></td><td >Use QWidget::setWindowModality(<a href="qt.html#WindowModality-enum">Qt::ApplicationModal</a>) instead.</td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#WindowType-enum">Qt::WGroupLeader</a></td><td >Use QWidget::setWindowModality(<a href="qt.html#WindowModality-enum">Qt::WindowModal</a>) for each child dialog of the group leader, but do not change the modality of the group leader itself.</td></tr>
</table>
<a name="properties"></a><a name="properties"></a>
<h2>Properties</h2>
<p>Some properties have been renamed in Qt 4, to make Qt's API more consistent and more intuitive. For example, <a href="qwidget.html">QWidget</a>'s <tt>caption</tt> property has been renamed <tt>windowTitle</tt> to make it clear that it refers to the title shown in the window's title bar.</p>
<p>In addition, the property system has been extended to allow properties to be redefined in subclasses with the <a href="qobject.html#Q_PROPERTY">Q_PROPERTY</a>() macro, removing the need for a <tt>Q_OVERRIDE()</tt> macro.</p>
<p>The table below lists the Qt properties that have been renamed in Qt 4. Occurrences of these in <i>Qt Designer</i> UI files are automatically converted to the new name by <tt>uic</tt>.</p>
<table class="generic">
<thead><tr class="qt-style"><th >Qt 3 name</th><th >Qt 4 name</th></tr></thead>
<tr valign="top" class="odd"><td >QButton::accel</td><td >QButton::shortcut</td></tr>
<tr valign="top" class="even"><td >QButton::on</td><td >QButton::checked</td></tr>
<tr valign="top" class="odd"><td >QButton::toggleButton</td><td ><a href="qabstractbutton.html#checkable-prop">QAbstractButton::checkable</a></td></tr>
<tr valign="top" class="even"><td >QDial::lineStep</td><td ><a href="qabstractslider.html#singleStep-prop">QDial::singleStep</a></td></tr>
<tr valign="top" class="odd"><td >QDial::maxValue</td><td ><a href="qabstractslider.html#maximum-prop">QDial::maximum</a></td></tr>
<tr valign="top" class="even"><td >QDial::minValue</td><td ><a href="qabstractslider.html#minimum-prop">QDial::minimum</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qdialog.html#modal-prop">QDialog::modal</a></td><td >QDialog::isModal</td></tr>
<tr valign="top" class="even"><td >QLineEdit::edited</td><td ><a href="qlineedit.html#modified-prop">QLineEdit::modified</a></td></tr>
<tr valign="top" class="odd"><td >QLineEdit::hasMarkedText</td><td ><a href="qlineedit.html#hasSelectedText-prop">QLineEdit::hasSelectedText</a></td></tr>
<tr valign="top" class="even"><td >QLineEdit::markedText</td><td ><a href="qlineedit.html#selectedText-prop">QLineEdit::selectedText</a></td></tr>
<tr valign="top" class="odd"><td >QObject::name</td><td ><a href="qobject.html#objectName-prop">QObject::objectName</a></td></tr>
<tr valign="top" class="even"><td >QProgressDialog::progress</td><td ><a href="qprogressdialog.html#value-prop">QProgressDialog::value</a></td></tr>
<tr valign="top" class="odd"><td >QProgressDialog::totalSteps</td><td ><a href="qprogressdialog.html#maximum-prop">QProgressDialog::maximum</a></td></tr>
<tr valign="top" class="even"><td >QProgressDialog::wasCancelled</td><td ><a href="qprogressdialog.html#wasCanceled-prop">QProgressDialog::wasCanceled</a></td></tr>
<tr valign="top" class="odd"><td >QPushButton::iconSet</td><td ><a href="qabstractbutton.html#icon-prop">QPushButton::icon</a></td></tr>
<tr valign="top" class="even"><td >QScrollBar::draggingSlider</td><td ><a href="qabstractslider.html#sliderDown-prop">QScrollBar::sliderDown</a></td></tr>
<tr valign="top" class="odd"><td >QScrollBar::lineStep</td><td ><a href="qabstractslider.html#singleStep-prop">QScrollBar::singleStep</a></td></tr>
<tr valign="top" class="even"><td >QScrollBar::maxValue</td><td ><a href="qabstractslider.html#maximum-prop">QScrollBar::maximum</a></td></tr>
<tr valign="top" class="odd"><td >QScrollBar::minValue</td><td ><a href="qabstractslider.html#minimum-prop">QScrollBar::minimum</a></td></tr>
<tr valign="top" class="even"><td >QSlider::lineStep</td><td ><a href="qabstractslider.html#singleStep-prop">QSlider::singleStep</a></td></tr>
<tr valign="top" class="odd"><td >QSlider::maxValue</td><td ><a href="qabstractslider.html#maximum-prop">QSlider::maximum</a></td></tr>
<tr valign="top" class="even"><td >QSlider::minValue</td><td ><a href="qabstractslider.html#minimum-prop">QSlider::minimum</a></td></tr>
<tr valign="top" class="odd"><td >QSpinBox::lineStep</td><td ><a href="qspinbox.html#singleStep-prop">QSpinBox::singleStep</a></td></tr>
<tr valign="top" class="even"><td >QSpinBox::maxValue</td><td ><a href="qspinbox.html#maximum-prop">QSpinBox::maximum</a></td></tr>
<tr valign="top" class="odd"><td >QSpinBox::minValue</td><td ><a href="qspinbox.html#minimum-prop">QSpinBox::minimum</a></td></tr>
<tr valign="top" class="even"><td >QTabBar::currentTab</td><td ><a href="qtabbar.html#currentIndex-prop">QTabBar::currentIndex</a></td></tr>
<tr valign="top" class="odd"><td >QTabWidget::currentPage</td><td >QTabWidget::currentWidget</td></tr>
<tr valign="top" class="even"><td >QToolButton::iconSet</td><td ><a href="qabstractbutton.html#icon-prop">QToolButton::icon</a></td></tr>
<tr valign="top" class="odd"><td >QToolButton::textLabel</td><td ><a href="qabstractbutton.html#text-prop">QToolButton::text</a></td></tr>
<tr valign="top" class="even"><td >QWidget::caption</td><td ><a href="qwidget.html#windowTitle-prop">QWidget::windowTitle</a></td></tr>
<tr valign="top" class="odd"><td >QWidget::icon</td><td ><a href="qwidget.html#windowIcon-prop">QWidget::windowIcon</a></td></tr>
<tr valign="top" class="even"><td >QWidget::iconText</td><td ><a href="qwidget.html#windowIconText-prop">QWidget::windowIconText</a></td></tr>
</table>
<p>A handful of properties in Qt 3 are no longer properties in Qt 4, but the access functions still exist as part of the Qt 4 API. These are not used by <i>Qt Designer</i>; the only case where you need to worry about them is in highly dynamic applications that use Qt's meta-object system to access properties. Here's the list of these properties with the read and write functions that you can use instead:</p>
<table class="generic">
<thead><tr class="qt-style"><th >Qt 3 property</th><th >Qt 4 read function</th><th >Qt 4 write function</th></tr></thead>
<tr valign="top" class="odd"><td >QSqlDatabase::connectOptions</td><td ><a href="qsqldatabase.html#connectOptions">QSqlDatabase::connectOptions</a>()</td><td ><a href="qsqldatabase.html#setConnectOptions">QSqlDatabase::setConnectOptions</a>()</td></tr>
<tr valign="top" class="even"><td >QSqlDatabase::databaseName</td><td ><a href="qsqldatabase.html#databaseName">QSqlDatabase::databaseName</a>()</td><td ><a href="qsqldatabase.html#setDatabaseName">QSqlDatabase::setDatabaseName</a>()</td></tr>
<tr valign="top" class="odd"><td >QSqlDatabase::hostName</td><td ><a href="qsqldatabase.html#hostName">QSqlDatabase::hostName</a>()</td><td ><a href="qsqldatabase.html#setHostName">QSqlDatabase::setHostName</a>()</td></tr>
<tr valign="top" class="even"><td >QSqlDatabase::password</td><td ><a href="qsqldatabase.html#password">QSqlDatabase::password</a>()</td><td ><a href="qsqldatabase.html#setPassword">QSqlDatabase::setPassword</a>()</td></tr>
<tr valign="top" class="odd"><td >QSqlDatabase::port</td><td ><a href="qsqldatabase.html#port">QSqlDatabase::port</a>()</td><td ><a href="qsqldatabase.html#setPort">QSqlDatabase::setPort</a>()</td></tr>
<tr valign="top" class="even"><td >QSqlDatabase::userName</td><td ><a href="qsqldatabase.html#userName">QSqlDatabase::userName</a>()</td><td ><a href="qsqldatabase.html#setUserName">QSqlDatabase::setUserName</a>()</td></tr>
</table>
<p>Some properties have been removed from Qt 4, but the associated access functions are provided if <tt>QT3_SUPPORT</tt> is defined to help porting to Qt 4. When converting Qt 3 UI files to Qt 4, <tt>uic</tt> generates calls to the Qt 3 compatibility functions. Note that this only applies to the properties of the <a href="qt3support.html">Qt3Support</a> library, i.e. <tt>QT3_SUPPORT</tt> properties of the other libraries must be ported manually when converting Qt 3 UI files to Qt 4.</p>
<p>The table below lists these properties with the read and write functions that you can use instead. The documentation for the individual functions explains how to replace them with non-compatibility Qt 4 functions.</p>
<table class="generic">
<thead><tr class="qt-style"><th >Qt 3 property</th><th >Qt 4 read function (<tt>QT3_SUPPORT</tt>)</th><th >Qt 4 write function (<tt>QT3_SUPPORT</tt>)</th></tr></thead>
<tr valign="top" class="odd"><td >QMenuBar::separator</td><td ><a href="qmenubar-qt3.html#separator" class="compat">QMenuBar::separator</a>()</td><td ><a href="qmenubar-qt3.html#setSeparator" class="compat">QMenuBar::setSeparator</a>()</td></tr>
<tr valign="top" class="even"><td >QPushButton::menuButton</td><td ><a href="qpushbutton-qt3.html#isMenuButton" class="compat">QPushButton::isMenuButton</a>()</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td >QTabWidget::margin</td><td ><a href="qtabwidget-qt3.html#margin" class="compat">QTabWidget::margin</a>()</td><td ><a href="qtabwidget-qt3.html#setMargin" class="compat">QTabWidget::setMargin</a>()</td></tr>
<tr valign="top" class="even"><td >QTextEdit::textFormat</td><td ><a href="qtextedit-qt3.html#textFormat" class="compat">QTextEdit::textFormat</a>()</td><td ><a href="qtextedit-qt3.html#setTextFormat" class="compat">QTextEdit::setTextFormat</a>()</td></tr>
<tr valign="top" class="odd"><td >QWidget::backgroundBrush</td><td >QWidget::backgroundBrush()</td><td >N/A</td></tr>
<tr valign="top" class="even"><td >QWidget::backgroundMode</td><td ><a href="qwidget-qt3.html#backgroundMode" class="compat">QWidget::backgroundMode</a>()</td><td ><a href="qwidget-qt3.html#setBackgroundMode" class="compat">QWidget::setBackgroundMode</a>()</td></tr>
<tr valign="top" class="odd"><td >QWidget::backgroundOrigin</td><td ><a href="qwidget-qt3.html#backgroundOrigin" class="compat">QWidget::backgroundOrigin</a>()</td><td ><a href="qwidget-qt3.html#setBackgroundOrigin" class="compat">QWidget::setBackgroundOrigin</a>()</td></tr>
<tr valign="top" class="even"><td >QWidget::colorGroup</td><td ><a href="qwidget-qt3.html#colorGroup" class="compat">QWidget::colorGroup</a>()</td><td >QWidget::setColorGroup()</td></tr>
<tr valign="top" class="odd"><td >QWidget::customWhatsThis</td><td >QWidget::customWhatsThis()</td><td >QWidget::setCustomWhatsThis()</td></tr>
<tr valign="top" class="even"><td >QWidget::inputMethodEnabled</td><td >QWidget::inputMethodEnabled()</td><td ><a href="qwidget-qt3.html#setInputMethodEnabled" class="compat">QWidget::setInputMethodEnabled</a>()</td></tr>
<tr valign="top" class="odd"><td >QWidget::ownCursor</td><td ><a href="qwidget-qt3.html#ownCursor" class="compat">QWidget::ownCursor</a>()</td><td >N/A</td></tr>
<tr valign="top" class="even"><td >QWidget::ownFont</td><td ><a href="qwidget-qt3.html#ownFont" class="compat">QWidget::ownFont</a>()</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td >QWidget::ownPalette</td><td ><a href="qwidget-qt3.html#ownPalette" class="compat">QWidget::ownPalette</a>()</td><td >N/A</td></tr>
<tr valign="top" class="even"><td >QWidget::paletteBackgroundColor</td><td >QWidget::paletteBackgroundColor()</td><td ><a href="qwidget-qt3.html#setPaletteBackgroundColor" class="compat">QWidget::setPaletteBackgroundColor</a>()</td></tr>
<tr valign="top" class="odd"><td >QWidget::paletteBackgroundPixmap</td><td >QWidget::paletteBackgroundPixmap()</td><td ><a href="qwidget-qt3.html#setPaletteBackgroundPixmap" class="compat">QWidget::setPaletteBackgroundPixmap</a>()</td></tr>
<tr valign="top" class="even"><td >QWidget::paletteForegroundColor</td><td >QWidget::paletteForegroundColor()</td><td ><a href="qwidget-qt3.html#setPaletteForegroundColor" class="compat">QWidget::setPaletteForegroundColor</a>()</td></tr>
<tr valign="top" class="odd"><td >QWidget::underMouse</td><td ><a href="qwidget.html#underMouse">QWidget::underMouse</a>()</td><td >N/A</td></tr>
</table>
<p>The following Qt 3 properties and their access functions are no longer available in Qt 4. In most cases, Qt 4 provides similar functionality.</p>
<table class="generic">
<thead><tr class="qt-style"><th >Qt 3 property</th><th >Qt 4 equivalent</th></tr></thead>
<tr valign="top" class="odd"><td >QButton::autoRepeat</td><td >N/A</td></tr>
<tr valign="top" class="even"><td >QButton::autoResize</td><td >Call <a href="qwidget.html">QWidget</a>:setFixedSize(<a href="qwidget.html#sizeHint-prop">QWidget::sizeHint</a>()) whenever you change the contents.</td></tr>
<tr valign="top" class="odd"><td >QButton::exclusiveToggle</td><td >See <a href="qabstractbutton.html#autoExclusive-prop">QAbstractButton::autoExclusive</a>.</td></tr>
<tr valign="top" class="even"><td >QButton::pixmap</td><td >Use <a href="qabstractbutton.html#icon-prop">QAbstractButton::icon</a> instead.</td></tr>
<tr valign="top" class="odd"><td >QButton::toggleState</td><td >Use <a href="qcheckbox-qt3.html#setState" class="compat">QCheckBox::setState</a>() and <a href="qcheckbox-qt3.html#state" class="compat">QCheckBox::state</a>() instead.</td></tr>
<tr valign="top" class="even"><td >QButton::toggleType</td><td >Use <a href="qcheckbox.html#tristate-prop">QCheckBox::setTristate</a>() instead.</td></tr>
<tr valign="top" class="odd"><td >QComboBox::autoResize</td><td >Call <a href="qwidget.html">QWidget</a>:setFixedSize(<a href="qwidget.html#sizeHint-prop">QWidget::sizeHint</a>()) whenever you change the contents.</td></tr>
<tr valign="top" class="even"><td >QFrame::contentsRect</td><td >Use <a href="q3frame.html#contentsRect-prop">Q3Frame::contentsRect</a>() instead.</td></tr>
<tr valign="top" class="odd"><td >QFrame::margin</td><td >Use <a href="qwidget.html#setContentsMargins">QWidget::setContentsMargins</a>() instead.</td></tr>
<tr valign="top" class="even"><td >QTabBar::keyboardFocusTab</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td >QToolButton::offIconSet</td><td >Use the <a href="qicon.html#State-enum">off component</a> of <a href="qabstractbutton.html#icon-prop">QAbstractButton::icon</a> instead.</td></tr>
<tr valign="top" class="even"><td >QToolButton::onIconSet</td><td >Use the <a href="qicon.html#State-enum">on component</a> of <a href="qabstractbutton.html#icon-prop">QAbstractButton::icon</a> instead.</td></tr>
<tr valign="top" class="odd"><td >QWidget::microFocusHint</td><td >N/A</td></tr>
<tr valign="top" class="even"><td >QMimeSource::serialNumber ()</td><td >N/A</td></tr>
</table>
<a name="explicit-sharing"></a>
<h2>Explicit Sharing</h2>
<p>Qt 4 is the first version of Qt that contains no <a href="http://doc.qt.nokia.com/3.3/shclass.html">explicitly shared</a> classes. All classes that were explicitly shared in Qt 3 are <i>implicitly</i> shared in Qt 4:</p>
<ul>
<li><a href="qimage.html">QImage</a></li>
<li><a href="qbitarray.html">QBitArray</a></li>
<li><a href="qbytearray.html">QByteArray</a></li>
<li><a href="q3pointarray.html" class="compat">Q3PointArray</a></li>
</ul>
<p>This means that if you took a copy of an instance of the class (using operator=() or the class's copy constructor), any modification to the copy would affect the original and vice versa. Needless to say, this behavior is rarely desirable.</p>
<p>Fortunately, nearly all Qt 3 applications don't rely on explicit sharing. When porting, you typically only need to remove calls to detach() and/or copy(), which aren't necessary anymore.</p>
<p>If you deliberately rely on explicit sharing in your application, you can use pointers or references to achieve the same result in Qt 4.</p>
<p>For example, if you have code like</p>
<pre class="cpp"> void asciify(QByteArray array)
{
for (int i = 0; i < (int)array.size(); ++i) {
if ((uchar)array[i] >= 128)
array[i] = '?';
}
}</pre>
<p>you can rewrite it as</p>
<pre class="cpp"> <span class="type">void</span> asciify(<span class="type"><a href="qbytearray.html">QByteArray</a></span> <span class="operator">&</span>array)
{
<span class="keyword">for</span> (<span class="type">int</span> i <span class="operator">=</span> <span class="number">0</span>; i <span class="operator"><</span> array<span class="operator">.</span>size(); <span class="operator">+</span><span class="operator">+</span>i) {
<span class="keyword">if</span> ((<span class="type"><a href="qtglobal.html#uchar-typedef">uchar</a></span>)array<span class="operator">[</span>i<span class="operator">]</span> <span class="operator">></span><span class="operator">=</span> <span class="number">128</span>)
array<span class="operator">[</span>i<span class="operator">]</span> <span class="operator">=</span> <span class="char">'?'</span>;
}
}</pre>
<p>(Notice the <tt>&</tt> in the parameter declaration.)</p>
<a name="painting-and-redrawing-widgets"></a>
<h2>Painting and Redrawing Widgets</h2>
<p>When implementing custom widgets in Qt 3, it was possible to use <a href="qpainter.html">QPainter</a> to draw on a widget outside paint events. This made it possible to integrate Qt applications with third party libraries and tools that impose their own rendering models. For example, a widget might be repainted in a slot using data obtained from an external source.</p>
<p>In Qt 4, it is only possible to paint on a widget from within its <a href="qwidget.html#paintEvent">paintEvent()</a> handler function. This restriction simplifies Qt's interaction with native window systems, improves the performance of applications by reducing the number of redraw operations, and also enables features to be implemented to improve the appearance of widgets, such as a backing store.</p>
<p>Generally, we recommend redesigning applications to perform all painting operations in <a href="qwidget.html#paintEvent">paintEvent()</a> functions, deferring actual painting until the next time this function is called. Applications can post paint events to trigger repaints, and it may be possible to examine your widget's internal state to determine which part of the widget needs to be repainted.</p>
<p>If asynchronous repaints are used extensively by your application, and it is not practical to redesign the rendering model to perform all painting operations from within a widget's <a href="qwidget.html#paintEvent">paintEvent()</a> function, it may be necessary to consider using an intermediate painting step. In this approach, one or more images can be updated asynchronously and painted on the widget in the paint event. To avoid excessive buffering, it may be worthwhile disabling the backing store by setting the widget's <a href="qt.html#WidgetAttribute-enum">Qt::WA_PaintOnScreen</a> widget attribute.</p>
<p>On certain platforms, the <a href="qt.html#WidgetAttribute-enum">Qt::WA_PaintOutsidePaintEvent</a> widget attribute can be set to allow a widget to be painted from outside paint events.</p>
<p><b>Note:</b> Setting widget attributes to disable key features of Qt's widget rendering model may also cause other features to be disabled.</p>
<a name="compatibility-signals-and-slots"></a>
<h2>Compatibility Signals and Slots</h2>
<p>When <tt>QT3_SUPPORT</tt> is defined, the default connection type for signals and slots is the <a href="qt.html#ConnectionType-enum">Qt::AutoCompatConnection</a> type. This allows so-called <i>compatibility</i> signals and slots (defined in Qt 3 support mode to provide Qt 3 compatibility features) to be connected to other signals and slots.</p>
<p>However, if Qt is compiled with debugging output enabled, and the developer uses other connection types to connect to compatibility signals and slots (perhaps by building their application without Qt 3 support enabled), then Qt will output warnings to the console to indicate that compatibility connections are being made. This is intended to be used as an aid in the process of porting a Qt 3 application to Qt 4.</p>
<a name="qaccel"></a>
<h2>QAccel</h2>
<p>The <tt>QAccel</tt> class has been renamed <a href="q3accel.html" class="compat">Q3Accel</a> and moved to the <a href="qt3support.html">Qt3Support</a> module. In new applications, you have three options:</p>
<ol class="1">
<li>You can use <a href="qaction.html">QAction</a> and set a key sequence using <a href="qaction.html#shortcut-prop">QAction::setShortcut</a>().</li>
<li>You can use <a href="qshortcut.html">QShortcut</a>, a class that provides similar functionality to <a href="q3accel.html" class="compat">Q3Accel</a>.</li>
<li>You can use <a href="qwidget.html#grabShortcut">QWidget::grabShortcut</a>() and process "shortcut" events by reimplementing <a href="qwidget.html#event">QWidget::event</a>().</li>
</ol>
<p>The <a href="q3accel.html" class="compat">Q3Accel</a> class also supports multiple accelerators using the same object, by calling <a href="q3accel.html#insertItem">Q3Accel::insertItem</a>() multiple times. In Qt 4, the solution is to create multiple <a href="qshortcut.html">QShortcut</a> objects.</p>
<a name="qaccessibleinterface"></a>
<h2>QAccessibleInterface</h2>
<p>The <a href="qaccessibleinterface.html">QAccessibleInterface</a> class has undergone some API changes in Qt 4, to make it more consistent with the rest of the Qt API.</p>
<p>If you have classes that inherit <a href="qaccessibleinterface.html">QAccessibleInterface</a> or one of its subclasses (<a href="qaccessibleobject.html">QAccessibleObject</a>, <a href="qaccessiblewidget.html">QAccessibleWidget</a>, etc.), you must port them the new <a href="qaccessibleinterface.html">QAccessibleInterface</a> API.</p>
<p>See <a href="porting4-virtual-functions.html">Virtual Functions</a> for a list of <a href="qaccessibleinterface.html">QAccessibleInterface</a> virtual member functions in Qt 3 that are no longer virtual in Qt 4.</p>
<a name="qaccessibletitlebar"></a>
<h2>QAccessibleTitleBar</h2>
<p>The <tt>QAccessibleTitleBar</tt> has been renamed Q3AccessibleTitleBar and moved to the <a href="qt3support.html">Qt3Support</a> library.</p>
<a name="qaction-section"></a><a name="qaction"></a>
<h2>QAction</h2>
<p>The <a href="qaction.html">QAction</a> class has been redesigned in Qt 4 to integrate better with the rest of the menu system. It unifies the old <tt>QMenuItem</tt> class and the old <tt>QAction</tt> class into one class, avoiding unnecessary data duplication and the need to learn two different APIs.</p>
<p>The old <tt>QAction</tt> and <tt>QActionGroup</tt> classes have been renamed <a href="q3action.html" class="compat">Q3Action</a> and <a href="q3actiongroup.html" class="compat">Q3ActionGroup</a> and moved to <a href="qt3support.html">Qt3Support</a>. In addition, the new <a href="qaction.html">QAction</a> class has compatibility functions to ease transition to Qt 4. Note that when using <a href="q3toolbar.html" class="compat">Q3ToolBar</a> and <a href="q3popupmenu.html" class="compat">Q3PopupMenu</a>, their actions must be <a href="q3action.html" class="compat">Q3Action</a>s.</p>
<p>See <a href="porting4-virtual-functions.html">Virtual Functions</a> for a list of <a href="qaction.html">QAction</a> virtual member functions in Qt 3 that are no longer virtual in Qt 4.</p>
<a name="qactiongroup"></a>
<h2>QActionGroup</h2>
<p>The <a href="qaction.html">QAction</a> class has been completely redesigned in Qt 4 to integrate better with the rest of the menu system. See the <a href="#qaction-section">section on QAction</a> for details.</p>
<a name="qapplication"></a>
<h2>QApplication</h2>
<p>The <a href="qapplication.html">QApplication</a> class has been split into two classes: <a href="qcoreapplication.html">QCoreApplication</a> and <a href="qapplication.html">QApplication</a>. The new <a href="qapplication.html">QApplication</a> class inherits <a href="qcoreapplication.html">QCoreApplication</a> and adds GUI-related functionality. In practice, this has no consequences for existing Qt applications.</p>
<p>In addition, the following API changes were made:</p>
<ol class="1">
<li><a href="qapplication.html#allWidgets">QApplication::allWidgets</a>() and <a href="qapplication.html#topLevelWidgets">QApplication::topLevelWidgets</a>() used to return a pointer to a <a href="qwidget.html#QWidgetList-typedef">QWidgetList</a>. Now they return a <a href="qwidget.html#QWidgetList-typedef">QWidgetList</a>.<p>Also, <a href="qwidget.html#QWidgetList-typedef">QWidgetList</a> has changed from being a typedef for QPtrList<<a href="qwidget.html">QWidget</a>> to being a typedef for <a href="qlist.html">QList</a><<a href="qwidget.html">QWidget</a> *>. See the <a href="#qwidgetlist-section">section on QWidgetList</a> below for details.</p>
<p>For example, if you have code like</p>
<pre class="cpp"> QWidgetList *list = QApplication::topLevelWidgets();
QWidgetListIt it(*list);
QWidget *widget;
while ((widget = it.current())) {
if (widget->inherits("MainWindow"))
((MainWindow *)widget)->updateRecentFileItems();
++it;
}
delete list;</pre>
<p>you can rewrite it as</p>
<pre class="cpp"> <span class="type"><a href="qwidget.html#QWidgetList-typedef">QWidgetList</a></span> list <span class="operator">=</span> <span class="type"><a href="qapplication.html">QApplication</a></span><span class="operator">::</span>topLevelWidgets();
<span class="keyword">for</span> (<span class="type">int</span> i <span class="operator">=</span> <span class="number">0</span>; i <span class="operator"><</span> list<span class="operator">.</span>size(); <span class="operator">+</span><span class="operator">+</span>i) {
<span class="keyword">if</span> (MainWindow <span class="operator">*</span>mainWin <span class="operator">=</span> qobject_cast<span class="operator"><</span>MainWindow <span class="operator">*</span><span class="operator">></span>(list<span class="operator">.</span>at(i)))
mainWin<span class="operator">-</span><span class="operator">></span>updateRecentFileItems();
}</pre>
</li>
<li><a href="qapplication-qt3.html#setMainWidget" class="compat">QApplication::setMainWidget</a>() is no longer used. When all an application's windows are closed, the application will exit normally.</li>
</ol>
<a name="qaquastyle"></a>
<h2>QAquaStyle</h2>
<p>The <tt>QAquaStyle</tt> class first appeared in Qt 3.0, when the Qt for Mac OS X port was first released. It emulated Apple's "Aqua" theme. In Qt 3.1, <a href="#qaquastyle">QAquaStyle</a> was obsoleted by <a href="qmacstyle.html">QMacStyle</a>, which uses Appearance Manager to perform its drawing.</p>
<p>The <tt>QAquaStyle</tt> class is no longer provided in Qt 4. Use <a href="qmacstyle.html">QMacStyle</a> instead.</p>
<a name="qasciidict-section"></a><a name="qasciicache-t"></a>
<h2>QAsciiCache<T></h2>
<p><tt>QAsciiCache<T></tt> has been renamed <a href="q3asciicache.html" class="compat">Q3AsciiCache</a><T> and moved to the <a href="qt3support.html">Qt3Support</a> library. It has been replaced by <a href="qcache.html">QCache</a><<a href="qbytearray.html">QByteArray</a>, T>.</p>
<p>For details, read the <a href="#qcache-section">section on QCache<T></a>, mentally substituting <a href="qbytearray.html">QByteArray</a> for <a href="qstring.html">QString</a>.</p>
<a name="qasciidict-t"></a>
<h2>QAsciiDict<T></h2>
<p>QAsciiDict<T> and QAsciiDictIterator<T> have been renamed <a href="q3asciidict.html" class="compat">Q3AsciiDict</a><T> and <a href="q3asciidictiterator.html" class="compat">Q3AsciiDictIterator</a><T> and moved to the <a href="qt3support.html">Qt3Support</a> library. They have been replaced by the more modern <a href="qhash.html">QHash</a><Key, T> and <a href="qmultihash.html">QMultiHash</a><Key, T> classes and their associated iterator classes.</p>
<p>When porting old code that uses <a href="q3asciidict.html" class="compat">Q3AsciiDict</a><T> to Qt 4, there are four classes that you can use:</p>
<ul>
<li><a href="qmultihash.html">QMultiHash</a><<a href="qbytearray.html">QByteArray</a>, T *></li>
<li><a href="qmultihash.html">QMultiHash</a><<a href="qbytearray.html">QByteArray</a>, T></li>
<li><a href="qhash.html">QHash</a><<a href="qbytearray.html">QByteArray</a>, T *></li>
<li><a href="qhash.html">QHash</a><<a href="qbytearray.html">QByteArray</a>, T></li>
</ul>
<p>For details, read the <a href="#qdict-section">section on QDict<T></a>, mentally substituting <a href="qbytearray.html">QByteArray</a> for <a href="qstring.html">QString</a>.</p>
<a name="qasyncio"></a>
<h2>QAsyncIO</h2>
<p>The <tt>QAsyncIO</tt> class was used internally in Qt 2.x in conjunction with QImageConsumer. It was obsoleted in Qt 3.0.</p>
<p>If you use this mechanism in your application, please submit a report to the <a href="http://bugreports.qt-project.org">Task Tracker</a> on the Qt website and we will try to find a satisfactory substitute.</p>
<a name="qbackinsertiterator"></a>
<h2>QBackInsertIterator</h2>
<p>The undocumented <tt>QBackInsertIterator</tt> class has been removed from the Qt library. If you need it in your application, feel free to copy the source code from the Qt 3 <tt><qtl.h></tt> header file.</p>
<a name="qbitarray"></a>
<h2>QBitArray</h2>
<p>In Qt 3, <a href="qbitarray.html">QBitArray</a> inherited from <a href="qbytearray.html">QByteArray</a>. In Qt 4, <a href="qbitarray.html">QBitArray</a> is a totally independent class. This makes very little difference to the user, except that the new <a href="qbitarray.html">QBitArray</a> doesn't provide any of <a href="qbytearray.html">QByteArray</a>'s byte-based API anymore. These calls will result in a compile-time error, except calls to <a href="qbitarray.html#truncate">QBitArray::truncate</a>(), whose parameter was a number of <i>bytes</i> in Qt 3 and a number of bits in Qt 4.</p>
<p><a href="qbitarray.html">QBitArray</a> was an explicitly shared class in Qt 3. See <a href="#explicit-sharing">Explicit Sharing</a> for more information.</p>
<p>The <tt>QBitVal</tt> class has been renamed QBitRef.</p>
<a name="qbutton"></a>
<h2>QButton</h2>
<p>The <tt>QButton</tt> class has been replaced by <a href="qabstractbutton.html">QAbstractButton</a> in Qt 4. Classes like <a href="qpushbutton.html">QPushButton</a> and <a href="qradiobutton.html">QRadioButton</a> inherit from <a href="qabstractbutton.html">QAbstractButton</a>. As a help when porting older Qt applications, the <a href="qt3support.html">Qt3Support</a> library contains a <a href="q3button.html" class="compat">Q3Button</a> class implemented in terms of the new <a href="qabstractbutton.html">QAbstractButton</a>.</p>
<p>If you used the <tt>QButton</tt> class as a base class for your own button type and want to port your code to the newer <a href="qabstractbutton.html">QAbstractButton</a>, you need to be aware that <a href="qabstractbutton.html">QAbstractButton</a> has no equivalent for the Q3Button::drawButton(<a href="qpainter.html">QPainter</a> *) virtual function. The solution is to reimplement <a href="qwidget.html#paintEvent">QWidget::paintEvent</a>() in your <a href="qabstractbutton.html">QAbstractButton</a> subclass as follows:</p>
<pre class="cpp"> <span class="type">void</span> MyButton<span class="operator">::</span>paintEvent(<span class="type"><a href="qpaintevent.html">QPaintEvent</a></span> <span class="operator">*</span>)
{
<span class="type"><a href="qpainter.html">QPainter</a></span> painter(<span class="keyword">this</span>);
drawButton(<span class="operator">&</span>painter);
}</pre>
<table class="generic">
<thead><tr class="qt-style"><th ><a href="q3button.html" class="compat">Q3Button</a> function</th><th ><a href="qabstractbutton.html">QAbstractButton</a> equivalent</th></tr></thead>
<tr valign="top" class="odd"><td >Q3Button::autoResize()</td><td >Call <a href="qwidget.html">QWidget</a>:setFixedSize(<a href="qwidget.html#sizeHint-prop">QWidget::sizeHint</a>()) whenever you change the contents.</td></tr>
<tr valign="top" class="even"><td >Q3Button::isExclusiveToggle()</td><td >Use <a href="qabstractbutton.html#group">QAbstractButton::group</a>() or <a href="qabstractbutton.html#autoExclusive-prop">QAbstractButton::autoExclusive</a>() instead.</td></tr>
<tr valign="top" class="odd"><td ><a href="qabstractbutton-qt3.html#pixmap" class="compat">Q3Button::pixmap</a>() const</td><td ><a href="qabstractbutton.html#icon-prop">QAbstractButton::icon</a>()</td></tr>
<tr valign="top" class="even"><td >Q3Button::setAutoResize()</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td >Q3Button::setPixmap(const <a href="qpixmap.html">QPixmap</a> &)</td><td >QAbstractButton::setIcon(const <a href="qicon.html">QIcon</a> &)</td></tr>
<tr valign="top" class="even"><td >Q3Button::setState(ToggleState)</td><td >See remark below</td></tr>
<tr valign="top" class="odd"><td >Q3Button::setToggleType(ToggleType)</td><td >See remark below</td></tr>
<tr valign="top" class="even"><td >Q3Button::state()</td><td >See remark below</td></tr>
<tr valign="top" class="odd"><td >Q3Button::stateChanged(int)</td><td >See remark below</td></tr>
<tr valign="top" class="even"><td >Q3Button::toggleType()</td><td >See remark below</td></tr>
</table>
<p>Remarks:</p>
<ol class="1">
<li>In Qt 3, <tt>QButton</tt> had a "toggle type", which could be QButton::SingleShot, QButton::Toggle, or QButton::Tristate. The new <a href="qabstractbutton.html">QAbstractButton</a> class doesn't support "tristate" directly; this feature is implemented in <a href="qcheckbox.html">QCheckBox</a> instead. The two other "toggle types" (<tt>QButton::SingleShot</tt> and <tt>QButton::Toggle</tt>) are replaced by a <a href="qabstractbutton.html#checkable-prop">QAbstractButton::checkable</a> property.</li>
<li>In Qt 3, <a href="#qbutton">QButton</a> had a "toggle state", which could be <tt>QButton::Off</tt>, <tt>QButton::NoChange</tt>, or <tt>QButton::On</tt>. In Qt 4, this mechanism has been moved to <a href="qcheckbox.html">QCheckBox</a>.</li>
</ol>
<p>See <a href="porting4-virtual-functions.html">Virtual Functions</a> for a list of <tt>QButton</tt> virtual member functions in Qt 3 that aren't virtual in Qt 4.</p>
<p>See <a href="#properties">Properties</a> for a list of <tt>QButton</tt> properties in Qt 3 that have changed in Qt 4.</p>
<a name="qbuttongroup"></a>
<h2>QButtonGroup</h2>
<p>The <tt>QButtonGroup</tt> class has been completely redesigned in Qt 4. For compatibility, the old <tt>QButtonGroup</tt> class has been renamed <a href="q3buttongroup.html" class="compat">Q3ButtonGroup</a> and has been moved to <a href="qt3support.html">Qt3Support</a>. Likewise, the <tt>QHButtonGroup</tt> and <tt>QVButtonGroup</tt> convenience subclasses have been renamed <tt>Q3HButtonGroup</tt> and <tt>Q3VButtonGroup</tt> and moved to the <a href="qt3support.html">Qt3Support</a> library.</p>
<p>The old <tt>QButtonGroup</tt>, as well as <a href="q3buttongroup.html" class="compat">Q3ButtonGroup</a>, can be used in two ways:</p>
<ol class="1">
<li>The button group is the parent widget of a number of buttons, i.e. the button group is the parent argument in the button constructor. The buttons are assigned identifiers 0, 1, 2, etc., in the order they are created. A <a href="q3buttongroup.html" class="compat">Q3ButtonGroup</a> can display a frame and a title because it inherits <a href="q3groupbox.html" class="compat">Q3GroupBox</a>.</li>
<li>The button group is an invisible widget and the contained buttons have some other parent widget. In this usage, each button must be manually inserted, using <a href="q3buttongroup.html#insert">Q3ButtonGroup::insert</a>(), into the button group and given an ID number.</li>
</ol>
<p>Unlike <a href="q3buttongroup.html" class="compat">Q3ButtonGroup</a>, the new <a href="qbuttongroup.html">QButtonGroup</a> doesn't inherit <a href="qwidget.html">QWidget</a>. It is very similar to a "hidden <a href="q3buttongroup.html" class="compat">Q3ButtonGroup</a>".</p>
<p>If you use a <a href="q3buttongroup.html" class="compat">Q3ButtonGroup</a>, <a href="q3hbuttongroup.html" class="compat">Q3HButtonGroup</a>, or <a href="q3vbuttongroup.html" class="compat">Q3VButtonGroup</a> as a widget and want to port to Qt 4, you can replace it with <a href="qgroupbox.html">QGroupBox</a>. In Qt 4, radio buttons with the same parent are automatically part of an exclusive group, so you normally don't need to do anything else. See also the <a href="#qgroupbox-section">section on QGroupBox</a> below.</p>
<p>See <a href="porting4-virtual-functions.html">Virtual Functions</a> for a list of <a href="qbuttongroup.html">QButtonGroup</a> virtual member functions in Qt 3 that are no longer virtual in Qt 4.</p>
<a name="qbytearray-section"></a><a name="qbytearray"></a>
<h2>QByteArray</h2>
<p>In Qt 3, <a href="qbytearray.html">QByteArray</a> was simply a typedef for QMemArray<char>. In Qt 4, <a href="qbytearray.html">QByteArray</a> is a class in its own right, with a higher-level API in the style of <a href="qstring.html">QString</a>.</p>
<p>Here are the main issues to be aware of when porting to Qt 4:</p>
<ol class="1">
<li>The QMemArray(int size) constructor has been replaced with <a href="qbytearray.html">QByteArray</a>(int size, char ch). The second argument specifies which character should be used for initializing the array; pass '\0' if you have no specific needs.<p>For example, if you have code like</p>
<pre class="cpp"> QByteArray ba(64);</pre>
<p>you can rewrite it as</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> ba(<span class="number">64</span><span class="operator">,</span> <span class="char">'\0'</span>);</pre>
</li>
<li>QMemArray::at() returned a non-const reference, whereas the new <a href="qbytearray.html#at">QByteArray::at</a>() returns a const value. Code like<pre class="cpp"> ba<span class="operator">.</span>at(<span class="number">0</span>) <span class="operator">=</span> <span class="char">'X'</span>;</pre>
<p>will no longer compile. Instead, use QByteArray::operator[]:</p>
<pre class="cpp"> ba<span class="operator">[</span><span class="number">0</span><span class="operator">]</span> <span class="operator">=</span> <span class="char">'X'</span>;</pre>
</li>
<li>The QMemArray::contains(char) function has been renamed QByteArray::count(char). In addition, there now exists a QByteArray::contains(char) function that returns a boolean value. Replace old calls to contains() with either count() or contains(), depending on whether you care about the specific number of occurrences of a character in the byte array or only care about whether the array contains that character or not.</li>
<li>The new <a href="qbytearray.html">QByteArray</a> has no assign() function. Calls to QMemArray::assign(const QMemArray &) can be replaced by calls to QByteArray::operator=(). Calls to QMemArray::assign(const T *, uint) have no equivalent in Qt 4; if you use it, the solution is either to use <a href="qbytearray.html#fromRawData">QByteArray::fromRawData</a>() and to call free() yourself to avoid a memory leak, or to use the <a href="qbytearray.html">QByteArray</a>(const char *, int) constructor, which will take a deep copy of the data.</li>
<li>QMemArray::bsearch() and QMemArray::sort() have no equivalent in the new <a href="qbytearray.html">QByteArray</a> class. Use <a href="qtalgorithms.html#qBinaryFind">qBinaryFind</a>() and <a href="qtalgorithms.html#qSort">qSort</a>() if you need that functionality.</li>
</ol>
<p><a href="qbytearray.html">QByteArray</a> was an explicitly shared class in Qt 3. See <a href="#explicit-sharing">Explicit Sharing</a> for more information.</p>
<a name="qcache-section"></a><a name="qcache-t"></a>
<h2>QCache<T></h2>
<p><a href="qcache.html">QCache</a><T> has been renamed <a href="q3cache.html" class="compat">Q3Cache</a><T> and moved to <a href="qt3support.html">Qt3Support</a>. The new <a href="qcache.html">QCache</a> class has a different API, and takes different template parameters: <a href="qcache.html">QCache</a><Key, T>.</p>
<p>When porting to Qt 4, <a href="qcache.html">QCache</a><<a href="qstring.html">QString</a>, T> is the obvious substitute for <a href="q3cache.html" class="compat">Q3Cache</a><T>. The following table summarizes the API differences.</p>
<table class="generic">
<thead><tr class="qt-style"><th ><a href="q3cache.html" class="compat">Q3Cache</a><T> function</th><th ><a href="qcache.html">QCache</a><<a href="qstring.html">QString</a>, T> equivalent</th></tr></thead>
<tr valign="top" class="odd"><td >Q3Cache::Q3Cache(int maxCost, int size, bool caseSensitive)</td><td >See remark below</td></tr>
<tr valign="top" class="even"><td ><a href="q3ptrcollection.html#autoDelete">Q3Cache::autoDelete</a>()</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td ><a href="q3cache.html#count">Q3Cache::count</a>()</td><td ><a href="qcache.html#count">QCache::count</a>() or <a href="qcache.html#size">QCache::size</a>() (equivalent)</td></tr>
<tr valign="top" class="even"><td ><a href="q3ptrcollection.html#setAutoDelete">Q3Cache::setAutoDelete</a>()</td><td >See remark below</td></tr>
<tr valign="top" class="odd"><td ><a href="q3cache.html#size">Q3Cache::size</a>()</td><td >N/A</td></tr>
<tr valign="top" class="even"><td ><a href="q3cache.html#statistics">Q3Cache::statistics</a>()</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td >Q3Cache::operator=()</td><td >See remark below</td></tr>
</table>
<p>Remarks:</p>
<ol class="1">
<li><a href="q3cache.html" class="compat">Q3Cache</a> requires the user to allocate a specific number of buckets by passing a prime number (17 by default) to the constructor. In contrast, the new <a href="qcache.html">QCache</a>'s hash table automatically grows and shrinks as needed, and the constructor doesn't take a prime number.</li>
<li><a href="q3cache.html" class="compat">Q3Cache</a> supportes case-insensitive lookups by passing false as second argument to the constructor. This feature has no equivalent in <a href="qmultihash.html">QMultiHash</a>. Instead, call <a href="qstring.html#toLower">QString::toLower</a>() before you insert or lookup a key in the hash.</li>
<li>The <a href="q3cache.html#insert">Q3Cache::insert</a>() function returns a <tt>bool</tt> value that indicates whether or not the item actually was inserted in the cache. If the item wasn't inserted, it was the caller's responsibility to delete the item. The new <a href="qcache.html#insert">QCache::insert</a>() function returns <tt>void</tt> and either adds it to the cache or deletes it right away. Old code like<pre class="cpp"> <span class="keyword">if</span> (<span class="operator">!</span>cache<span class="operator">.</span>insert(key<span class="operator">,</span> object))
<span class="keyword">delete</span> object;</pre>
<p>becomes</p>
<pre class="cpp"> cache<span class="operator">.</span>insert(key<span class="operator">,</span> object);</pre>
</li>
<li>The new <a href="qcache.html">QCache</a> class <i>always</i> takes ownership of the items it stores (i.e. auto-delete is always on). If you use <a href="q3cache.html" class="compat">Q3Cache</a> with auto-delete turned off (the rarely useful default), you cannot use <a href="qcache.html">QCache</a> as a direct substitute. One unelegant trick that works well in practice is to use <a href="qcache.html">QCache</a><<a href="qstring.html">QString</a>, T *> instead of <a href="qcache.html">QCache</a><<a href="qstring.html">QString</a>, T>. In that case, <a href="qcache.html">QCache</a> owns the pointers, not the objects that the pointers refer to. For example,<pre class="cpp"> <span class="type"><a href="q3cache.html">Q3Cache</a></span><span class="operator"><</span><span class="type"><a href="qwidget.html">QWidget</a></span><span class="operator">></span> cache;
cache<span class="operator">.</span>insert(widget<span class="operator">-</span><span class="operator">></span>name()<span class="operator">,</span> widget);
<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
<span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>foo <span class="operator">=</span> cache<span class="operator">.</span>take(<span class="string">"foo"</span>);
<span class="keyword">if</span> (foo)
foo<span class="operator">-</span><span class="operator">></span>show();</pre>
<p>becomes</p>
<pre class="cpp"> <span class="keyword">typedef</span> <span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span><span class="type">QWidgetPtr</span>;
<span class="type"><a href="qcache.html">QCache</a></span><span class="operator"><</span><span class="type"><a href="qstring.html">QString</a></span><span class="operator">,</span> <span class="type">QWidgetPtr</span><span class="operator">></span> cache;
cache<span class="operator">.</span>insert(widget<span class="operator">-</span><span class="operator">></span>name()<span class="operator">,</span> <span class="keyword">new</span> <span class="type">QWidgetPtr</span>(widget));
<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
<span class="type">QWidgetPtr</span> <span class="operator">*</span>ptr <span class="operator">=</span> cache<span class="operator">.</span>take(<span class="string">"foo"</span>);
<span class="keyword">if</span> (ptr) {
<span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>foo <span class="operator">=</span> <span class="operator">*</span>ptr;
<span class="keyword">delete</span> ptr;
foo<span class="operator">-</span><span class="operator">></span>show();
}</pre>
<p>An alternative is to stick to using <a href="q3cache.html" class="compat">Q3Cache</a>.</p>
</li>
</ol>
<p>QCacheIterator<T> has been renamed <a href="q3cacheiterator.html" class="compat">Q3CacheIterator</a><T> and moved to the <a href="qt3support.html">Qt3Support</a> library. The new <a href="qcache.html">QCache</a> class doesn't offer any iterator types.</p>
<a name="qcanvas"></a>
<h2>QCanvas</h2>
<p>The canvas module classes have been renamed and moved to the <a href="qt3support.html">Qt3Support</a> library.</p>
<table class="generic">
<thead><tr class="qt-style"><th >Qt 3 class name</th><th >Compatibility class in Qt 4</th></tr></thead>
<tr valign="top" class="odd"><td ><tt>QCanvas</tt></td><td ><a href="q3canvas.html" class="compat">Q3Canvas</a></td></tr>
<tr valign="top" class="even"><td ><tt>QCanvasEllipse</tt></td><td ><a href="q3canvasellipse.html" class="compat">Q3CanvasEllipse</a></td></tr>
<tr valign="top" class="odd"><td ><tt>QCanvasItem</tt></td><td ><a href="q3canvasitem.html" class="compat">Q3CanvasItem</a></td></tr>
<tr valign="top" class="even"><td ><tt>QCanvasItemList</tt></td><td ><a href="q3canvasitemlist.html" class="compat">Q3CanvasItemList</a></td></tr>
<tr valign="top" class="odd"><td ><tt>QCanvasLine</tt></td><td ><a href="q3canvasline.html" class="compat">Q3CanvasLine</a></td></tr>
<tr valign="top" class="even"><td ><tt>QCanvasPixmap</tt></td><td ><a href="q3canvaspixmap.html" class="compat">Q3CanvasPixmap</a></td></tr>
<tr valign="top" class="odd"><td ><tt>QCanvasPixmapArray</tt></td><td ><a href="q3canvaspixmaparray.html" class="compat">Q3CanvasPixmapArray</a></td></tr>
<tr valign="top" class="even"><td ><tt>QCanvasPolygon</tt></td><td ><a href="q3canvaspolygon.html" class="compat">Q3CanvasPolygon</a></td></tr>
<tr valign="top" class="odd"><td ><tt>QCanvasPolygonalItem</tt></td><td ><a href="q3canvaspolygonalitem.html" class="compat">Q3CanvasPolygonalItem</a></td></tr>
<tr valign="top" class="even"><td ><tt>QCanvasRectangle</tt></td><td ><a href="q3canvasrectangle.html" class="compat">Q3CanvasRectangle</a></td></tr>
<tr valign="top" class="odd"><td ><tt>QCanvasSpline</tt></td><td ><a href="q3canvasspline.html" class="compat">Q3CanvasSpline</a></td></tr>
<tr valign="top" class="even"><td ><tt>QCanvasSprite</tt></td><td ><a href="q3canvassprite.html" class="compat">Q3CanvasSprite</a></td></tr>
<tr valign="top" class="odd"><td ><tt>QCanvasText</tt></td><td ><a href="q3canvastext.html" class="compat">Q3CanvasText</a></td></tr>
<tr valign="top" class="even"><td ><tt>QCanvasView</tt></td><td ><a href="q3canvasview.html" class="compat">Q3CanvasView</a></td></tr>
</table>
<p>The <a href="graphicsview.html">Graphics View Framework</a> replaces <a href="#qcanvas">QCanvas</a>. For more on porting to Graphics View, see <a href="graphicsview-porting.html">Porting to Graphics View</a>.</p>
<a name="qcolor"></a>
<h2>QColor</h2>
<p>In Qt 4, <a href="qcolor.html">QColor</a> is a value type like <a href="qpoint.html">QPoint</a> or <a href="qrect.html">QRect</a>. Graphics system-specific code has been implemented in <a href="qcolormap.html">QColormap</a>.</p>
<p>The <tt>QColor::maxColors()</tt> function has been replaced by <a href="qcolormap.html#size">QColormap::size</a>().</p>
<p>The <tt>QColor::numBitPlanes()</tt> function has been replaced by <a href="qcolormap.html#depth">QColormap::depth</a>().</p>
<p>The <tt>QColor::setNamedColor()</tt> function no longer supports the named color in the same way as Qt 3. Qt 4's <a href="qcolor.html#setNamedColor">setNamedColor()</a> uses the new W3C convention as stated <a href="http://www.w3.org/TR/SVG/types.html#ColorKeywords">here</a>.</p>
<table class="generic">
<thead><tr class="qt-style"><th colspan="4">Predefined Qt Colors</th></tr></thead>
<tr valign="top" class="odd"><td ><a href="qt.html#GlobalColor-enum">Qt::color0</a></td><td ><a href="qt.html#GlobalColor-enum">Qt::color1</a></td><td ><a href="qt.html#GlobalColor-enum">Qt::black</a></td><td ><a href="qt.html#GlobalColor-enum">Qt::white</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#GlobalColor-enum">Qt::darkGray</a></td><td ><a href="qt.html#GlobalColor-enum">Qt::gray</a></td><td ><a href="qt.html#GlobalColor-enum">Qt::lightGray</a></td><td ><a href="qt.html#GlobalColor-enum">Qt::red</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#GlobalColor-enum">Qt::green</a></td><td ><a href="qt.html#GlobalColor-enum">Qt::blue</a></td><td ><a href="qt.html#GlobalColor-enum">Qt::cyan</a></td><td ><a href="qt.html#GlobalColor-enum">Qt::magenta</a></td></tr>
<tr valign="top" class="even"><td ><a href="qt.html#GlobalColor-enum">Qt::yellow</a></td><td ><a href="qt.html#GlobalColor-enum">Qt::darkRed</a></td><td ><a href="qt.html#GlobalColor-enum">Qt::darkGreen</a></td><td ><a href="qt.html#GlobalColor-enum">Qt::darkBlue</a></td></tr>
<tr valign="top" class="odd"><td ><a href="qt.html#GlobalColor-enum">Qt::darkCyan</a></td><td ><a href="qt.html#GlobalColor-enum">Qt::darkMagenta</a></td><td ><a href="qt.html#GlobalColor-enum">Qt::darkYellow</a></td><td ><a href="qt.html#GlobalColor-enum">Qt::transparent</a></td></tr>
</table>
<p>The predefined colors listed in the table above were static <a href="qcolor.html">QColor</a> objects in Qt 3. In Qt 4, they are enum values of type <a href="qt.html#GlobalColor-enum">Qt::GlobalColor</a>. Thanks to the implicit <a href="qcolor.html">QColor</a>(<a href="qt.html#GlobalColor-enum">Qt::GlobalColor</a>) constructor, the enum values are automatically converted to <a href="qcolor.html">QColor</a>s in most contexts. Occasionally, you might need a cast.</p>
<p>For example, if you have code like</p>
<pre class="cpp"> QColor lightCyan = Qt::cyan.light(180);</pre>
<p>you can rewrite it as</p>
<pre class="cpp"> <span class="type"><a href="qcolor.html">QColor</a></span> lightCyan <span class="operator">=</span> <span class="type"><a href="qcolor.html">QColor</a></span>(<span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>cyan)<span class="operator">.</span>light(<span class="number">180</span>);</pre>
<a name="qcolorgroup"></a>
<h2>QColorGroup</h2>
<p>In Qt 3, a <a href="qpalette.html">QPalette</a> consisted of three <a href="qcolorgroup.html" class="compat">QColorGroup</a> objects. In Qt 4, the (rarely used) <a href="qcolorgroup.html" class="compat">QColorGroup</a> abstraction has been eliminated. For source compatibility, a <a href="qcolorgroup.html" class="compat">QColorGroup</a> class is available when <tt>QT3_SUPPORT</tt> is defined.</p>
<p>The new <a href="qpalette.html">QPalette</a> still works in terms of color groups, specified through enum values (<a href="qpalette.html#ColorGroup-enum">QPalette::Active</a>, <a href="qpalette.html#ColorGroup-enum">QPalette::Disabled</a>, and <a href="qpalette.html#ColorGroup-enum">QPalette::Inactive</a>). It also has the concept of a <i>current</i> color group, which you can set using <a href="qpalette.html#setCurrentColorGroup">QPalette::setCurrentColorGroup</a>().</p>
<p>The <a href="qpalette.html">QPalette</a> object returned by <a href="qwidget.html#palette-prop">QWidget::palette</a>() returns a <a href="qpalette.html">QPalette</a> initialized with the correct current color group for the widget. This means that if you had code like</p>
<pre class="cpp"> painter.setBrush(colorGroup().brush(QColorGroup::Text));</pre>
<p>you can simply replace colorGroup() with palette():</p>
<pre class="cpp"> painter<span class="operator">.</span>setBrush(palette()<span class="operator">.</span>brush(<span class="type"><a href="qpalette.html">QPalette</a></span><span class="operator">::</span>Text));</pre>
<a name="qcolordrag"></a>
<h2>QColorDrag</h2>
<p>The <tt>QColorDrag</tt> class has been renamed <a href="q3colordrag.html" class="compat">Q3ColorDrag</a> and moved to the <a href="qt3support.html">Qt3Support</a> library. In Qt 4, use <a href="qmimedata.html">QMimeData</a> instead and call QMimeData::setColor() to set the color.</p>
<a name="qcombobox"></a>
<h2>QComboBox</h2>
<p>In Qt 3, the list box used to display the contents of a <tt>QComboBox</tt> widget could be accessed by using the <tt>listBox()</tt> function. In Qt 4, the standard list box is provided by a <a href="qlistview.html">QListView</a> widget, and can be accessed with the <a href="qcombobox.html#view">view()</a> function.</p>
<p>See <a href="porting4-virtual-functions.html">Virtual Functions</a> for a list of <a href="qcombobox.html">QComboBox</a> virtual member functions in Qt 3 that are no longer virtual in Qt 4.</p>
<a name="qcstring"></a>
<h2>QCString</h2>
<p>In Qt 3, <a href="#qcstring">QCString</a> inherited from <a href="qbytearray.html">QByteArray</a>. The main drawback of this approach is that the user had the responsibility of ensuring that the string is '\0'-terminated. Another important issue was that conversions between <tt>QCString</tt> and <a href="qbytearray.html">QByteArray</a> often gave confusing results. (See the <a href="http://doc.qt.nokia.com/qq/qq05-achtung.html#qcstringisastringofchars">Achtung! Binary and Character Data</a> article in <i>Qt Quarterly</i> for an overview of the pitfalls.)</p>
<p>Qt 4 solves that problem by merging the <a href="qbytearray.html">QByteArray</a> and <tt>QCString</tt> classes into one class called <a href="qbytearray.html">QByteArray</a>. Most functions that were in <tt>QCString</tt> previously have been moved to <a href="qbytearray.html">QByteArray</a>. The '\0' issue is handled by having <a href="qbytearray.html">QByteArray</a> allocate one extra byte that it always sets to '\0'. For example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> ba(<span class="string">"Hello"</span>);
ba<span class="operator">.</span>size(); <span class="comment">// returns 5 (the '\0' is not counted)</span>
ba<span class="operator">.</span>length(); <span class="comment">// returns 5</span>
ba<span class="operator">.</span>data()<span class="operator">[</span><span class="number">5</span><span class="operator">]</span>; <span class="comment">// returns '\0'</span></pre>
<p>The <a href="qt3support.html">Qt3Support</a> library contains a class called <a href="q3cstring.html" class="compat">Q3CString</a> that inherits from the new <a href="qbytearray.html">QByteArray</a> class and that extends it to provide an API that is as close to the old <tt>QCString</tt> class as possible. Note that the following functions aren't provided by <a href="q3cstring.html" class="compat">Q3CString</a>:</p>
<ul>
<li>QCString::find(const <a href="qregexp.html">QRegExp</a> &, int)</li>
<li>QCString::findRev(const <a href="qregexp.html">QRegExp</a> &, int)</li>
<li>QCString::contains(const <a href="qregexp.html">QRegExp</a> &)</li>
<li>QCString::replace(const <a href="qregexp.html">QRegExp</a> &, const char *)</li>
</ul>
<p>The following functions have lost their last parameter, which specified whether the search was case sensitive or not:</p>
<ul>
<li>QByteArray::find(char, int)</li>
<li>QByteArray::find(const char *, int)</li>
<li>QByteArray::findRev(char, int)</li>
<li>QByteArray::findRev(const char *, int)</li>
<li>QByteArray::contains(char)</li>
<li>QByteArray::contains(const char *)</li>
</ul>
<p>In both cases, the solution is to convert the <tt>QCString</tt> to a <a href="qstring.html">QString</a> and use the corresponding <a href="qstring.html">QString</a> functions instead.</p>
<p>Also be aware that <tt>QCString::size()</tt> (inherited from <a href="qbytearray.html">QByteArray</a>) used to return the size of the character data <i>including</i> the '\0'-terminator, whereas the new <a href="qbytearray.html#size">QByteArray::size</a>() is just a synonym for <a href="qbytearray.html#length">QByteArray::length</a>(). This brings <a href="qbytearray.html">QByteArray</a> in line with <a href="qstring.html">QString</a>.</p>
<p>When porting to Qt 4, occurrences of <tt>QCString</tt> should be replaced with <a href="qbytearray.html">QByteArray</a> or <a href="qstring.html">QString</a>. The following table summarizes the API differences between the <a href="q3cstring.html" class="compat">Q3CString</a> class and the Qt 4 <a href="qbytearray.html">QByteArray</a> and <a href="qstring.html">QString</a> classes:</p>
<table class="generic">
<thead><tr class="qt-style"><th ><a href="q3cstring.html" class="compat">Q3CString</a> function</th><th >Qt 4 equivalent</th></tr></thead>
<tr valign="top" class="odd"><td >Q3CString::Q3CString(const char *, uint)</td><td >See remark below</td></tr>
<tr valign="top" class="even"><td >Q3CString::Q3CString(int)</td><td >QByteArray::QByteArray(int, char)</td></tr>
<tr valign="top" class="odd"><td ><a href="q3cstring.html#leftJustify">Q3CString::leftJustify</a>()</td><td ><a href="qstring.html#leftJustified">QString::leftJustified</a>()</td></tr>
<tr valign="top" class="even"><td ><a href="qbytearray.html#length">Q3CString::length</a>()</td><td ><a href="qbytearray.html#length">QByteArray::length</a>() or <a href="qbytearray.html#size">QByteArray::size</a>() (equivalent)</td></tr>
<tr valign="top" class="odd"><td ><a href="q3cstring.html#lower">Q3CString::lower</a>()</td><td ><a href="qbytearray.html#toLower">QByteArray::toLower</a>()</td></tr>
<tr valign="top" class="even"><td ><a href="q3cstring.html#rightJustify">Q3CString::rightJustify</a>()</td><td ><a href="qstring.html#rightJustified">QString::rightJustified</a>()</td></tr>
<tr valign="top" class="odd"><td ><a href="q3cstring.html#setExpand">Q3CString::setExpand</a>()</td><td >See remark below</td></tr>
<tr valign="top" class="even"><td ><a href="q3cstring.html#simplifyWhiteSpace">Q3CString::simplifyWhiteSpace</a>()</td><td ><a href="qbytearray.html#simplified">QByteArray::simplified</a>()</td></tr>
<tr valign="top" class="odd"><td ><a href="q3cstring.html#sprintf">Q3CString::sprintf</a>()</td><td ><a href="qstring.html#sprintf">QString::sprintf</a>()</td></tr>
<tr valign="top" class="even"><td ><a href="q3cstring.html#stripWhiteSpace">Q3CString::stripWhiteSpace</a>()</td><td ><a href="qbytearray.html#trimmed">QByteArray::trimmed</a>()</td></tr>
<tr valign="top" class="odd"><td ><a href="q3cstring.html#toDouble">Q3CString::toDouble</a>()</td><td ><a href="qstring.html#toDouble">QString::toDouble</a>()</td></tr>
<tr valign="top" class="even"><td ><a href="q3cstring.html#toFloat">Q3CString::toFloat</a>()</td><td ><a href="qstring.html#toFloat">QString::toFloat</a>()</td></tr>
<tr valign="top" class="odd"><td ><a href="q3cstring.html#toInt">Q3CString::toInt</a>()</td><td ><a href="qstring.html#toInt">QString::toInt</a>()</td></tr>
<tr valign="top" class="even"><td ><a href="q3cstring.html#toLong">Q3CString::toLong</a>()</td><td ><a href="qstring.html#toLong">QString::toLong</a>()</td></tr>
<tr valign="top" class="odd"><td ><a href="q3cstring.html#toShort">Q3CString::toShort</a>()</td><td ><a href="qstring.html#toShort">QString::toShort</a>()</td></tr>
<tr valign="top" class="even"><td ><a href="q3cstring.html#toUInt">Q3CString::toUInt</a>()</td><td ><a href="qstring.html#toUInt">QString::toUInt</a>()</td></tr>
<tr valign="top" class="odd"><td ><a href="q3cstring.html#toULong">Q3CString::toULong</a>()</td><td ><a href="qstring.html#toULong">QString::toULong</a>()</td></tr>
<tr valign="top" class="even"><td ><a href="q3cstring.html#toUShort">Q3CString::toUShort</a>()</td><td ><a href="qstring.html#toUShort">QString::toUShort</a>()</td></tr>
<tr valign="top" class="odd"><td ><a href="q3cstring.html#upper">Q3CString::upper</a>()</td><td ><a href="qbytearray.html#toUpper">QByteArray::toUpper</a>()</td></tr>
</table>
<p>Remarks:</p>
<ol class="1">
<li><a href="q3cstring.html" class="compat">Q3CString</a>(const char *str, uint max) constructs a string of length strlen(str) or <i>max</i> - 1, whichever is shorter. <a href="qbytearray.html">QByteArray</a>(const char *data, int size) constructs a byte array containing exactly <i>size</i> bytes.<p>For example, if you have code like</p>
<pre class="cpp"> QCString str1("Hello", 4); // "Hel"
QCString str2("Hello world!", n);</pre>
<p>you can rewrite it as</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> str1(<span class="string">"Hello"</span><span class="operator">,</span> <span class="number">3</span>);
<span class="type"><a href="qbytearray.html">QByteArray</a></span> str2(<span class="string">"Hello world!"</span>);
str2<span class="operator">.</span>truncate(n <span class="operator">-</span> <span class="number">1</span>);</pre>
</li>
<li>Q3CString::setExpand(uint index, char ch) has no equivalent in Qt 4.<p>For example, if you have code like</p>
<pre class="cpp"> QCString str("Hello world");
str.setExpand(16, '\n'); // "Hello world \n"</pre>
<p>you can rewrite it as</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> str(<span class="string">"Hello world"</span>);
<span class="keyword">while</span> (str<span class="operator">.</span>size() <span class="operator"><</span> <span class="number">16</span>)
str <span class="operator">+</span><span class="operator">=</span> <span class="char">' '</span>;
str <span class="operator">+</span><span class="operator">=</span> <span class="char">'\n'</span>;</pre>
</li>
</ol>
<p>Since the old <tt>QCString</tt> class inherited from <a href="qbytearray.html">QByteArray</a>, everything that is said in the <a href="#qbytearray-section">QByteArray section</a> applies for <tt>QCString</tt> as well.</p>
<a name="qcustomevent"></a>
<h2>QCustomEvent</h2>
<p>In Qt 3, developers could create a custom event by constructing a new <a href="qcustomevent.html" class="compat">QCustomEvent</a>, and send relevant data to other components in the application by passing a void pointer, either on construction or using the setData() function. Objects could receive custom events by reimplementing the <a href="qobject.html#customEvent">customEvent()</a> function, and access the stored data using the event's data() function.</p>
<p>In Qt 4, custom events are created by subclassing <a href="qevent.html">QEvent</a>. Event-specific data can be stored in a way that is appropriate for your application. Custom events are still delivered to each object's <a href="qobject.html#customEvent">customEvent()</a> handler function, but as <a href="qevent.html">QEvent</a> objects rather than as deprecated <a href="qcustomevent.html" class="compat">QCustomEvent</a> objects.</p>
<a name="qdatabrowser"></a>
<h2>QDataBrowser</h2>
<p>The <tt>QDataBrowser</tt> class has been renamed <a href="q3databrowser.html" class="compat">Q3DataBrowser</a> and moved to the <a href="qt3support.html">Qt3Support</a> library. In Qt 4.2, you should use the <a href="qdatawidgetmapper.html">QDataWidgetMapper</a> class to create data-aware forms.</p>
<p>See <a href="qtsql.html">QtSql Module</a> for an overview of the new SQL classes.</p>
<a name="qdatapump"></a>
<h2>QDataPump</h2>
<p>The <tt>QDataPump</tt> class was used internally in Qt 2.x in conjunction with QImageConsumer. It was obsoleted in Qt 3.0.</p>
<p>If you use this mechanism in your application, please submit a report to the <a href="http://bugreports.qt-project.org">Task Tracker</a> on the Qt website and we will try to find a satisfactory substitute.</p>
<a name="qdatasink"></a>
<h2>QDataSink</h2>
<p>The <tt>QDataSink</tt> class was used internally in Qt 2.x in conjunction with QImageConsumer. It was obsoleted in Qt 3.0.</p>
<p>If you use this mechanism in your application, please submit a report to the <a href="http://bugreports.qt-project.org">Task Tracker</a> on the Qt website and we will try to find a satisfactory substitute.</p>
<a name="qdatasource"></a>
<h2>QDataSource</h2>
<p>The <tt>QDataSource</tt> class was used internally in Qt 2.x in conjunction with QImageConsumer. It was obsoleted in Qt 3.0. If you use this mechanism in your application, please submit a report to the <a href="http://bugreports.qt-project.org">Task Tracker</a> on the Qt website and we will try to find a satisfactory substitute.</p>
<a name="qdatatable"></a>
<h2>QDataTable</h2>
<p>The <tt>QDataTable</tt> class has been renamed <a href="q3datatable.html" class="compat">Q3DataTable</a> and moved to the <a href="qt3support.html">Qt3Support</a> library. In Qt 4.2, you should use the <a href="qdatawidgetmapper.html">QDataWidgetMapper</a> class to create data-aware forms.</p>
<p>See <a href="qtsql.html">QtSql Module</a> for an overview of the new SQL classes.</p>
<a name="qdataview"></a>
<h2>QDataView</h2>
<p>The <tt>QDataView</tt> class has been renamed <a href="q3dataview.html" class="compat">Q3DataView</a> and moved to the <a href="qt3support.html">Qt3Support</a> library. In Qt 4.2, you should use the <a href="qdatawidgetmapper.html">QDataWidgetMapper</a> class to create data-aware forms.</p>
<p>See <a href="qtsql.html">QtSql Module</a> for an overview of the new SQL classes.</p>
<a name="qdateedit"></a>
<h2>QDateEdit</h2>
<p>The <a href="qdateedit.html">QDateEdit</a> class in Qt 4 is a convenience class based on <a href="qdatetimeedit.html">QDateTimeEdit</a>. The old class has been renamed <a href="q3dateedit.html" class="compat">Q3DateEdit</a> and moved to the <a href="qt3support.html">Qt3Support</a> library.</p>
<p>See <a href="porting4-virtual-functions.html">Virtual Functions</a> for a list of <tt>QDateEdit</tt> virtual member functions in Qt 3 that are no longer virtual in Qt 4.</p>
<a name="qdatetimeeditbase"></a>
<h2>QDateTimeEditBase</h2>
<p>The <tt>QDateTimeEditBase</tt> class has been renamed <a href="q3datetimeeditbase.html" class="compat">Q3DateTimeEditBase</a> and moved to <a href="qt3support.html">Qt3Support</a>. Use <a href="qdatetimeedit.html">QDateTimeEdit</a> or <a href="qabstractspinbox.html">QAbstractSpinBox</a> instead.</p>
<a name="qdatetimeedit"></a>
<h2>QDateTimeEdit</h2>
<p>The old <tt>QDateTimeEdit</tt> class has been renamed <a href="q3datetimeeditbase.html" class="compat">Q3DateTimeEditBase</a> and moved to <a href="qt3support.html">Qt3Support</a>. The new <a href="qdatetimeedit.html">QDateTimeEdit</a> in Qt 4 has been rewritten from scratch to provide a more flexible and powerful API.</p>
<p>See <a href="porting4-virtual-functions.html">Virtual Functions</a> for a list of <a href="qdatetimeedit.html">QDateTimeEdit</a> virtual member functions in Qt 3 that are no longer virtual in Qt 4.</p>
<a name="qdeepcopy-t"></a>
<h2>QDeepCopy<T></h2>
<p>The <tt>QDeepCopy<T></tt> class in Qt 3 provided a means of ensuring that implicitly shared and explicitly shared classes referenced unique data. This was necessary because the reference counting in Qt's container classes was done in a thread-unsafe manner.</p>
<p>With Qt 4, <tt>QDeepCopy<T></tt> has been renamed <a href="q3deepcopy.html" class="compat">Q3DeepCopy</a><T> and moved to the <a href="qt3support.html">Qt3Support</a> library. Removing it from existing code is straightforward.</p>
<p>For example, if you have code like</p>
<pre class="cpp"> QString str1 = "I am a string";
QDeepCopy<QString> str2 = str1;
QString str3 = QDeepCopy<QString>(str2);</pre>
<p>you can rewrite it as</p>
<pre class="cpp"> <span class="type"><a href="qstring.html">QString</a></span> str1 <span class="operator">=</span> <span class="string">"I am a string"</span>;
<span class="type"><a href="qstring.html">QString</a></span> str2 <span class="operator">=</span> str1;
<span class="type"><a href="qstring.html">QString</a></span> str3 <span class="operator">=</span> str2;</pre>
<a name="qdial"></a>
<h2>QDial</h2>
<p>See <a href="porting4-virtual-functions.html">Virtual Functions</a> for a list of <a href="qdial.html">QDial</a> virtual member functions in Qt 3 that are no longer virtual in Qt 4.</p>
<p>See <a href="#properties">Properties</a> for a list of <a href="qdial.html">QDial</a> properties in Qt 3 that have changed in Qt 4.</p>
<a name="qdict-section"></a><a name="qdict-t"></a>
<h2>QDict<T></h2>
<p><tt>QDict<T></tt> has been renamed <a href="q3dict.html" class="compat">Q3Dict</a><T> and moved to <a href="qt3support.html">Qt3Support</a>. It has been replaced by the more modern <a href="qhash.html">QHash</a><Key, T> and <a href="qmultihash.html">QMultiHash</a><Key, T> classes.</p>
<p>When porting old code that uses QDict<T> to Qt 4, there are four classes that you can use:</p>
<table class="generic">
<thead><tr class="qt-style"><th >Qt 4 class</th><th >When to use it</th></tr></thead>
<tr valign="top" class="odd"><td ><a href="qmultihash.html">QMultiHash</a><<a href="qstring.html">QString</a>, T *></td><td >Since <a href="q3dict.html" class="compat">Q3Dict</a><T> is pointer-based and allows duplicate keys, this is usually the most straightforward conversion.</td></tr>
<tr valign="top" class="even"><td ><a href="qmultihash.html">QMultiHash</a><<a href="qstring.html">QString</a>, T></td><td >If type <tt>T</tt> is an <a href="containers.html#assignable-data-type">assignable data type</a>, you can use <tt>T</tt> as the value type rather than <tt>T *</tt>. This often leads to nicer code.</td></tr>
<tr valign="top" class="odd"><td ><a href="qhash.html">QHash</a><<a href="qstring.html">QString</a>, T *></td><td rowspan="2">If you don't use duplicate keys, you can use <a href="qhash.html">QHash</a> instead of <a href="qmultihash.html">QMultiHash</a>. <a href="qmultihash.html">QMultiHash</a> inherits from <a href="qhash.html">QHash</a>.</td></tr>
<tr valign="top" class="even"><td ><a href="qhash.html">QHash</a><<a href="qstring.html">QString</a>, T></td></tr>
</table>
<p>The APIs of <a href="q3dict.html" class="compat">Q3Dict</a><T> and <a href="qmultihash.html">QMultiHash</a><<a href="qstring.html">QString</a>, T *> are quite similar. The main issue is that <a href="q3dict.html" class="compat">Q3Dict</a> supports auto-delete whereas <a href="qmultihash.html">QMultiHash</a> doesn't.</p>
<p>The following table summarizes the API differences between the two classes:</p>
<table class="generic">
<thead><tr class="qt-style"><th ><a href="q3dict.html" class="compat">Q3Dict</a> function</th><th ><a href="qmultihash.html">QMultiHash</a> equivalent</th></tr></thead>
<tr valign="top" class="odd"><td >Q3Dict::Q3Dict(int size, bool caseSensitive)</td><td >See remarks below</td></tr>
<tr valign="top" class="even"><td ><a href="q3ptrcollection.html#autoDelete">Q3Dict::autoDelete</a>()</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td ><a href="q3dict.html#count">Q3Dict::count</a>()</td><td ><a href="qmultihash.html#count">QMultiHash::count</a>() or <a href="qhash.html#size">QMultiHash::size</a>() (equivalent)</td></tr>
<tr valign="top" class="even"><td >Q3Dict::find(const <a href="qstring.html">QString</a> &)</td><td >QMultiHash::value(const <a href="qstring.html">QString</a> &)</td></tr>
<tr valign="top" class="odd"><td >Q3Dict::remove(const <a href="qstring.html">QString</a> &)</td><td >QMultiHash::take(const <a href="qstring.html">QString</a> &)</td></tr>
<tr valign="top" class="even"><td >Q3Dict::resize(uint)</td><td >QMultiHash::reserve(int)</td></tr>
<tr valign="top" class="odd"><td ><a href="q3ptrcollection.html#setAutoDelete">Q3Dict::setAutoDelete</a>()</td><td >See discussion below</td></tr>
<tr valign="top" class="even"><td ><a href="q3dict.html#size">Q3Dict::size</a>()</td><td ><a href="qhash.html#capacity">QMultiHash::capacity</a>()</td></tr>
<tr valign="top" class="odd"><td ><a href="q3dict.html#statistics">Q3Dict::statistics</a>()</td><td >N/A</td></tr>
<tr valign="top" class="even"><td >Q3Dict::operator[](const <a href="qstring.html">QString</a> &)</td><td >See remark below</td></tr>
</table>
<p>Remarks:</p>
<ol class="1">
<li><a href="q3dict.html" class="compat">Q3Dict</a> requires the user to allocate a specific number of buckets by passing a prime number (17 by default) to the constructor and/or calling <a href="q3dict.html#resize">Q3Dict::resize</a>() later on. In contrast, <a href="qmultihash.html">QMultiHash</a>'s hash table automatically grows and shrinks as needed, and the constructor doesn't take a prime number.</li>
<li><a href="q3dict.html" class="compat">Q3Dict</a> supportes case-insensitive lookups by passing false as second argument to the constructor. This feature has no equivalent in <a href="qmultihash.html">QMultiHash</a>. Instead, call <a href="qstring.html#toLower">QString::toLower</a>() before you insert or lookup a key in the hash.</li>
<li><a href="q3dict.html#size">Q3Dict::size</a>() and <a href="qhash.html#size">QMultiHash::size</a>() have different semantics. The former returns the number of buckets in the container, whereas the latter returns the number of <i>items</i> in the container.</li>
<li>If there are multiple items with the same key, <a href="q3dict.html#remove">Q3Dict::remove</a>() removes only the most recently inserted item, whereas <a href="qmultihash.html#remove">QMultiHash::remove</a>() removes all items that share a particular key. To remove only the most recently inserted item, call <a href="qhash.html#take">QMultiHash::take</a>().</li>
<li><a href="q3dict.html" class="compat">Q3Dict</a> has only one [] operator (Q3Dict::operator[]()), providing const access to an item's value. <a href="qmultihash.html">QMultiHash</a> also has a non-const overload that can be used on the left side of the assignment operator. If you use the [] operator on a non-const <a href="qhash.html">QHash</a> with an unexisting item, <a href="qhash.html">QHash</a> will created an element and initialize it to be a null pointer. For that reason, Q3Dict::operator[] should be converted to <a href="qhash.html#value">QMultiHash::value</a>(), not QMultiHash::operator[].</li>
</ol>
<p>If you use <a href="q3dict.html" class="compat">Q3Dict</a>'s auto-delete feature (by calling Q3Dict::setAutoDelete(true)), you need to do some more work. You have two options: Either you call <tt>delete</tt> yourself whenever you remove an item from the container, or you use <a href="qmultihash.html">QMultiHash</a><<a href="qstring.html">QString</a>, T> instead of <a href="qmultihash.html">QMultiHash</a><<a href="qstring.html">QString</a>, T *> (i.e. store values directly instead of pointers to values). Here, we'll see when to call <tt>delete</tt>.</p>
<p>The following table summarizes the idioms that you need to watch out for if you want to call <tt>delete</tt> yourself.</p>
<table class="generic">
<thead><tr class="qt-style"><th ><a href="q3dict.html" class="compat">Q3Dict</a> idiom</th><th ><a href="qmultihash.html">QMultiHash</a> idiom</th></tr></thead>
<tr valign="top" class="odd"><td ><pre class="cpp"> dict<span class="operator">.</span>replace(key<span class="operator">,</span> value);</pre>
</td><td ><pre class="cpp"> <span class="keyword">delete</span> hash<span class="operator">.</span>take(key);
hash<span class="operator">.</span>insert(key<span class="operator">,</span> value);</pre>
</td></tr>
<tr valign="top" class="even"><td ><pre class="cpp"> dict<span class="operator">.</span>remove(key<span class="operator">,</span> value);</pre>
</td><td ><pre class="cpp"> <span class="keyword">delete</span> hash<span class="operator">.</span>take(key);</pre>
</td></tr>
<tr valign="top" class="odd"><td ><pre class="cpp"> dict<span class="operator">.</span>clear();</pre>
<p>(also called from <a href="q3dict.html" class="compat">Q3Dict</a>'s destructor)</p>
</td><td ><pre class="cpp"> <span class="keyword">while</span> (<span class="operator">!</span>hash<span class="operator">.</span>isEmpty()) {
T <span class="operator">*</span>value <span class="operator">=</span> <span class="operator">*</span>hash<span class="operator">.</span>begin();
hash<span class="operator">.</span>erase(hash<span class="operator">.</span>begin());
<span class="keyword">delete</span> value;
}</pre>
<p>In 99% of cases, the following idiom also works:</p>
<pre class="cpp"> <a href="qtalgorithms.html#qDeleteAll">qDeleteAll</a>(hash);
hash<span class="operator">.</span>clear();</pre>
<p>However, it may lead to crashes if <tt>hash</tt> is referenced from the value type's destructor, because <tt>hash</tt> contains dangling pointers until clear() is called.</p>
</td></tr>
</table>
<p>Be aware that <a href="q3dict.html" class="compat">Q3Dict</a>'s destructor automatically calls clear(). If you have a <a href="q3dict.html" class="compat">Q3Dict</a> data member in a custom class and use the auto-delete feature, you will need to call <tt>delete</tt> on all the items in the container from your class destructor to avoid a memory leak.</p>
<p>Finally, <tt>QDictIterator<T></tt> (renamed <a href="q3dictiterator.html" class="compat">Q3DictIterator</a><T>) must also be ported. There are no fewer than four iterator classes that can be used as a replacement: <a href="qhash-const-iterator.html">QHash::const_iterator</a>, <a href="qhash-iterator.html">QHash::iterator</a>, <a href="qhashiterator.html">QHashIterator</a>, and <a href="qmutablehashiterator.html">QMutableHashIterator</a>. The most straightforward class to use when porting is <a href="qhashiterator.html">QHashIterator</a><<a href="qstring.html">QString</a>, T *>. The following table summarizes the API differences:</p>
<table class="generic">
<thead><tr class="qt-style"><th ><a href="q3dictiterator.html" class="compat">Q3DictIterator</a> functions</th><th >Qt 4 equivalent</th></tr></thead>
<tr valign="top" class="odd"><td ><a href="q3dictiterator.html#count">Q3DictIterator::count</a>()</td><td ><a href="qhash.html#count">QHash::count</a>() or <a href="qhash.html#size">QHash::size</a>()</td></tr>
<tr valign="top" class="even"><td ><a href="q3dictiterator.html#current">Q3DictIterator::current</a>()</td><td ><a href="qhashiterator.html#value">QHashIterator::value</a>()</td></tr>
<tr valign="top" class="odd"><td ><a href="q3dictiterator.html#currentKey">Q3DictIterator::currentKey</a>()</td><td ><a href="qhashiterator.html#key">QHashIterator::key</a>()</td></tr>
<tr valign="top" class="even"><td ><a href="q3dictiterator.html#isEmpty">Q3DictIterator::isEmpty</a>()</td><td ><a href="qhash.html#isEmpty">QHash::isEmpty</a>()</td></tr>
<tr valign="top" class="odd"><td ><a href="q3dictiterator.html#toFirst">Q3DictIterator::toFirst</a>()</td><td ><a href="qhashiterator.html#toFront">QHashIterator::toFront</a>()</td></tr>
<tr valign="top" class="even"><td >Q3DictIterator::operator()()</td><td ><a href="qhashiterator.html#value">QHashIterator::value</a>()</td></tr>
<tr valign="top" class="odd"><td >Q3DictIterator::operator*()</td><td ><a href="qhashiterator.html#value">QHashIterator::value</a>()</td></tr>
<tr valign="top" class="even"><td >Q3DictIterator::operator++()</td><td >See remark below</td></tr>
</table>
<p>Be aware that <a href="qhashiterator.html">QHashIterator</a> has a different way of iterating than <a href="q3dictiterator.html" class="compat">Q3DictIterator</a>. A typical loop with <a href="q3dictiterator.html" class="compat">Q3DictIterator</a> looks like this:</p>
<pre class="cpp"> <span class="type"><a href="q3dictiterator.html">Q3DictIterator</a></span><span class="operator"><</span><span class="type"><a href="qwidget.html">QWidget</a></span><span class="operator">></span> i(dict);
<span class="keyword">while</span> (i<span class="operator">.</span>current() <span class="operator">!</span><span class="operator">=</span> <span class="number">0</span>) {
do_something(i<span class="operator">.</span>currentKey()<span class="operator">,</span> i<span class="operator">.</span>current());
<span class="operator">+</span><span class="operator">+</span>i;
}</pre>
<p>Here's the equivalent <a href="qhashiterator.html">QHashIterator</a> loop:</p>
<pre class="cpp"> <span class="type"><a href="qhashiterator.html">QHashIterator</a></span><span class="operator"><</span><span class="type"><a href="qstring.html">QString</a></span><span class="operator">,</span> <span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span><span class="operator">></span> i(hash);
<span class="keyword">while</span> (i<span class="operator">.</span>hasNext()) {
i<span class="operator">.</span>next(); <span class="comment">// must come first</span>
do_something(i<span class="operator">.</span>key()<span class="operator">,</span> i<span class="operator">.</span>value());
}</pre>
<p>See <a href="containers.html#java-style-iterators">Java-style iterators</a> for details.</p>
<a name="qdir"></a>
<h2>QDir</h2>
<p>The following functions used to have a boolean <tt>acceptAbsPath</tt> parameter that defaulted to true:</p>
<ul>
<li><a href="qdir.html#filePath">QDir::filePath</a>()</li>
<li><a href="qdir-qt3.html#absFilePath" class="compat">QDir::absFilePath</a>()</li>
<li><a href="qdir.html#cd">QDir::cd</a>()</li>
<li><a href="qdir.html#mkdir">QDir::mkdir</a>()</li>
<li><a href="qdir.html#rmdir">QDir::rmdir</a>()</li>
<li><a href="qdir.html#remove">QDir::remove</a>()</li>
<li><a href="qdir.html#rename">QDir::rename</a>()</li>
<li><a href="qdir.html#exists">QDir::exists</a>()</li>
</ul>
<p>In Qt 3, if <tt>acceptAbsPath</tt> is true, a file name starting with '/' is be returned without change; if <tt>acceptAbsPath</tt> is false, an absolute path is prepended to the file name. For example:</p>
<table class="generic">
<thead><tr class="qt-style"><th >Current directory</th><th >File name</th><th ><tt>acceptAbsPath</tt></th><th >File path</th></tr></thead>
<tr valign="top" class="odd"><td rowspan="2">/home/tsmith</td><td rowspan="2">index.html</td><td >true</td><td >/home/tsmith/index.html</td></tr>
<tr valign="top" class="even"><td >false</td><td >/home/tsmith/index.html</td></tr>
<tr valign="top" class="odd"><td rowspan="2">/home/tsmith</td><td rowspan="2">/index.html</td><td >true</td><td >/index.html</td></tr>
<tr valign="top" class="even"><td >false</td><td >/home/tsmith/index.html</td></tr>
</table>
<p>In Qt 4, this parameter is no longer available. If you use it in your code, you can check that <a href="qdir.html#isRelativePath">QDir::isRelativePath</a>() returns false instead.</p>
<p>For example, if you have code like</p>
<pre class="cpp"> QDir dir("/home/tsmith");
QString path = dir.filePath(fileName, false);</pre>
<p>you can rewrite it as</p>
<pre class="cpp"> <span class="type"><a href="qdir.html">QDir</a></span> dir(<span class="string">"/home/tsmith"</span>);
<span class="type"><a href="qstring.html">QString</a></span> path;
<span class="keyword">if</span> (dir<span class="operator">.</span>isRelativePath(fileName))
path <span class="operator">=</span> dir<span class="operator">.</span>filePath(fileName);
<span class="keyword">else</span>
path <span class="operator">=</span> fileName;</pre>
<p>QDir::encodedEntryList() has been removed.</p>
<p>fileInfoList(), entryInfoList(), and drives() now return a <a href="qlist.html">QList</a><<a href="qfileinfo.html">QFileInfo</a>> and not a QPtrList<<a href="qfileinfo.html">QFileInfo</a>> *. Code using these methods will not work with the <a href="qt3support.html">Qt3Support</a> library and must be adapted instead.</p>
<p>See <a href="porting4-virtual-functions.html">Virtual Functions</a> for a list of <a href="qdir.html">QDir</a> virtual member functions in Qt 3 that are no longer virtual in Qt 4.</p>
<p><a href="qdir.html#match">QDir::match</a>() now always matches case insensitively.</p>
<p><a href="qdir-qt3.html#homeDirPath" class="compat">QDir::homeDirPath</a>() has been removed. Use <a href="qdir.html#home">QDir::home</a>() instead, and extract the path separately.</p>
<a name="qdns"></a>
<h2>QDns</h2>
<p>Qt 3 used its own implementation of the DNS protocol and provided a low-level <tt>QDns</tt> class. Qt 4's <a href="qhostinfo.html">QHostInfo</a> class uses the system's <tt>gethostbyname()</tt> function from a thread instead.</p>
<p>The old <tt>QDns</tt> class has been renamed <a href="q3dns.html" class="compat">Q3Dns</a> and moved to the <a href="qt3support.html">Qt3Support</a> library. The new <a href="qhostinfo.html">QHostInfo</a> class has a radically different API: It consists mainly of two static functions, one of which is blocking (<a href="qhostinfo.html#fromName">QHostInfo::fromName</a>()), the other non-blocking (<a href="qhostinfo.html#lookupHost">QHostInfo::lookupHost</a>()). See the <a href="qhostinfo.html">QHostInfo</a> class documentation for details.</p>
<a name="qdockarea"></a>
<h2>QDockArea</h2>
<p>The <tt>QDockArea</tt> class has been renamed <a href="q3dockarea.html" class="compat">Q3DockArea</a> and moved to the <a href="qt3support.html">Qt3Support</a> library. In Qt 4, <a href="qmainwindow.html">QMainWindow</a> handles the dock and toolbar areas itself. See the <a href="qmainwindow.html">QMainWindow</a> documentation for details.</p>
<a name="qdockwindow"></a>
<h2>QDockWindow</h2>
<p>The old <tt>QDockWindow</tt> class has been renamed <a href="q3dockwindow.html" class="compat">Q3DockWindow</a> and moved to the <a href="qt3support.html">Qt3Support</a> library. In Qt 4, there is a new <a href="qdockwidget.html">QDockWidget</a> class with a different API. See the class documentation for details.</p>
<p>See <a href="porting4-virtual-functions.html">Virtual Functions</a> for a list of <a href="qdockwidget.html">QDockWidget</a> virtual member functions in Qt 3 that are no longer virtual in Qt 4.</p>
<p><b>Note:</b> <a href="q3dockwindow.html" class="compat">Q3DockWindow</a>'s <a href="q3dockwindow.html#horizontallyStretchable-prop">horizontallyStretchable</a> property can be achieved in <a href="qdockwidget.html">QDockWidget</a> with <a href="qwidget.html#size-hints-and-size-policies">size policies</a>.</p>
<a name="qdragobject"></a>
<h2>QDragObject</h2>
<p>The <tt>QDragObject</tt> class has been renamed <a href="q3dragobject.html" class="compat">Q3DragObject</a> and moved to the <a href="qt3support.html">Qt3Support</a> library. In Qt 4, it has been replaced by the <a href="qmimedata.html">QMimeData</a> class. See the class documentation for details.</p>
<p>Note that the <a href="q3dragobject.html#DragMode-enum">Q3DragObject::DragCopyOrMove</a> drag and drop mode is interpreted differently to Qt 3's QDragObject::DragCopyOrMove mode. In Qt 3, a move operation was performed by default, and the user had to hold down the <b>Ctrl</b> key to perform a copy operation. In Qt 4, a copy operation is performed by default; the user has to hold down the <b>Shift</b> key to perform a move operation.</p>
<p>See <a href="porting4-dnd.html">Porting to Qt 4 - Drag and Drop</a> for a comparison between the drag and drop APIs in Qt 3 and Qt 4.</p>
<a name="qdropsite"></a>
<h2>QDropSite</h2>
<p>The <tt>QDropSite</tt> class has been renamed <a href="q3dropsite.html" class="compat">Q3DropSite</a> and moved to the <a href="qt3support.html">Qt3Support</a> library.</p>
<p>The <a href="#qdropsite">QDropSite</a> class has been obsolete ever since Qt 2.0. The only thing it does is call QWidget::setAcceptDrops(true).</p>
<p>For example, if you have code like</p>
<pre class="cpp"> class MyWidget : public QWidget, public QDropSite
{
public:
MyWidget(const QWidget *parent)
: QWidget(parent), QDropSite(this)
{
}
...
}</pre>
<p>you can rewrite it as</p>
<pre class="cpp"> <span class="keyword">class</span> MyWidget : <span class="keyword">public</span> <span class="type"><a href="qwidget.html">QWidget</a></span>
{
<span class="keyword">public</span>:
MyWidget(<span class="keyword">const</span> <span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>parent)
: <span class="type"><a href="qwidget.html">QWidget</a></span>(parent)
{
setAcceptDrops(<span class="keyword">true</span>);
}
<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
}</pre>
<p>See <a href="porting4-dnd.html">Porting to Qt 4 - Drag and Drop</a> for a comparison between the drag and drop APIs in Qt 3 and Qt 4.</p>
<a name="qeditorfactory"></a>
<h2>QEditorFactory</h2>
<p>The <tt>QEditorFactory</tt> class has been renamed <a href="q3editorfactory.html" class="compat">Q3EditorFactory</a> and moved to the <a href="qt3support.html">Qt3Support</a> library.</p>
<p>See <a href="qtsql.html">QtSql Module</a> for an overview of the new SQL classes.</p>
<a name="qeventloop"></a>
<h2>QEventLoop</h2>
<p>In Qt 3, <tt>QEventLoop</tt> combined the Qt event loop and the event dispatching. In Qt 4, these tasks are now assigned to two distinct classes: <a href="qeventloop.html">QEventLoop</a> and <a href="qabstracteventdispatcher.html">QAbstractEventDispatcher</a>.</p>
<p>If you subclassed <a href="qeventloop.html">QEventLoop</a> to integrate with another library's event loop, you must subclass <a href="qabstracteventdispatcher.html">QAbstractEventDispatcher</a> instead. See the class documentation for details.</p>
<p>Developers using <tt>QEventLoop::loopLevel()</tt> in Qt 3 should use <a href="qcoreapplication-qt3.html#loopLevel" class="compat">QCoreApplication::loopLevel</a>() instead. Note that this function is marked as obsolete, but it is expected to be available for the lifetime of Qt 4.</p>
<a name="qfiledialog"></a>
<h2>QFileDialog</h2>
<p>The <a href="qfiledialog.html">QFileDialog</a> class in Qt 4 has been totally rewritten. It provides most of the functionality of the old <tt>QFileDialog</tt> class, but with a different API. Some functionality, such as the ability to preview files, is expected to be added in a later Qt 4 release.</p>
<p>The old <tt>QFileDialog</tt>, <tt>QFileIconProvider</tt>, and <tt>QFilePreview</tt> classes has been renamed <a href="q3filedialog.html" class="compat">Q3FileDialog</a>, <a href="q3fileiconprovider.html" class="compat">Q3FileIconProvider</a>, and <a href="q3filepreview.html" class="compat">Q3FilePreview</a> and have been moved to <a href="qt3support.html">Qt3Support</a>. You can use them if you need some functionality not provided yet by the new <a href="qfiledialog.html">QFileDialog</a> class.</p>
<p>The following table lists which functions have been renamed or removed in Qt 4.</p>
<table class="generic">
<thead><tr class="qt-style"><th >Old function</th><th >Qt 4 equivalent</th></tr></thead>
<tr valign="top" class="odd"><td >Q3FileDialog::addFilter(const <a href="qstring.html">QString</a> &)</td><td >See remark below</td></tr>
<tr valign="top" class="even"><td >Q3FileDialog::addLeftWidget(<a href="qwidget.html">QWidget</a> *)</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td >Q3FileDialog::addRightWidget(<a href="qwidget.html">QWidget</a> *)</td><td >N/A</td></tr>
<tr valign="top" class="even"><td >Q3FileDialog::addToolButton(<a href="qabstractbutton.html">QAbstractButton</a> *, bool separator)</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td >Q3FileDialog::addWidgets(<a href="qlabel.html">QLabel</a> *, <a href="qwidget.html">QWidget</a> *, <a href="qpushbutton.html">QPushButton</a> *)</td><td >N/A</td></tr>
<tr valign="top" class="even"><td ><a href="q3filedialog.html#dir">Q3FileDialog::dir</a>()</td><td ><a href="qfiledialog.html#directory">QFileDialog::directory</a>()</td></tr>
<tr valign="top" class="odd"><td ><a href="q3filedialog.html#dirPath-prop">Q3FileDialog::dirPath</a>()</td><td ><a href="qfiledialog.html#directory">QFileDialog::directory</a>().path()</td></tr>
<tr valign="top" class="even"><td ><a href="q3filedialog.html#iconProvider">Q3FileDialog::iconProvider</a>()</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td ><a href="q3filedialog.html#contentsPreview-prop">Q3FileDialog::isContentsPreviewEnabled</a>()</td><td >N/A</td></tr>
<tr valign="top" class="even"><td ><a href="q3filedialog.html#infoPreview-prop">Q3FileDialog::isInfoPreviewEnabled</a>()</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td ><a href="q3filedialog.html#previewMode-prop">Q3FileDialog::previewMode</a>()</td><td >N/A</td></tr>
<tr valign="top" class="even"><td ><a href="q3filedialog.html#rereadDir">Q3FileDialog::rereadDir</a>()</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td ><a href="q3filedialog.html#resortDir">Q3FileDialog::resortDir</a>()</td><td >N/A</td></tr>
<tr valign="top" class="even"><td >Q3FileDialog::selectAll(bool)</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td >Q3FileDialog::setContentsPreview(<a href="qwidget.html">QWidget</a> *, <a href="q3filepreview.html" class="compat">Q3FilePreview</a> *)</td><td >N/A</td></tr>
<tr valign="top" class="even"><td >Q3FileDialog::setContentsPreviewEnabled(bool)</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td >Q3FileDialog::setDir(const <a href="qstring.html">QString</a> &)</td><td >QFileDialog::setDirectory(const <a href="qstring.html">QString</a> &)</td></tr>
<tr valign="top" class="even"><td >Q3FileDialog::setFilters(const char **)</td><td >Q3FileDialog::setFilters(const <a href="qstringlist.html">QStringList</a> &)</td></tr>
<tr valign="top" class="odd"><td >Q3FileDialog::setIconProvider(<a href="q3fileiconprovider.html" class="compat">Q3FileIconProvider</a> *)</td><td >N/A</td></tr>
<tr valign="top" class="even"><td >Q3FileDialog::setInfoPreview(<a href="qwidget.html">QWidget</a> *, <a href="q3filepreview.html" class="compat">Q3FilePreview</a> *)</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td >Q3FileDialog::setInfoPreviewEnabled(bool)</td><td >N/A</td></tr>
<tr valign="top" class="even"><td >Q3FileDialog::setPreviewMode(PreviewMode)</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td >Q3FileDialog::setSelectedFilter(const <a href="qstring.html">QString</a> &)</td><td >QFileDialog::selectFilter(const <a href="qstring.html">QString</a> &)</td></tr>
<tr valign="top" class="even"><td >Q3FileDialog::setSelectedFilter(int)</td><td >See remark below</td></tr>
<tr valign="top" class="odd"><td >Q3FileDialog::setSelection(const <a href="qstring.html">QString</a> &)</td><td >QFileDialog::selectFile(const <a href="qstring.html">QString</a> &)</td></tr>
<tr valign="top" class="even"><td >Q3FileDialog::setShowHiddenFiles(bool)</td><td >showHidden()</td></tr>
<tr valign="top" class="odd"><td >Q3FileDialog::setUrl(const <a href="#qurloperator">QUrlOperator</a> &)</td><td >N/A</td></tr>
<tr valign="top" class="even"><td ><a href="q3filedialog.html#showHiddenFiles-prop">Q3FileDialog::showHiddenFiles</a>()</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td ><a href="q3filedialog.html#url">Q3FileDialog::url</a>()</td><td >QUrl::fromLocalFile(<a href="qfiledialog.html#directory">QFileDialog::directory</a>())</td></tr>
<thead><tr class="qt-style"><th >Old signals</th><th >Qt 4 equivalent</th></tr></thead>
<tr valign="top" class="even"><td >Q3FileDialog::fileHighlighted(const <a href="qstring.html">QString</a> &)</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td >Q3FileDialog::fileSelected(const <a href="qstring.html">QString</a> &)</td><td >QFileDialog::filesSelected(const <a href="qstringlist.html">QStringList</a> &)</td></tr>
<tr valign="top" class="even"><td >Q3FileDialog::dirEntered(const <a href="qstring.html">QString</a> &)</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td >Q3FileDialog::filterSelected(const <a href="qstring.html">QString</a> &)</td><td >N/A</td></tr>
</table>
<p>Remarks:</p>
<ol class="1">
<li>The Q3FileDialog::addFilter(const <a href="qstring.html">QString</a> &) function has no direct equivalent in the new <a href="qfiledialog.html">QFileDialog</a>. Use <a href="qfiledialog-qt3.html#setFilters" class="compat">QFileDialog::setFilters</a>() instead.<p>For example, if you have code like</p>
<pre class="cpp"> fileDialog->addFilter(tr("JPEG files (*.jpg *.jpeg)"));</pre>
<p>you can rewrite it as</p>
<pre class="cpp"> <span class="type"><a href="qstringlist.html">QStringList</a></span> filters <span class="operator">=</span> fileDialog<span class="operator">-</span><span class="operator">></span>filters();
filters <span class="operator"><</span><span class="operator"><</span> tr(<span class="string">"JPEG files (*.jpg *.jpeg)"</span>);
fileDialog<span class="operator">-</span><span class="operator">></span>setFilters(filters);</pre>
</li>
<li>The Q3FileDialog::setSelectedFilter(int) overload has no direct equivalent in the new <a href="qfiledialog.html">QFileDialog</a>. Use QFileDialog::selectFilter(const <a href="qstring.html">QString</a> &) instead.<p>For example, if you have code like</p>
<pre class="cpp"> fileDialog->setSelectedFilter(3);</pre>
<p>you can rewrite it as</p>
<pre class="cpp"> fileDialog<span class="operator">-</span><span class="operator">></span>selectFilter(fileDialog<span class="operator">-</span><span class="operator">></span>filters()<span class="operator">.</span>at(<span class="number">3</span>));</pre>
</li>
</ol>
<p>There are no equivalent virtual functions to the two <a href="q3filedialog.html#setSelectedFilter">Q3FileDialog::setSelectedFilter</a>() virtual functions in the <a href="qfiledialog.html">QFileDialog</a> API. In addition, these functions have been renamed or removed, as described above.</p>
<a name="qfocusdata"></a>
<h2>QFocusData</h2>
<p>The <a href="#qfocusdata">QFocusData</a> class is not available in Qt 4. Some of its functionality is available via the <a href="qwidget.html#nextInFocusChain">QWidget::nextInFocusChain</a>() and <a href="qwidget.html#focusNextPrevChild">QWidget::focusNextPrevChild</a>() functions.</p>
<a name="qfocusevent"></a>
<h2>QFocusEvent</h2>
<p>The setReason() function is no longer present in Qt 4. It is necessary to define the reason when constructing a focus event.</p>
<a name="qfont"></a>
<h2>QFont</h2>
<p><tt>QFont::Script</tt> has been moved to <a href="qfontdatabase.html#WritingSystem-enum">QFontDatabase::WritingSystem</a>.</p>
<a name="qframe"></a>
<h2>QFrame</h2>
<p>The <a href="qframe.html">QFrame</a> class has been made more lightweight in Qt 4, by reducing the number of properties and virtual functions. The reduction in the number of virtual functions is significant because <a href="qframe.html">QFrame</a> is the base class of many Qt classes.</p>
<p>Here's an overview of the changes:</p>
<ul>
<li><a href="qframe.html">QFrame</a> no longer has a <tt>margin</tt> property (which wasn't honored by Qt's layout managers anyway).</li>
<li><a href="qframe.html">QFrame</a> no longer has a frameChanged() function, reimplement <a href="qwidget.html#resizeEvent">QFrame::resizeEvent</a>() instead.</li>
<li><a href="qframe.html">QFrame</a> used to have drawFrame(<a href="qpainter.html">QPainter</a> *) and drawContents(<a href="qpainter.html">QPainter</a> *) virtual functions. These are now gone. In Qt 4, the frame is drawn by the <a href="qframe.html#paintEvent">QFrame::paintEvent</a>() function. If you want to change the way <a href="qframe.html">QFrame</a> paints itself, reimplement this function. To draw the contents of the frame, reimplement <a href="qframe.html">QFrame</a>:paintEvent() and call the base class implementation of the function before you use the <a href="qwidget.html#contentsRect">contentsRect()</a> function inherited from <a href="qwidget.html">QWidget</a>, to retrieve the rectangle to paint on.</li>
</ul>
<p>To help with porting, the <a href="qt3support.html">Qt3Support</a> library contains a <a href="q3frame.html" class="compat">Q3Frame</a> class that inherits <a href="qframe.html">QFrame</a> and provides a similar API to the old <a href="qframe.html">QFrame</a> class. If you derived from <a href="qframe.html">QFrame</a> in your application, you might want to use <a href="q3frame.html" class="compat">Q3Frame</a> as a base class as a first step in the porting process, and later move on to the new <a href="qframe.html">QFrame</a> class.</p>
<p>See <a href="porting4-virtual-functions.html">Virtual Functions</a> for a list of <a href="qframe.html">QFrame</a> virtual member functions in Qt 3 that are no longer virtual in Qt 4.</p>
<a name="qftp"></a>
<h2>QFtp</h2>
<p><a href="qftp.html">QFtp</a> no longer inherits from <a href="#qnetworkprotocol">QNetworkProtocol</a>. See the <a href="#qnetworkprotocol-section">section on QNetworkProtocol</a> for details.</p>
<p>The old <tt>QFtp</tt> class has been renamed <a href="q3ftp.html" class="compat">Q3Ftp</a> and moved to the <a href="qt3support.html">Qt3Support</a> library.</p>
<a name="qglayoutiterator-section"></a><a name="qglayoutiterator"></a>
<h2>QGLayoutIterator</h2>
<p>The <a href="#qglayoutiterator">QGLayoutIterator</a> class no longer exists in Qt 4. This makes only a difference if you implemented custom layout managers (i.e., <a href="qlayout.html">QLayout</a> subclasses).</p>
<p>The new approach is much simpler: It consists in reimplementing <a href="qlayout.html#itemAt">QLayout::itemAt</a>() and <a href="qlayout.html#takeAt">QLayout::takeAt</a>(). These functions operate on indexes, eliminating the need for a layout iterator class.</p>
<a name="qgrid"></a>
<h2>QGrid</h2>
<p>The <tt>QGrid</tt> class is now only available as <a href="q3grid.html" class="compat">Q3Grid</a> in Qt 4. You can achieve the same result as <tt>QGrid</tt> by creating a <a href="qwidget.html">QWidget</a> with a grid layout:</p>
<p>For example, if you have code like</p>
<pre class="cpp"> QGrid *grid = new QGrid(2, Qt::Horizontal);
QPushButton *child1 = new QPushButton(grid);
QPushButton *child2 = new QPushButton(grid);
QPushButton *child3 = new QPushButton(grid);
QPushButton *child4 = new QPushButton(grid);</pre>
<p>you can rewrite it as</p>
<pre class="cpp"> <span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>grid <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qwidget.html">QWidget</a></span>;
<span class="type"><a href="qpushbutton.html">QPushButton</a></span> <span class="operator">*</span>child1 <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qpushbutton.html">QPushButton</a></span>(grid);
<span class="type"><a href="qpushbutton.html">QPushButton</a></span> <span class="operator">*</span>child2 <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qpushbutton.html">QPushButton</a></span>(grid);
<span class="type"><a href="qpushbutton.html">QPushButton</a></span> <span class="operator">*</span>child3 <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qpushbutton.html">QPushButton</a></span>(grid);
<span class="type"><a href="qpushbutton.html">QPushButton</a></span> <span class="operator">*</span>child4 <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qpushbutton.html">QPushButton</a></span>(grid);
<span class="type"><a href="qvboxlayout.html">QVBoxLayout</a></span> <span class="operator">*</span>layout <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qvboxlayout.html">QVBoxLayout</a></span>;
layout<span class="operator">-</span><span class="operator">></span>addWidget(child1<span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> <span class="number">0</span>);
layout<span class="operator">-</span><span class="operator">></span>addWidget(child2<span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> <span class="number">1</span>);
layout<span class="operator">-</span><span class="operator">></span>addWidget(child3<span class="operator">,</span> <span class="number">1</span><span class="operator">,</span> <span class="number">0</span>);
layout<span class="operator">-</span><span class="operator">></span>addWidget(child4<span class="operator">,</span> <span class="number">1</span><span class="operator">,</span> <span class="number">1</span>);
grid<span class="operator">-</span><span class="operator">></span>setLayout(layout);</pre>
<a name="qgridlayout"></a>
<h2>QGridLayout</h2>
<p>See <a href="porting4-virtual-functions.html">Virtual Functions</a> for a list of <a href="qgridlayout.html">QGridLayout</a> virtual member functions in Qt 3 that are no longer virtual in Qt 4.</p>
<a name="qgridview"></a>
<h2>QGridView</h2>
<p>The <tt>QGridView</tt> class has been renamed <a href="q3gridview.html" class="compat">Q3GridView</a> and moved to the <a href="qt3support.html">Qt3Support</a> library. In Qt 4, we recommend that you use <a href="qtableview.html">QTableView</a> or <a href="qabstractitemview.html">QAbstractItemView</a> for presenting tabular data.</p>
<p>See <a href="model-view-programming.html">Model/View Programming</a> for an overview of the new item view classes.</p>
<a name="qgroupbox-section"></a><a name="qgroupbox"></a>
<h2>QGroupBox</h2>
<p>The <a href="qgroupbox.html">QGroupBox</a> class has been redesigned in Qt 4. Many of the features of the old <tt>QGroupBox</tt> class can be obtained by using the <a href="q3groupbox.html" class="compat">Q3GroupBox</a> class from the <a href="qt3support.html">Qt3Support</a> library.</p>
<p>The new <a href="qgroupbox.html">QGroupBox</a> is more lightweight. It doesn't attempt to duplicate functionality already provided by <a href="qgridlayout.html">QGridLayout</a>, and it does not inherit from <a href="qframe.html">QFrame</a>. As a result, the following members have been removed:</p>
<ul>
<li><a href="q3groupbox.html#columns-prop">Q3GroupBox::setColumns</a>(), <a href="q3groupbox.html#columns-prop">Q3GroupBox::columns</a>()</li>
<li><a href="q3groupbox.html#orientation-prop">Q3GroupBox::setOrientation</a>(), <a href="q3groupbox.html#orientation-prop">Q3GroupBox::orientation</a>()</li>
<li><a href="q3groupbox.html#setInsideMargin">Q3GroupBox::setInsideMargin</a>(), <a href="q3groupbox.html#insideMargin">Q3GroupBox::insideMargin</a>()</li>
<li><a href="q3groupbox.html#addSpace">Q3GroupBox::addSpace</a>()</li>
</ul>
<p>Naturally, the <tt>columns</tt> and <tt>orientation</tt> properties have also been removed.</p>
<p>If you rely on some of the missing functionality in your application, you can use <a href="q3groupbox.html" class="compat">Q3GroupBox</a> instead of <a href="qgroupbox.html">QGroupBox</a> as a help to porting.</p>
<p>See <a href="porting4-virtual-functions.html">Virtual Functions</a> for a list of <a href="qgroupbox.html">QGroupBox</a> virtual member functions in Qt 3 that are no longer virtual in Qt 4.</p>
<a name="qhbox"></a>
<h2>QHBox</h2>
<p>The <tt>QHBox</tt> class is now only available as <a href="q3hbox.html" class="compat">Q3HBox</a> in Qt 4. You can achieve the same result as <tt>QHBox</tt> by creating a <a href="qwidget.html">QWidget</a> with an horizontal layout:</p>
<p>For example, if you have code like</p>
<pre class="cpp"> QHBox *hbox = new QHBox;
QPushButton *child1 = new QPushButton(hbox);
QPushButton *child2 = new QPushButton(hbox);</pre>
<p>you can rewrite it as</p>
<pre class="cpp"> <span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>hbox <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qwidget.html">QWidget</a></span>;
<span class="type"><a href="qpushbutton.html">QPushButton</a></span> <span class="operator">*</span>child1 <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qpushbutton.html">QPushButton</a></span>;
<span class="type"><a href="qpushbutton.html">QPushButton</a></span> <span class="operator">*</span>child2 <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qpushbutton.html">QPushButton</a></span>;
<span class="type"><a href="qhboxlayout.html">QHBoxLayout</a></span> <span class="operator">*</span>layout <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qhboxlayout.html">QHBoxLayout</a></span>;
layout<span class="operator">-</span><span class="operator">></span>addWidget(child1);
layout<span class="operator">-</span><span class="operator">></span>addWidget(child2);
hbox<span class="operator">-</span><span class="operator">></span>setLayout(layout);</pre>
<p>Note that child widgets are not automatically placed into the widget's layout; you will need to manually add each widget to the <a href="qhboxlayout.html">QHBoxLayout</a>.</p>
<a name="qheader"></a>
<h2>QHeader</h2>
<p>The <tt>QHeader</tt> class has been renamed <a href="q3header.html" class="compat">Q3Header</a> and moved to the <a href="qt3support.html">Qt3Support</a> library. In Qt 4, it is replaced by the <a href="qheaderview.html">QHeaderView</a> class.</p>
<p>See <a href="model-view-programming.html">Model/View Programming</a> for an overview of the new item view classes.</p>
<a name="qhgroupbox"></a>
<h2>QHGroupBox</h2>
<p>The <tt>QHGroupBox</tt> class has been renamed <a href="q3hgroupbox.html" class="compat">Q3HGroupBox</a> and moved to the <a href="qt3support.html">Qt3Support</a> library. Qt 4 does not provide a specific replacement class for <tt>QHGroupBox</tt> since <a href="qgroupbox.html">QGroupBox</a> is designed to be a generic container widget. As a result, you need to supply your own layout for any child widgets.</p>
<p>See <a href="#qgroupbox">#QGroupBox</a> for more information about porting code that uses group boxes.</p>
<a name="qhttp"></a>
<h2>QHttp</h2>
<p><a href="qhttp.html" class="obsolete">QHttp</a> no longer inherits from <a href="#qnetworkprotocol">QNetworkProtocol</a>. See the See the <a href="#qnetworkprotocol-section">section on QNetworkProtocol</a> for details.</p>
<p>The old <tt>QHttp</tt>, <tt>QHttpHeader</tt>, <tt>QHttpRequestHeader</tt>, and <tt>QHttpResponseHeader</tt> classes have been renamed <a href="q3http.html" class="compat">Q3Http</a>, <a href="q3httpheader.html" class="compat">Q3HttpHeader</a>, <a href="q3httprequestheader.html" class="compat">Q3HttpRequestHeader</a>, and <a href="q3httpresponseheader.html" class="compat">Q3HttpResponseHeader</a> and have been moved to the <a href="qt3support.html">Qt3Support</a> library.</p>
<a name="qiconfactory"></a>
<h2>QIconFactory</h2>
<p>The <a href="#qiconfactory">QIconFactory</a> class is no longer part of Qt. It has been replaced by the <a href="qiconengine.html">QIconEngine</a> class.</p>
<a name="qiconset"></a>
<h2>QIconSet</h2>
<p>The QIconSet class is no longer part of Qt. It has been replaced by the <a href="qicon.html">QIcon</a> class.</p>
<a name="qiconview"></a>
<h2>QIconView</h2>
<p>The <tt>QIconView</tt>, <tt>QIconViewItem</tt>, <tt>QIconDrag</tt>, and <tt>QIconDragItem</tt> classes has been renamed <a href="q3iconview.html" class="compat">Q3IconView</a>, <a href="q3iconviewitem.html" class="compat">Q3IconViewItem</a>, <a href="q3icondrag.html" class="compat">Q3IconDrag</a>, and <a href="q3icondragitem.html" class="compat">Q3IconDragItem</a> and moved to the <a href="qt3support.html">Qt3Support</a> library. New Qt applications should use <a href="qlistwidget.html">QListWidget</a> or its base class <a href="qlistview.html">QListView</a> instead, and call QListView::setViewMode(<a href="qlistview.html#ViewMode-enum">QListView::IconMode</a>) to obtain an "icon view" look.</p>
<p>See <a href="model-view-programming.html">Model/View Programming</a> for an overview of the new item view classes.</p>
<a name="qimagedrag"></a>
<h2>QImageDrag</h2>
<p>The <tt>QImageDrag</tt> class has been renamed <a href="q3imagedrag.html" class="compat">Q3ImageDrag</a> and moved to the <a href="qt3support.html">Qt3Support</a> library. In Qt 4, use <a href="qmimedata.html">QMimeData</a> instead and call QMimeData::setImage() to set the image.</p>
<p>See <a href="porting4-dnd.html">Porting to Qt 4 - Drag and Drop</a> for a comparison between the drag and drop APIs in Qt 3 and Qt 4.</p>
<a name="qimageio"></a>
<h2>QImageIO</h2>
<p>The <tt>QImageIO</tt> class has been split into two classes: <a href="qimagereader.html">QImageReader</a> and <a href="qimagewriter.html">QImageWriter</a>. The table below shows the correspondance between the two APIs:</p>
<table class="generic">
<thead><tr class="qt-style"><th >Qt 3 function</th><th >Qt 4 equivalents</th></tr></thead>
<tr valign="top" class="odd"><td >QImageIO::description()</td><td >QImageWriter::text()</td></tr>
<tr valign="top" class="even"><td >QImageIO::fileName()</td><td ><a href="qimagereader.html#fileName">QImageReader::fileName</a>() and <a href="qimagewriter.html#fileName">QImageWriter::fileName</a>()</td></tr>
<tr valign="top" class="odd"><td >QImageIO::format()</td><td ><a href="qimagereader.html#format">QImageReader::format</a>() and <a href="qimagewriter.html#format">QImageWriter::format</a>()</td></tr>
<tr valign="top" class="even"><td >QImageIO::gamma()</td><td ><a href="qimagewriter.html#gamma">QImageWriter::gamma</a>()</td></tr>
<tr valign="top" class="odd"><td >QImageIO::image()</td><td >Return value of <a href="qimagereader.html#read">QImageReader::read</a>()</td></tr>
<tr valign="top" class="even"><td >QImageIO::inputFormats()</td><td ><a href="qimagereader.html#supportedImageFormats">QImageReader::supportedImageFormats</a>()</td></tr>
<tr valign="top" class="odd"><td >QImageIO::ioDevice()</td><td ><a href="qimagereader.html#device">QImageReader::device</a>() and <a href="qimagewriter.html#device">QImageWriter::device</a>()</td></tr>
<tr valign="top" class="even"><td >QImageIO::outputFormats()</td><td ><a href="qimagewriter.html#supportedImageFormats">QImageWriter::supportedImageFormats</a>()</td></tr>
<tr valign="top" class="odd"><td >QImageIO::parameters()</td><td >N/A</td></tr>
<tr valign="top" class="even"><td >QImageIO::quality()</td><td ><a href="qimagewriter.html#quality">QImageWriter::quality</a>()</td></tr>
<tr valign="top" class="odd"><td >QImageIO::read()</td><td ><a href="qimagereader.html#read">QImageReader::read</a>()</td></tr>
<tr valign="top" class="even"><td >QImageIO::setDescription()</td><td ><a href="qimagewriter.html#setText">QImageWriter::setText</a>()</td></tr>
<tr valign="top" class="odd"><td >QImageIO::setFileName()</td><td ><a href="qimagereader.html#setFileName">QImageReader::setFileName</a>() and <a href="qimagewriter.html#setFileName">QImageWriter::setFileName</a>()</td></tr>
<tr valign="top" class="even"><td >QImageIO::setFormat()</td><td ><a href="qimagereader.html#setFormat">QImageReader::setFormat</a>() and <a href="qimagewriter.html#setFormat">QImageWriter::setFormat</a>()</td></tr>
<tr valign="top" class="odd"><td >QImageIO::setGamma()</td><td ><a href="qimagewriter.html#setGamma">QImageWriter::setGamma</a>()</td></tr>
<tr valign="top" class="even"><td >QImageIO::setIODevice()</td><td ><a href="qimagereader.html#setDevice">QImageReader::setDevice</a>() and <a href="qimagewriter.html#setDevice">QImageWriter::setDevice</a>()</td></tr>
<tr valign="top" class="odd"><td >QImageIO::setImage()</td><td >Argument to <a href="qimagewriter.html#write">QImageWriter::write</a>()</td></tr>
<tr valign="top" class="even"><td >QImageIO::setParameters()</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td >QImageIO::setQuality()</td><td ><a href="qimagewriter.html#setQuality">QImageWriter::setQuality</a>()</td></tr>
<tr valign="top" class="even"><td >QImageIO::setStatus()</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td >QImageIO::status()</td><td ><a href="qimagereader.html#error">QImageReader::error</a>() and <a href="qimagewriter.html#error">QImageWriter::error</a>()</td></tr>
<tr valign="top" class="even"><td >QImageIO::write()</td><td ><a href="qimagewriter.html#write">QImageWriter::write</a>()</td></tr>
</table>
<a name="qintcache-t"></a>
<h2>QIntCache<T></h2>
<p>QIntCache<T> has been moved to <a href="qt3support.html">Qt3Support</a>. It has been replaced by <a href="qcache.html">QCache</a><int, T>.</p>
<p>For details, read the <a href="#qcache-section">section on QCache<T></a>, mentally substituting <tt>int</tt> for <a href="qstring.html">QString</a>.</p>
<a name="qintdict-t"></a>
<h2>QIntDict<T></h2>
<p>QIntDict<T> and QIntDictIterator<T> have been moved to <a href="qt3support.html">Qt3Support</a>. They have been replaced by the more modern <a href="qhash.html">QHash</a><Key, T> and <a href="qmultihash.html">QMultiHash</a><Key, T> classes and their associated iterator classes.</p>
<p>When porting old code that uses QIntDict<T> to Qt 4, there are four classes that you can use:</p>
<ul>
<li><a href="qmultihash.html">QMultiHash</a><int, T *></li>
<li><a href="qmultihash.html">QMultiHash</a><int, T></li>
<li><a href="qhash.html">QHash</a><int, T *></li>
<li><a href="qhash.html">QHash</a><int, T></li>
</ul>
<p>For details, read the <a href="#qdict-section">section on QDict<T></a>, mentally substituting <tt>int</tt> for <a href="qstring.html">QString</a>.</p>
<a name="qiodevice-section"></a><a name="qiodevice"></a>
<h2>QIODevice</h2>
<p>The <a href="qiodevice.html">QIODevice</a> class's API has been simplified to make it easier to subclass and to make it work more smoothly with asynchronous devices such as <a href="qtcpsocket.html">QTcpSocket</a> and <a href="qprocess.html">QProcess</a>.</p>
<p>The following virtual functions have changed name or signature:</p>
<table class="generic">
<thead><tr class="qt-style"><th >Qt 3 function</th><th >Comment</th></tr></thead>
<tr valign="top" class="odd"><td ><a href="qiodevice-qt3.html#at" class="compat">QIODevice::at</a>() const</td><td >Renamed <a href="qiodevice.html#pos">QIODevice::pos</a>().</td></tr>
<tr valign="top" class="even"><td >QIODevice::at(Offset)</td><td >Renamed <a href="qiodevice.html#seek">QIODevice::seek</a>().</td></tr>
<tr valign="top" class="odd"><td >QIODevice::open(int)</td><td >The parameter is now of type <a href="qiodevice.html#OpenModeFlag-enum">QIODevice::OpenMode</a>.</td></tr>
<tr valign="top" class="even"><td >QIODevice::readBlock(char *, <a href="qtglobal-qt3.html#Q_ULONG-typedef" class="compat">Q_ULONG</a>)</td><td >QIODevice::read(char *, qint64)</td></tr>
<tr valign="top" class="odd"><td >QIODevice::writeBlock(const char *, <a href="qtglobal-qt3.html#Q_ULONG-typedef" class="compat">Q_ULONG</a>)</td><td >QIODevice::write(const char *, qint64)</td></tr>
</table>
<p><b>Note:</b> QIODevice::open(<a href="qiodevice.html#OpenModeFlag-enum">QIODevice::OpenMode</a>) is no longer pure virtual.</p>
<p>The following functions are no longer virtual or don't exist anymore:</p>
<table class="generic">
<tr valign="top" class="odd"><td ><a href="qiodevice-qt3.html#getch" class="compat">QIODevice::getch</a>()</td><td >Renamed <a href="qiodevice.html#getChar">QIODevice::getChar</a>() and implemented in terms of <a href="qiodevice.html#readData">QIODevice::readData</a>().</td></tr>
<tr valign="top" class="even"><td >QIODevice::putch(int)</td><td >Renamed <a href="qiodevice.html#putChar">QIODevice::putChar</a>() and implemented in terms of <a href="qiodevice.html#writeData">QIODevice::writeData</a>().</td></tr>
<tr valign="top" class="odd"><td ><a href="qiodevice.html#readAll">QIODevice::readAll</a>()</td><td >Implemented in terms of <a href="qiodevice.html#readData">QIODevice::readData</a>().</td></tr>
<tr valign="top" class="even"><td >QIODevice::readLine(char *, <a href="qtglobal-qt3.html#Q_ULONG-typedef" class="compat">Q_ULONG</a>)</td><td >Implemented in terms of <a href="qiodevice.html#readData">QIODevice::readData</a>()</td></tr>
<tr valign="top" class="odd"><td >QIODevice::ungetch(int)</td><td >Renamed <a href="qiodevice.html#ungetChar">QIODevice::ungetChar</a>() and simulated using an internal unget buffer.</td></tr>
</table>
<p>The <tt>IO_xxx</tt> flags have been revised, and the protected setFlags() function removed. Most of the flags have been eliminated because errors are best handled by implementing certain functions in <a href="qiodevice.html">QIODevice</a> subclasses rather than through the base classes. The file access flags, such as <tt>IO_ReadOnly</tt> and <tt>IO_WriteOnly</tt>, have been moved to the <a href="qiodevice.html">QIODevice</a> class to avoid polluting the global namespace. The table below shows the correspondence between the Qt 3 <tt>IO_xxx</tt> flags and the Qt 4 API:</p>
<table class="generic">
<thead><tr class="qt-style"><th >Qt 3 constant</th><th >Qt 4 equivalent</th></tr></thead>
<tr valign="top" class="odd"><td >IO_Direct</td><td >Use !<a href="qiodevice.html#isSequential">QIODevice::isSequential</a>() instead (notice the <i>not</i>).</td></tr>
<tr valign="top" class="even"><td >IO_Sequential</td><td >Use <a href="qiodevice.html#isSequential">QIODevice::isSequential</a>() instead.</td></tr>
<tr valign="top" class="odd"><td >IO_Combined</td><td >N/A</td></tr>
<tr valign="top" class="even"><td >IO_TypeMask</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td >IO_Raw</td><td ><a href="qiodevice.html#OpenModeFlag-enum">QIODevice::Unbuffered</a></td></tr>
<tr valign="top" class="even"><td >IO_Async</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td >IO_ReadOnly</td><td ><a href="qiodevice.html#OpenModeFlag-enum">QIODevice::ReadOnly</a></td></tr>
<tr valign="top" class="even"><td >IO_WriteOnly</td><td ><a href="qiodevice.html#OpenModeFlag-enum">QIODevice::WriteOnly</a></td></tr>
<tr valign="top" class="odd"><td >IO_ReadWrite</td><td ><a href="qiodevice.html#OpenModeFlag-enum">QIODevice::ReadWrite</a></td></tr>
<tr valign="top" class="even"><td >IO_Append</td><td ><a href="qiodevice.html#OpenModeFlag-enum">QIODevice::Append</a></td></tr>
<tr valign="top" class="odd"><td >IO_Truncate</td><td ><a href="qiodevice.html#OpenModeFlag-enum">QIODevice::Truncate</a></td></tr>
<tr valign="top" class="even"><td >IO_Translate</td><td ><a href="qiodevice.html#OpenModeFlag-enum">QIODevice::Text</a></td></tr>
<tr valign="top" class="odd"><td >IO_ModeMask</td><td >N/A</td></tr>
<tr valign="top" class="even"><td >IO_Open</td><td >Use <a href="qiodevice.html#isOpen">QIODevice::isOpen</a>() instead.</td></tr>
<tr valign="top" class="odd"><td >IO_StateMask</td><td >N/A</td></tr>
<tr valign="top" class="even"><td >IO_Ok</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td >IO_ReadError</td><td >N/A</td></tr>
<tr valign="top" class="even"><td >IO_WriteError</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td >IO_FatalError</td><td >N/A</td></tr>
<tr valign="top" class="even"><td >IO_ResourceError</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td >IO_OpenError</td><td >N/A</td></tr>
<tr valign="top" class="even"><td >IO_ConnectError</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td >IO_AbortError</td><td >N/A</td></tr>
<tr valign="top" class="even"><td >IO_TimeOutError</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td >IO_UnspecifiedError</td><td >N/A</td></tr>
</table>
<a name="qiodevicesource"></a>
<h2>QIODeviceSource</h2>
<p>The <a href="#qiodevicesource">QIODeviceSource</a> class was used internally in Qt 2.x in conjunction with QImageConsumer. It was obsoleted in Qt 3.0. If you use this mechanism in your application, please submit a report to the <a href="http://bugreports.qt-project.org">Task Tracker</a> on the Qt website and we will try to find a satisfactory substitute.</p>
<a name="qlabel"></a>
<h2>QLabel</h2>
<p><a href="qlabel.html">QLabel</a> doesn't enable word-wrap automatically anymore when rich text is used. You can enable it by calling <a href="qlabel.html#wordWrap-prop">QLabel::setWordWrap</a>() or by setting the <a href="qlabel.html#wordWrap-prop">wordWrap</a> property. The reason for this change is that the old behavior was confusing to many users.</p>
<p>Also, <a href="qlabel.html">QLabel</a> no longer offers an <tt>autoResize</tt> property. Instead, you can call <a href="qwidget.html#setFixedSize">QWidget::setFixedSize</a>() on the label, with <a href="qlabel.html#sizeHint">QLabel::sizeHint</a>() as the argument, whenever you change the contents of the <a href="qlabel.html">QLabel</a>.</p>
<p>See also <a href="porting4-virtual-functions.html">Virtual Functions</a> for a list of <a href="qlabel.html">QLabel</a> virtual member functions in Qt 3 that are no longer virtual in Qt 4.</p>
<a name="qlayout"></a>
<h2>QLayout</h2>
<p>In Qt 4, margins are always handled by layouts; there is no QLayout::setSupportsMargin() function anymore.</p>
<p>The deleteAllItems() function is now only available if <tt>QT3_SUPPORT</tt> is defined. If you maintain a <a href="qlist.html">QList</a> of layout items, you can use <a href="qtalgorithms.html#qDeleteAll">qDeleteAll</a>() to remove all the items in one go.</p>
<p>In Qt 3, it was possible to change the resizing behavior for layouts in top-level widgets by adjusting the layout's <tt>resizeMode</tt> property. In Qt 4, this property has been replaced by the <a href="qlayout.html#sizeConstraint-prop">QLayout::sizeConstraint</a> property which provides more control over how the layout behaves when resized.</p>
<p>See also the <a href="#qlayoutiterator-section">section on QLayoutIterator</a> and the <a href="#qglayoutiterator-section">section on QGLayoutIterator</a>.</p>
<a name="qlayoutiterator-section"></a><a name="qlayoutiterator"></a>
<h2>QLayoutIterator</h2>
<p>The QLayoutIterator class is obsoleted in Qt 4. It is available only if <tt>QT3_SUPPORT</tt> is defined. It can be replaced by the <a href="qlayout.html#itemAt">QLayout::itemAt</a>() and <a href="qlayout.html#takeAt">QLayout::takeAt</a>() functions, which operate on indexes.</p>
<p>For example, if you have code like</p>
<pre class="cpp"> QLayoutIterator it = layout()->iterator();
QLayoutItem *child;
while ((child = it.current()) != 0) {
if (child->widget() == myWidget) {
it.takeCurrent();
return;
++it;
}</pre>
<p>you can rewrite it as</p>
<pre class="cpp"> <span class="type">int</span> i <span class="operator">=</span> <span class="number">0</span>;
<span class="type"><a href="qlayoutitem.html">QLayoutItem</a></span> <span class="operator">*</span>child;
<span class="keyword">while</span> ((child <span class="operator">=</span> layout()<span class="operator">-</span><span class="operator">></span>itemAt(i)) <span class="operator">!</span><span class="operator">=</span> <span class="number">0</span>) {
<span class="keyword">if</span> (child<span class="operator">-</span><span class="operator">></span>widget() <span class="operator">=</span><span class="operator">=</span> myWidget) {
layout()<span class="operator">-</span><span class="operator">></span>takeAt(i);
<span class="keyword">return</span>;
}
<span class="operator">+</span><span class="operator">+</span>i;
}</pre>
<a name="qlineedit"></a>
<h2>QLineEdit</h2>
<p>See <a href="#properties">Properties</a> for a list of <a href="qlineedit.html">QLineEdit</a> properties in Qt 3 that have changed in Qt 4.</p>
<p>The default value of <a href="qlineedit.html">QLineEdit</a>'s <a href="qlineedit.html#dragEnabled-prop">dragEnabled</a> property was <tt>true</tt> in Qt 3. In Qt 4, the default value is <tt>false</tt>.</p>
<p>Note that <a href="qlineedit.html">QLineEdit</a> in Qt 4 is no longer a subclass of <a href="qframe.html">QFrame</a>. If you need to visually style a line edit with a frame, we recommend either using a <a href="qframe.html">QFrame</a> as a container for a <a href="qlineedit.html">QLineEdit</a> or customizing the line edit with a <a href="stylesheet.html">style sheet</a>.</p>
<a name="qlistbox"></a>
<h2>QListBox</h2>
<p>The <tt>QListBox</tt>, <tt>QListBoxItem</tt>, <tt>QListBoxText</tt>, and <tt>QListBoxPixmap</tt> classes have been renamed <a href="q3listbox.html" class="compat">Q3ListBox</a>, <a href="q3listboxitem.html" class="compat">Q3ListBoxItem</a>, <a href="q3listboxtext.html" class="compat">Q3ListBoxText</a>, and <a href="q3listboxpixmap.html" class="compat">Q3ListBoxPixmap</a> and have been moved to the <a href="qt3support.html">Qt3Support</a> library. New Qt applications should use <a href="qlistwidget.html">QListWidget</a> or its base class <a href="qlistview.html">QListView</a> instead.</p>
<p>See <a href="model-view-programming.html">Model/View Programming</a> for an overview of the new item view classes.</p>
<a name="qlistview"></a>
<h2>QListView</h2>
<p>The <tt>QListView</tt>, <tt>QListViewItem</tt>, <tt>QCheckListItem</tt>, and <tt>QListViewItemIterator</tt> classes have been renamed <a href="q3listview.html" class="compat">Q3ListView</a>, <a href="q3listviewitem.html" class="compat">Q3ListViewItem</a>, <a href="q3checklistitem.html" class="compat">Q3CheckListItem</a>, and <a href="q3listviewitemiterator.html" class="compat">Q3ListViewItemIterator</a>, and have been moved to the <a href="qt3support.html">Qt3Support</a> library. New Qt applications should use one of the following four classes instead: <a href="qtreeview.html">QTreeView</a> or <a href="qtreewidget.html">QTreeWidget</a> for tree-like structures; <a href="qlistwidget.html">QListWidget</a> or the new <a href="qlistview.html">QListView</a> class for one-dimensional lists.</p>
<p>See <a href="model-view-programming.html">Model/View Programming</a> for an overview of the new item view classes.</p>
<a name="qlocalfs"></a>
<h2>QLocalFs</h2>
<p>The <tt>QLocalFs</tt> class is no longer part of the public Qt API. It has been renamed <a href="q3localfs.html" class="compat">Q3LocalFs</a> and moved to <a href="qt3support.html">Qt3Support</a>. Use <a href="qdir.html">QDir</a>, <a href="qfileinfo.html">QFileInfo</a>, or <a href="qfile.html">QFile</a> instead.</p>
<a name="qmainwindow"></a>
<h2>QMainWindow</h2>
<p>The <a href="qmainwindow.html">QMainWindow</a> class has been redesigned in Qt 4 to provide a more modern look and feel and more flexibility. The API has changed to reflect that. The old <tt>QMainWindow</tt> class has been renamed <a href="q3mainwindow.html" class="compat">Q3MainWindow</a> and moved to <a href="qt3support.html">Qt3Support</a>. See the <a href="qmainwindow.html">QMainWindow</a> class documentation for details.</p>
<a name="qmemarray-section"></a><a name="qmemarray-t"></a>
<h2>QMemArray<T></h2>
<p>QMemArray<T> has been moved to <a href="qt3support.html">Qt3Support</a>. It has been replaced by the <a href="qvector.html">QVector</a><T> class.</p>
<p>The following table summarizes the API differences between the two classes.</p>
<table class="generic">
<tr valign="top" class="odd"><td >QMemArray::assign(const QMemArray<T> &)</td><td >QVector::operator=()</td></tr>
<tr valign="top" class="even"><td >QMemArray::assign(const T *, uint)</td><td >See remark below</td></tr>
<tr valign="top" class="odd"><td >QMemArray::duplicate(const QMemArray &)</td><td >QVector::operator=()</td></tr>
<tr valign="top" class="even"><td >QMemArray::duplicate(const T *, uint)</td><td >See remark below</td></tr>
<tr valign="top" class="odd"><td >QMemArray::setRawData(const T *, uint)</td><td >N/A</td></tr>
<tr valign="top" class="even"><td >QMemArray::resetRawData(const T *, uint)</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td >QMemArray::find(const T &, uint)</td><td >QVector::indexOf(const T &, int)</td></tr>
<tr valign="top" class="even"><td >QMemArray::contains(const T &)</td><td >QVector::count(const T &)</td></tr>
<tr valign="top" class="odd"><td >QMemArray::sort()</td><td ><a href="qtalgorithms.html#qSort">qSort</a>()</td></tr>
<tr valign="top" class="even"><td >QMemArray::bsearch(const T &d)</td><td ><a href="qtalgorithms.html#qBinaryFind">qBinaryFind</a>()</td></tr>
<tr valign="top" class="odd"><td >QMemArray::at(uint)</td><td >QVector::operator[]()</td></tr>
<tr valign="top" class="even"><td >QMemArray::operator const T *()</td><td ><a href="qvector.html#constData">QVector::constData</a>()</td></tr>
</table>
<p>Remarks:</p>
<ol class="1">
<li>QMemArray::assign(const T *, uint) and QMemArray::duplicate(const T *, uint) can be replaced by <a href="qvector.html#resize">QVector::resize</a>() and <a href="qtalgorithms.html#qCopy">qCopy</a>().<p>For example, if you have code like</p>
<pre class="cpp"> QMemArray<QSize> array;
...
array.assign(data, size);</pre>
<p>you can rewrite it as</p>
<pre class="cpp"> <span class="type"><a href="qvector.html">QVector</a></span><span class="operator"><</span><span class="type"><a href="qsize.html">QSize</a></span><span class="operator">></span> vector;
<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
vector<span class="operator">.</span>resize(size);
<a href="qtalgorithms.html#qCopy">qCopy</a>(data<span class="operator">,</span> data <span class="operator">+</span> size<span class="operator">,</span> vector<span class="operator">.</span>begin());</pre>
</li>
<li>QMemArray is an explicitly shared class, whereas <a href="qvector.html">QVector</a> is implicitly shared. See <a href="#explicit-sharing">Explicit Sharing</a> for more information.</li>
</ol>
<a name="qmenubar"></a>
<h2>QMenuBar</h2>
<p>In Qt 3, <a href="qmenubar.html">QMenuBar</a> inherited from <a href="qframe.html">QFrame</a> and <a href="#qmenudata">QMenuData</a>; in Qt 4, it is a direct subclass of <a href="qwidget.html">QWidget</a>. Applications that provided customized menu bars will need to take advantage of the styling features described in the <a href="stylesheet.html">Qt Style Sheets</a> document.</p>
<p>It is not possible to add widgets to menu bars in Qt 4.</p>
<a name="qmenudata"></a>
<h2>QMenuData</h2>
<p>In Qt 4, the <a href="qmenu.html">QMenu</a> class provides a menu widget that can be used in all the places where menus are used in an application. Unlike <tt>QMenuData</tt>, <a href="qmenu.html">QMenu</a> is designed around the concept of actions, provided by the <a href="qaction.html">QAction</a> class, instead of the identifiers used in Qt 3.</p>
<p>In Qt 3, it was possible to insert widgets directly into menus by using a specific <tt>QMenuData::insertItem()</tt> overload. In Qt 4.2 and later, the <a href="qwidgetaction.html">QWidgetAction</a> class can be used to wrap widgets for use in Qt 4's action-based APIs.</p>
<a name="qmessagebox"></a>
<h2>QMessageBox</h2>
<p>The <a href="qmessagebox.html#iconPixmap-prop">QMessageBox::iconPixmap</a>() function used to return a "const <a href="qpixmap.html">QPixmap</a> *". In Qt 4, it returns a <a href="qpixmap.html">QPixmap</a>.</p>
<a name="qmimesourcefactory"></a>
<h2>QMimeSourceFactory</h2>
<p>The <tt>QMimeSourceFactory</tt> has been renamed <a href="q3mimesourcefactory.html" class="compat">Q3MimeSourceFactory</a> and moved to the <a href="qt3support.html">Qt3Support</a> library. New Qt applications should use Qt 4's <a href="resources.html#resource-system">Resource System</a> instead.</p>
<a name="qmovie"></a>
<h2>QMovie</h2>
<p>The <a href="qmovie.html">QMovie</a> API has been revised in Qt 4 to make it more consistent with the other Qt classes (notably <a href="qimagereader.html">QImageReader</a>). The table below summarizes the changes.</p>
<table class="generic">
<thead><tr class="qt-style"><th >Qt 3 function</th><th >Qt 4 equivalent</th></tr></thead>
<tr valign="top" class="odd"><td >QMovie::connectResize()</td><td >Connect to <a href="qmovie.html#resized">QMovie::resized</a>()</td></tr>
<tr valign="top" class="even"><td >QMovie::connectStatus()</td><td >Connect to <a href="qmovie.html#stateChanged">QMovie::stateChanged</a>()</td></tr>
<tr valign="top" class="odd"><td >QMovie::connectUpdate()</td><td >Connect to <a href="qmovie.html#updated">QMovie::updated</a>()</td></tr>
<tr valign="top" class="even"><td >QMovie::disconnectResize()</td><td >Disconnect from <a href="qmovie.html#resized">QMovie::resized</a>()</td></tr>
<tr valign="top" class="odd"><td >QMovie::disconnectStatus()</td><td >Disconnect from <a href="qmovie.html#stateChanged">QMovie::stateChanged</a>()</td></tr>
<tr valign="top" class="even"><td >QMovie::disconnectUpdate()</td><td >Disconnect from <a href="qmovie.html#updated">QMovie::updated</a>()</td></tr>
<tr valign="top" class="odd"><td ><a href="qmovie.html#finished">QMovie::finished</a>()</td><td >Use <a href="qmovie.html#state">QMovie::state</a>() instead</td></tr>
<tr valign="top" class="even"><td ><a href="qmovie-qt3.html#frameImage" class="compat">QMovie::frameImage</a>()</td><td >Use <a href="qmovie.html#currentImage">QMovie::currentImage</a>() instead</td></tr>
<tr valign="top" class="odd"><td ><a href="qmovie-qt3.html#frameNumber" class="compat">QMovie::frameNumber</a>()</td><td >Use <a href="qmovie.html#currentFrameNumber">QMovie::currentFrameNumber</a>() instead</td></tr>
<tr valign="top" class="even"><td ><a href="qmovie-qt3.html#framePixmap" class="compat">QMovie::framePixmap</a>()</td><td >Use <a href="qmovie.html#currentPixmap">QMovie::currentPixmap</a>() instead</td></tr>
<tr valign="top" class="odd"><td >QMovie::getValidRect()</td><td >Use frameRect() instead</td></tr>
<tr valign="top" class="even"><td ><a href="qmovie-qt3.html#isNull" class="compat">QMovie::isNull</a>()</td><td >Use <a href="qmovie.html#isValid">QMovie::isValid</a>() instead</td></tr>
<tr valign="top" class="odd"><td ><a href="qmovie-qt3.html#pause" class="compat">QMovie::pause</a>()</td><td >Use QMovie::setPaused(true) instead</td></tr>
<tr valign="top" class="even"><td ><a href="qmovie-qt3.html#paused" class="compat">QMovie::paused</a>()</td><td >Use <a href="qmovie.html#state">QMovie::state</a>() instead</td></tr>
<tr valign="top" class="odd"><td >QMovie::pushData()</td><td >N/A</td></tr>
<tr valign="top" class="even"><td >QMovie::pushSpace()</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td ><a href="qmovie-qt3.html#restart" class="compat">QMovie::restart</a>()</td><td >Use QMovie::jumpToFrame(0) instead</td></tr>
<tr valign="top" class="even"><td ><a href="qmovie-qt3.html#running" class="compat">QMovie::running</a>()</td><td >Use <a href="qmovie.html#state">QMovie::state</a>() instead</td></tr>
<tr valign="top" class="odd"><td ><a href="qmovie-qt3.html#step" class="compat">QMovie::step</a>()</td><td >Use <a href="qmovie.html#jumpToFrame">QMovie::jumpToFrame</a>() and <a href="qmovie.html#setPaused">QMovie::setPaused</a>() instead</td></tr>
<tr valign="top" class="even"><td ><a href="qmovie-qt3.html#step" class="compat">QMovie::step</a>()</td><td >Use <a href="qmovie.html#jumpToNextFrame">QMovie::jumpToNextFrame</a>() instead</td></tr>
<tr valign="top" class="odd"><td >QMovie::steps()</td><td >Use <a href="qmovie.html#currentFrameNumber">QMovie::currentFrameNumber</a>() and <a href="qmovie.html#frameCount">QMovie::frameCount</a>() instead</td></tr>
<tr valign="top" class="even"><td ><a href="qmovie-qt3.html#unpause" class="compat">QMovie::unpause</a>()</td><td >Use QMovie::setPaused(false) instead</td></tr>
</table>
<a name="qmultilineedit"></a>
<h2>QMultiLineEdit</h2>
<p>The <tt>QMultiLineEdit</tt> class in Qt 3 was a convenience <a href="qtextedit.html">QTextEdit</a> subclass that provided an interface compatible with Qt 2's <a href="#qmultilineedit">QMultiLineEdit</a> class. In Qt 4, it is called <a href="q3multilineedit.html" class="compat">Q3MultiLineEdit</a>, it inherits <a href="q3textedit.html" class="compat">Q3TextEdit</a>, and it is part of <a href="qt3support.html">Qt3Support</a>. Use <a href="qtextedit.html">QTextEdit</a> in new code.</p>
<a name="qnetworkprotocol-section"></a><a name="qnetworkprotocol"></a>
<h2>QNetworkProtocol</h2>
<p>The <a href="#qnetworkprotocol">QNetworkProtocol</a>, QNetworkProtocolFactoryBase, QNetworkProtocolFactory<T>, and QNetworkOperation classes are no longer part of the public Qt API. They have been renamed <a href="q3networkprotocol.html" class="compat">Q3NetworkProtocol</a>, Q3NetworkProtocolFactoryBase, Q3NetworkProtocolFactory<T>, and <a href="q3networkoperation.html" class="compat">Q3NetworkOperation</a> and have been moved to the <a href="qt3support.html">Qt3Support</a> library.</p>
<p>In Qt 4 applications, you can use classes like <a href="qftp.html">QFtp</a> and <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a> directly to perform file-related actions on a remote host.</p>
<a name="qobject"></a>
<h2>QObject</h2>
<p><a href="qobject.html#children">QObject::children</a>() now returns a <a href="qobject.html#QObjectList-typedef">QObjectList</a> instead of a pointer to a <a href="qobject.html#QObjectList-typedef">QObjectList</a>. See also the comments on <a href="qobject.html#QObjectList-typedef">QObjectList</a> below.</p>
<p>Use <a href="qobject.html#findChildren">QObject::findChildren</a>() instead of QObject::queryList(). For example:</p>
<pre class="cpp"> <span class="type"><a href="qlist.html">QList</a></span><span class="operator"><</span><span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span><span class="operator">></span> myWidgets <span class="operator">=</span> myParent<span class="operator">-</span><span class="operator">></span>findChildren<span class="operator"><</span><span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span><span class="operator">></span>();</pre>
<p>QObject::killTimers() has been removed because it was unsafe to use in subclass. (A subclass normally doesn't know whether the base class uses timers or not.)</p>
<p>The <tt>QObject::name</tt> property has been renamed <a href="qobject.html#objectName-prop">QObject::objectName</a>.</p>
<p><tt>QObject::objectTrees()</tt> has been removed. If you are primarly interested in widgets, use <a href="qapplication.html#allWidgets">QApplication::allWidgets</a>() or <a href="qapplication.html#topLevelWidgets">QApplication::topLevelWidgets</a>().</p>
<a name="qobjectdictionary"></a>
<h2>QObjectDictionary</h2>
<p>The <a href="#qobjectdictionary">QObjectDictionary</a> class is a synonym for QAsciiDict<<a href="qmetaobject.html">QMetaObject</a>>. See the <a href="#qasciidict-section">section on QAsciiDict<T></a>.</p>
<a name="qobjectlist"></a>
<h2>QObjectList</h2>
<p>In Qt 3, the <a href="qobject.html#QObjectList-typedef">QObjectList</a> class was a typedef for QPtrList<<a href="qobject.html">QObject</a>>. In Qt 4, it is a typedef for <a href="qlist.html">QList</a><<a href="qobject.html">QObject</a> *>. See the <a href="#qptrlist-section">section on QPtrList<T></a>.</p>
<a name="qpaintdevice"></a>
<h2>QPaintDevice</h2>
<p>To reimplement painter backends one previously needed to reimplement the virtual function QPaintDevice::cmd(). This function is taken out and should is replaced with the function <a href="qpaintdevice.html#paintEngine">QPaintDevice::paintEngine</a>() and the abstract class <a href="qpaintengine.html">QPaintEngine</a>. <a href="qpaintengine.html">QPaintEngine</a> provides virtual functions for all drawing operations that can be performed on a painter backend.</p>
<p><a href="qimage-qt3.html#bitBlt" class="compat">bitBlt</a>() and copyBlt() are now only compatibility functions. Use <a href="qpainter.html#drawPixmap">QPainter::drawPixmap</a>() instead.</p>
<a name="qpaintdevicemetrics"></a>
<h2>QPaintDeviceMetrics</h2>
<p>All functions that used to be provided by the <tt>QPaintDeviceMetrics</tt> class have now been moved to <a href="qpaintdevice.html">QPaintDevice</a>.</p>
<p>For example, if you have code like</p>
<pre class="cpp"> QPaintDeviceMetrics metrics(widget);
int deviceDepth = metrics.depth();</pre>
<p>you can rewrite it as</p>
<pre class="cpp"> <span class="type">int</span> deviceDepth <span class="operator">=</span> widget<span class="operator">-</span><span class="operator">></span>depth();</pre>
<p>For compatibility, the old <tt>QPaintDeviceMetrics</tt> class has been renamed <a href="q3paintdevicemetrics.html" class="compat">Q3PaintDeviceMetrics</a> and moved to <a href="qt3support.html">Qt3Support</a>.</p>
<a name="qpainter"></a>
<h2>QPainter</h2>
<p>The <a href="qpainter.html">QPainter</a> class has undergone some changes in Qt 4 because of the way rectangles are drawn. In Qt 4, the result of drawing a <a href="qrect.html">QRect</a> with a pen width of 1 pixel is 1 pixel wider and 1 pixel taller than in Qt 3.</p>
<p>For compatibility, we provide a <a href="q3painter.html" class="compat">Q3Painter</a> class in <a href="qt3support.html">Qt3Support</a> that provides the old semantics. See the <a href="q3painter.html" class="compat">Q3Painter</a> documentation for details and for the reasons why we had to make this change.</p>
<p>The <a href="http://doc.qt.nokia.com/3.3/qpainter.html#CoordinateMode-enum">QPainter::CoordinateMode</a> enum has been removed in Qt 4. All clipping operations are now defined using logical coordinates and are subject to transformation operations.</p>
<p>The <a href="http://doc.qt.nokia.com/3.3/qpainter.html#RasterOP-enum">QPainter::RasterOP</a> enum has been replaced with <a href="qpainter.html#CompositionMode-enum">QPainter::CompositionMode</a>.</p>
<a name="qpicture"></a>
<h2>QPicture</h2>
<p>In Qt 3, a <a href="qpicture.html">QPicture</a> could be saved in the SVG file format. In Qt 4, the SVG support is provided by the <a href="qtsvg.html">QtSvg</a> module, which includes classes for <i>displaying</i> the contents of SVG files.</p>
<p>If you would like to generate SVG files, you can use the <a href="q3picture.html" class="compat">Q3Picture</a> compatibility class or the <a href="qsvggenerator.html">QSvgGenerator</a> class introduced in Qt 4.3.</p>
<a name="qpixmap"></a>
<h2>QPixmap</h2>
<p>The mask() function has been changed to return a reference to a <a href="qbitmap.html">QBitmap</a> rather than a pointer. As a result, it is no longer possible simply to test for a null pointer when determining whether a pixmap has a mask. Instead, you need to explicitly test whether the mask bitmap is null or not.</p>
<p>For example, if you have code like</p>
<pre class="cpp"> if (pixmap.mask())
widget->setMask(*pixmap.mask());</pre>
<p>you can rewrite it as</p>
<pre class="cpp"> <span class="keyword">if</span> (<span class="operator">!</span>pixmap<span class="operator">.</span>mask()<span class="operator">.</span>isNull())
widget<span class="operator">-</span><span class="operator">></span>setMask(pixmap<span class="operator">.</span>mask());</pre>
<p>The <tt>QPixmap::setOptimization()</tt> and <tt>QPixmap::setDefaultOptimization()</tt> mechanism is no longer available in Qt 4.</p>
<a name="qpointarray"></a>
<h2>QPointArray</h2>
<p>The <tt>QPointArray</tt> class has been renamed <a href="qpolygon.html">QPolygon</a> in Qt 4 and has undergone significant changes. In Qt 3, <tt>QPointArray</tt> inherited from QMemArray<<a href="qpoint.html">QPoint</a>>. In Qt 4, <a href="qpolygon.html">QPolygon</a> inherits from <a href="qvector.html">QVector</a><<a href="qpoint.html">QPoint</a>>. Everything mentioned in the <a href="#qmemarray-section">section on QMemArray<T></a> apply for <a href="#qpointarray">QPointArray</a> as well.</p>
<p>The <a href="qt3support.html">Qt3Support</a> library contains a <a href="q3pointarray.html" class="compat">Q3PointArray</a> class that inherits from <a href="qpolygon.html">QPolygon</a> and provides a few functions that existed in <tt>QPointArray</tt> but no longer exist in <a href="qpolygon.html">QPolygon</a>. These functions include <a href="q3pointarray.html#makeArc">Q3PointArray::makeArc</a>(), <a href="q3pointarray.html#makeEllipse">Q3PointArray::makeEllipse</a>(), and <a href="q3pointarray.html#cubicBezier">Q3PointArray::cubicBezier</a>(). In Qt 4, we recommend that you use <a href="qpainterpath.html">QPainterPath</a> for representing arcs, ellipses, and Bezier curves, rather than <a href="qpolygon.html">QPolygon</a>.</p>
<p>The <a href="qpolygon.html#setPoints">QPolygon::setPoints</a>() and <a href="qpolygon.html#putPoints">QPolygon::putPoints</a>() functions return <tt>void</tt> in Qt 4. The corresponding Qt 3 functions returned a <tt>bool</tt> indicating whether the array was successfully resized or not. This can now be checked by checking <a href="qvector.html#size">QPolygon::size</a>() after the call.</p>
<a name="qpopupmenu"></a>
<h2>QPopupMenu</h2>
<p>For most purposes, <a href="#qpopupmenu">QPopupMenu</a> has been replaced by <a href="qmenu.html">QMenu</a> in Qt 4. For compatibility with older applications, <a href="q3popupmenu.html" class="compat">Q3PopupMenu</a> provides the old API and features that are specific to pop-up menus. Note that, when using <a href="q3popupmenu.html" class="compat">Q3PopupMenu</a>, the menu's actions must be <a href="q3action.html" class="compat">Q3Action</a>s.</p>
<p>In Qt 3, it was common practice to add entries to pop-up menus using the insertItem() function, maintaining identifiers for future use; for example, to dynamically change menu items. In Qt 4, menu entries are completely represented by actions for consistency with other user interface components, such as toolbar buttons. Create new menus with the <a href="qmenu.html">QMenu</a> class, and use the overloaded <a href="qmenu.html#addAction">QMenu::addAction</a>() functions to insert new entries. If you need to manage a set of actions created for a particular menu, we suggest that you construct a <a href="qactiongroup.html">QActionGroup</a> and add them to that.</p>
<p>The <a href="examples-mainwindow.html">Main Window Examples</a> provided show how to use Qt's action system to construct menus, toolbars, and other common user interface elements.</p>
<a name="qprinter"></a>
<h2>QPrinter</h2>
<p>The <a href="qprinter.html">QPrinter</a> class now expects printing to be set up from a <a href="qprintdialog.html">QPrintDialog</a>.</p>
<a name="qprocess"></a>
<h2>QProcess</h2>
<p>The <a href="qprocess.html">QProcess</a> class has undergone major improvements in Qt 4. It now inherits <a href="qiodevice.html">QIODevice</a>, which makes it possible to combine <a href="qprocess.html">QProcess</a> with a <a href="qtextstream.html">QTextStream</a> or a <a href="qdatastream.html">QDataStream</a>.</p>
<p>The old <tt>QProcess</tt> class has been renamed <a href="q3process.html" class="compat">Q3Process</a> and moved to the <a href="qt3support.html">Qt3Support</a> library.</p>
<a name="qprogressbar"></a>
<h2>QProgressBar</h2>
<p>The <a href="qprogressbar.html">QProgressBar</a> API has been significantly improved in Qt 4. The old <tt>QProgressBar</tt> API is available as <a href="q3progressbar.html" class="compat">Q3ProgressBar</a> in the <a href="qt3support.html">Qt3Support</a> library.</p>
<a name="qprogressdialog"></a>
<h2>QProgressDialog</h2>
<p>The <a href="qprogressdialog.html">QProgressDialog</a> API has been significantly improved in Qt 4. The old <tt>QProgressDialog</tt> API is available as <a href="q3progressdialog.html" class="compat">Q3ProgressDialog</a> in the <a href="qt3support.html">Qt3Support</a> library.</p>
<p>See <a href="#properties">Properties</a> for a list of <a href="qprogressdialog.html">QProgressDialog</a> properties in Qt 3 that have changed in Qt 4.</p>
<a name="qptrcollection-t"></a>
<h2>QPtrCollection<T></h2>
<p>The <tt>QPtrCollection<T></tt> abstract base class has been renamed <a href="q3ptrcollection.html" class="compat">Q3PtrCollection</a><T> moved to the <a href="qt3support.html">Qt3Support</a> library. There is no direct equivalent in Qt 4.</p>
<p>See <a href="containers.html">Container Classes</a> for a list of Qt 4 containers.</p>
<a name="qptrdict-t"></a>
<h2>QPtrDict<T></h2>
<p><tt>QPtrDict<T></tt> and <tt>QPtrDictIterator<T></tt> have been renamed <a href="q3ptrdict.html" class="compat">Q3PtrDict</a><T> and <a href="q3ptrdictiterator.html" class="compat">Q3PtrDictIterator</a><T> and have been moved to the <a href="qt3support.html">Qt3Support</a> library. They have been replaced by the more modern <a href="qhash.html">QHash</a><Key, T> and <a href="qmultihash.html">QMultiHash</a><Key, T> classes and their associated iterator classes.</p>
<p>When porting old code that uses <a href="q3ptrdict.html" class="compat">Q3PtrDict</a><T> to Qt 4, there are four classes that you can use:</p>
<ul>
<li><a href="qmultihash.html">QMultiHash</a><void *, T *></li>
<li><a href="qmultihash.html">QMultiHash</a><void *, T></li>
<li><a href="qhash.html">QHash</a><void *, T *></li>
<li><a href="qhash.html">QHash</a><void *, T></li>
</ul>
<p>(You can naturally use other types than <tt>void *</tt> for the key type, e.g. <tt>QWidget *</tt>.)</p>
<p>To port <a href="q3ptrdict.html" class="compat">Q3PtrDict</a><T> to Qt 4, read the <a href="#qdict-section">section on QDict<T></a>, mentally substituting <tt>void *</tt> for <a href="qstring.html">QString</a>.</p>
<a name="qptrlist-section"></a><a name="qptrlist-t"></a>
<h2>QPtrList<T></h2>
<p>QPtrList<T>, QPtrListIterator<T>, and QPtrListStdIterator<T> have been moved to the <a href="qt3support.html">Qt3Support</a> library. They have been replaced by the more modern <a href="qlist.html">QList</a> and <a href="qlinkedlist.html">QLinkedList</a> classes and their associated iterator classes.</p>
<p>When porting to Qt 4, you have the choice of using <a href="qlist.html">QList</a><T> or <a href="qlinkedlist.html">QLinkedList</a><T> as alternatives to QValueList<T>. <a href="qlist.html">QList</a><T> has an index-based API and provides very fast random access (QList::operator[]), whereas <a href="qlinkedlist.html">QLinkedList</a><T> has an iterator-based API.</p>
<p>The following table summarizes the API differences between QPtrList<T> and <a href="qlist.html">QList</a><T *>:</p>
<table class="generic">
<thead><tr class="qt-style"><th >QPtrList function</th><th ><a href="qlist.html">QList</a> equivalent</th></tr></thead>
<tr valign="top" class="odd"><td >QPtrList::contains(const T *)</td><td >QList::count(T *)</td></tr>
<tr valign="top" class="even"><td >QPtrList::containsRef(const T *)</td><td >QList::count(T *)</td></tr>
<tr valign="top" class="odd"><td >QPtrList::find(const T *)</td><td >See remark below</td></tr>
<tr valign="top" class="even"><td >QPtrList::findRef(const T *)</td><td >See remark below</td></tr>
<tr valign="top" class="odd"><td >QPtrList::getFirst()</td><td ><a href="qlist.html#first">QList::first</a>()</td></tr>
<tr valign="top" class="even"><td >QPtrList::getLast()</td><td ><a href="qlist.html#last">QList::last</a>()</td></tr>
<tr valign="top" class="odd"><td >QPtrList::inSort(const T *)</td><td >N/A</td></tr>
<tr valign="top" class="even"><td >QPtrList::remove(const T *)</td><td >QList::removeAll(T *)</td></tr>
<tr valign="top" class="odd"><td >QPtrList::remove(uint)</td><td >QList::removeAt(int)</td></tr>
<tr valign="top" class="even"><td >QPtrList::removeNode(QLNode *)</td><td >N/A</td></tr>
<tr valign="top" class="odd"><td >QPtrList::removeRef(const T *)</td><td >QList::removeAll(T *)</td></tr>
<tr valign="top" class="even"><td >QPtrList::sort()</td><td >See remark below</td></tr>
<tr valign="top" class="odd"><td >QPtrList::takeNode(QLNode *)</td><td >N/A</td></tr>
<tr valign="top" class="even"><td >QPtrList::toVector(QGVector *)</td><td >See remark below</td></tr>
</table>
<p>Remarks:</p>
<ol class="1">
<li>QPtrList::toVector(QGVector *) can be replaced by <a href="qvector.html#resize">QVector::resize</a>() and <a href="qtalgorithms.html#qCopy">qCopy</a>().<p>For example, if you have code like</p>
<pre class="cpp"> QPtrList<QWidget> list;
...
QPtrVector<QWidget> vector;
list.toVector(&vector);</pre>
<p>you can rewrite it as</p>
<pre class="cpp"> <span class="type"><a href="qlist.html">QList</a></span><span class="operator"><</span><span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span><span class="operator">></span> list;
<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
<span class="type"><a href="qvector.html">QVector</a></span><span class="operator"><</span><span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span><span class="operator">></span> vector;
vector<span class="operator">.</span>resize(list<span class="operator">.</span>size());
<a href="qtalgorithms.html#qCopy">qCopy</a>(list<span class="operator">.</span>begin()<span class="operator">,</span> list<span class="operator">.</span>end()<span class="operator">,</span> vector<span class="operator">.</span>begin());</pre>
</li>
<li>QPtrList::sort() relied on the virtual compareItems() to sort items. In Qt 4, you can use <a href="qtalgorithms.html#qSort">qSort</a>() instead and pass your "compare item" function as an argument.</li>
<li>QPtrList::find(const T *) returns an iterator, whereas QList::indexOf(T *) returns an index. To convert an index into an iterator, add the index to <a href="qlist.html#begin">QList::begin</a>().</li>
<li>QPtrList::removeFirst() and QPtrList::removeLast() return a <tt>bool</tt> that indicates whether the element was removed or not. The corresponding <a href="qlist.html">QList</a> functions return <tt>void</tt>. You can achieve the same result by calling <a href="qlist.html#isEmpty">QList::isEmpty</a>() before attempting to remove an item.</li>
</ol>
<p>If you use QPtrList's auto-delete feature (by calling QPtrList::setAutoDelete(true)), you need to do some more work. You have two options: Either you call <tt>delete</tt> yourself whenever you remove an item from the container, or you can use <a href="qlist.html">QList</a><T> instead of <a href="qlist.html">QList</a><T *> (i.e. store values directly instead of pointers to values). Here, we'll see when to call <tt>delete</tt>.</p>
<p>The following table summarizes the idioms that you need to watch out for if you want to call <tt>delete</tt> yourself.</p>
<table class="generic">
<thead><tr class="qt-style"><th >QPtrList idiom</th><th ><a href="qlist.html">QList</a> idiom</th></tr></thead>
<tr valign="top" class="odd"><td ><pre class="cpp"> list<span class="operator">.</span>replace(index<span class="operator">,</span> value);</pre>
</td><td ><pre class="cpp"> <span class="keyword">delete</span> list<span class="operator">[</span>index<span class="operator">]</span>;
list<span class="operator">[</span>index<span class="operator">]</span> <span class="operator">=</span> value;</pre>
</td></tr>
<tr valign="top" class="even"><td ><pre class="cpp"> list<span class="operator">.</span>removeFirst();</pre>
</td><td ><pre class="cpp"> <span class="keyword">delete</span> list<span class="operator">.</span>takeFirst();</pre>
</td></tr>
<tr valign="top" class="odd"><td ><pre class="cpp"> list<span class="operator">.</span>removeLast();</pre>
</td><td ><pre class="cpp"> <span class="keyword">delete</span> list<span class="operator">.</span>takeLast();</pre>
</td></tr>
<tr valign="top" class="even"><td ><pre class="cpp"> list<span class="operator">.</span>remove(index);</pre>
</td><td ><pre class="cpp"> <span class="keyword">delete</span> list<span class="operator">.</span>takeAt(index);</pre>
</td></tr>
<tr valign="top" class="odd"><td ><pre class="cpp"> list<span class="operator">.</span>remove(value);</pre>
</td><td ><pre class="cpp"> <span class="type">int</span> i <span class="operator">=</span> list<span class="operator">.</span>indexOf(value);
<span class="keyword">if</span> (i <span class="operator">!</span><span class="operator">=</span> <span class="operator">-</span><span class="number">1</span>)
<span class="keyword">delete</span> list<span class="operator">.</span>takeAt(i);</pre>
</td></tr>
<tr valign="top" class="even"><td ><pre class="cpp"> list<span class="operator">.</span>remove();</pre>
<p>(removes the current item)</p>
</td><td ><pre class="cpp"> <span class="type"><a href="qmutablelistiterator.html">QMutableListIterator</a></span><span class="operator"><</span>T <span class="operator">*</span><span class="operator">></span> i;
<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
<span class="keyword">delete</span> i<span class="operator">.</span>value();
i<span class="operator">.</span>remove();</pre>
</td></tr>
<tr valign="top" class="odd"><td ><pre class="cpp"> list<span class="operator">.</span>clear();</pre>
<p>(also called from QPtrList's destructor)</p>
</td><td ><pre class="cpp"> <span class="keyword">while</span> (<span class="operator">!</span>list<span class="operator">.</span>isEmpty())
<span class="keyword">delete</span> list<span class="operator">.</span>takeFirst();</pre>
<p>In 99% of cases, the following idiom also works:</p>
<pre class="cpp"> <a href="qtalgorithms.html#qDeleteAll">qDeleteAll</a>(list);
list<span class="operator">.</span>clear();</pre>
<p>However, it may lead to crashes if <tt>list</tt> is referenced from the value type's destructor, because <tt>list</tt> contains dangling pointers until clear() is called.</p>
</td></tr>
</table>
<p>Be aware that QPtrList's destructor automatically calls clear(). If you have a QPtrList data member in a custom class and use the auto-delete feature, you will need to call <tt>delete</tt> on all the items in the container from your class destructor to avoid a memory leak.</p>
<p>QPtrList had the concept of a "current item", which could be used for traversing the list without using an iterator. When porting to Qt 4, you can use the Java-style <a href="qlistiterator.html">QListIterator</a><T *> (or <a href="qmutablelistiterator.html">QMutableListIterator</a><T *>) class instead. The following table summarizes the API differences:</p>
<table class="generic">
<thead><tr class="qt-style"><th >QPtrList function</th><th ><a href="qlistiterator.html">QListIterator</a> equivalent</th></tr></thead>
<tr valign="top" class="odd"><td >QPtrList::at()</td><td >N/A</td></tr>
<tr valign="top" class="even"><td >QPtrList::current()</td><td ><a href="qmutablelistiterator.html#value">QMutableListIterator::value</a>()</td></tr>
<tr valign="top" class="odd"><td >QPtrList::currentNode()</td><td >N/A</td></tr>
<tr valign="top" class="even"><td >QPtrList::findNext(const T *)</td><td >QListIterator::findNext(const T *)</td></tr>
<tr valign="top" class="odd"><td >QPtrList::findNextRef(const T *)</td><td >QListIterator::findNext(const T *)</td></tr>
<tr valign="top" class="even"><td >QPtrList::first()</td><td >QPtrList::toFront()</td></tr>
<tr valign="top" class="odd"><td >QPtrList::last()</td><td >QPtrList::toBack()</td></tr>
<tr valign="top" class="even"><td >QPtrList::next()</td><td >QPtrList::next()</td></tr>
<tr valign="top" class="odd"><td >QPtrList::prev()</td><td >QPtrList::previous()</td></tr>
<tr valign="top" class="even"><td >QPtrList::remove()</td><td ><a href="qmutablelistiterator.html#remove">QMutableListIterator::remove</a>()</td></tr>
<tr valign="top" class="odd"><td >QPtrList::take()</td><td ><a href="qmutablelistiterator.html#remove">QMutableListIterator::remove</a>()</td></tr>
</table>
<p>Be aware that <a href="qlistiterator.html">QListIterator</a> has a different way of iterating than QPtrList. A typical loop with QPtrList looks like this:</p>
<pre class="cpp"> <span class="type">QPtrList</span><span class="operator"><</span><span class="type"><a href="qwidget.html">QWidget</a></span><span class="operator">></span> list;
<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
<span class="keyword">while</span> (list<span class="operator">.</span>current() <span class="operator">!</span><span class="operator">=</span> <span class="number">0</span>) {
do_something(list<span class="operator">.</span>current());
list<span class="operator">.</span>next();
}</pre>
<p>Here's the equivalent <a href="qlistiterator.html">QListIterator</a> loop:</p>
<pre class="cpp"> <span class="type"><a href="qlist.html">QList</a></span><span class="operator"><</span><span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span><span class="operator">></span> list;
<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
<span class="type"><a href="qlistiterator.html">QListIterator</a></span><span class="operator"><</span><span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span><span class="operator">></span> i(list);
<span class="keyword">while</span> (i<span class="operator">.</span>hasNext())
do_something(i<span class="operator">.</span>next());</pre>
<p>Finally, QPtrListIterator<T> must also be ported. There are no fewer than four iterator classes that can be used as a replacement: <a href="qlist-const-iterator.html">QList::const_iterator</a>, <a href="qlist-iterator.html">QList::iterator</a>, <a href="qlistiterator.html">QListIterator</a>, and <a href="qmutablelistiterator.html">QMutableListIterator</a>. The most straightforward class to use when porting is <a href="qmutablelistiterator.html">QMutableListIterator</a><T *> (if you modify the list through the iterator) or <a href="qlistiterator.html">QListIterator</a><T *> (if you don't). The following table summarizes the API differences:</p>
<table class="generic">
<thead><tr class="qt-style"><th >QPtrListIterator function</th><th >Qt 4 equivalent</th></tr></thead>
<tr valign="top" class="odd"><td >QPtrListIterator::atFirst()</td><td >!<a href="qlistiterator.html#hasPrevious">QListIterator::hasPrevious</a>() (notice the <tt>!</tt>)</td></tr>
<tr valign="top" class="even"><td >QPtrListIterator::atLast()</td><td >!<a href="qlistiterator.html#hasNext">QListIterator::hasNext</a>() (notice the <tt>!</tt>)</td></tr>
<tr valign="top" class="odd"><td >QPtrListIterator::count()</td><td ><a href="qlist.html#count">QList::count</a>() or <a href="qlist.html#size">QList::size</a>()</td></tr>
<tr valign="top" class="even"><td >QPtrListIterator::current()</td><td ><a href="qmutablelistiterator.html#value">QMutableListIterator::value</a>()</td></tr>
<tr valign="top" class="odd"><td >QPtrListIterator::isEmpty()</td><td ><a href="qlist.html#isEmpty">QList::isEmpty</a>()</td></tr>
<tr valign="top" class="even"><td >QPtrListIterator::toFirst()</td><td ><a href="qlistiterator.html#toFront">QListIterator::toFront</a>()</td></tr>
<tr valign="top" class="odd"><td >QPtrListIterator::toLast()</td><td ><a href="qlistiterator.html#toBack">QListIterator::toBack</a>()</td></tr>
<tr valign="top" class="even"><td >QPtrListIterator::operator()</td><td ><a href="qmutablelistiterator.html#value">QMutableListIterator::value</a>()</td></tr>
<tr valign="top" class="odd"><td >QPtrListIterator::operator*()</td><td ><a href="qmutablelistiterator.html#value">QMutableListIterator::value</a>()</td></tr>
</table>
<p>Again, be aware that <a href="qlistiterator.html">QListIterator</a> has a different way of iterating than QPtrList. A typical loop with QPtrList looks like this:</p>
<pre class="cpp"> <span class="type">QPtrList</span><span class="operator"><</span><span class="type"><a href="qwidget.html">QWidget</a></span><span class="operator">></span> list;
<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
<span class="type">QPtrListIterator</span><span class="operator"><</span><span class="type"><a href="qwidget.html">QWidget</a></span><span class="operator">></span> i;
<span class="keyword">while</span> (i<span class="operator">.</span>current() <span class="operator">!</span><span class="operator">=</span> <span class="number">0</span>) {
do_something(i<span class="operator">.</span>current());
i<span class="operator">.</span>next();
}</pre>
<p>Here's the equivalent <a href="qlistiterator.html">QListIterator</a> loop:</p>
<pre class="cpp"> <span class="type"><a href="qlist.html">QList</a></span><span class="operator"><</span><span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span><span class="operator">></span> list;
<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
<span class="type"><a href="qlistiterator.html">QListIterator</a></span><span class="operator"><</span><span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span><span class="operator">></span> i(list);
<span class="keyword">while</span> (i<span class="operator">.</span>hasNext())
do_something(i<span class="operator">.</span>next());</pre>
<p>Finally, QPtrListStdIterator<T> must also be ported. This is easy, because <a href="qlist.html">QList</a> also provides STL-style iterators (<a href="qlist-iterator.html">QList::iterator</a> and <a href="qlist-const-iterator.html">QList::const_iterator</a>).</p>
<a name="qptrqueue-t"></a>
<h2>QPtrQueue<T></h2>
<p>QPtrQueue has been moved to the <a href="qt3support.html">Qt3Support</a> library. It has been replaced by the more modern <a href="qqueue.html">QQueue</a> class.</p>
<p>The following table summarizes the differences between QPtrQueue<T> and <a href="qqueue.html">QQueue</a><T *>:</p>
<table class="generic">
<thead><tr class="qt-style"><th >QPtrQueue function</th><th ><a href="qqueue.html">QQueue</a> equivalent</th></tr></thead>
<tr valign="top" class="odd"><td >QPtrQueue::autoDelete()</td><td >See discussion below</td></tr>
<tr valign="top" class="even"><td >QPtrQueue::count()</td><td ><a href="qlist.html#count">QQueue::count</a>() or <a href="qlist.html#size">QQueue::size</a>() (equivalent)</td></tr>
<tr valign="top" class="odd"><td >QPtrQueue::current()</td><td ><a href="qqueue.html#head">QQueue::head</a>()</td></tr>
<tr valign="top" class="even"><td >QPtrQueue::remove()</td><td ><a href="qqueue.html#dequeue">QQueue::dequeue</a>()</td></tr>
<tr valign="top" class="odd"><td >QPtrQueue::setAutoDelete()</td><td >See discussion below</td></tr>
</table>
<p>If you use QPtrQueue's auto-delete feature (by calling QPtrQueue::setAutoDelete(true)), you need to do some more work. You have two options: Either you call <tt>delete</tt> yourself whenever you remove an item from the container, or you can use <a href="qqueue.html">QQueue</a><T> instead of <a href="qqueue.html">QQueue</a><T *> (i.e. store values directly instead of pointers to values). Here, we will show when to call <tt>delete</tt>.</p>
<table class="generic">
<thead><tr class="qt-style"><th >QPtrQueue idiom</th><th ><a href="qqueue.html">QQueue</a> idiom</th></tr></thead>
<tr valign="top" class="odd"><td ><pre class="cpp"> queue<span class="operator">.</span>dequeue();</pre>
</td><td ><pre class="cpp"> <span class="keyword">delete</span> queue<span class="operator">.</span>dequeue();</pre>
</td></tr>
<tr valign="top" class="even"><td ><pre class="cpp"> queue<span class="operator">.</span>remove();</pre>
</td><td ><pre class="cpp"> <span class="keyword">delete</span> queue<span class="operator">.</span>dequeue();</pre>
</td></tr>
<tr valign="top" class="odd"><td ><pre class="cpp"> queue<span class="operator">.</span>clear();</pre>
<p>(also called from QPtrQueue's destructor)</p>
</td><td ><pre class="cpp"> <span class="keyword">while</span> (<span class="operator">!</span>queue<span class="operator">.</span>isEmpty())
<span class="keyword">delete</span> queue<span class="operator">.</span>dequeue();</pre>
<p>In 99% of cases, the following idiom also works:</p>
<pre class="cpp"> <a href="qtalgorithms.html#qDeleteAll">qDeleteAll</a>(queue);
queue<span class="operator">.</span>clear();</pre>
<p>However, it may lead to crashes if <tt>queue</tt> is referenced from the value type's destructor, because <tt>queue</tt> contains dangling pointers until clear() is called.</p>
</td></tr>
</table>
<a name="qptrstack-t"></a>
<h2>QPtrStack<T></h2>
<p>QPtrStack has been moved to the <a href="qt3support.html">Qt3Support</a> library. It has been replaced by the more modern <a href="qstack.html">QStack</a> class.</p>
<p>The following table summarizes the differences between QPtrStack<T> and <a href="qstack.html">QStack</a><T *>:</p>
<table class="generic">
<thead><tr class="qt-style"><th >QPtrStack function</th><th ><a href="qstack.html">QStack</a> equivalent</th></tr></thead>
<tr valign="top" class="odd"><td >QPtrStack::autoDelete()</td><td >See discussion below</td></tr>
<tr valign="top" class="even"><td >QPtrStack::count()</td><td ><a href="qvector.html#count">QStack::count</a>() or <a href="qvector.html#size">QStack::size</a>() (equivalent)</td></tr>
<tr valign="top" class="odd"><td >QPtrStack::current()</td><td ><a href="qstack.html#top">QStack::top</a>()</td></tr>
<tr valign="top" class="even"><td >QPtrStack::remove()</td><td ><a href="qstack.html#pop">QStack::pop</a>()</td></tr>
<tr valign="top" class="odd"><td >QPtrStack::setAutoDelete()</td><td >See discussion below</td></tr>
</table>
<p>If you use QPtrStack's auto-delete feature (by calling QPtrStack::setAutoDelete(true)), you need to do some more work. You have two options: Either you call <tt>delete</tt> yourself whenever you remove an item from the container, or you can use <a href="qstack.html">QStack</a><T> instead of <a href="qstack.html">QStack</a><T *> (i.e. store values directly instead of pointers to values). Here, we will show when to call <tt>delete</tt>.</p>
<table class="generic">
<thead><tr class="qt-style"><th >QPtrStack idiom</th><th ><a href="qstack.html">QStack</a> idiom</th></tr></thead>
<tr valign="top" class="odd"><td ><pre class="cpp"> stack<span class="operator">.</span>pop();</pre>
</td><td ><pre class="cpp"> <span class="keyword">delete</span> stack<span class="operator">.</span>pop();</pre>
</td></tr>
<tr valign="top" class="even"><td ><pre class="cpp"> stack<span class="operator">.</span>remove();</pre>
</td><td ><pre class="cpp"> <span class="keyword">delete</span> stack<span class="operator">.</span>pop();</pre>
</td></tr>
<tr valign="top" class="odd"><td ><pre class="cpp"> stack<span class="operator">.</span>clear();</pre>
<p>(also called from QPtrStack's destructor)</p>
</td><td ><pre class="cpp"> <span class="keyword">while</span> (<span class="operator">!</span>stack<span class="operator">.</span>isEmpty())
<span class="keyword">delete</span> stack<span class="operator">.</span>pop();</pre>
<p>In 99% of cases, the following idiom also works:</p>
<pre class="cpp"> <a href="qtalgorithms.html#qDeleteAll">qDeleteAll</a>(stack);
stack<span class="operator">.</span>clear();</pre>
<p>However, it may lead to crashes if <tt>stack</tt> is referenced from the value type's destructor, because <tt>stack</tt> contains dangling pointers until clear() is called.</p>
</td></tr>
</table>
<a name="qptrvector-t"></a>
<h2>QPtrVector<T></h2>
<p>QPtrVector<T> has been moved to <a href="qt3support.html">Qt3Support</a>. It has been replaced by the more modern <a href="qvector.html">QVector</a> class.</p>
<p>When porting to Qt 4, you can use <a href="qvector.html">QVector</a><T *> as an alternative to QPtrVector<T>. The APIs of QPtrVector<T> and <a href="qvector.html">QVector</a><T *> are somewhat similar. The main issue is that QPtrVector supports auto-delete whereas <a href="qvector.html">QVector</a> doesn't.</p>
<p>The following table summarizes the API differences between the two classes:</p>
<table class="generic">
<thead><tr class="qt-style"><th >QPtrVector function</th><th ><a href="qvector.html">QVector</a> equivalent</th></tr></thead>
<tr valign="top" class="odd"><td >QPtrVector::autoDelete()</td><td >See discussion below</td></tr>
<tr valign="top" class="even"><td >QPtrVector::bsearch(const T *)</td><td ><a href="qtalgorithms.html#qBinaryFind">qBinaryFind</a>()</td></tr>
<tr valign="top" class="odd"><td >QPtrVector::contains(const T *)</td><td >QVector::count(T *)</td></tr>
<tr valign="top" class="even"><td >QPtrVector::containsRef(const T *)</td><td >QVector::count(T *)</td></tr>
<tr valign="top" class="odd"><td >QPtrVector::count()</td><td >See remark below</td></tr>
<tr valign="top" class="even"><td >QPtrVector::insert(uint, T *)</td><td >See remark below</td></tr>
<tr valign="top" class="odd"><td >QPtrVector::isNull()</td><td >N/A</td></tr>
<tr valign="top" class="even"><td >QPtrVector::remove(uint)</td><td >See remark below</td></tr>
<tr valign="top" class="odd"><td >QPtrVector::setAutoDelete()</td><td >See discussion below</td></tr>
<tr valign="top" class="even"><td >QPtrVector::sort()</td><td ><a href="qtalgorithms.html#qSort">qSort</a>()</td></tr>
<tr valign="top" class="odd"><td >QPtrVector::take(uint)</td><td >See remark below</td></tr>
<tr valign="top" class="even"><td >QPtrVector::toList(QGList *)</td><td >QList::QList(const <a href="qvector.html">QVector</a> &)</td></tr>
</table>
<p>Remarks:</p>
<ol class="1">
<li>QPtrVector::insert(uint, T *) sets an item to store a certain pointer value. This is <i>not</i> the same as QVector::insert(int, T *), which creates space for the item by moving following items by one position. Use <tt>vect[i] = ptr</tt> to set a <a href="qvector.html">QVector</a> item to a particular value.</li>
<li>QPtrVector::remove(uint) sets an item to be 0. This is <i>not</i> the same as QVector::removeAt(int), which entirely erases the item, reducing the size of the vector. Use <tt>vect[i] = 0</tt> to set a <a href="qvector.html">QVector</a> item to 0.</li>
<li>Likewise, QPtrVector::take(uint) sets an item to be 0 and returns the previous value of the item. Again, this is easy to achieve using QVector::operator[]().</li>
<li>QPtrVector::count() returns the number of non-null items in the vector, whereas <a href="qvector.html#count">QVector::count</a>() (like <a href="qvector.html#size">QVector::size</a>()) returns the number of items (null or non-null) in the vector. Fortunately, it's not too hard to simulate QPtrVector::count().<p>For example, if you have code like</p>
<pre class="cpp"> int numValidItems = vect.count();</pre>
<p>you can rewrite it as</p>
<pre class="cpp"> <span class="type">int</span> numValidItems <span class="operator">=</span> vect<span class="operator">.</span>size() <span class="operator">-</span> vect<span class="operator">.</span>count(<span class="number">0</span>);</pre>
</li>
</ol>
<p>If you use <a href="qvector.html">QVector</a>'s auto-delete feature (by calling QVector::setAutoDelete(true)), you need to do some more work. You have two options: Either you call <tt>delete</tt> yourself whenever you remove an item from the container, or you use <a href="qvector.html">QVector</a><T> instead of <a href="qvector.html">QVector</a><T *> (i.e. store values directly instead of pointers to values). Here, we'll see when to call <tt>delete</tt>.</p>
<p>The following table summarizes the idioms that you need to watch out for if you want to call <tt>delete</tt> yourself.</p>
<table class="generic">
<thead><tr class="qt-style"><th >QPtrVector idiom</th><th ><a href="qvector.html">QVector</a> idiom</th></tr></thead>
<tr valign="top" class="odd"><td ><pre class="cpp"> vect<span class="operator">.</span>insert(i<span class="operator">,</span> ptr);</pre>
</td><td ><pre class="cpp"> <span class="keyword">delete</span> vect<span class="operator">[</span>i<span class="operator">]</span>;
vect<span class="operator">[</span>i<span class="operator">]</span> <span class="operator">=</span> ptr;</pre>
</td></tr>
<tr valign="top" class="even"><td ><pre class="cpp"> vect<span class="operator">.</span>remove(i);</pre>
</td><td ><pre class="cpp"> <span class="keyword">delete</span> vect<span class="operator">[</span>i<span class="operator">]</span>;
vect<span class="operator">[</span>i<span class="operator">]</span> <span class="operator">=</span> <span class="number">0</span>;</pre>
</td></tr>
<tr valign="top" class="odd"><td ><pre class="cpp"> T <span class="operator">*</span>ptr <span class="operator">=</span> vect<span class="operator">.</span>take(i);</pre>
</td><td ><pre class="cpp"> T <span class="operator">*</span>ptr <span class="operator">=</span> vect<span class="operator">[</span>i<span class="operator">]</span>;
vect<span class="operator">[</span>i<span class="operator">]</span> <span class="operator">=</span> <span class="number">0</span>;</pre>
</td></tr>
<tr valign="top" class="even"><td ><pre class="cpp"> vect<span class="operator">.</span>resize(n)</pre>
</td><td ><pre class="cpp"> <span class="keyword">while</span> (n <span class="operator">></span> vect<span class="operator">.</span>size())
vect<span class="operator">.</span>append(<span class="number">0</span>);
<span class="keyword">while</span> (n <span class="operator"><</span> vect<span class="operator">.</span>size() {
T <span class="operator">*</span>ptr <span class="operator">=</span> vect<span class="operator">.</span>last();
vect<span class="operator">.</span>remove(vect<span class="operator">.</span>size() <span class="operator">-</span> <span class="number">1</span>);
<span class="keyword">delete</span> ptr;
}</pre>
</td></tr>
<tr valign="top" class="odd"><td ><pre class="cpp"> vect<span class="operator">.</span>clear();</pre>
<p>(also called from QPtrVector's destructor)</p>
</td><td ><pre class="cpp"> <span class="keyword">for</span> (<span class="type">int</span> i <span class="operator">=</span> <span class="number">0</span>; i <span class="operator"><</span> vect<span class="operator">.</span>size(); <span class="operator">+</span><span class="operator">+</span>i)
T <span class="operator">*</span>ptr <span class="operator">=</span> vect<span class="operator">[</span>i<span class="operator">]</span>;
vect<span class="operator">[</span>i<span class="operator">]</span> <span class="operator">=</span> <span class="number">0</span>;
<span class="keyword">delete</span> ptr;
}</pre>
<p>In 99% of cases, the following idiom also works:</p>
<pre class="cpp"> <a href="qtalgorithms.html#qDeleteAll">qDeleteAll</a>(vect);
vect<span class="operator">.</span>clear();</pre>
<p>However, it may lead to crashes if <tt>vect</tt> is referenced from the value type's destructor, because <tt>vect</tt> contains dangling pointers until clear() is called.</p>
</td></tr>
</table>
<p>Be aware that QPtrVector's destructor automatically calls clear(). If you have a QPtrVector data member in a custom class and use the auto-delete feature, you will need to call <tt>delete</tt> on all the items in the container from your class destructor to avoid a memory leak.</p>
<a name="qpushbutton"></a>
<h2>QPushButton</h2>
<p>See <a href="#properties">Properties</a> for a list of <a href="qpushbutton.html">QPushButton</a> properties in Qt 3 that have changed in Qt 4.</p>
<a name="qrangecontrol"></a>
<h2>QRangeControl</h2>
<p>In Qt 3, various "range control" widgets (<a href="qdial.html">QDial</a>, <a href="qscrollbar.html">QScrollBar</a>, <a href="qslider.html">QSlider</a>, and QSpin) inherited from both <a href="qwidget.html">QWidget</a> and <tt>QRangeControl</tt>.</p>
<p>In Qt 4, <tt>QRangeControl</tt> has been replaced with the new <a href="qabstractslider.html">QAbstractSlider</a> and <a href="qabstractspinbox.html">QAbstractSpinBox</a> classes, which inherit from <a href="qwidget.html">QWidget</a> and provides similar functionality. Apart from eliminating unnecessary multiple inheritance, the new design allows <a href="qabstractslider.html">QAbstractSlider</a> to provide signals, slots, and properties.</p>
<p>The old <tt>QRangeControl</tt> class has been renamed <a href="q3rangecontrol.html" class="compat">Q3RangeControl</a> and moved to the <a href="qt3support.html">Qt3Support</a> library, together with the (undocumented) <tt>QSpinWidget</tt> class.</p>
<p>If you use <tt>QRangeControl</tt> as a base class in your application, you can switch to use <a href="qabstractslider.html">QAbstractSlider</a> or <a href="qabstractspinbox.html">QAbstractSpinBox</a> instead.</p>
<p>For example, if you have code like</p>
<pre class="cpp"> class VolumeControl : public QWidget, public QRangeControl
{
...
protected:
void valueChange() {
update();
emit valueChanged(value());
}
void rangeChange() {
update();
}
void stepChange() {
update();
}
};</pre>
<p>you can rewrite it as</p>
<pre class="cpp"> <span class="keyword">class</span> VolumeControl : <span class="keyword">public</span> <span class="type"><a href="qabstractslider.html">QAbstractSlider</a></span>
{
<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
<span class="keyword">protected</span>:
<span class="type">void</span> sliderChange(SliderChange change) {
update();
<span class="keyword">if</span> (change <span class="operator">=</span><span class="operator">=</span> SliderValueChange)
<span class="keyword">emit</span> valueChanged(value());
}
};</pre>
<a name="qregexp"></a>
<h2>QRegExp</h2>
<p>The search() and searchRev() functions have been renamed to indexIn() and lastIndexIn() respectively.</p>
<a name="qregion"></a>
<h2>QRegion</h2>
<p>The following changes have been made to <a href="qregion.html">QRegion</a> in Qt 4:</p>
<ul>
<li>There is no longer any difference between a <i>null</i> region and an <i>empty</i> region. Use isEmpty() in most places where you would have used a null <a href="qregion.html">QRegion</a>.</li>
<li><a href="qregion.html#rects">QRegion::rects</a>() used to return a QMemArray<<a href="qrect.html">QRect</a>>. It now returns a <a href="qvector.html">QVector</a><<a href="qrect.html">QRect</a>>.</li>
</ul>
<a name="qscrollbar"></a>
<h2>QScrollBar</h2>
<p>See <a href="#properties">Properties</a> for a list of <a href="qscrollbar.html">QScrollBar</a> properties in Qt 3 that have changed in Qt 4.</p>
<a name="qscrollview"></a>
<h2>QScrollView</h2>
<p>The <tt>QScrollView</tt> class has been renamed <a href="q3scrollview.html" class="compat">Q3ScrollView</a> and moved to the <a href="qt3support.html">Qt3Support</a> library. It has been replaced by the <a href="qabstractscrollarea.html">QAbstractScrollArea</a> and <a href="qscrollarea.html">QScrollArea</a> classes.</p>
<p>Note that Qt 4 in general uses the <a href="qscrollarea.html#widget">QScrollArea::widget</a>() function where Qt 3 used QScrollView::viewport(). The rationale for this is that it is no longer possible to draw directly on a scroll area. The <a href="qscrollarea.html#widget">QScrollArea::widget</a>() function returns the widget set on the scroll area.</p>
<p><tt>QScrollView</tt> was designed to work around the 16-bit limitation on widget coordinates found on most window systems. In Qt 4, this is done transparently for <i>all</i> widgets, so there is no longer a need for such functionality in <tt>QScrollView</tt>. For that reason, the new <a href="qabstractscrollarea.html">QAbstractScrollArea</a> and <a href="qscrollarea.html">QScrollArea</a> classes are much more lightweight, and concentrate on handling scroll bars.</p>
<a name="qserversocket"></a>
<h2>QServerSocket</h2>
<p>The <tt>QServerSocket</tt> class has been renamed <a href="q3serversocket.html" class="compat">Q3ServerSocket</a> and moved to the <a href="qt3support.html">Qt3Support</a> library. In Qt 4, it has been replaced by <a href="qtcpserver.html">QTcpServer</a>.</p>
<p>With <a href="q3serversocket.html" class="compat">Q3ServerSocket</a>, connections are accepted by reimplementing a virtual function (<a href="q3serversocket.html#newConnection">Q3ServerSocket::newConnection</a>()). With <a href="qtcpserver.html">QTcpServer</a>, on the other hand, you don't need to subclass. Instead, simply connect to the <a href="qtcpserver.html#newConnection">QTcpServer::newConnection</a>() signal.</p>
<a name="qsettings"></a>
<h2>QSettings</h2>
<p>The <a href="qsettings.html">QSettings</a> class has been rewritten to be more robust and to respect existing standards (e.g., the INI file format). The API has also been extensively revised. The old API is still provided when Qt 3 support is enabled.</p>
<p>Since the format and location of settings have changed between Qt 3 and Qt 4, the Qt 4 version of your application won't recognize settings written using Qt 3.</p>
<a name="qshared"></a>
<h2>QShared</h2>
<p>The <tt>QShared</tt> class has been obsoleted by the more powerful <a href="qshareddata.html">QSharedData</a> and <a href="qshareddatapointer.html">QSharedDataPointer</a> as a means of creating custom implicitly shared classes. It has been renamed <a href="q3shared.html" class="compat">Q3Shared</a> and moved to the <a href="qt3support.html">Qt3Support</a> library.</p>
<p>An easy way of porting to Qt 4 is to include this class into your project and to use it instead of <tt>QShared</tt>:</p>
<pre class="cpp"> <span class="keyword">struct</span> Shared
{
Shared() : count(<span class="number">1</span>) {}
<span class="type">void</span> ref() { <span class="operator">+</span><span class="operator">+</span>count; }
<span class="type">bool</span> deref() { <span class="keyword">return</span> <span class="operator">!</span><span class="operator">-</span><span class="operator">-</span>count; }
<span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> count;
};</pre>
<p>If possible, we recommend that you use <a href="qshareddata.html">QSharedData</a> and <a href="qshareddatapointer.html">QSharedDataPointer</a> instead. They provide thread-safe reference counting and handle all the reference counting behind the scenes, eliminating the risks of forgetting to increment or decrement the reference count.</p>
<a name="qsignal"></a>
<h2>QSignal</h2>
<p>The <a href="#qsignal">QSignal</a> class has been renamed to <a href="q3signal.html" class="compat">Q3Signal</a> and moved to the <a href="qt3support.html">Qt3Support</a> library. The preferred approach is to create your own <a href="qobject.html">QObject</a> subclass with a signal that has the desired signature. Alternatively, you can call <a href="qmetaobject.html#invokeMethod">QMetaObject::invokeMethod</a>() if you want to invoke a slot.</p>
<a name="qsimplerichtext"></a>
<h2>QSimpleRichText</h2>
<p><a href="#qsimplerichtext">QSimpleRichText</a> has been obsoleted by <a href="qtextdocument.html">QTextDocument</a>. It has been renamed <a href="q3simplerichtext.html" class="compat">Q3SimpleRichText</a> and moved to the <a href="qt3support.html">Qt3Support</a> library.</p>
<p>Previously, you would do the following with <a href="q3simplerichtext.html" class="compat">Q3SimpleRichText</a>:</p>
<pre class="cpp"> <span class="comment">// Declare the object</span>
<span class="type">QSimpleRichText</span> richText(text<span class="operator">,</span> font);
<span class="comment">// Set the width of the paragraph to w</span>
richText<span class="operator">.</span>setWidth(w);
<span class="comment">// Or set a reasonable default size</span>
richText<span class="operator">.</span>adjustSize();
<span class="comment">// Query for its used size</span>
<span class="type">int</span> width <span class="operator">=</span> richText<span class="operator">.</span>widthUsed();
<span class="type">int</span> height <span class="operator">=</span> richText<span class="operator">.</span>height();
<span class="comment">// Draw</span>
richText<span class="operator">.</span>draw(painter<span class="operator">,</span> x<span class="operator">,</span> y<span class="operator">,</span> clipRect<span class="operator">,</span> colorGroup);</pre>
<p>However, with <a href="qtextdocument.html">QTextDocument</a>, you use the following code instead:</p>
<pre class="cpp"> <span class="comment">// Declare the object</span>
<span class="type"><a href="qtextdocument.html">QTextDocument</a></span> doc;
<span class="comment">// If text is rich text, use setHtml()</span>
doc<span class="operator">.</span>setHtml(text);
<span class="comment">// Otherwise, use setPlainText()</span>
doc<span class="operator">.</span>setPlainText(text);
<span class="comment">// Set the width of the paragraph of text to w</span>
doc<span class="operator">.</span>setTextWidth(w);
<span class="comment">// Query for the used size</span>
<span class="type">int</span> width <span class="operator">=</span> doc<span class="operator">.</span>idealWidth();
<span class="type">int</span> height <span class="operator">=</span> doc<span class="operator">.</span>size()<span class="operator">.</span>height();
<span class="comment">// Draw</span>
painter<span class="operator">.</span>translate(x<span class="operator">,</span> y);
doc<span class="operator">.</span>drawContents(painter<span class="operator">,</span> clipRect);
<span class="comment">// If you have a palette/colorgroup you can draw using lower-level functions:</span>
<span class="type"><a href="qabstracttextdocumentlayout.html">QAbstractTextDocumentLayout</a></span><span class="operator">::</span>PaintContext context;
context<span class="operator">.</span>palette <span class="operator">=</span> myPalette;
doc<span class="operator">.</span>documentLayout()<span class="operator">-</span><span class="operator">></span>draw(painter<span class="operator">,</span> context);</pre>
<p>See <a href="richtext.html">Rich Text Processing</a> for an overview of the Qt 4 rich text classes.</p>
<a name="qslider"></a>
<h2>QSlider</h2>
<p>The QSlider::sliderStart() and QSlider::sliderRect() functions have been removed.</p>
<p>The slider's rect can now be retrieved using the code snippet below:</p>
<pre class="cpp"> <span class="type"><a href="qslider.html">QSlider</a></span> <span class="operator">*</span>slider;
slider<span class="operator">-</span><span class="operator">></span>style()<span class="operator">-</span><span class="operator">></span>subControlRect(CC_Slider<span class="operator">,</span> sliderOption<span class="operator">,</span> SC_SliderHandle<span class="operator">,</span> slider);</pre>
<p>In addition, the direction of a vertical <a href="qslider.html">QSlider</a> has changed, i.e. the bottom is now the minimum, and the top the maximum. You can use the <a href="qabstractslider.html#invertedAppearance-prop">QAbstractSlider::invertedAppearance</a> property to control this behavior.</p>
<p>See <a href="#properties">Properties</a> for a list of <a href="qslider.html">QSlider</a> properties in Qt 3 that have changed in Qt 4.</p>
<a name="qsocket"></a>
<h2>QSocket</h2>
<p>The <tt>QSocket</tt> class has been renamed <a href="q3socket.html" class="compat">Q3Socket</a> and moved to the <a href="qt3support.html">Qt3Support</a> library. In Qt 4, it has been replaced by the <a href="qtcpsocket.html">QTcpSocket</a> class, which inherits most of its functionality from <a href="qabstractsocket.html">QAbstractSocket</a>.</p>
<a name="qsocketdevice"></a>
<h2>QSocketDevice</h2>
<p>The <tt>QSocketDevice</tt> class has been renamed <a href="q3socketdevice.html" class="compat">Q3SocketDevice</a> and moved to the <a href="qt3support.html">Qt3Support</a> library. In Qt 4, there is no direct equivalent to <a href="q3socketdevice.html" class="compat">Q3SocketDevice</a>:</p>
<ul>
<li>If you use <a href="q3socketdevice.html" class="compat">Q3SocketDevice</a> in a thread to perform blocking network I/O (a technique encouraged by the <i>Qt Quarterly</i> article <a href="http://doc.qt.nokia.com/qq/qq09-networkthread.html">Unblocking Networking</a>), you can now use <a href="qtcpsocket.html">QTcpSocket</a>, <a href="qftp.html">QFtp</a>, or <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a>, which can be used from non-GUI threads.</li>
<li>If you use <a href="q3socketdevice.html" class="compat">Q3SocketDevice</a> for UDP, you can now use <a href="qudpsocket.html">QUdpSocket</a> instead.</li>
<li>If you use <a href="q3socketdevice.html" class="compat">Q3SocketDevice</a> for other uses, Qt 4 offers no alternative right now. However, there is a <tt>QAbstractSocketEngine</tt> internal class that offers a low-level socket API similar to <a href="q3socketdevice.html" class="compat">Q3SocketDevice</a>. Should the need for such functionality arise in Qt 4 applications, we will consider making this class public in a future release.</li>
</ul>
<a name="qsortedlist"></a>
<h2>QSortedList</h2>
<p>The <a href="#qsortedlist">QSortedList</a><T> class has been deprecated since Qt 3.0. In Qt 4, it has been moved to the <a href="qt3support.html">Qt3Support</a> library.</p>
<p>In new code, we recommend that you use <a href="qlist.html">QList</a><T> instead and use <a href="qtalgorithms.html#qSort">qSort</a>() to sort the items.</p>
<a name="qsplitter"></a>
<h2>QSplitter</h2>
<p>The function setResizeMode() has been moved into <a href="qt3support.html">Qt3Support</a>. Set the stretch factor in the widget's size policy to get equivalent functionality.</p>
<p>The obsolete function drawSplitter() has been removed. Use <a href="qstyle.html#drawPrimitive">QStyle::drawPrimitive</a>() to acheive similar functionality.</p>
<a name="qspinbox"></a>
<h2>QSpinBox</h2>
<p>See <a href="#properties">Properties</a> for a list of <a href="qspinbox.html">QSpinBox</a> properties in Qt 3 that have changed in Qt 4.</p>
<a name="qsqlcursor"></a>
<h2>QSqlCursor</h2>
<p>The <tt>QSqlCursor</tt> class has been renamed <a href="q3sqlcursor.html" class="compat">Q3SqlCursor</a> and moved to the <a href="qt3support.html">Qt3Support</a> library. In Qt 4, you can use <a href="qsqlquery.html">QSqlQuery</a>, <a href="qsqlquerymodel.html">QSqlQueryModel</a>, or <a href="qsqltablemodel.html">QSqlTableModel</a>, depending on whether you want a low-level or a high-level interface for accessing databases.</p>
<p>See <a href="qtsql.html">QtSql Module</a> for an overview of the new SQL classes.</p>
<a name="qsqldatabase"></a>
<h2>QSqlDatabase</h2>
<p><a href="qsqldatabase.html">QSqlDatabase</a> is now a smart pointer that is passed around by value. Simply replace all <a href="qsqldatabase.html">QSqlDatabase</a> pointers by <a href="qsqldatabase.html">QSqlDatabase</a> objects.</p>
<a name="qsqleditorfactory"></a>
<h2>QSqlEditorFactory</h2>
<p>The <tt>QSqlEditorFactory</tt> class has been renamed <a href="q3sqleditorfactory.html" class="compat">Q3SqlEditorFactory</a> and moved to <a href="qt3support.html">Qt3Support</a>.</p>
<p>See <a href="qtsql.html">QtSql Module</a> for an overview of the new SQL classes.</p>
<a name="qsqlerror"></a>
<h2>QSqlError</h2>
<p>The enum <tt>Type</tt> was renamed to <tt>ErrorType</tt>, The values were renamed as well:</p>
<ul>
<li>None - use NoError instead</li>
<li>Connection - use ConnectionError instead</li>
<li>Statement - use StatementError instead</li>
<li>Transaction - use TransactionError instead</li>
<li>Unknown - use UnknownError instead</li>
</ul>
<a name="qsqlfieldinfo"></a>
<h2>QSqlFieldInfo</h2>
<p>The <a href="#qsqlfieldinfo">QSqlFieldInfo</a> class has been moved to <a href="qt3support.html">Qt3Support</a>. Its functionality is now provided by the <a href="qsqlfield.html">QSqlField</a> class.</p>
<p>See <a href="qtsql.html">QtSql Module</a> for an overview of the new SQL classes.</p>
<a name="qsqlform"></a>
<h2>QSqlForm</h2>
<p>The <tt>QSqlForm</tt> class has been renamed <a href="q3sqlform.html" class="compat">Q3SqlForm</a> and moved to the <a href="qt3support.html">Qt3Support</a> library.</p>
<p>See <a href="qtsql.html">QtSql Module</a> for an overview of the new SQL classes.</p>
<a name="qsqlpropertymap"></a>
<h2>QSqlPropertyMap</h2>
<p>The <tt>QSqlPropertyMap</tt> class has been renamed <a href="q3sqlpropertymap.html" class="compat">Q3SqlPropertyMap</a> moved to the <a href="qt3support.html">Qt3Support</a> library.</p>
<p>See <a href="qtsql.html">QtSql Module</a> for an overview of the new SQL classes.</p>
<a name="qsqlquery"></a>
<h2>QSqlQuery</h2>
<p><a href="qsqlquery-qt3.html#prev" class="compat">QSqlQuery::prev</a>() was renamed to <a href="qsqlquery.html#previous">QSqlQuery::previous</a>(). <a href="qsqlquery-qt3.html#prev" class="compat">QSqlQuery::prev</a>() remains, but it just calls previous(). <a href="qsqlquery.html">QSqlQuery</a> no longer has any virtual methods, i.e., exec(), value(), seek(), next(), prev(), first(), last(), and the destructor are no longer virtual.</p>
<a name="qsqlrecord"></a>
<h2>QSqlRecord</h2>
<p><a href="qsqlrecord.html">QSqlRecord</a> behaves like a vector now, <a href="qsqlrecord.html#insert">QSqlRecord::insert</a>() will actually insert a new field instead of replacing the existing one.</p>
<a name="qsqlrecordinfo"></a>
<h2>QSqlRecordInfo</h2>
<p>The <a href="#qsqlrecordinfo">QSqlRecordInfo</a> class has been moved to <a href="qt3support.html">Qt3Support</a>. Its functionality is now provided by the <a href="qsqlrecord.html">QSqlRecord</a> class.</p>
<p>See <a href="qtsql.html">QtSql Module</a> for an overview of the new SQL classes.</p>
<a name="qsqlselectcursor"></a>
<h2>QSqlSelectCursor</h2>
<p>The <tt>QSqlSelectCursor</tt> class has been renamed <a href="q3sqlselectcursor.html" class="compat">Q3SqlSelectCursor</a> and moved to the <a href="qt3support.html">Qt3Support</a> library.</p>
<p>See <a href="qtsql.html">QtSql Module</a> for an overview of the new SQL classes.</p>
<a name="qstoreddrag"></a>
<h2>QStoredDrag</h2>
<p>The <tt>QStoredDrag</tt> class has been renamed <a href="q3storeddrag.html" class="compat">Q3StoredDrag</a> and moved to the <a href="qt3support.html">Qt3Support</a> library. In Qt 4, use <a href="qmimedata.html">QMimeData</a> instead and call <a href="qmimedata.html#setData">QMimeData::setData</a>() to set the data.</p>
<p>See <a href="porting4-dnd.html">Porting to Qt 4 - Drag and Drop</a> for a comparison between the drag and drop APIs in Qt 3 and Qt 4.</p>
<a name="qstr-i-list"></a>
<h2>QStr(I)List</h2>
<p>The QStrList and QStrIList convenience classes have been deprecated since Qt 2.0. In Qt 4, they have been moved to the <a href="qt3support.html">Qt3Support</a> library. If you used any of these, we recommend that you use <a href="qstringlist.html">QStringList</a> or <a href="qlist.html">QList</a><<a href="qbytearray.html">QByteArray</a>> instead.</p>
<a name="qstr-i-vec"></a>
<h2>QStr(I)Vec</h2>
<p>The QStrVec and QStrIVec convenience classes have been deprecated since Qt 2.0. In Qt 4, they have been moved to <a href="qt3support.html">Qt3Support</a>. If you used any of these, we recommend that you use <a href="qstringlist.html">QStringList</a> or <a href="qlist.html">QList</a><<a href="qbytearray.html">QByteArray</a>> instead.</p>
<a name="qstring"></a>
<h2>QString</h2>
<p>Here are the main issues to be aware of when porting <a href="qstring.html">QString</a> to Qt 4:</p>
<ol class="1">
<li>The QString::QString(<a href="qchar.html">QChar</a>) constructor performed implicit conversion in Qt 3. Now, you will need a cast to convert a <a href="qchar.html">QChar</a> to a <a href="qstring.html">QString</a>.</li>
<li>The QString::QString(const <a href="qbytearray.html">QByteArray</a> &) constructor used to stop at the first '\0' it encountered, for compatibility with Qt 1. This quirk has now been fixed; in Qt 4, the resulting <a href="qstring.html">QString</a> always has the same length as the <a href="qbytearray.html">QByteArray</a> that was passed to the constructor.</li>
<li>The <a href="qstring.html#null-var">QString::null</a> static constant has been deprecated in Qt 4. For compatibility, Qt 4 provides a <a href="qstring.html#null-var">QString::null</a> symbol that behaves more or less the same as the old constant. The new idiom is to write QString() instead of <a href="qstring.html#null-var">QString::null</a>, or to call clear().<p>For example, if you have code like</p>
<pre class="cpp"> str1 = QString::null;
if (str2 == QString::null)
do_something(QString::null);</pre>
<p>you can rewrite it as</p>
<pre class="cpp"> str1<span class="operator">.</span>clear();
<span class="keyword">if</span> (str2<span class="operator">.</span>isNull())
do_something(<span class="type"><a href="qstring.html">QString</a></span>());</pre>
<p>In new code, we recommend that you don't rely on the distinction between a null string and a (non-null) empty string. See <a href="qstring.html#distinction-between-null-and-empty-strings">Distinction Between Null and Empty Strings</a> for details.</p>
</li>
<li><a href="qstring-qt3.html#latin1" class="compat">QString::latin1</a>() and <a href="qstring-qt3.html#ascii" class="compat">QString::ascii</a>() have been replaced with <a href="qstring.html#toLatin1">QString::toLatin1</a>() and <a href="qstring.html#toAscii">QString::toAscii</a>(), which return a <a href="qbytearray.html">QByteArray</a> instead of a (non-reentrant) <tt>const char *</tt>. For consistency, <a href="qstring-qt3.html#utf8" class="compat">QString::utf8</a>() and <a href="qstring-qt3.html#local8Bit" class="compat">QString::local8Bit</a>(), which already returned a <a href="qbytearray.html">QByteArray</a> (actually a <tt>QCString</tt>), have been renamed <a href="qstring.html#toUtf8">QString::toUtf8</a>() and <a href="qstring.html#toLocal8Bit">QString::toLocal8Bit</a>().<p>To obtain a <tt>const char *</tt> pointer to ASCII or Latin-1 data, use <a href="qstring.html#toAscii">QString::toAscii</a>() or <a href="qstring.html#toLatin1">QString::toLatin1</a>() to obtain a <a href="qbytearray.html">QByteArray</a> containing the data, then call <a href="qbytearray.html#constData">QByteArray::constData</a>() to access the character data directly. Note that the pointer returned by this function is only valid for the lifetime of the byte array; you should avoid taking a pointer to the data contained in temporary objects.</p>
<pre class="cpp"> <span class="type"><a href="qstring.html">QString</a></span> greeting <span class="operator">=</span> <span class="string">"Hello"</span>;
<span class="keyword">const</span> <span class="type">char</span> <span class="operator">*</span>badData <span class="operator">=</span> greeting<span class="operator">.</span>toAscii()<span class="operator">.</span>constData(); <span class="comment">// data is invalid</span>
<span class="type"><a href="qbytearray.html">QByteArray</a></span> asciiData <span class="operator">=</span> greeting<span class="operator">.</span>toAscii();
<span class="keyword">const</span> <span class="type">char</span> <span class="operator">*</span>goodData <span class="operator">=</span> asciiData<span class="operator">.</span>constData();</pre>
<p>In the above example, the <tt>goodData</tt> pointer is valid for the lifetime of the <tt>asciiData</tt> byte array. If you need to keep a copy of the data in a non-Qt data structure, use standard C memory allocation and string copying functions to do so <i>before</i> destroying the byte array.</p>
</li>
<li><a href="qstring.html#at">QString::at</a>() returned a non-const reference, whereas the new <a href="qstring.html#at">QString::at</a>() returns a const value. Code like<pre class="cpp"> str<span class="operator">.</span>at(<span class="number">0</span>) <span class="operator">=</span> <span class="char">'X'</span>;</pre>
<p>will no longer compile. Instead, use QString::operator[]:</p>
<pre class="cpp"> str<span class="operator">[</span><span class="number">0</span><span class="operator">]</span> <span class="operator">=</span> <span class="char">'X'</span>;</pre>
</li>
<li>The QString::contains(<i>x</i>) function (where <i>x</i> is a character or a string) has been renamed QString::count(<i>x</i>). In addition, there now exists a set of <a href="qstring.html#contains">QString::contains</a>() functions that returns a boolean value. Replace old calls to contains() with either count() or contains(), depending on whether you care about the specific number of occurrences of a character in the string or only care about whether the string contains that character or not.</li>
<li>Many functions in <a href="qstring.html">QString</a> had a <tt>bool</tt> parameter that specified case sensitivity. In Qt 4, in the interest of code readability and maintainability, the <tt>bool</tt> parameters have been replaced by the <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a> enum, which can take the values <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> and <a href="qt.html#CaseSensitivity-enum">Qt::CaseInsensitive</a>.<p>For example, if you have code like</p>
<pre class="cpp"> if (url.startsWith("http:", false))
...</pre>
<p>you can rewrite it as</p>
<pre class="cpp"> <span class="keyword">if</span> (url<span class="operator">.</span>startsWith(<span class="string">"http:"</span><span class="operator">,</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>CaseInsensitive))
<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span></pre>
</li>
<li>The QString::setExpand(uint, <a href="qchar.html">QChar</a>) function, which already was obsolete in Qt 3, is no longer available. Use QString::operator[] instead.<p>For example, if you have code like</p>
<pre class="cpp"> str.setExpand(32, '$');</pre>
<p>you can rewrite it as</p>
<pre class="cpp"> str<span class="operator">[</span><span class="number">32</span><span class="operator">]</span> <span class="operator">=</span> <span class="char">'$'</span>;</pre>
</li>
<li>The <tt>QT_NO_ASCII_CAST</tt> and <tt>QT_NO_CAST_ASCII</tt> macros have been renamed <tt>QT_NO_CAST_TO_ASCII</tt> and <tt>QT_NO_CAST_FROM_ASCII</tt>, respectively.</li>
<li>The <a href="qstring.html#data">QString::data</a>() used to return the same as <a href="qstring-qt3.html#ascii" class="compat">QString::ascii</a>(). It now returns a pointer to the Unicode data stored in the <a href="qstring.html">QString</a> object. Call <a href="qstring-qt3.html#ascii" class="compat">QString::ascii</a>() if you want the old behavior.</li>
<li><a href="qstring.html#arg">QString::arg</a>() now converts two-digit place markers, allowing up to 99 place markers to be used in any given string.</li>
<li>Comparisons between QStrings and <tt>NULL</tt> in order to determine whether strings are empty are no longer allowed. Use <a href="qstring.html#isEmpty">isEmpty()</a> instead.</li>
</ol>
<a name="qstringlist"></a>
<h2>QStringList</h2>
<p><a href="qstringlist.html">QStringList</a> now inherits from <a href="qlist.html">QList</a><<a href="qstring.html">QString</a>> and can no longer be converted to a QValueList<<a href="qstring.html">QString</a>>. Since QValueList inherits <a href="qlist.html">QList</a> a cast will work as expected.</p>
<p>This change implies some API incompatibilities for <a href="qstringlist.html">QStringList</a>. For example, at() returns the string, not an iterator. See the <a href="#qvaluelist-section">section on QValueList</a> for details.</p>
<p>The static <a href="qstringlist-qt3.html#split" class="compat">QStringList::split</a>() function for splitting strings into lists of smaller strings has been replaced by <a href="qstring.html#split">QString::split</a>(), which returns a <a href="qstringlist.html">QStringList</a>.</p>
<a name="qstyle"></a>
<h2>QStyle</h2>
<p>The <a href="qstyle.html">QStyle</a> API has been overhauled and improved. Most of the information on why this change was done is described in <a href="qt4-styles.html">the QStyle overview</a>.</p>
<p>Since <a href="qstyle.html">QStyle</a> is mostly used internally by Qt's widgets and styles and since it is not essential to the good functioning of an application, there is no compatibility path. This means that we have changed many enums and functions and the qt3to4 porting tool will not change much in your qstyle code. To ease the pain, we list some of the major changes here.</p>
<p><a href="qstyleoption.html">QStyleOption</a> has taken on a more central role and is no longer an optional argument, please see the <a href="qstyleoption.html">QStyleOption</a> documentation for more information.</p>
<p>The QStyle::StyleFlags have been renamed QStyle::StateFlags and are now prefixed State_ instead of Style_, in addition the Style_ButtonDefault flag has moved to <a href="qstyleoptionbutton.html">QStyleOptionButton</a>.</p>
<p>The <a href="qstyle.html#PrimitiveElement-enum">QStyle::PrimitiveElement</a> enumeration has undergone extensive change. Some of the enums were moved to <a href="qstyle.html#ControlElement-enum">QStyle::ControlElement</a>, some were removed and all were renamed. This renaming is not done by the qt3to4 porting tool, so you must do it yourself. The table below shows how things look now.</p>
<table class="generic">
<thead><tr class="qt-style"><th >Old name</th><th >New name</th><th >Remark</th></tr></thead>
<tr valign="top" class="odd"><td ><tt>PE_ButtonCommand</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_PanelButtonCommand</a></td></tr>
<tr valign="top" class="even"><td ><tt>PE_ButtonDefault</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_FrameDefaultButton</a></td></tr>
<tr valign="top" class="odd"><td ><tt>PE_ButtonBevel</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_PanelButtonBevel</a></td></tr>
<tr valign="top" class="even"><td ><tt>PE_ButtonTool</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_PanelButtonTool</a></td></tr>
<tr valign="top" class="odd"><td ><tt>PE_ButtonDropDown</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_IndicatorButtonDropDown</a></td></tr>
<tr valign="top" class="even"><td ><tt>PE_FocusRect</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_FrameFocusRect</a></td></tr>
<tr valign="top" class="odd"><td ><tt>PE_ArrowUp</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_IndicatorArrowUp</a></td></tr>
<tr valign="top" class="even"><td ><tt>PE_ArrowDown</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_IndicatorArrowDown</a></td></tr>
<tr valign="top" class="odd"><td ><tt>PE_ArrowRight</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_IndicatorArrowRight</a></td></tr>
<tr valign="top" class="even"><td ><tt>PE_ArrowLeft</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_IndicatorArrowLeft</a></td></tr>
<tr valign="top" class="odd"><td ><tt>PE_SpinBoxUp</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_IndicatorSpinUp</a></td></tr>
<tr valign="top" class="even"><td ><tt>PE_SpinBoxDown</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_IndicatorSpinDown</a></td></tr>
<tr valign="top" class="odd"><td ><tt>PE_SpinBoxPlus</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_IndicatorSpinPlus</a></td></tr>
<tr valign="top" class="even"><td ><tt>PE_SpinBoxMinus</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_IndicatorSpinMinus</a></td></tr>
<tr valign="top" class="odd"><td ><tt>PE_SpinBoxSlider</tt></td><td >QStyle::CE_SpinBoxSlider</td><td >uses <a href="qstyle.html#drawControl">QStyle::drawControl</a>()</td></tr>
<tr valign="top" class="even"><td ><tt>PE_Indicator</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_IndicatorCheckBox</a></td></tr>
<tr valign="top" class="odd"><td ><tt>PE_IndicatorMask</tt></td><td >N/A</td><td >use <a href="qstyle.html#styleHint">QStyle::styleHint</a>() to retrieve mask</td></tr>
<tr valign="top" class="even"><td ><tt>PE_ExclusiveIndicator</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_IndicatorRadioButton</a></td></tr>
<tr valign="top" class="odd"><td ><tt>PE_ExclusiveIndicatorMask</tt></td><td >N/A</td><td >use <a href="qstyle.html#styleHint">QStyle::styleHint</a>() to retrieve mask</td></tr>
<tr valign="top" class="even"><td ><tt>PE_DockWindowHandle</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_IndicatorToolBarHandle</a></td></tr>
<tr valign="top" class="odd"><td ><tt>PE_DockWindowSeparator</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_Q3DockWindowSeparator</a></td></tr>
<tr valign="top" class="even"><td ><tt>PE_DockWindowResizeHandle</tt></td><td >QStyle::PE_IndicatorDockWindowResizeHandle</td></tr>
<tr valign="top" class="odd"><td ><tt>PE_DockWindowTitle</tt></td><td >QStyle::CE_DockWindowTitle</td><td >uses <a href="qstyle.html#drawControl">QStyle::drawControl</a>()</td></tr>
<tr valign="top" class="even"><td ><tt>PE_Splitter</tt></td><td ><a href="qstyle.html#ControlElement-enum">QStyle::CE_Splitter</a></td><td >uses <a href="qstyle.html#drawControl">QStyle::drawControl</a>()</td></tr>
<tr valign="top" class="odd"><td ><tt>PE_Panel</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_Frame</a></td></tr>
<tr valign="top" class="even"><td ><tt>PE_PanelMenu</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_FrameMenu</a></td></tr>
<tr valign="top" class="odd"><td ><tt>PE_PanelMenuBar</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_PanelMenuBar</a></td></tr>
<tr valign="top" class="even"><td ><tt>PE_PanelDockWindow</tt></td><td >QStyle::PE_FrameDockWindow</td></tr>
<tr valign="top" class="odd"><td ><tt>PE_TabBarBase</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_FrameTabBarBase</a></td></tr>
<tr valign="top" class="even"><td ><tt>PE_HeaderSection</tt></td><td ><a href="qstyle.html#ControlElement-enum">QStyle::CE_HeaderSection</a></td><td >uses <a href="qstyle.html#drawControl">QStyle::drawControl</a>()</td></tr>
<tr valign="top" class="odd"><td ><tt>PE_HeaderArrow</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_IndicatorHeaderArrow</a></td></tr>
<tr valign="top" class="even"><td ><tt>PE_StatusBarSection</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_FrameStatusBar</a></td></tr>
<tr valign="top" class="odd"><td ><tt>PE_Separator</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_Q3Separator</a></td></tr>
<tr valign="top" class="even"><td ><tt>PE_SizeGrip</tt></td><td ><a href="qstyle.html#ControlElement-enum">QStyle::CE_SizeGrip</a></td><td >uses <a href="qstyle.html#drawControl">QStyle::drawControl</a>()</td></tr>
<tr valign="top" class="odd"><td ><tt>PE_CheckMark</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_IndicatorMenuCheckMark</a></td></tr>
<tr valign="top" class="even"><td ><tt>PE_ScrollBarAddLine</tt></td><td ><a href="qstyle.html#ControlElement-enum">QStyle::CE_ScrollBarAddLine</a></td><td >uses <a href="qstyle.html#drawControl">QStyle::drawControl</a>()</td></tr>
<tr valign="top" class="odd"><td ><tt>PE_ScrollBarSubLine</tt></td><td ><a href="qstyle.html#ControlElement-enum">QStyle::CE_ScrollBarSubLine</a></td><td >uses <a href="qstyle.html#drawControl">QStyle::drawControl</a>()</td></tr>
<tr valign="top" class="even"><td ><tt>PE_ScrollBarAddPage</tt></td><td ><a href="qstyle.html#ControlElement-enum">QStyle::CE_ScrollBarAddPage</a></td><td >uses <a href="qstyle.html#drawControl">QStyle::drawControl</a>()</td></tr>
<tr valign="top" class="odd"><td ><tt>PE_ScrollBarSubPage</tt></td><td ><a href="qstyle.html#ControlElement-enum">QStyle::CE_ScrollBarSubPage</a></td><td >uses <a href="qstyle.html#drawControl">QStyle::drawControl</a>()</td></tr>
<tr valign="top" class="even"><td ><tt>PE_ScrollBarSlider</tt></td><td ><a href="qstyle.html#ControlElement-enum">QStyle::CE_ScrollBarSlider</a></td><td >uses <a href="qstyle.html#drawControl">QStyle::drawControl</a>()</td></tr>
<tr valign="top" class="odd"><td ><tt>PE_ScrollBarFirst</tt></td><td ><a href="qstyle.html#ControlElement-enum">QStyle::CE_ScrollBarFirst</a></td><td >uses <a href="qstyle.html#drawControl">QStyle::drawControl</a>()</td></tr>
<tr valign="top" class="even"><td ><tt>PE_ScrollBarLast</tt></td><td ><a href="qstyle.html#ControlElement-enum">QStyle::CE_ScrollBarLast</a></td><td >uses <a href="qstyle.html#drawControl">QStyle::drawControl</a>()</td></tr>
<tr valign="top" class="odd"><td ><tt>PE_ProgressBarChunk</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_IndicatorProgressChunk</a></td></tr>
<tr valign="top" class="even"><td ><tt>PE_PanelLineEdit</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_FrameLineEdit</a></td></tr>
<tr valign="top" class="odd"><td ><tt>PE_PanelTabWidget</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_FrameTabWidget</a></td></tr>
<tr valign="top" class="even"><td ><tt>PE_WindowFrame</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_FrameWindow</a></td></tr>
<tr valign="top" class="odd"><td ><tt>PE_CheckListController</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_Q3CheckListController</a></td></tr>
<tr valign="top" class="even"><td ><tt>PE_CheckListIndicator</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_Q3CheckListIndicator</a></td></tr>
<tr valign="top" class="odd"><td ><tt>PE_CheckListExclusiveIndicator</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_Q3CheckListExclusiveIndicator</a></td></tr>
<tr valign="top" class="even"><td ><tt>PE_PanelGroupBox</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_FrameGroupBox</a></td></tr>
<tr valign="top" class="odd"><td ><tt>PE_TreeBranch</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_IndicatorBranch</a></td></tr>
<tr valign="top" class="even"><td ><tt>PE_RubberBand</tt></td><td ><a href="qstyle.html#ControlElement-enum">QStyle::CE_RubberBand</a></td><td >uses <a href="qstyle.html#drawControl">QStyle::drawControl</a>()</td></tr>
<tr valign="top" class="odd"><td ><tt>PE_PanelToolBar</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_PanelToolBar</a></td></tr>
<tr valign="top" class="even"><td ><tt>PE_ToolBarHandle</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_IndicatorToolBarHandle</a></td></tr>
<tr valign="top" class="odd"><td ><tt>PE_ToolBarSeparator</tt></td><td ><a href="qstyle.html#PrimitiveElement-enum">QStyle::PE_IndicatorToolBarSeparator</a></td></tr>
</table>
<p>The QStyle::drawControlMask() and QStyle::drawComplexControlMask() functions have been removed. They are replaced with a style hint.</p>
<p>The QStyle::drawItem() overloads that took both a pixmap and a string have been removed. Use <a href="qstyle.html#drawItemText">QStyle::drawItemText</a>() and <a href="qstyle.html#drawItemPixmap">QStyle::drawItemPixmap</a>() directly.</p>
<p>The QStyle::itemRect() overload that took both a pixmap and a string is also removed, use either <a href="qstyle.html#itemTextRect">QStyle::itemTextRect</a>() or <a href="qstyle.html#itemPixmapRect">QStyle::itemPixmapRect</a>() instead.</p>
<a name="qstylesheet"></a>
<h2>QStyleSheet</h2>
<p>The <a href="#qstylesheet">QStyleSheet</a> and QStyleSheetItem classes have been renamed <a href="q3stylesheet.html" class="compat">Q3StyleSheet</a> and <a href="q3stylesheetitem.html" class="compat">Q3StyleSheetItem</a>, and have been moved to the <a href="qt3support.html">Qt3Support</a> library.</p>
<p>See <a href="richtext.html">Rich Text Processing</a> for an overview of the Qt 4 rich text classes, and <a href="stylesheet.html">Qt Style Sheets</a> for a description of CSS-like style sheet support in Qt 4.2 and above.</p>
<a name="qsyntaxhighlighter"></a>
<h2>QSyntaxHighlighter</h2>
<p>The <tt>QSyntaxHighlighter</tt> class from Qt 3 has been renamed <a href="q3syntaxhighlighter.html" class="compat">Q3SyntaxHighlighter</a> and moved to the <a href="qt3support.html">Qt3Support</a> library. Since Qt 4.1, it has been replaced by a new <a href="qsyntaxhighlighter.html">QSyntaxHighlighter</a> class based on Qt 4's new rich text engine.</p>
<a name="qtabbar"></a>
<h2>QTabBar</h2>
<p>See <a href="#properties">Properties</a> for a list of <a href="qtabbar.html">QTabBar</a> properties in Qt 3 that have changed in Qt 4.</p>
<a name="qtabdialog"></a>
<h2>QTabDialog</h2>
<p>The <tt>QTabDialog</tt> class is no longer part of the public Qt API. It has been renamed <a href="q3tabdialog.html" class="compat">Q3TabDialog</a> and moved to <a href="qt3support.html">Qt3Support</a>. In Qt 4 applications, you can easily obtain the same result by combining a <a href="qtabwidget.html">QTabWidget</a> with a <a href="qdialog.html">QDialog</a> and provide <a href="qpushbutton.html">QPushButton</a>s yourself.</p>
<p>See also the <a href="dialogs-tabdialog.html">dialogs/tabdialog</a> example, which shows how to implement tab dialogs in Qt 4.</p>
<a name="qtabwidget"></a>
<h2>QTabWidget</h2>
<p>See <a href="#properties">Properties</a> for a list of <a href="qtabwidget.html">QTabWidget</a> properties in Qt 3 that have changed in Qt 4.</p>
<a name="qtable"></a>
<h2>QTable</h2>
<p>The <tt>QTable</tt>, <tt>QTableItem</tt>, <tt>QComboTableItem</tt>, <tt>QCheckTableItem</tt>, and <tt>QTableSelection</tt> classes have been renamed <a href="q3table.html" class="compat">Q3Table</a>, <a href="q3tableitem.html" class="compat">Q3TableItem</a>, <a href="q3combotableitem.html" class="compat">Q3ComboTableItem</a>, <a href="q3checktableitem.html" class="compat">Q3CheckTableItem</a>, and <a href="q3tableselection.html" class="compat">Q3TableSelection</a> and moved to the <a href="qt3support.html">Qt3Support</a> library. New Qt applications should use the new <a href="qtablewidget.html">QTableWidget</a> or <a href="qtableview.html">QTableView</a> class instead.</p>
<p>Some of these classes behave differently with respect to the way they handle <tt>NULL</tt> pointers. For example, <a href="q3tableitem.html#setPixmap">Q3TableItem::setPixmap</a>() no longer accepts <tt>NULL</tt> or 0 to indicate that the item should contain a null pixmap; in this case, a null pixmap should be constructed and passed explicitly to the function.</p>
<p>See <a href="model-view-programming.html">Model/View Programming</a> for an overview of the new item view classes.</p>
<a name="qtextcodec"></a>
<h2>QTextCodec</h2>
<p>The loadCharmap() and loadCharmapFromFile() functions are no longer available in Qt 4. You need to create your own codec if you want to create a codec based on a POSIX2 charmap definition.</p>
<a name="qtextdrag"></a>
<h2>QTextDrag</h2>
<p>The <tt>QTextDrag</tt> class has been renamed <a href="q3textdrag.html" class="compat">Q3TextDrag</a> and moved to the <a href="qt3support.html">Qt3Support</a> library. In Qt 4, use <a href="qmimedata.html">QMimeData</a> instead and call <a href="qmimedata.html#setText">QMimeData::setText</a>() to set the data.</p>
<p>See <a href="porting4-dnd.html">Porting to Qt 4 - Drag and Drop</a> for a comparison between the drag and drop APIs in Qt 3 and Qt 4.</p>
<a name="qtextedit"></a>
<h2>QTextEdit</h2>
<p>The old <a href="qtextedit.html">QTextEdit</a> and <a href="qtextbrowser.html">QTextBrowser</a> classes have been renamed <a href="q3textedit.html" class="compat">Q3TextEdit</a> and <a href="q3textbrowser.html" class="compat">Q3TextBrowser</a>, and have been moved to <a href="qt3support.html">Qt3Support</a>. The new <a href="qtextedit.html">QTextEdit</a> and <a href="qtextbrowser.html">QTextBrowser</a> have a somewhat different API.</p>
<p>The <tt>QTextEdit::setWrapPolicy()</tt> function has been renamed to <a href="qtextedit.html#wordWrapMode-prop">setWordWrapMode()</a> and the <tt>QTextEdit::setWrapColumnOrWidth()</tt> function has been renamed to <a href="qtextedit.html#lineWrapColumnOrWidth-prop">setLineWrapColumnOrWidth()</a>. The <a href="q3textedit.html#wrapPolicy-prop">Q3TextEdit::setWrapPolicy</a>() and <a href="q3textedit.html#wrapColumnOrWidth-prop">Q3TextEdit::setWrapColumnOrWidth</a>() still provide this functionality in the <a href="q3textedit.html" class="compat">Q3TextEdit</a> class.</p>
<p>See <a href="richtext.html">Rich Text Processing</a> for an overview of the Qt 4 rich text classes.</p>
<a name="qtextistream"></a>
<h2>QTextIStream</h2>
<p>The <a href="qtextistream.html" class="compat">QTextIStream</a> convenience class is no longer provided in Qt 4. Use <a href="qtextstream.html">QTextStream</a> directly instead.</p>
<a name="qtextostream"></a>
<h2>QTextOStream</h2>
<p>The <a href="qtextostream.html" class="compat">QTextOStream</a> convenience class is no longer provided in Qt 4. Use <a href="qtextstream.html">QTextStream</a> directly instead.</p>
<a name="qtextostreamiterator"></a>
<h2>QTextOStreamIterator</h2>
<p>The undocumented <tt>QTextOStreamIterator</tt> class has been removed from the Qt library. If you need it in your application, feel free to copy the source code from the Qt 3 <tt><qtl.h></tt> header file.</p>
<a name="qtextstream"></a>
<h2>QTextStream</h2>
<p><a href="qtextstream.html">QTextStream</a> has undergone a number of API and implementation enhancements, and some of the changes affect <a href="qtextstream.html">QTextStream</a>'s behavior:</p>
<ul>
<li><a href="qtextstream.html">QTextStream</a> now uses buffered writing, which means that you need to call <a href="qtextstream.html#flush">QTextStream::flush</a>(), or use the streaming manipulators <tt>endl</tt> or <tt>flush</tt> if you need <a href="qtextstream.html">QTextStream</a> to flush its write buffer. The stream is flushed automatically if <a href="qtextstream.html">QTextStream</a> is deleted or when the device is closed.</li>
<li><a href="qtextstream.html">QTextStream</a> now uses buffered reading, so if you read a line from the stream, <a href="qtextstream.html">QTextStream</a> will read as much as it can from the device to fill up its internal read buffer. This speeds up reading significantly, but Qt 3 code that mixed <a href="qtextstream.html">QTextStream</a> access and direct device access may need to be updated.</li>
<li>While <a href="qtextstream.html">QTextStream</a> in Qt 3 always translated end-of-line characters from Windows style ("\r\n") to Unix style ("\n") on Windows, <a href="qtextstream.html">QTextStream</a> in Qt 4 only does this on devices opened with the <tt>QIODevice::Text</tt> mode (formerly <tt>IO_Translate</tt>).</li>
</ul>
<p>Note that when using a <a href="qtextstream.html">QTextStream</a> on a <a href="qfile.html">QFile</a> in Qt 4, calling <a href="qiodevice.html#reset">QIODevice::reset</a>() on the <a href="qfile.html">QFile</a> will not have the expected result because <a href="qtextstream.html">QTextStream</a> now buffers the file. Use the <a href="qtextstream.html#seek">QTextStream::seek</a>() function instead.</p>
<a name="qtextview"></a>
<h2>QTextView</h2>
<p>The <tt>QTextView</tt> class has been renamed <a href="q3textview.html" class="compat">Q3TextView</a> and moved to the <a href="qt3support.html">Qt3Support</a> library.</p>
<a name="qtimeedit"></a>
<h2>QTimeEdit</h2>
<p>The <a href="qtimeedit.html">QTimeEdit</a> class in Qt 4 is a convenience class based on <a href="qdatetimeedit.html">QDateTimeEdit</a>. The old class has been renamed <a href="q3timeedit.html" class="compat">Q3TimeEdit</a> and moved to the <a href="qt3support.html">Qt3Support</a> library.</p>
<p>See <a href="porting4-virtual-functions.html">Virtual Functions</a> for a list of <tt>QTimeEdit</tt> virtual member functions in Qt 3 that are no longer virtual in Qt 4.</p>
<a name="qtimer"></a>
<h2>QTimer</h2>
<p>Windows restricts the granularity of timers, but starting with Qt 4, we emulate a finer time resolution. On Windows XP we use the multimedia timer API, which gives us 1 millisecond resolution for <a href="qtimer.html">QTimer</a>.</p>
<p>Note that Windows 2000 has a lower timer resolution, and that code relying on underlying system timer restrictions encounters no such limitations using Qt 4 (e.g., setting an interval of 0 millisecond results in Qt occupying all of the processor time when no GUI events need processing).</p>
<a name="qtoolbar"></a>
<h2>QToolBar</h2>
<p>The old <tt>QToolBar</tt> class, which worked with the old <tt>QMainWindow</tt> and <tt>QDockArea</tt> classes and inherited from <tt>QDockWindow</tt>, has been renamed <a href="q3toolbar.html" class="compat">Q3ToolBar</a> and moved to <a href="qt3support.html">Qt3Support</a>. Note that, when using <a href="q3toolbar.html" class="compat">Q3ToolBar</a>, the toolbar's actions must be <a href="q3action.html" class="compat">Q3Action</a>s.</p>
<p>Use the new <a href="qtoolbar.html">QToolBar</a> class in new applications.</p>
<p><b>Note:</b> <a href="q3toolbar.html" class="compat">Q3ToolBar</a>'s <a href="q3dockwindow.html#horizontallyStretchable-prop">horizontallyStretchable</a> property can be achieved in <a href="qtoolbar.html">QToolBar</a> with <a href="qwidget.html#size-hints-and-size-policies">size policies</a>.</p>
<a name="qtoolbutton"></a>
<h2>QToolButton</h2>
<p>See <a href="#properties">Properties</a> for a list of <a href="qtoolbutton.html">QToolButton</a> properties in Qt 3 that have changed in Qt 4.</p>
<p>Note that many of the properties that could previously be set in the constructor must now be set separately.</p>
<a name="qtooltip"></a>
<h2>QToolTip</h2>
<p>The QToolTip::setGloballyEnabled() function no longer exists. Tooltips can be disabled by <a href="qobject.html#installEventFilter">installing an event filter</a> on <a href="qapplication.html#qApp">qApp</a> (the unique <a href="qapplication.html">QApplication</a> object) to block events of type <a href="qevent.html#Type-enum">QEvent::ToolTip</a>.</p>
<a name="quridrag"></a>
<h2>QUriDrag</h2>
<p>The <tt>QUriDrag</tt> class has been renamed <a href="q3uridrag.html" class="compat">Q3UriDrag</a> and moved to the <a href="qt3support.html">Qt3Support</a> library. In Qt 4, use <a href="qmimedata.html">QMimeData</a> instead and call QMimeData::setUrl() to set the URL.</p>
<p>See <a href="porting4-dnd.html">Porting to Qt 4 - Drag and Drop</a> for a comparison between the drag and drop APIs in Qt 3 and Qt 4.</p>
<a name="qurl"></a>
<h2>QUrl</h2>
<p>The <a href="qurl.html">QUrl</a> class has been rewritten from scratch in Qt 4 to be more standard-compliant. The old <a href="qurl.html">QUrl</a> class has been renamed <a href="q3url.html" class="compat">Q3Url</a> and moved to the <a href="qt3support.html">Qt3Support</a> library.</p>
<p>The new <a href="qurl.html">QUrl</a> class provides an extensive list of compatibility functions to ease porting from <a href="q3url.html" class="compat">Q3Url</a> to <a href="qurl.html">QUrl</a>. A few functions require you to change your code:</p>
<ul>
<li>Q3Url::Q3Url(const <a href="q3url.html" class="compat">Q3Url</a> &, const <a href="qstring.html">QString</a> &, bool) can be simulated by combining the URLs manually (using QString::operator+(), for example).</li>
<li>Q3Url::setEncodedPathAndQuery(const <a href="qstring.html">QString</a> &) is replaced by <a href="qurl.html#setPath">QUrl::setPath</a>() and <a href="qurl.html#setEncodedQuery">QUrl::setEncodedQuery</a>().</li>
<li><a href="q3url.html#encodedPathAndQuery">Q3Url::encodedPathAndQuery</a>() is replaced by <a href="qurl.html#pathx">QUrl::path</a>() and <a href="qurl.html#encodedQuery">QUrl::encodedQuery</a>().</li>
<li><a href="q3url.html#isLocalFile">Q3Url::isLocalFile</a>() can be simulated by checking that <a href="qurl-qt3.html#protocol" class="compat">QUrl::protocol</a>() is "file".</li>
<li>Q3Url::toString(bool, bool) is replaced by QUrl::toString(int), where the <tt>int</tt> parameter specifies a combination of <a href="qurl.html#FormattingOption-enum">formatting options</a>.</li>
</ul>
<a name="qurloperator"></a>
<h2>QUrlOperator</h2>
<p>The <tt>QUrlOperator</tt> class is no longer part of the public Qt API. It has been renamed <a href="q3urloperator.html" class="compat">Q3UrlOperator</a> and moved to <a href="qt3support.html">Qt3Support</a>.</p>
<p>From Qt 4.4, the Network Access API provides a subset of the features provided by <tt>QUrlOperator</tt> that are mostly intended for use with applications that use the HTTP and FTP protocols. See the <a href="qnetworkrequest.html">QNetworkRequest</a>, <a href="qnetworkreply.html">QNetworkReply</a>, and <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a> documentation for further details.</p>
<a name="qvaluelist-section"></a><a name="qvaluelist-t"></a>
<h2>QValueList<T></h2>
<p>The QValueList<T> class has been replaced by <a href="qlist.html">QList</a><T> and <a href="qlinkedlist.html">QLinkedList</a><T> in Qt 4. As a help when porting older Qt applications, the <a href="qt3support.html">Qt3Support</a> library contains a QValueList<T> class implemented in terms of the new <a href="qlinkedlist.html">QLinkedList</a><T>. Similarly, it contains QValueListIterator<T> and QValueListConstIterator<T> classes implemented in terms of <a href="qlinkedlist.html">QLinkedList</a><T>::iterator and <a href="qlinkedlist.html">QLinkedList</a><T>::const_iterator.</p>
<p>When porting to Qt 4, you have the choice of using <a href="qlist.html">QList</a><T> or <a href="qlinkedlist.html">QLinkedList</a><T> as alternatives to QValueList<T>. <a href="qlist.html">QList</a><T> has an index-based API and provides very fast random access (QList::operator[]), whereas <a href="qlinkedlist.html">QLinkedList</a><T> has an iterator-based API.</p>
<p>Here's a list of problem functions:</p>
<ul>
<li>QValueList(const std::list<T> &) doesn't exist in <a href="qlist.html">QList</a> or <a href="qlinkedlist.html">QLinkedList</a>. You can simulate it by calling <a href="qlinkedlist.html#append">append()</a> in a loop.</li>
<li>QValueList::insert(iterator, size_type, const T& x) doesn't exist in <a href="qlist.html">QList</a> or <a href="qlinkedlist.html">QLinkedList</a>. Call <a href="qlinkedlist.html#insert">insert()</a> repeatedly instead.</li>
<li>QValueList::fromLast() doesn't exist in <a href="qlist.html">QList</a> or <a href="qlinkedlist.html">QLinkedList</a>. Use QValueList::end() instead.<p>For example, if you have code like</p>
<pre class="cpp"> for (QValueList<T>::iterator i = list.fromLast(); i != list.begin(); --i)
do_something(*i);</pre>
<p>you can rewrite it as</p>
<pre class="cpp"> <span class="type"><a href="qlinkedlist.html">QLinkedList</a></span><span class="operator"><</span>T<span class="operator">></span><span class="operator">::</span>iterator i <span class="operator">=</span> list<span class="operator">.</span>end();
<span class="keyword">while</span> (i <span class="operator">!</span><span class="operator">=</span> list<span class="operator">.</span>begin()) {
<span class="operator">-</span><span class="operator">-</span>i; <span class="comment">// decrement i before using it</span>
do_something(<span class="operator">*</span>i);
}</pre>
</li>
<li>QValueList::append() and QValueList::prepend() return an iterator to the inserted item. <a href="qlist.html">QList</a>'s and <a href="qlinkedlist.html">QLinkedList</a>'s corresponding functions don't, but it's not a problem because QValueList::prepend() always returns begin() and append() always returns QValueList::end() - 1.</li>
<li>QValueList::at(<i>i</i>) return an iterator to the item at index <i>i</i>. This corresponds to <a href="qlist.html#begin">QList::begin</a>() + <i>i</i>.</li>
<li>QValueList::contains(const T &) corresponds to QList::count(const T &) and QLinkedList::count(const T &).</li>
</ul>
<a name="qvaluevector-t"></a>
<h2>QValueVector<T></h2>
<p>The QValueVector<T> class has been replaced by <a href="qvector.html">QVector</a><T> in Qt 4. As a help when porting older Qt applications, the <a href="qt3support.html">Qt3Support</a> library contains a <a href="q3valuevector.html" class="compat">Q3ValueVector</a><T> class implemented in terms of the new <a href="qvector.html">QVector</a><T>.</p>
<p>When porting from QValueVector<T> to <a href="qvector.html">QVector</a><T>, you might run into the following incompatibilities:</p>
<ul>
<li>QValueVector(const std::vector<T> &) doesn't exist in <a href="qvector.html">QVector</a>. You can simulate it by calling <a href="qvector.html#append">QVector::append</a>()} in a loop.</li>
<li>QValueVector::resize(int, const T &) doesn't exist in <a href="qvector.html">QVector</a>. If you want the new items to be initialized with a particular value, use <a href="qvector.html#insert">QVector::insert</a>() instead.</li>
<li>QValueVector::at() on a non-const vector returns a non-const reference. This corresponds to QVector::operator[]().</li>
<li>Both QValueVector::at() functions have an <i>ok</i> parameter of type <tt>bool *</tt> that is set to true if the index is within bounds. This functionality doesn't exist in <a href="qvector.html">QVector</a>; instead, check the index against <a href="qvector.html#size">QVector::size</a>() yourself.</li>
</ul>
<p>See <a href="containers.html">Container Classes</a> for an overview of the Qt 4 container classes.</p>
<a name="qvariant"></a>
<h2>QVariant</h2>
<p>Some changes to the rest of the Qt library have implications on <a href="qvariant.html">QVariant</a>:</p>
<ol class="1">
<li>The <tt>QVariant::ColorGroup</tt> enum value is defined only if <tt>QT3_SUPPORT</tt> is defined.</li>
<li>The <tt>QVariant::IconSet</tt> enum value has been renamed <a href="qvariant.html#Type-enum">QVariant::Icon</a>.</li>
<li>The <tt>QVariant::CString</tt> enum value is now a synonym for <a href="qvariant.html#Type-enum">QVariant::ByteArray</a>.</li>
</ol>
<p>Also, the <a href="qvariant.html">QVariant</a>(bool, int) constructor has been replaced by <a href="qvariant.html">QVariant</a>(bool). Old code like <a href="qvariant.html">QVariant</a>(true, 0) should be replaced with <a href="qvariant.html">QVariant</a>(true); otherwise, the <a href="qvariant.html">QVariant</a>(int, void *) overload might accidentally be triggered.</p>
<p>Many of <a href="qvariant.html">QVariant</a>'s convenience functions in Qt 3, such as toColor() and toKeySequence(), have been removed to enable <a href="qvariant.html">QVariant</a> to be part of the <a href="qtcore.html">QtCore</a> module. <a href="qvariant.html">QVariant</a> is still able to hold values of these types.</p>
<p>Types which are not supported by any of the <a href="qvariant.html">QVariant</a> constructors can be stored as variants with the <a href="qvariant.html#fromValue">QVariant::fromValue</a>() function. Types with no suitable convenience function for unpacking can be retrieved with the <a href="qvariant.html#value">QVariant::value</a>() function or passed directly to classes that implement the QVariant() operator.</p>
<table class="generic">
<thead><tr class="qt-style"><th >Qt 3 function</th><th >Qt 4 function</th></tr></thead>
<tr valign="top" class="odd"><td >toBitmap ()</td><td ><a href="qvariant.html#value">QVariant::value</a>()</td></tr>
<tr valign="top" class="even"><td >toBrush ()</td><td ><a href="qvariant.html#value">QVariant::value</a>()</td></tr>
<tr valign="top" class="odd"><td >toColorGroup ()</td><td >Use <a href="qvariant.html#value">QVariant::value</a>() with <a href="qpalette.html">QPalette</a> instead.</td></tr>
<tr valign="top" class="even"><td >toColor ()</td><td ><a href="qvariant.html#value">QVariant::value</a>()</td></tr>
<tr valign="top" class="odd"><td >toCString ()</td><td ><a href="qvariant.html#toByteArray">QVariant::toByteArray</a>()</td></tr>
<tr valign="top" class="even"><td >toCursor ()</td><td ><a href="qvariant.html#value">QVariant::value</a>()</td></tr>
<tr valign="top" class="odd"><td >toFont ()</td><td ><a href="qvariant.html#value">QVariant::value</a>()</td></tr>
<tr valign="top" class="even"><td >toIconSet ()</td><td >Use <a href="qvariant.html#value">QVariant::value</a>() with <a href="qicon.html">QIcon</a> instead.</td></tr>
<tr valign="top" class="odd"><td >toImage ()</td><td ><a href="qvariant.html#value">QVariant::value</a>()</td></tr>
<tr valign="top" class="even"><td >toKeySequence ()</td><td ><a href="qvariant.html#value">QVariant::value</a>()</td></tr>
<tr valign="top" class="odd"><td >toPalette ()</td><td ><a href="qvariant.html#value">QVariant::value</a>()</td></tr>
<tr valign="top" class="even"><td >toPen ()</td><td ><a href="qvariant.html#value">QVariant::value</a>()</td></tr>
<tr valign="top" class="odd"><td >toPixmap ()</td><td ><a href="qvariant.html#value">QVariant::value</a>()</td></tr>
<tr valign="top" class="even"><td >toPointArray ()</td><td ><a href="qvariant.html#value">QVariant::value</a>()</td></tr>
<tr valign="top" class="odd"><td >toRegion ()</td><td ><a href="qvariant.html#value">QVariant::value</a>()</td></tr>
<tr valign="top" class="even"><td >toSizePolicy ()</td><td ><a href="qvariant.html#value">QVariant::value</a>()</td></tr>
</table>
<p>See the <a href="qvariant.html#Type-enum">QVariant::Type</a> enum for a list of types supported by <a href="qvariant.html">QVariant</a>.</p>
<a name="qvbox"></a>
<h2>QVBox</h2>
<p>The <tt>QVBox</tt> class is now only available as <a href="q3vbox.html" class="compat">Q3VBox</a> in Qt 4. You can achieve the same result as <tt>QVBox</tt> by creating a <a href="qwidget.html">QWidget</a> with a vertical layout:</p>
<p>For example, if you have code like</p>
<pre class="cpp"> QVBox *vbox = new QVBox;
QPushButton *child1 = new QPushButton(vbox);
QPushButton *child2 = new QPushButton(vbox);</pre>
<p>you can rewrite it as</p>
<pre class="cpp"> <span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>vbox <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qwidget.html">QWidget</a></span>;
<span class="type"><a href="qpushbutton.html">QPushButton</a></span> <span class="operator">*</span>child1 <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qpushbutton.html">QPushButton</a></span>;
<span class="type"><a href="qpushbutton.html">QPushButton</a></span> <span class="operator">*</span>child2 <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qpushbutton.html">QPushButton</a></span>;
<span class="type"><a href="qvboxlayout.html">QVBoxLayout</a></span> <span class="operator">*</span>layout <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qvboxlayout.html">QVBoxLayout</a></span>;
layout<span class="operator">-</span><span class="operator">></span>addWidget(child1);
layout<span class="operator">-</span><span class="operator">></span>addWidget(child2);
vbox<span class="operator">-</span><span class="operator">></span>setLayout(layout);</pre>
<p>Note that child widgets are not automatically placed into the widget's layout; you will need to manually add each widget to the <a href="qvboxlayout.html">QVBoxLayout</a>.</p>
<a name="qvgroupbox"></a>
<h2>QVGroupBox</h2>
<p>The <tt>QVGroupBox</tt> class has been renamed <a href="q3vgroupbox.html" class="compat">Q3VGroupBox</a> and moved to the <a href="qt3support.html">Qt3Support</a> library. Qt 4 does not provide a specific replacement class for <tt>QVGroupBox</tt> since <a href="qgroupbox.html">QGroupBox</a> is designed to be a generic container widget. As a result, you need to supply your own layout for any child widgets.</p>
<p>See <a href="#qgroupbox">#QGroupBox</a> for more information about porting code that uses group boxes.</p>
<a name="qwhatsthis"></a>
<h2>QWhatsThis</h2>
<p>The <a href="qwhatsthis.html">QWhatsThis</a> class has been redesigned in Qt 4. The old <tt>QWhatsThis</tt> class is available as <a href="q3whatsthis.html" class="compat">Q3WhatsThis</a> in <a href="qt3support.html">Qt3Support</a>.</p>
<a name="qwidget"></a>
<h2>QWidget</h2>
<p>Widget background painting has been greatly improved, supporting flicker-free updates and making it possible to have semi-transparent widgets. This renders the following background handling functions obsolete:</p>
<ul>
<li>QWidget::repaint(bool noErase) - the <tt>noErase</tt> boolean parameter is gone</li>
<li>QWidget::setBackgroundMode(BackgroundMode m)</li>
<li>QWidget::backgroundBrush() const</li>
<li>QWidget::setBackgroundPixmap(const <a href="qpixmap.html">QPixmap</a> &pm)</li>
<li>QWidget::backgroundPixmap() const</li>
<li>QWidget::setBackgroundColor(const <a href="qcolor.html">QColor</a> &c)</li>
<li>QWidget::backgroundColor() const</li>
<li>QWidget::foregroundColor() const</li>
<li>QWidget::eraseColor() const</li>
<li>QWidget::setEraseColor(const <a href="qcolor.html">QColor</a> &c)</li>
<li>QWidget::erasePixmap() const</li>
<li>QWidget::setErasePixmap(const <a href="qpixmap.html">QPixmap</a> &p)</li>
<li>QWidget::paletteForegroundColor()</li>
<li>QWidget::setPaletteForegroundColor(const <a href="qcolor.html">QColor</a> &c)</li>
<li>QWidget::paletteBackgroundColor()</li>
<li>QWidget::setPaletteBackgroundColor(const <a href="qcolor.html">QColor</a> &c)</li>
<li>QWidget::paletteBackgroundPixmap() const</li>
<li>QWidget::setPaletteBackgroundPixmap(const <a href="qpixmap.html">QPixmap</a> &p)</li>
<li><a href="qwidget-qt3.html#erase" class="compat">QWidget::erase</a>()</li>
<li>QWidget::erase(const <a href="qrect.html">QRect</a> &r)</li>
<li>QWidget::setBackgroundOrigin( BackgroundOrigin )</li>
<li><a href="qwidget-qt3.html#BackgroundOrigin-enum" class="compat">QWidget::BackgroundOrigin</a> backgroundOrigin() const</li>
<li><a href="qwidget-qt3.html#backgroundOffset" class="compat">QWidget::backgroundOffset</a>()</li>
</ul>
<p>Sample code on how to do obtain similar behavior from Qt 4, previously handled by some of the above functions can be found in the <a href="http://doc.qt.nokia.com/qwidget-qt3.html">Qt 3 Support Members for QWidget</a> page.</p>
<p>A widget now receives change events in its <a href="qwidget.html#changeEvent">QWidget::changeEvent</a>() handler. This makes the following virtual change handlers obsolete:</p>
<ul>
<li>QWidget::styleChange - use <a href="qevent.html#Type-enum">QEvent::StyleChange</a></li>
<li>QWidget::enabledChange - use <a href="qevent.html#Type-enum">QEvent::EnabledChange</a></li>
<li>QWidget::paletteChange - use <a href="qevent.html#Type-enum">QEvent::PaletteChange</a></li>
<li>QWidget::fontChange - use <a href="qevent.html#Type-enum">QEvent::FontChange</a></li>
<li>QWidget::windowActivationChange - use <a href="qevent.html#Type-enum">QEvent::ActivationChange</a></li>
<li>QWidget::languageChange - use <a href="qevent.html#Type-enum">QEvent::LanguageChange</a></li>
</ul>
<p>The following functions were slots, but are no more:</p>
<ul>
<li><a href="qwidget.html#clearFocus">QWidget::clearFocus</a>()</li>
<li><a href="qwidget.html#mouseTracking-prop">QWidget::setMouseTracking</a>()</li>
<li>QWidget::stackUnder(<a href="qwidget.html">QWidget</a>*)</li>
<li>QWidget::move(int x, int y)</li>
<li>QWidget::move(const <a href="qpoint.html">QPoint</a> &)</li>
<li>QWidget::resize(int w, int h)</li>
<li>QWidget::resize(const <a href="qsize.html">QSize</a> &)</li>
<li>QWidget::setGeometry(int x, int y, int w, int h)</li>
<li>QWidget::setGeometry(const <a href="qrect.html">QRect</a> &)</li>
<li><a href="qwidget.html#adjustSize">QWidget::adjustSize</a>()</li>
<li>QWidget::update(int x, int y, int w, int h)</li>
<li>QWidget::update(const <a href="qrect.html">QRect</a>&)</li>
<li>QWidget::repaint(bool erase)</li>
<li>QWidget::repaint(int x, int y, int w, int h, bool erase)</li>
<li>QWidget::repaint(const <a href="qrect.html">QRect</a> &, bool erase)</li>
<li>QWidget::repaint(const <a href="qregion.html">QRegion</a> &, bool erase)</li>
<li>QWidget::setCaption(const <a href="qstring.html">QString</a> &)</li>
<li>QWidget::setIcon(const <a href="qpixmap.html">QPixmap</a> &)</li>
<li>QWidget::setIconText(const <a href="qstring.html">QString</a> &)</li>
</ul>
<p>The following functions were incorrectly marked as virtual:</p>
<ul>
<li>QWidget::close(bool alsoDelete)</li>
<li>QWidget::create(WId, bool, bool)</li>
<li>QWidget::destroy(bool)</li>
<li>QWidget::move(int x, int y)</li>
<li>QWidget::reparent(<a href="qwidget.html">QWidget</a> *parent, WFlags, const <a href="qpoint.html">QPoint</a> &, bool)</li>
<li>QWidget::resize(int w, int h)</li>
<li>QWidget::setAcceptDrops(bool on)</li>
<li><a href="qwidget-qt3.html#setActiveWindow" class="compat">QWidget::setActiveWindow</a>()</li>
<li>QWidget::setAutoMask(bool)</li>
<li>QWidget::setBackgroundColor(const <a href="qcolor.html">QColor</a> &)</li>
<li>QWidget::setBackgroundMode(BackgroundMode)</li>
<li>QWidget::setBackgroundOrigin(BackgroundOrigin)</li>
<li>QWidget::setBackgroundPixmap(const <a href="qpixmap.html">QPixmap</a> &)</li>
<li>QWidget::setCaption(const <a href="qstring.html">QString</a> &)</li>
<li>QWidget::setCursor(const <a href="qcursor.html">QCursor</a> &)</li>
<li>QWidget::setEnabled(bool)</li>
<li>QWidget::setEraseColor(const <a href="qcolor.html">QColor</a> &)</li>
<li>QWidget::setErasePixmap(const <a href="qpixmap.html">QPixmap</a> &)</li>
<li><a href="qwidget.html#setFocus">QWidget::setFocus</a>()</li>
<li>QWidget::setFocusPolicy(FocusPolicy)</li>
<li>QWidget::setFocusProxy(<a href="qwidget.html">QWidget</a> *)</li>
<li>QWidget::setFont(const <a href="qfont.html">QFont</a> &)</li>
<li>QWidget::setGeometry(const <a href="qrect.html">QRect</a> &)</li>
<li>QWidget::setGeometry(int x, int y, int w, int h)</li>
<li>QWidget::setIcon(const <a href="qpixmap.html">QPixmap</a> &)</li>
<li>QWidget::setIconText(const <a href="qstring.html">QString</a> &)</li>
<li>QWidget::setKeyCompression(bool)</li>
<li>QWidget::setMask(const <a href="qbitmap.html">QBitmap</a> &)</li>
<li>QWidget::setMask(const <a href="qregion.html">QRegion</a> &)</li>
<li>QWidget::setMaximumSize(int maxw, int maxh)</li>
<li>QWidget::setMicroFocusHint(int x, int y, int w, int h, bool, <a href="qfont.html">QFont</a> *f)</li>
<li>QWidget::setMinimumSize(int minw, int minh)</li>
<li>QWidget::setMouseTracking(bool enable)</li>
<li>QWidget::setPalette(const <a href="qpalette.html">QPalette</a> &)</li>
<li>QWidget::setPaletteBackgroundColor(const <a href="qcolor.html">QColor</a> &)</li>
<li>QWidget::setPaletteBackgroundPixmap(const <a href="qpixmap.html">QPixmap</a> &)</li>
<li>QWidget::setSizeIncrement(int w, int h)</li>
<li>QWidget::setSizePolicy(<a href="qsizepolicy.html">QSizePolicy</a>)</li>
<li>QWidget::setUpdatesEnabled(bool enable)</li>
<li>QWidget::setWState(uint)</li>
<li><a href="qwidget.html#show">QWidget::show</a>()</li>
<li><a href="qwidget.html#showFullScreen">QWidget::showFullScreen</a>()</li>
<li><a href="qwidget.html#showMaximized">QWidget::showMaximized</a>()</li>
<li><a href="qwidget.html#showMinimized">QWidget::showMinimized</a>()</li>
<li><a href="qwidget.html#showNormal">QWidget::showNormal</a>()</li>
<li><a href="qwidget.html#sizePolicy-prop">QWidget::sizePolicy</a>()</li>
<li><a href="qwidget.html#cursor-prop">QWidget::unsetCursor</a>()</li>
</ul>
<p>The internal clearWState() function was removed. Use <a href="qwidget.html#setAttribute">QWidget::setAttribute</a>() instead.</p>
<p>setWFlags() was renamed <a href="qwidget.html#windowFlags-prop">QWidget::setWindowFlags</a>().</p>
<p>clearWFlags() has no direct replacement. You can use <a href="qwidget.html#setAttribute">QWidget::setAttribute</a>() instead. For example, <tt>setAttribute(..., false)</tt> to clear an attribute. More information is available <a href="http://doc.qt.nokia.com/qwidget.html#setAttribute">here</a>.</p>
<p>testWFlags() was renamed to <a href="qwidget.html#testAttribute">testAttribute()</a>.</p>
<p>See <a href="#properties">Properties</a> for a list of <a href="qwidget.html">QWidget</a> properties in Qt 3 that have changed in Qt 4.</p>
<a name="qwidgetfactory"></a>
<h2>QWidgetFactory</h2>
<p>The <tt>QWidgetFactory</tt> class has been replaced by <a href="qformbuilder.html">QFormBuilder</a> in Qt 4.</p>
<a name="qwidgetintdict"></a>
<h2>QWidgetIntDict</h2>
<p>The <a href="#qwidgetintdict">QWidgetIntDict</a> class was a synonym for QIntDict<<a href="qwidget.html">QWidget</a>>. It is no longer available in Qt 4. If you link against <a href="qt3support.html">Qt3Support</a>, you can use <a href="q3intdict.html" class="compat">Q3IntDict</a><<a href="qwidget.html">QWidget</a>> instead; otherwise, see the <a href="#qdict-section">section on QDict<T></a>.</p>
<a name="qwidgetlist-section"></a><a name="qwidgetlist"></a>
<h2>QWidgetList</h2>
<p>In Qt 3, the <a href="qwidget.html#QWidgetList-typedef">QWidgetList</a> class was a typedef for QPtrList<<a href="qwidget.html">QWidget</a>>. In Qt 4, it is a typedef for <a href="qlist.html">QList</a><<a href="qwidget.html">QWidget</a> *>. See the <a href="#qptrlist-section">section on QPtrList<T></a>.</p>
<a name="qwidgetplugin"></a>
<h2>QWidgetPlugin</h2>
<p>The <a href="#qwidgetplugin">QWidgetPlugin</a> class is no longer available in Qt 4. To create custom widget plugins, subclass <a href="qdesignercustomwidgetinterface.html">QDesignerCustomWidgetInterface</a> to provide information about the custom widget, and build a plugin in the way described in the <a href="designer-customwidgetplugin.html">Custom Widget Plugin</a> example.</p>
<a name="qwidgetstack"></a>
<h2>QWidgetStack</h2>
<p>The <a href="#qwidgetstack">QWidgetStack</a> class is no longer part of the Qt public API. It has been renamed <a href="q3widgetstack.html" class="compat">Q3WidgetStack</a> and moved to <a href="qt3support.html">Qt3Support</a>. In Qt 4 applications, you can use <a href="qstackedwidget.html">QStackedWidget</a> instead to obtain the same results.</p>
<a name="qwizard"></a>
<h2>QWizard</h2>
<p>The <tt>QWizard</tt> class was reintroduced in Qt 4.3. See the <a href="dialogs-trivialwizard.html">Trivial Wizard Example</a>, <a href="dialogs-licensewizard.html">License Wizard Example</a> and <a href="dialogs-classwizard.html">Class Wizard Example</a> for more details.</p>
<a name="qworkspace"></a>
<h2>QWorkspace</h2>
<p>The <tt>QWorkspace</tt> in Qt 4 class requires explicit adding of MDI windows with <a href="qworkspace.html#addWindow">QWorkspace::addWindow</a>().</p>
</div>
<!-- @@@porting4.html -->
<p class="naviNextPrevious footerNavi">
<a class="prevPage" href="porting.html">Porting Guides</a>
<a class="nextPage" href="porting4-virtual-functions.html">Porting to Qt 4 - Virtual Functions</a>
</p>
<div class="ft">
<span></span>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2012 Nokia Corporation and/or its
subsidiaries. Documentation contributions included herein are the copyrights of
their respective owners.</p>
<br />
<p>
The documentation provided herein is licensed under the terms of the
<a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
License version 1.3</a> as published by the Free Software Foundation.</p>
<p>
Documentation sources may be obtained from <a href="http://www.qt-project.org">
www.qt-project.org</a>.</p>
<br />
<p>
Nokia, Qt and their respective logos are trademarks of Nokia Corporation
in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. <a title="Privacy Policy"
href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>
|