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
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QWebPage Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QWebPage Class Reference<br /><sup><sup>[<a href="qtwebkit.html">QtWebKit</a> module]</sup></sup></h1><p>The QWebPage class provides an object to view and edit web
documents. <a href="#details">More...</a></p>
<p>Inherits <a href="qobject.html">QObject</a>.</p><h3>Types</h3><ul><li><div class="fn" />class <b><a href="qwebpage-choosemultiplefilesextensionoption.html">ChooseMultipleFilesExtensionOption</a></b></li><li><div class="fn" />class <b><a href="qwebpage-choosemultiplefilesextensionreturn.html">ChooseMultipleFilesExtensionReturn</a></b></li><li><div class="fn" />enum <b><a href="qwebpage.html#ErrorDomain-enum">ErrorDomain</a></b> { QtNetwork, Http, WebKit }</li><li><div class="fn" />class <b><a href="qwebpage-errorpageextensionoption.html">ErrorPageExtensionOption</a></b></li><li><div class="fn" />class <b><a href="qwebpage-errorpageextensionreturn.html">ErrorPageExtensionReturn</a></b></li><li><div class="fn" />enum <b><a href="qwebpage.html#Extension-enum">Extension</a></b> { ChooseMultipleFilesExtension, ErrorPageExtension }</li><li><div class="fn" />class <b><a href="qwebpage-extensionoption.html">ExtensionOption</a></b></li><li><div class="fn" />class <b><a href="qwebpage-extensionreturn.html">ExtensionReturn</a></b></li><li><div class="fn" />enum <b><a href="qwebpage.html#Feature-enum">Feature</a></b> { Notifications, Geolocation }</li><li><div class="fn" />enum <b><a href="qwebpage.html#FindFlag-enum">FindFlag</a></b> { FindBackward, FindCaseSensitively, FindWrapsAroundDocument, HighlightAllOccurrences }</li><li><div class="fn" />class <b><a href="qwebpage-findflags.html">FindFlags</a></b></li><li><div class="fn" />enum <b><a href="qwebpage.html#LinkDelegationPolicy-enum">LinkDelegationPolicy</a></b> { DontDelegateLinks, DelegateExternalLinks, DelegateAllLinks }</li><li><div class="fn" />enum <b><a href="qwebpage.html#NavigationType-enum">NavigationType</a></b> { NavigationTypeLinkClicked, NavigationTypeFormSubmitted, NavigationTypeBackOrForward, NavigationTypeReload, NavigationTypeFormResubmitted, NavigationTypeOther }</li><li><div class="fn" />enum <b><a href="qwebpage.html#PermissionPolicy-enum">PermissionPolicy</a></b> { PermissionUnknown, PermissionGrantedByUser, PermissionDeniedByUser }</li><li><div class="fn" />class <b><a href="qwebpage-viewportattributes.html">ViewportAttributes</a></b></li><li><div class="fn" />enum <b><a href="qwebpage.html#WebAction-enum">WebAction</a></b> { NoWebAction, OpenLink, OpenLinkInNewWindow, OpenFrameInNewWindow, ..., CopyImageUrlToClipboard }</li><li><div class="fn" />enum <b><a href="qwebpage.html#WebWindowType-enum">WebWindowType</a></b> { WebBrowserWindow, WebModalDialog }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qwebpage.html#QWebPage">__init__</a></b> (<i>self</i>, QObject <i>parent</i> = None)</li><li><div class="fn" />bool <b><a href="qwebpage.html#acceptNavigationRequest">acceptNavigationRequest</a></b> (<i>self</i>, QWebFrame <i>frame</i>, QNetworkRequest <i>request</i>, NavigationType <i>type</i>)</li><li><div class="fn" />QAction <b><a href="qwebpage.html#action">action</a></b> (<i>self</i>, WebAction <i>action</i>)</li><li><div class="fn" />int <b><a href="qwebpage.html#bytesReceived">bytesReceived</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qwebpage.html#chooseFile">chooseFile</a></b> (<i>self</i>, QWebFrame <i>originatingFrame</i>, QString <i>oldFile</i>)</li><li><div class="fn" />QObject <b><a href="qwebpage.html#createPlugin">createPlugin</a></b> (<i>self</i>, QString <i>classid</i>, QUrl <i>url</i>, QStringList <i>paramNames</i>, QStringList <i>paramValues</i>)</li><li><div class="fn" />QMenu <b><a href="qwebpage.html#createStandardContextMenu">createStandardContextMenu</a></b> (<i>self</i>)</li><li><div class="fn" />QWebPage <b><a href="qwebpage.html#createWindow">createWindow</a></b> (<i>self</i>, WebWindowType <i>type</i>)</li><li><div class="fn" />QWebFrame <b><a href="qwebpage.html#currentFrame">currentFrame</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qwebpage.html#event">event</a></b> (<i>self</i>, QEvent)</li><li><div class="fn" />bool <b><a href="qwebpage.html#extension">extension</a></b> (<i>self</i>, Extension <i>extension</i>, ExtensionOption <i>option</i> = None, ExtensionReturn <i>output</i> = None)</li><li><div class="fn" />bool <b><a href="qwebpage.html#findText">findText</a></b> (<i>self</i>, QString <i>subString</i>, FindFlags <i>options</i> = 0)</li><li><div class="fn" />bool <b><a href="qwebpage.html#focusNextPrevChild">focusNextPrevChild</a></b> (<i>self</i>, bool <i>next</i>)</li><li><div class="fn" />bool <b><a href="qwebpage.html#forwardUnsupportedContent">forwardUnsupportedContent</a></b> (<i>self</i>)</li><li><div class="fn" />QWebFrame <b><a href="qwebpage.html#frameAt">frameAt</a></b> (<i>self</i>, QPoint <i>pos</i>)</li><li><div class="fn" />bool <b><a href="qwebpage.html#hasSelection">hasSelection</a></b> (<i>self</i>)</li><li><div class="fn" />QWebHistory <b><a href="qwebpage.html#history">history</a></b> (<i>self</i>)</li><li><div class="fn" />QVariant <b><a href="qwebpage.html#inputMethodQuery">inputMethodQuery</a></b> (<i>self</i>, Qt.InputMethodQuery <i>property</i>)</li><li><div class="fn" />bool <b><a href="qwebpage.html#isContentEditable">isContentEditable</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qwebpage.html#isModified">isModified</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qwebpage.html#javaScriptAlert">javaScriptAlert</a></b> (<i>self</i>, QWebFrame <i>originatingFrame</i>, QString <i>msg</i>)</li><li><div class="fn" />bool <b><a href="qwebpage.html#javaScriptConfirm">javaScriptConfirm</a></b> (<i>self</i>, QWebFrame <i>originatingFrame</i>, QString <i>msg</i>)</li><li><div class="fn" /><b><a href="qwebpage.html#javaScriptConsoleMessage">javaScriptConsoleMessage</a></b> (<i>self</i>, QString <i>message</i>, int <i>lineNumber</i>, QString <i>sourceID</i>)</li><li><div class="fn" />(bool, QString <i>result</i>) <b><a href="qwebpage.html#javaScriptPrompt">javaScriptPrompt</a></b> (<i>self</i>, QWebFrame <i>originatingFrame</i>, QString <i>msg</i>, QString <i>defaultValue</i>)</li><li><div class="fn" />bool <b><a href="qwebpage.html#javaScriptPrompt-2">javaScriptPrompt</a></b> (<i>self</i>, QWebFrame <i>originatingFrame</i>, QString <i>msg</i>, QString <i>defaultValue</i>, QString <i>result</i>)</li><li><div class="fn" />LinkDelegationPolicy <b><a href="qwebpage.html#linkDelegationPolicy">linkDelegationPolicy</a></b> (<i>self</i>)</li><li><div class="fn" />QWebFrame <b><a href="qwebpage.html#mainFrame">mainFrame</a></b> (<i>self</i>)</li><li><div class="fn" />QNetworkAccessManager <b><a href="qwebpage.html#networkAccessManager">networkAccessManager</a></b> (<i>self</i>)</li><li><div class="fn" />QPalette <b><a href="qwebpage.html#palette">palette</a></b> (<i>self</i>)</li><li><div class="fn" />QWebPluginFactory <b><a href="qwebpage.html#pluginFactory">pluginFactory</a></b> (<i>self</i>)</li><li><div class="fn" />QSize <b><a href="qwebpage.html#preferredContentsSize">preferredContentsSize</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qwebpage.html#selectedHtml">selectedHtml</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qwebpage.html#selectedText">selectedText</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qwebpage.html#setActualVisibleContentRect">setActualVisibleContentRect</a></b> (<i>self</i>, QRect <i>rect</i>)</li><li><div class="fn" /><b><a href="qwebpage.html#setContentEditable">setContentEditable</a></b> (<i>self</i>, bool <i>editable</i>)</li><li><div class="fn" /><b><a href="qwebpage.html#setFeaturePermission">setFeaturePermission</a></b> (<i>self</i>, QWebFrame <i>frame</i>, Feature <i>feature</i>, PermissionPolicy <i>policy</i>)</li><li><div class="fn" /><b><a href="qwebpage.html#setForwardUnsupportedContent">setForwardUnsupportedContent</a></b> (<i>self</i>, bool <i>forward</i>)</li><li><div class="fn" /><b><a href="qwebpage.html#setLinkDelegationPolicy">setLinkDelegationPolicy</a></b> (<i>self</i>, LinkDelegationPolicy <i>policy</i>)</li><li><div class="fn" /><b><a href="qwebpage.html#setNetworkAccessManager">setNetworkAccessManager</a></b> (<i>self</i>, QNetworkAccessManager <i>manager</i>)</li><li><div class="fn" /><b><a href="qwebpage.html#setPalette">setPalette</a></b> (<i>self</i>, QPalette <i>palette</i>)</li><li><div class="fn" /><b><a href="qwebpage.html#setPluginFactory">setPluginFactory</a></b> (<i>self</i>, QWebPluginFactory <i>factory</i>)</li><li><div class="fn" /><b><a href="qwebpage.html#setPreferredContentsSize">setPreferredContentsSize</a></b> (<i>self</i>, QSize <i>size</i>)</li><li><div class="fn" />QWebSettings <b><a href="qwebpage.html#settings">settings</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qwebpage.html#setView">setView</a></b> (<i>self</i>, QWidget <i>view</i>)</li><li><div class="fn" /><b><a href="qwebpage.html#setViewportSize">setViewportSize</a></b> (<i>self</i>, QSize <i>size</i>)</li><li><div class="fn" />bool <b><a href="qwebpage.html#shouldInterruptJavaScript">shouldInterruptJavaScript</a></b> (<i>self</i>)</li><li><div class="fn" />QStringList <b><a href="qwebpage.html#supportedContentTypes">supportedContentTypes</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qwebpage.html#supportsContentType">supportsContentType</a></b> (<i>self</i>, QString <i>mimeType</i>)</li><li><div class="fn" />bool <b><a href="qwebpage.html#supportsExtension">supportsExtension</a></b> (<i>self</i>, Extension <i>extension</i>)</li><li><div class="fn" />bool <b><a href="qwebpage.html#swallowContextMenuEvent">swallowContextMenuEvent</a></b> (<i>self</i>, QContextMenuEvent <i>event</i>)</li><li><div class="fn" />int <b><a href="qwebpage.html#totalBytes">totalBytes</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qwebpage.html#triggerAction">triggerAction</a></b> (<i>self</i>, WebAction <i>action</i>, bool <i>checked</i> = False)</li><li><div class="fn" />QUndoStack <b><a href="qwebpage.html#undoStack">undoStack</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qwebpage.html#updatePositionDependentActions">updatePositionDependentActions</a></b> (<i>self</i>, QPoint <i>pos</i>)</li><li><div class="fn" />QString <b><a href="qwebpage.html#userAgentForUrl">userAgentForUrl</a></b> (<i>self</i>, QUrl <i>url</i>)</li><li><div class="fn" />QWidget <b><a href="qwebpage.html#view">view</a></b> (<i>self</i>)</li><li><div class="fn" />ViewportAttributes <b><a href="qwebpage.html#viewportAttributesForSize">viewportAttributesForSize</a></b> (<i>self</i>, QSize <i>availableSize</i>)</li><li><div class="fn" />QSize <b><a href="qwebpage.html#viewportSize">viewportSize</a></b> (<i>self</i>)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qwebpage.html#applicationCacheQuotaExceeded">applicationCacheQuotaExceeded</a></b> ( ::QWebSecurityOrigin*, ::quint64)</li><li><div class="fn" />void <b><a href="qwebpage.html#contentsChanged">contentsChanged</a></b> ()</li><li><div class="fn" />void <b><a href="qwebpage.html#databaseQuotaExceeded">databaseQuotaExceeded</a></b> ( ::QWebFrame*,QString)</li><li><div class="fn" />void <b><a href="qwebpage.html#downloadRequested">downloadRequested</a></b> (const ::QNetworkRequest&)</li><li><div class="fn" />void <b><a href="qwebpage.html#featurePermissionRequestCanceled">featurePermissionRequestCanceled</a></b> ( ::QWebFrame*, ::QWebPage::Feature)</li><li><div class="fn" />void <b><a href="qwebpage.html#featurePermissionRequested">featurePermissionRequested</a></b> ( ::QWebFrame*, ::QWebPage::Feature)</li><li><div class="fn" />void <b><a href="qwebpage.html#frameCreated">frameCreated</a></b> ( ::QWebFrame*)</li><li><div class="fn" />void <b><a href="qwebpage.html#geometryChangeRequested">geometryChangeRequested</a></b> (const ::QRect&)</li><li><div class="fn" />void <b><a href="qwebpage.html#linkClicked">linkClicked</a></b> (const ::QUrl&)</li><li><div class="fn" />void <b><a href="qwebpage.html#linkHovered">linkHovered</a></b> (const QString&,const QString&,const QString&)</li><li><div class="fn" />void <b><a href="qwebpage.html#loadFinished">loadFinished</a></b> (bool)</li><li><div class="fn" />void <b><a href="qwebpage.html#loadProgress">loadProgress</a></b> (int)</li><li><div class="fn" />void <b><a href="qwebpage.html#loadStarted">loadStarted</a></b> ()</li><li><div class="fn" />void <b><a href="qwebpage.html#menuBarVisibilityChangeRequested">menuBarVisibilityChangeRequested</a></b> (bool)</li><li><div class="fn" />void <b><a href="qwebpage.html#microFocusChanged">microFocusChanged</a></b> ()</li><li><div class="fn" />void <b><a href="qwebpage.html#printRequested">printRequested</a></b> ( ::QWebFrame*)</li><li><div class="fn" />void <b><a href="qwebpage.html#repaintRequested">repaintRequested</a></b> (const ::QRect&)</li><li><div class="fn" />void <b><a href="qwebpage.html#restoreFrameStateRequested">restoreFrameStateRequested</a></b> ( ::QWebFrame*)</li><li><div class="fn" />void <b><a href="qwebpage.html#saveFrameStateRequested">saveFrameStateRequested</a></b> ( ::QWebFrame*, ::QWebHistoryItem*)</li><li><div class="fn" />void <b><a href="qwebpage.html#scrollRequested">scrollRequested</a></b> (int,int,const ::QRect&)</li><li><div class="fn" />void <b><a href="qwebpage.html#selectionChanged">selectionChanged</a></b> ()</li><li><div class="fn" />void <b><a href="qwebpage.html#statusBarMessage">statusBarMessage</a></b> (const QString&)</li><li><div class="fn" />void <b><a href="qwebpage.html#statusBarVisibilityChangeRequested">statusBarVisibilityChangeRequested</a></b> (bool)</li><li><div class="fn" />void <b><a href="qwebpage.html#toolBarVisibilityChangeRequested">toolBarVisibilityChangeRequested</a></b> (bool)</li><li><div class="fn" />void <b><a href="qwebpage.html#unsupportedContent">unsupportedContent</a></b> ( ::QNetworkReply*)</li><li><div class="fn" />void <b><a href="qwebpage.html#viewportChangeRequested">viewportChangeRequested</a></b> ()</li><li><div class="fn" />void <b><a href="qwebpage.html#windowCloseRequested">windowCloseRequested</a></b> ()</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QWebPage class provides an object to view and edit web
documents.</p>
<p>QWebPage holds a main frame responsible for web content,
settings, the history of navigated links and actions. This class
can be used, together with <a href="qwebframe.html">QWebFrame</a>,
to provide functionality like <a href="qwebview.html">QWebView</a>
in a widget-less environment.</p>
<p>QWebPage's API is very similar to <a href="qwebview.html">QWebView</a>, as you are still provided with common
functions like <a href="qwebpage.html#action">action</a>() (known
as <a href="qwebview.html#pageAction">pageAction</a>() in <a href="qwebview.html">QWebView</a>), <a href="qwebpage.html#triggerAction">triggerAction</a>(), <a href="qwebpage.html#findText">findText</a>() and <a href="qwebpage.html#settings">settings</a>(). More <a href="qwebview.html">QWebView</a>-like functions can be found in the
main frame of QWebPage, obtained via the <a href="qwebpage.html#mainFrame">mainFrame</a>() function. For example,
the <a href="qwebframe.html#load">load</a>(), <a href="qwebframe.html#url-prop">setUrl</a>() and <a href="qwebframe.html#setHtml">setHtml</a>() functions for QWebPage can
be accessed using <a href="qwebframe.html">QWebFrame</a>.</p>
<p>The <a href="qwebpage.html#loadStarted">loadStarted</a>() signal
is emitted when the page begins to load.The <a href="qwebpage.html#loadProgress">loadProgress</a>() signal, on the
other hand, is emitted whenever an element of the web page
completes loading, such as an embedded image, a script, etc.
Finally, the <a href="qwebpage.html#loadFinished">loadFinished</a>() signal is emitted
when the page contents are loaded completely, independent of script
execution or page rendering. Its argument, either true or false,
indicates whether or not the load operation succeeded.</p>
<a id="using-qwebpage-in-a-widget-less-environment" name="using-qwebpage-in-a-widget-less-environment" />
<h3>Using QWebPage in a Widget-less Environment</h3>
<p>Before you begin painting a QWebPage object, you need to set the
size of the viewport by calling <a href="qwebpage.html#viewportSize-prop">setViewportSize</a>(). Then, you
invoke the main frame's render function (<a href="qwebframe.html#render">QWebFrame.render</a>()). An example of
this is shown in the code snippet below.</p>
<p>Suppose we have a <tt>Thumbnail</tt> class as follows:</p>
<pre class="cpp">
<span class="keyword">class</span> Thumbnailer : <span class="keyword">public</span> <span class="type"><a href="qobject.html">QObject</a></span>
{
Q_OBJECT
<span class="keyword">public</span>:
Thumbnailer(<span class="keyword">const</span> <span class="type"><a href="qurl.html">QUrl</a></span> <span class="operator">&</span>url);
<span class="keyword">signals</span>:
<span class="type">void</span> finished();
<span class="keyword">private</span> <span class="keyword">slots</span>:
<span class="type">void</span> render();
<span class="keyword">private</span>:
<span class="type">QWebPage</span> page;
};
</pre>
<p>The <tt>Thumbnail</tt>'s constructor takes in a <i>url</i>. We
connect our QWebPage object's <a href="qwebpage.html#loadFinished">loadFinished()</a> signal to our
private slot, <tt>render()</tt>.</p>
<pre class="cpp">
Thumbnailer<span class="operator">.</span>Thumbnailer(<span class="keyword">const</span> <span class="type"><a href="qurl.html">QUrl</a></span> <span class="operator">&</span>url)
{
page<span class="operator">.</span>mainFrame()<span class="operator">-</span><span class="operator">></span>load(url);
connect(<span class="operator">&</span>page<span class="operator">,</span> SIGNAL(loadFinished(<span class="type">bool</span>))<span class="operator">,</span>
<span class="keyword">this</span><span class="operator">,</span> SLOT(render()));
}
</pre>
<p>The <tt>render()</tt> function shows how we can paint a
thumbnail using a QWebPage object.</p>
<pre class="cpp">
<span class="type">void</span> Thumbnailer<span class="operator">.</span>render()
{
page<span class="operator">.</span>setViewportSize(page<span class="operator">.</span>mainFrame()<span class="operator">-</span><span class="operator">></span>contentsSize());
<span class="type"><a href="qimage.html">QImage</a></span> image(page<span class="operator">.</span>viewportSize()<span class="operator">,</span> <span class="type"><a href="qimage.html">QImage</a></span><span class="operator">.</span>Format_ARGB32);
<span class="type"><a href="qpainter.html">QPainter</a></span> painter(<span class="operator">&</span>image);
page<span class="operator">.</span>mainFrame()<span class="operator">-</span><span class="operator">></span>render(<span class="operator">&</span>painter);
painter<span class="operator">.</span>end();
<span class="type"><a href="qimage.html">QImage</a></span> thumbnail <span class="operator">=</span> image<span class="operator">.</span>scaled(<span class="number">400</span><span class="operator">,</span> <span class="number">400</span>);
thumbnail<span class="operator">.</span>save(<span class="string">"thumbnail.png"</span>);
<span class="keyword">emit</span> finished();
}
</pre>
<p>We begin by setting the <a href="qwebpage.html#viewportSize-prop">viewportSize</a> and then we
instantiate a <a href="qimage.html">QImage</a> object,
<tt>image</tt>, with the same size as our <a href="qwebpage.html#viewportSize-prop">viewportSize</a>. This image is
then sent as a parameter to <tt>painter</tt>. Next, we render the
contents of the main frame and its subframes into <tt>painter</tt>.
Finally, we save the scaled image.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="ErrorDomain-enum" />QWebPage.ErrorDomain</h3><p>This enum describes the domain of an <a href="qwebpage-errorpageextensionoption.html">ErrorPageExtensionOption</a>
object (i.e. the layer in which the error occurred).</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.QtNetwork</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The error occurred in the QtNetwork layer; the
error code is of type <a href="qnetworkreply.html#NetworkError-enum">QNetworkReply.NetworkError</a>.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.Http</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The error occurred in the HTTP layer; the
error code is a HTTP status code (see <a href="qnetworkrequest.html#Attribute-enum">QNetworkRequest.HttpStatusCodeAttribute</a>).</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.WebKit</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">The error is an internal WebKit error.</td>
</tr>
</table>
<p>This enum was introduced or modified in Qt 4.6.</p>
<h3 class="fn"><a name="Extension-enum" />QWebPage.Extension</h3><p>This enum describes the types of extensions that the page can
support. Before using these extensions, you should verify that the
extension is supported by calling <a href="qwebpage.html#supportsExtension">supportsExtension</a>().</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign">
<tt>QWebPage.ChooseMultipleFilesExtension</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">Whether the web page supports multiple file
selection. This extension is invoked when the web content requests
one or more file names, for example as a result of the user
clicking on a "file upload" button in a HTML form where multiple
file selection is allowed.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.ErrorPageExtension</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">Whether the web page can provide an error page
when loading fails. (introduced in Qt 4.6)</td>
</tr>
</table>
<p><b>See also</b> <a href="qwebpage-choosemultiplefilesextensionoption.html">ChooseMultipleFilesExtensionOption</a>,
<a href="qwebpage-choosemultiplefilesextensionreturn.html">ChooseMultipleFilesExtensionReturn</a>,
<a href="qwebpage-errorpageextensionoption.html">ErrorPageExtensionOption</a>,
and <a href="qwebpage-errorpageextensionreturn.html">ErrorPageExtensionReturn</a>.</p>
<h3 class="fn"><a name="Feature-enum" />QWebPage.Feature</h3><h3 class="fn"><a name="FindFlag-enum" />QWebPage.FindFlag</h3><p>This enum describes the options available to the <a href="qwebpage.html#findText">findText</a>() function. The options can
be OR-ed together from the following list:</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.FindBackward</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">Searches backwards instead of forwards.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.FindCaseSensitively</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">By default <a href="qwebpage.html#findText">findText</a>() works case insensitive.
Specifying this option changes the behaviour to a case sensitive
find operation.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QWebPage.FindWrapsAroundDocument</tt></td>
<td class="topAlign"><tt>4</tt></td>
<td class="topAlign">Makes <a href="qwebpage.html#findText">findText</a>() restart from the beginning
of the document if the end was reached and the text was not
found.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QWebPage.HighlightAllOccurrences</tt></td>
<td class="topAlign"><tt>8</tt></td>
<td class="topAlign">Highlights all existing occurrences of a
specific string. (This value was introduced in 4.6.)</td>
</tr>
</table>
<p>The FindFlags type is a typedef for <a href="qflags.html">QFlags</a><FindFlag>. It stores an OR
combination of FindFlag values.</p>
<h3 class="fn"><a name="LinkDelegationPolicy-enum" />QWebPage.LinkDelegationPolicy</h3><p>This enum defines the delegation policies a webpage can have
when activating links and emitting the <a href="qwebpage.html#linkClicked">linkClicked</a>() signal.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.DontDelegateLinks</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">No links are delegated. Instead, <a href="qwebpage.html">QWebPage</a> tries to handle them all.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.DelegateExternalLinks</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">When activating links that point to documents
not stored on the local filesystem or an equivalent - such as the
Qt resource system - then <a href="qwebpage.html#linkClicked">linkClicked</a>() is emitted.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.DelegateAllLinks</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">Whenever a link is activated the <a href="qwebpage.html#linkClicked">linkClicked</a>() signal is
emitted.</td>
</tr>
</table>
<p><b>See also</b> <a href="qwebpage.html#linkDelegationPolicy-prop">QWebPage.linkDelegationPolicy</a>.</p>
<h3 class="fn"><a name="NavigationType-enum" />QWebPage.NavigationType</h3><p>This enum describes the types of navigation available when
browsing through hyperlinked documents.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign">
<tt>QWebPage.NavigationTypeLinkClicked</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The user clicked on a link or pressed return
on a focused link.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QWebPage.NavigationTypeFormSubmitted</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The user activated a submit button for an HTML
form.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QWebPage.NavigationTypeBackOrForward</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">Navigation to a previously shown document in
the back or forward history is requested.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.NavigationTypeReload</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign">The user activated the reload action.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QWebPage.NavigationTypeFormResubmitted</tt></td>
<td class="topAlign"><tt>4</tt></td>
<td class="topAlign">An HTML form was submitted a second time.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.NavigationTypeOther</tt></td>
<td class="topAlign"><tt>5</tt></td>
<td class="topAlign">A navigation to another document using a
method not listed above.</td>
</tr>
</table>
<p><b>See also</b> <a href="qwebpage.html#acceptNavigationRequest">acceptNavigationRequest</a>().</p>
<h3 class="fn"><a name="PermissionPolicy-enum" />QWebPage.PermissionPolicy</h3><h3 class="fn"><a name="WebAction-enum" />QWebPage.WebAction</h3><p>This enum describes the types of action which can be performed
on the web page.</p>
<p>Actions only have an effect when they are applicable. The
availability of actions can be be determined by checking <a href="qaction.html#enabled-prop">isEnabled()</a> on the action returned
by <a href="qwebpage.html#action">action</a>().</p>
<p>One method of enabling the text editing, cursor movement, and
text selection actions is by setting <a href="qwebpage.html#contentEditable-prop">contentEditable</a> to
true.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.NoWebAction</tt></td>
<td class="topAlign"><tt>-1</tt></td>
<td class="topAlign">No action is triggered.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.OpenLink</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">Open the current link.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.OpenLinkInNewWindow</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">Open the current link in a new window.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.OpenFrameInNewWindow</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">Replicate the current frame in a new
window.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.DownloadLinkToDisk</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign">Download the current link to the disk.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.CopyLinkToClipboard</tt></td>
<td class="topAlign"><tt>4</tt></td>
<td class="topAlign">Copy the current link to the clipboard.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.OpenImageInNewWindow</tt></td>
<td class="topAlign"><tt>5</tt></td>
<td class="topAlign">Open the highlighted image in a new
window.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.DownloadImageToDisk</tt></td>
<td class="topAlign"><tt>6</tt></td>
<td class="topAlign">Download the highlighted image to the
disk.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.CopyImageToClipboard</tt></td>
<td class="topAlign"><tt>7</tt></td>
<td class="topAlign">Copy the highlighted image to the
clipboard.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QWebPage.CopyImageUrlToClipboard</tt></td>
<td class="topAlign"><tt>68</tt></td>
<td class="topAlign">Copy the highlighted image's URL to the
clipboard.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.Back</tt></td>
<td class="topAlign"><tt>8</tt></td>
<td class="topAlign">Navigate back in the history of navigated
links.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.Forward</tt></td>
<td class="topAlign"><tt>9</tt></td>
<td class="topAlign">Navigate forward in the history of navigated
links.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.Stop</tt></td>
<td class="topAlign"><tt>10</tt></td>
<td class="topAlign">Stop loading the current page.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QWebPage.StopScheduledPageRefresh</tt></td>
<td class="topAlign"><tt>67</tt></td>
<td class="topAlign">Stop all pending page refresh/redirect
requests.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.Reload</tt></td>
<td class="topAlign"><tt>11</tt></td>
<td class="topAlign">Reload the current page.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.ReloadAndBypassCache</tt></td>
<td class="topAlign"><tt>53</tt></td>
<td class="topAlign">Reload the current page, but do not use any
local cache. (Added in Qt 4.6)</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.Cut</tt></td>
<td class="topAlign"><tt>12</tt></td>
<td class="topAlign">Cut the content currently selected into the
clipboard.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.Copy</tt></td>
<td class="topAlign"><tt>13</tt></td>
<td class="topAlign">Copy the content currently selected into the
clipboard.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.Paste</tt></td>
<td class="topAlign"><tt>14</tt></td>
<td class="topAlign">Paste content from the clipboard.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.Undo</tt></td>
<td class="topAlign"><tt>15</tt></td>
<td class="topAlign">Undo the last editing action.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.Redo</tt></td>
<td class="topAlign"><tt>16</tt></td>
<td class="topAlign">Redo the last editing action.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.MoveToNextChar</tt></td>
<td class="topAlign"><tt>17</tt></td>
<td class="topAlign">Move the cursor to the next character.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.MoveToPreviousChar</tt></td>
<td class="topAlign"><tt>18</tt></td>
<td class="topAlign">Move the cursor to the previous
character.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.MoveToNextWord</tt></td>
<td class="topAlign"><tt>19</tt></td>
<td class="topAlign">Move the cursor to the next word.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.MoveToPreviousWord</tt></td>
<td class="topAlign"><tt>20</tt></td>
<td class="topAlign">Move the cursor to the previous word.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.MoveToNextLine</tt></td>
<td class="topAlign"><tt>21</tt></td>
<td class="topAlign">Move the cursor to the next line.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.MoveToPreviousLine</tt></td>
<td class="topAlign"><tt>22</tt></td>
<td class="topAlign">Move the cursor to the previous line.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.MoveToStartOfLine</tt></td>
<td class="topAlign"><tt>23</tt></td>
<td class="topAlign">Move the cursor to the start of the line.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.MoveToEndOfLine</tt></td>
<td class="topAlign"><tt>24</tt></td>
<td class="topAlign">Move the cursor to the end of the line.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.MoveToStartOfBlock</tt></td>
<td class="topAlign"><tt>25</tt></td>
<td class="topAlign">Move the cursor to the start of the
block.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.MoveToEndOfBlock</tt></td>
<td class="topAlign"><tt>26</tt></td>
<td class="topAlign">Move the cursor to the end of the block.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.MoveToStartOfDocument</tt></td>
<td class="topAlign"><tt>27</tt></td>
<td class="topAlign">Move the cursor to the start of the
document.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.MoveToEndOfDocument</tt></td>
<td class="topAlign"><tt>28</tt></td>
<td class="topAlign">Move the cursor to the end of the
document.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.SelectNextChar</tt></td>
<td class="topAlign"><tt>29</tt></td>
<td class="topAlign">Select to the next character.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.SelectPreviousChar</tt></td>
<td class="topAlign"><tt>30</tt></td>
<td class="topAlign">Select to the previous character.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.SelectNextWord</tt></td>
<td class="topAlign"><tt>31</tt></td>
<td class="topAlign">Select to the next word.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.SelectPreviousWord</tt></td>
<td class="topAlign"><tt>32</tt></td>
<td class="topAlign">Select to the previous word.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.SelectNextLine</tt></td>
<td class="topAlign"><tt>33</tt></td>
<td class="topAlign">Select to the next line.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.SelectPreviousLine</tt></td>
<td class="topAlign"><tt>34</tt></td>
<td class="topAlign">Select to the previous line.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.SelectStartOfLine</tt></td>
<td class="topAlign"><tt>35</tt></td>
<td class="topAlign">Select to the start of the line.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.SelectEndOfLine</tt></td>
<td class="topAlign"><tt>36</tt></td>
<td class="topAlign">Select to the end of the line.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.SelectStartOfBlock</tt></td>
<td class="topAlign"><tt>37</tt></td>
<td class="topAlign">Select to the start of the block.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.SelectEndOfBlock</tt></td>
<td class="topAlign"><tt>38</tt></td>
<td class="topAlign">Select to the end of the block.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.SelectStartOfDocument</tt></td>
<td class="topAlign"><tt>39</tt></td>
<td class="topAlign">Select to the start of the document.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.SelectEndOfDocument</tt></td>
<td class="topAlign"><tt>40</tt></td>
<td class="topAlign">Select to the end of the document.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.DeleteStartOfWord</tt></td>
<td class="topAlign"><tt>41</tt></td>
<td class="topAlign">Delete to the start of the word.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.DeleteEndOfWord</tt></td>
<td class="topAlign"><tt>42</tt></td>
<td class="topAlign">Delete to the end of the word.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QWebPage.SetTextDirectionDefault</tt></td>
<td class="topAlign"><tt>43</tt></td>
<td class="topAlign">Set the text direction to the default
direction.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QWebPage.SetTextDirectionLeftToRight</tt></td>
<td class="topAlign"><tt>44</tt></td>
<td class="topAlign">Set the text direction to left-to-right.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QWebPage.SetTextDirectionRightToLeft</tt></td>
<td class="topAlign"><tt>45</tt></td>
<td class="topAlign">Set the text direction to right-to-left.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.ToggleBold</tt></td>
<td class="topAlign"><tt>46</tt></td>
<td class="topAlign">Toggle the formatting between bold and normal
weight.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.ToggleItalic</tt></td>
<td class="topAlign"><tt>47</tt></td>
<td class="topAlign">Toggle the formatting between italic and
normal style.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.ToggleUnderline</tt></td>
<td class="topAlign"><tt>48</tt></td>
<td class="topAlign">Toggle underlining.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.InspectElement</tt></td>
<td class="topAlign"><tt>49</tt></td>
<td class="topAlign">Show the Web Inspector with the currently
highlighted HTML element.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QWebPage.InsertParagraphSeparator</tt></td>
<td class="topAlign"><tt>50</tt></td>
<td class="topAlign">Insert a new paragraph.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.InsertLineSeparator</tt></td>
<td class="topAlign"><tt>51</tt></td>
<td class="topAlign">Insert a new line.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.SelectAll</tt></td>
<td class="topAlign"><tt>52</tt></td>
<td class="topAlign">Selects all content.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.PasteAndMatchStyle</tt></td>
<td class="topAlign"><tt>54</tt></td>
<td class="topAlign">Paste content from the clipboard with current
style.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.RemoveFormat</tt></td>
<td class="topAlign"><tt>55</tt></td>
<td class="topAlign">Removes formatting and style.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.ToggleStrikethrough</tt></td>
<td class="topAlign"><tt>56</tt></td>
<td class="topAlign">Toggle the formatting between strikethrough
and normal style.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.ToggleSubscript</tt></td>
<td class="topAlign"><tt>57</tt></td>
<td class="topAlign">Toggle the formatting between subscript and
baseline.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.ToggleSuperscript</tt></td>
<td class="topAlign"><tt>58</tt></td>
<td class="topAlign">Toggle the formatting between supercript and
baseline.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.InsertUnorderedList</tt></td>
<td class="topAlign"><tt>59</tt></td>
<td class="topAlign">Toggles the selection between an ordered list
and a normal block.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.InsertOrderedList</tt></td>
<td class="topAlign"><tt>60</tt></td>
<td class="topAlign">Toggles the selection between an ordered list
and a normal block.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.Indent</tt></td>
<td class="topAlign"><tt>61</tt></td>
<td class="topAlign">Increases the indentation of the currently
selected format block by one increment.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.Outdent</tt></td>
<td class="topAlign"><tt>62</tt></td>
<td class="topAlign">Decreases the indentation of the currently
selected format block by one increment.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.AlignCenter</tt></td>
<td class="topAlign"><tt>63</tt></td>
<td class="topAlign">Applies center alignment to content.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.AlignJustified</tt></td>
<td class="topAlign"><tt>64</tt></td>
<td class="topAlign">Applies full justification to content.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.AlignLeft</tt></td>
<td class="topAlign"><tt>65</tt></td>
<td class="topAlign">Applies left justification to content.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.AlignRight</tt></td>
<td class="topAlign"><tt>66</tt></td>
<td class="topAlign">Applies right justification to content.</td>
</tr>
</table>
<h3 class="fn"><a name="WebWindowType-enum" />QWebPage.WebWindowType</h3><p>This enum describes the types of window that can be created by
the <a href="qwebpage.html#createWindow">createWindow</a>()
function.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.WebBrowserWindow</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The window is a regular web browser
window.</td>
</tr>
<tr>
<td class="topAlign"><tt>QWebPage.WebModalDialog</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The window acts as modal dialog.</td>
</tr>
</table>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QWebPage" />QWebPage.__init__ (<i>self</i>, <a href="qobject.html">QObject</a> <i>parent</i> = None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs an empty <a href="qwebpage.html">QWebPage</a> with
parent <i>parent</i>.</p>
<h3 class="fn"><a name="acceptNavigationRequest" />bool QWebPage.acceptNavigationRequest (<i>self</i>, <a href="qwebframe.html">QWebFrame</a> <i>frame</i>, <a href="qnetworkrequest.html">QNetworkRequest</a> <i>request</i>, <a href="qwebpage.html#NavigationType-enum">NavigationType</a> <i>type</i>)</h3><p>This function is called whenever <a href="qwebpage.html#ErrorDomain-enum">WebKit</a> requests to navigate
<i>frame</i> to the resource specified by <i>request</i> by means
of the specified navigation type <i>type</i>.</p>
<p>If <i>frame</i> is a null pointer then navigation to a new
window is requested. If the request is accepted <a href="qwebpage.html#createWindow">createWindow</a>() will be called.</p>
<p>The default implementation interprets the page's <a href="qwebpage.html#linkDelegationPolicy-prop">linkDelegationPolicy</a>
and emits linkClicked accordingly or returns true to let <a href="qwebpage.html">QWebPage</a> handle the navigation itself.</p>
<p><b>See also</b> <a href="qwebpage.html#createWindow">createWindow</a>().</p>
<h3 class="fn"><a name="action" /><a href="qaction.html">QAction</a> QWebPage.action (<i>self</i>, <a href="qwebpage.html#WebAction-enum">WebAction</a> <i>action</i>)</h3><p>Returns a <a href="qaction.html">QAction</a> for the specified
<a href="qwebpage.html#WebAction-enum">WebAction</a>
<i>action</i>.</p>
<p>The action is owned by the <a href="qwebpage.html">QWebPage</a>
but you can customize the look by changing its properties.</p>
<p><a href="qwebpage.html">QWebPage</a> also takes care of
implementing the action, so that upon triggering the corresponding
action is performed on the page.</p>
<p><b>See also</b> <a href="qwebpage.html#triggerAction">triggerAction</a>().</p>
<h3 class="fn"><a name="bytesReceived" />int QWebPage.bytesReceived (<i>self</i>)</h3><p>Returns the number of bytes that were received from the network
to render the current page.</p>
<p><b>See also</b> <a href="qwebpage.html#totalBytes">totalBytes</a>() and <a href="qwebpage.html#loadProgress">loadProgress</a>().</p>
<h3 class="fn"><a name="chooseFile" />QString QWebPage.chooseFile (<i>self</i>, <a href="qwebframe.html">QWebFrame</a> <i>originatingFrame</i>, QString <i>oldFile</i>)</h3><p>This function is called when the web content requests a file
name, for example as a result of the user clicking on a "file
upload" button in a HTML form.</p>
<p>A suggested filename may be provided in <i>suggestedFile</i>.
The frame originating the request is provided as
<i>parentFrame</i>.</p>
<p><b>See also</b> <a href="qwebpage.html#Extension-enum">ChooseMultipleFilesExtension</a>.</p>
<h3 class="fn"><a name="createPlugin" /><a href="qobject.html">QObject</a> QWebPage.createPlugin (<i>self</i>, QString <i>classid</i>, <a href="qurl.html">QUrl</a> <i>url</i>, QStringList <i>paramNames</i>, QStringList <i>paramValues</i>)</h3><p>This function is called whenever <a href="qwebpage.html#ErrorDomain-enum">WebKit</a> encounters a HTML
object element with type "application/x-qt-plugin". It is called
regardless of the value of <a href="qwebsettings.html#WebAttribute-enum">QWebSettings.PluginsEnabled</a>.
The <i>classid</i>, <i>url</i>, <i>paramNames</i> and
<i>paramValues</i> correspond to the HTML object element attributes
and child elements to configure the embeddable object.</p>
<h3 class="fn"><a name="createStandardContextMenu" /><a href="qmenu.html">QMenu</a> QWebPage.createStandardContextMenu (<i>self</i>)</h3><p>This function creates the standard context menu which is shown
when the user clicks on the web page with the right mouse button.
It is called from the default contextMenuEvent() handler. The popup
menu's ownership is transferred to the caller.</p>
<p>This function was introduced in Qt 4.5.</p>
<h3 class="fn"><a name="createWindow" /><a href="qwebpage.html">QWebPage</a> QWebPage.createWindow (<i>self</i>, <a href="qwebpage.html#WebWindowType-enum">WebWindowType</a> <i>type</i>)</h3><p>This function is called whenever <a href="qwebpage.html#ErrorDomain-enum">WebKit</a> wants to create a new
window of the given <i>type</i>, for example when a JavaScript
program requests to open a document in a new window.</p>
<p>If the new window can be created, the new window's <a href="qwebpage.html">QWebPage</a> is returned; otherwise a null pointer
is returned.</p>
<p>If the view associated with the web page is a <a href="qwebview.html">QWebView</a> object, then the default
implementation forwards the request to <a href="qwebview.html">QWebView</a>'s createWindow() function; otherwise
it returns a null pointer.</p>
<p>If <i>type</i> is <a href="qwebpage.html#WebWindowType-enum">WebModalDialog</a>, the
application must call setWindowModality(<a href="qt.html#WindowModality-enum">Qt.ApplicationModal</a>) on the new
window.</p>
<p><b>Note:</b> In the cases when the window creation is being
triggered by JavaScript, apart from reimplementing this method
application must also set the JavaScriptCanOpenWindows attribute of
<a href="qwebsettings.html">QWebSettings</a> to true in order for
it to get called.</p>
<p><b>See also</b> <a href="qwebpage.html#acceptNavigationRequest">acceptNavigationRequest</a>()
and <a href="qwebview.html#createWindow">QWebView.createWindow</a>().</p>
<h3 class="fn"><a name="currentFrame" /><a href="qwebframe.html">QWebFrame</a> QWebPage.currentFrame (<i>self</i>)</h3><p>Returns the frame currently active.</p>
<p><b>See also</b> <a href="qwebpage.html#mainFrame">mainFrame</a>() and <a href="qwebpage.html#frameCreated">frameCreated</a>().</p>
<h3 class="fn"><a name="event" />bool QWebPage.event (<i>self</i>, <a href="qevent.html">QEvent</a>)</h3><p>Reimplemented from <a href="qobject.html#event">QObject.event</a>().</p>
<h3 class="fn"><a name="extension" />bool QWebPage.extension (<i>self</i>, <a href="qwebpage.html#Extension-enum">Extension</a> <i>extension</i>, <a href="qwebpage-extensionoption.html">ExtensionOption</a> <i>option</i> = None, <a href="qwebpage-extensionreturn.html">ExtensionReturn</a> <i>output</i> = None)</h3><p>This virtual function can be reimplemented in a <a href="qwebpage.html">QWebPage</a> subclass to provide support for
extensions. The <i>option</i> argument is provided as input to the
extension; the output results can be stored in <i>output</i>.</p>
<p>The behavior of this function is determined by <i>extension</i>.
The <i>option</i> and <i>output</i> values are typically casted to
the corresponding types (for example, <a href="qwebpage-choosemultiplefilesextensionoption.html">ChooseMultipleFilesExtensionOption</a>
and <a href="qwebpage-choosemultiplefilesextensionreturn.html">ChooseMultipleFilesExtensionReturn</a>
for <a href="qwebpage.html#Extension-enum">ChooseMultipleFilesExtension</a>).</p>
<p>You can call <a href="qwebpage.html#supportsExtension">supportsExtension</a>() to check
if an extension is supported by the page.</p>
<p>Returns true if the extension was called successfully; otherwise
returns false.</p>
<p><b>See also</b> <a href="qwebpage.html#supportsExtension">supportsExtension</a>() and
<a href="qwebpage.html#Extension-enum">Extension</a>.</p>
<h3 class="fn"><a name="findText" />bool QWebPage.findText (<i>self</i>, QString <i>subString</i>, <a href="qwebpage-findflags.html">FindFlags</a> <i>options</i> = 0)</h3><p>Finds the specified string, <i>subString</i>, in the page, using
the given <i>options</i>.</p>
<p>If the <a href="qwebpage.html#FindFlag-enum">HighlightAllOccurrences</a> flag is
passed, the function will highlight all occurrences that exist in
the page. All subsequent calls will extend the highlight, rather
than replace it, with occurrences of the new string.</p>
<p>If the <a href="qwebpage.html#FindFlag-enum">HighlightAllOccurrences</a> flag is
not passed, the function will select an occurrence and all
subsequent calls will replace the current occurrence with the next
one.</p>
<p>To clear the selection, just pass an empty string.</p>
<p>Returns true if <i>subString</i> was found; otherwise returns
false.</p>
<h3 class="fn"><a name="focusNextPrevChild" />bool QWebPage.focusNextPrevChild (<i>self</i>, bool <i>next</i>)</h3><p>Similar to <a href="qwidget.html#focusNextPrevChild">QWidget.focusNextPrevChild</a>()
it focuses the next focusable web element if <i>next</i> is true;
otherwise the previous element is focused.</p>
<p>Returns true if it can find a new focusable element, or false if
it can't.</p>
<h3 class="fn"><a name="forwardUnsupportedContent" />bool QWebPage.forwardUnsupportedContent (<i>self</i>)</h3><h3 class="fn"><a name="frameAt" /><a href="qwebframe.html">QWebFrame</a> QWebPage.frameAt (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>pos</i>)</h3><p>Returns the frame at the given point <i>pos</i>, or 0 if there
is no frame at that position.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qwebpage.html#mainFrame">mainFrame</a>() and <a href="qwebpage.html#currentFrame">currentFrame</a>().</p>
<h3 class="fn"><a name="hasSelection" />bool QWebPage.hasSelection (<i>self</i>)</h3><h3 class="fn"><a name="history" /><a href="qwebhistory.html">QWebHistory</a> QWebPage.history (<i>self</i>)</h3><p>Returns a pointer to the view's history of navigated web
pages.</p>
<h3 class="fn"><a name="inputMethodQuery" />QVariant QWebPage.inputMethodQuery (<i>self</i>, <a href="qt.html#InputMethodQuery-enum">Qt.InputMethodQuery</a> <i>property</i>)</h3><p>This method is used by the input method to query a set of
properties of the page to be able to support complex input method
operations as support for surrounding text and reconversions.</p>
<p><i>property</i> specifies which property is queried.</p>
<p><b>See also</b> <a href="qwidget.html#inputMethodEvent">QWidget.inputMethodEvent</a>(),
<a href="qinputmethodevent.html">QInputMethodEvent</a>, and
<a href="qinputcontext.html">QInputContext</a>.</p>
<h3 class="fn"><a name="isContentEditable" />bool QWebPage.isContentEditable (<i>self</i>)</h3><h3 class="fn"><a name="isModified" />bool QWebPage.isModified (<i>self</i>)</h3><h3 class="fn"><a name="javaScriptAlert" />QWebPage.javaScriptAlert (<i>self</i>, <a href="qwebframe.html">QWebFrame</a> <i>originatingFrame</i>, QString <i>msg</i>)</h3><p>This function is called whenever a JavaScript program running
inside <i>frame</i> calls the alert() function with the message
<i>msg</i>.</p>
<p>The default implementation shows the message, <i>msg</i>, with
QMessageBox.information.</p>
<h3 class="fn"><a name="javaScriptConfirm" />bool QWebPage.javaScriptConfirm (<i>self</i>, <a href="qwebframe.html">QWebFrame</a> <i>originatingFrame</i>, QString <i>msg</i>)</h3><p>This function is called whenever a JavaScript program running
inside <i>frame</i> calls the confirm() function with the message,
<i>msg</i>. Returns true if the user confirms the message;
otherwise returns false.</p>
<p>The default implementation executes the query using
QMessageBox.information with <a href="qmessagebox.html#StandardButton-enum">QMessageBox.Yes</a> and
<a href="qmessagebox.html#StandardButton-enum">QMessageBox.No</a>
buttons.</p>
<h3 class="fn"><a name="javaScriptConsoleMessage" />QWebPage.javaScriptConsoleMessage (<i>self</i>, QString <i>message</i>, int <i>lineNumber</i>, QString <i>sourceID</i>)</h3><p>This function is called whenever a JavaScript program tries to
print a <i>message</i> to the web browser's console.</p>
<p>For example in case of evaluation errors the source URL may be
provided in <i>sourceID</i> as well as the <i>lineNumber</i>.</p>
<p>The default implementation prints nothing.</p>
<h3 class="fn"><a name="javaScriptPrompt" />(bool, QString <i>result</i>) QWebPage.javaScriptPrompt (<i>self</i>, <a href="qwebframe.html">QWebFrame</a> <i>originatingFrame</i>, QString <i>msg</i>, QString <i>defaultValue</i>)</h3><p>This function is called whenever a JavaScript program running
inside <i>frame</i> tries to prompt the user for input. The program
may provide an optional message, <i>msg</i>, as well as a default
value for the input in <i>defaultValue</i>.</p>
<p>If the prompt was cancelled by the user the implementation
should return false; otherwise the result should be written to
<i>result</i> and true should be returned. If the prompt was not
cancelled by the user, the implementation should return true and
the result string must not be null.</p>
<p>The default implementation uses <a href="qinputdialog.html#getText">QInputDialog.getText</a>().</p>
<h3 class="fn"><a name="javaScriptPrompt-2" />bool QWebPage.javaScriptPrompt (<i>self</i>, <a href="qwebframe.html">QWebFrame</a> <i>originatingFrame</i>, QString <i>msg</i>, QString <i>defaultValue</i>, QString <i>result</i>)</h3><h3 class="fn"><a name="linkDelegationPolicy" /><a href="qwebpage.html#LinkDelegationPolicy-enum">LinkDelegationPolicy</a> QWebPage.linkDelegationPolicy (<i>self</i>)</h3><h3 class="fn"><a name="mainFrame" /><a href="qwebframe.html">QWebFrame</a> QWebPage.mainFrame (<i>self</i>)</h3><p>Returns the main frame of the page.</p>
<p>The main frame provides access to the hierarchy of sub-frames
and is also needed if you want to explicitly render a web page into
a given painter.</p>
<p><b>See also</b> <a href="qwebpage.html#currentFrame">currentFrame</a>().</p>
<h3 class="fn"><a name="networkAccessManager" /><a href="qnetworkaccessmanager.html">QNetworkAccessManager</a> QWebPage.networkAccessManager (<i>self</i>)</h3><p>Returns the <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a> that is
responsible for serving network requests for this <a href="qwebpage.html">QWebPage</a>.</p>
<p><b>See also</b> <a href="qwebpage.html#setNetworkAccessManager">setNetworkAccessManager</a>().</p>
<h3 class="fn"><a name="palette" /><a href="qpalette.html">QPalette</a> QWebPage.palette (<i>self</i>)</h3><h3 class="fn"><a name="pluginFactory" /><a href="qwebpluginfactory.html">QWebPluginFactory</a> QWebPage.pluginFactory (<i>self</i>)</h3><p>Returns the <a href="qwebpluginfactory.html">QWebPluginFactory</a> that is responsible
for creating plugins embedded into this <a href="qwebpage.html">QWebPage</a>. If no plugin factory is installed a
null pointer is returned.</p>
<p><b>See also</b> <a href="qwebpage.html#setPluginFactory">setPluginFactory</a>().</p>
<h3 class="fn"><a name="preferredContentsSize" /><a href="qsize.html">QSize</a> QWebPage.preferredContentsSize (<i>self</i>)</h3><h3 class="fn"><a name="selectedHtml" />QString QWebPage.selectedHtml (<i>self</i>)</h3><h3 class="fn"><a name="selectedText" />QString QWebPage.selectedText (<i>self</i>)</h3><h3 class="fn"><a name="setActualVisibleContentRect" />QWebPage.setActualVisibleContentRect (<i>self</i>, <a href="qrect.html">QRect</a> <i>rect</i>)</h3><h3 class="fn"><a name="setContentEditable" />QWebPage.setContentEditable (<i>self</i>, bool <i>editable</i>)</h3><h3 class="fn"><a name="setFeaturePermission" />QWebPage.setFeaturePermission (<i>self</i>, <a href="qwebframe.html">QWebFrame</a> <i>frame</i>, <a href="qwebpage.html#Feature-enum">Feature</a> <i>feature</i>, <a href="qwebpage.html#PermissionPolicy-enum">PermissionPolicy</a> <i>policy</i>)</h3><h3 class="fn"><a name="setForwardUnsupportedContent" />QWebPage.setForwardUnsupportedContent (<i>self</i>, bool <i>forward</i>)</h3><h3 class="fn"><a name="setLinkDelegationPolicy" />QWebPage.setLinkDelegationPolicy (<i>self</i>, <a href="qwebpage.html#LinkDelegationPolicy-enum">LinkDelegationPolicy</a> <i>policy</i>)</h3><h3 class="fn"><a name="setNetworkAccessManager" />QWebPage.setNetworkAccessManager (<i>self</i>, <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a> <i>manager</i>)</h3><p>Sets the <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a>
<i>manager</i> responsible for serving network requests for this
<a href="qwebpage.html">QWebPage</a>.</p>
<p><b>Note:</b> It is currently not supported to change the network
access manager after the <a href="qwebpage.html">QWebPage</a> has
used it. The results of doing this are undefined.</p>
<p><b>See also</b> <a href="qwebpage.html#networkAccessManager">networkAccessManager</a>().</p>
<h3 class="fn"><a name="setPalette" />QWebPage.setPalette (<i>self</i>, <a href="qpalette.html">QPalette</a> <i>palette</i>)</h3><h3 class="fn"><a name="setPluginFactory" />QWebPage.setPluginFactory (<i>self</i>, <a href="qwebpluginfactory.html">QWebPluginFactory</a> <i>factory</i>)</h3><p>Sets the <a href="qwebpluginfactory.html">QWebPluginFactory</a>
<i>factory</i> responsible for creating plugins embedded into this
<a href="qwebpage.html">QWebPage</a>.</p>
<p>Note: The plugin factory is only used if the <a href="qwebsettings.html#WebAttribute-enum">QWebSettings.PluginsEnabled</a>
attribute is enabled.</p>
<p><b>See also</b> <a href="qwebpage.html#pluginFactory">pluginFactory</a>().</p>
<h3 class="fn"><a name="setPreferredContentsSize" />QWebPage.setPreferredContentsSize (<i>self</i>, <a href="qsize.html">QSize</a> <i>size</i>)</h3><h3 class="fn"><a name="settings" /><a href="qwebsettings.html">QWebSettings</a> QWebPage.settings (<i>self</i>)</h3><p>Returns a pointer to the page's settings object.</p>
<p><b>See also</b> <a href="qwebsettings.html#globalSettings">QWebSettings.globalSettings</a>().</p>
<h3 class="fn"><a name="setView" />QWebPage.setView (<i>self</i>, <a href="qwidget.html">QWidget</a> <i>view</i>)</h3><p>Sets the <i>view</i> that is associated with the web page.</p>
<p><b>See also</b> <a href="qwebpage.html#view">view</a>().</p>
<h3 class="fn"><a name="setViewportSize" />QWebPage.setViewportSize (<i>self</i>, <a href="qsize.html">QSize</a> <i>size</i>)</h3><h3 class="fn"><a name="shouldInterruptJavaScript" />bool QWebPage.shouldInterruptJavaScript (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>bool shouldInterruptJavaScript()</tt>.</p><p>This function is called when a JavaScript program is running for
a long period of time.</p>
<p>If the user wanted to stop the JavaScript the implementation
should return true; otherwise false.</p>
<p>The default implementation executes the query using
QMessageBox.information with <a href="qmessagebox.html#StandardButton-enum">QMessageBox.Yes</a> and
<a href="qmessagebox.html#StandardButton-enum">QMessageBox.No</a>
buttons.</p>
<p><b>Warning:</b> Because of binary compatibility constraints,
this function is not virtual. If you want to provide your own
implementation in a <a href="qwebpage.html">QWebPage</a> subclass,
reimplement the shouldInterruptJavaScript() slot in your subclass
instead. <a href="qtwebkit.html">QtWebKit</a> will dynamically
detect the slot and call it.</p>
<p>This function was introduced in Qt 4.6.</p>
<h3 class="fn"><a name="supportedContentTypes" />QStringList QWebPage.supportedContentTypes (<i>self</i>)</h3><p>Returns the list of all content types supported by <a href="qwebpage.html">QWebPage</a>.</p>
<h3 class="fn"><a name="supportsContentType" />bool QWebPage.supportsContentType (<i>self</i>, QString <i>mimeType</i>)</h3><p>Returns true if <a href="qwebpage.html">QWebPage</a> can handle
the given <i>mimeType</i>; otherwise, returns false.</p>
<h3 class="fn"><a name="supportsExtension" />bool QWebPage.supportsExtension (<i>self</i>, <a href="qwebpage.html#Extension-enum">Extension</a> <i>extension</i>)</h3><p>This virtual function returns true if the web page supports
<i>extension</i>; otherwise false is returned.</p>
<p><b>See also</b> <a href="qwebpage.html#extension">extension</a>().</p>
<h3 class="fn"><a name="swallowContextMenuEvent" />bool QWebPage.swallowContextMenuEvent (<i>self</i>, <a href="qcontextmenuevent.html">QContextMenuEvent</a> <i>event</i>)</h3><p>Filters the context menu event, <i>event</i>, through handlers
for scrollbars and custom event handlers in the web page. Returns
true if the event was handled; otherwise false.</p>
<p>A web page may swallow a context menu event through a custom
event handler, allowing for context menus to be implemented in
HTML/JavaScript. This is used by <a href="http://maps.google.com/">Google Maps</a>, for example.</p>
<h3 class="fn"><a name="totalBytes" />int QWebPage.totalBytes (<i>self</i>)</h3><p>Returns the total number of bytes that were received from the
network to render the current page, including extra content such as
embedded images.</p>
<p><b>See also</b> <a href="qwebpage.html#bytesReceived">bytesReceived</a>().</p>
<h3 class="fn"><a name="triggerAction" />QWebPage.triggerAction (<i>self</i>, <a href="qwebpage.html#WebAction-enum">WebAction</a> <i>action</i>, bool <i>checked</i> = False)</h3><p>This function can be called to trigger the specified
<i>action</i>. It is also called by <a href="qtwebkit.html">QtWebKit</a> if the user triggers the action, for
example through a context menu item.</p>
<p>If <i>action</i> is a checkable action then <i>checked</i>
specified whether the action is toggled or not.</p>
<p><b>See also</b> <a href="qwebpage.html#action">action</a>().</p>
<h3 class="fn"><a name="undoStack" /><a href="qundostack.html">QUndoStack</a> QWebPage.undoStack (<i>self</i>)</h3><p>Returns a pointer to the undo stack used for editable
content.</p>
<p><b>See also</b> <a href="qwebpage.html#modified-prop">modified</a>.</p>
<h3 class="fn"><a name="updatePositionDependentActions" />QWebPage.updatePositionDependentActions (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>pos</i>)</h3><p>Updates the page's actions depending on the position <i>pos</i>.
For example if <i>pos</i> is over an image element the <a href="qwebpage.html#WebAction-enum">CopyImageToClipboard</a> action is
enabled.</p>
<h3 class="fn"><a name="userAgentForUrl" />QString QWebPage.userAgentForUrl (<i>self</i>, <a href="qurl.html">QUrl</a> <i>url</i>)</h3><p>This function is called when a user agent for HTTP requests is
needed. You can reimplement this function to dynamically return
different user agents for different URLs, based on the <i>url</i>
parameter.</p>
<p>The default implementation returns the following value:</p>
<p>"Mozilla/5.0 (%Platform%%Security%%Subplatform%)
AppleWebKit/%WebKitVersion% (KHTML, like Gecko) %AppVersion
Safari/%WebKitVersion%"</p>
<p>On mobile platforms such as Symbian S60 and Maemo, "Mobile
Safari" is used instead of "Safari".</p>
<p>In this string the following values are replaced at
run-time:</p>
<ul>
<li>%Platform% expands to the windowing system followed by "; " if
it is not Windows (e.g. "X11; ").</li>
<li>%Security% expands to "N; " if SSL is disabled.</li>
<li>%Subplatform% expands to the operating system version (e.g.
"Windows NT 6.1" or "Intel Mac OS X 10.5").</li>
<li>%WebKitVersion% is the version of <a href="qwebpage.html#ErrorDomain-enum">WebKit</a> the application was
compiled against.</li>
<li>%AppVersion% expands to <a href="qcoreapplication.html#applicationName-prop">QCoreApplication.applicationName</a>()/<a href="qcoreapplication.html#applicationVersion-prop">QCoreApplication.applicationVersion</a>()
if they're set; otherwise defaulting to Qt and the current Qt
version.</li>
</ul>
<h3 class="fn"><a name="view" /><a href="qwidget.html">QWidget</a> QWebPage.view (<i>self</i>)</h3><p>Returns the view widget that is associated with the web
page.</p>
<p><b>See also</b> <a href="qwebpage.html#setView">setView</a>().</p>
<h3 class="fn"><a name="viewportAttributesForSize" /><a href="qwebpage-viewportattributes.html">ViewportAttributes</a> QWebPage.viewportAttributesForSize (<i>self</i>, <a href="qsize.html">QSize</a> <i>availableSize</i>)</h3><p>Computes the optimal viewport configuration given the
<i>availableSize</i>, when user interface components are
disregarded.</p>
<p>The configuration is also dependent on the device screen size
which is obtained automatically. For testing purposes the size can
be overridden by setting two environment variables
QTWEBKIT_DEVICE_WIDTH and QTWEBKIT_DEVICE_HEIGHT, which both needs
to be set.</p>
<p>The <a href="qwebpage-viewportattributes.html">ViewportAttributes</a> includes
a pixel density ratio, which will also be exposed to the web author
though the -webkit-pixel-ratio media feature. This is the ratio
between 1 density-independent pixel (DPI) and physical pixels.</p>
<p>A density-independent pixel is equivalent to one physical pixel
on a 160 DPI screen, so on our platform assumes that as the
baseline density.</p>
<p>The conversion of DIP units to screen pixels is quite
simple:</p>
<p>pixels = DIPs * (density / 160).</p>
<p>Thus, on a 240 DPI screen, 1 DIPs would equal 1.5 physical
pixels.</p>
<p>An invalid instance will be returned in the case an empty size
is passed to the method.</p>
<p><b>Note:</b> The density is automatically obtained from the DPI
of the screen where the page is being shown, but as many X11
servers are reporting wrong DPI, it is possible to override it
using <a href="qx11info.html#setAppDpiY">QX11Info.setAppDpiY</a>().</p>
<h3 class="fn"><a name="viewportSize" /><a href="qsize.html">QSize</a> QWebPage.viewportSize (<i>self</i>)</h3><hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="applicationCacheQuotaExceeded" />void applicationCacheQuotaExceeded ( ::QWebSecurityOrigin*, ::quint64)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the web site is asking to store
data to the application cache database databaseName and the quota
allocated to that web site is exceeded.</p>
<h3 class="fn"><a name="contentsChanged" />void contentsChanged ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the text in form elements
changes as well as other editable content.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qwebpage.html#contentEditable-prop">contentEditable</a>, <a href="qwebpage.html#modified-prop">modified</a>, <a href="qwebframe.html#toHtml">QWebFrame.toHtml</a>(), and <a href="qwebframe.html#toPlainText">QWebFrame.toPlainText</a>().</p>
<h3 class="fn"><a name="databaseQuotaExceeded" />void databaseQuotaExceeded ( ::QWebFrame*,QString)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the web site shown in
<i>frame</i> is asking to store data to the database
<i>databaseName</i> and the quota allocated to that web site is
exceeded.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qwebdatabase.html">QWebDatabase</a>.</p>
<h3 class="fn"><a name="downloadRequested" />void downloadRequested (const ::QNetworkRequest&)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when the user decides to download a link.
The url of the link as well as additional meta-information is
contained in <i>request</i>.</p>
<p><b>See also</b> <a href="qwebpage.html#unsupportedContent">unsupportedContent</a>().</p>
<h3 class="fn"><a name="featurePermissionRequestCanceled" />void featurePermissionRequestCanceled ( ::QWebFrame*, ::QWebPage::Feature)</h3><p>This is the default overload of this signal.</p><h3 class="fn"><a name="featurePermissionRequested" />void featurePermissionRequested ( ::QWebFrame*, ::QWebPage::Feature)</h3><p>This is the default overload of this signal.</p><h3 class="fn"><a name="frameCreated" />void frameCreated ( ::QWebFrame*)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the page creates a new
<i>frame</i>.</p>
<p><b>See also</b> <a href="qwebpage.html#currentFrame">currentFrame</a>().</p>
<h3 class="fn"><a name="geometryChangeRequested" />void geometryChangeRequested (const ::QRect&)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the document wants to change the
position and size of the page to <i>geom</i>. This can happen for
example through JavaScript.</p>
<h3 class="fn"><a name="linkClicked" />void linkClicked (const ::QUrl&)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the user clicks on a link and
the page's <a href="qwebpage.html#linkDelegationPolicy-prop">linkDelegationPolicy</a>
property is set to delegate the link handling for the specified
<i>url</i>.</p>
<p>By default no links are delegated and are handled by <a href="qwebpage.html">QWebPage</a> instead.</p>
<p><b>Note:</b> This signal possibly won't be emitted for clicked
links which use JavaScript to trigger navigation.</p>
<p><b>See also</b> <a href="qwebpage.html#linkHovered">linkHovered</a>().</p>
<h3 class="fn"><a name="linkHovered" />void linkHovered (const QString&,const QString&,const QString&)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when the mouse hovers over a link.</p>
<p><i>link</i> contains the link url. <i>title</i> is the link
element's title, if it is specified in the markup.
<i>textContent</i> provides text within the link element, e.g.,
text inside an HTML anchor tag.</p>
<p>When the mouse leaves the link element the signal is emitted
with empty parameters.</p>
<p><b>See also</b> <a href="qwebpage.html#linkClicked">linkClicked</a>().</p>
<h3 class="fn"><a name="loadFinished" />void loadFinished (bool)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when the page finishes loading content.
This signal is independant of script execution or page rendering.
<i>ok</i> will indicate whether the load was successful or any
error occurred.</p>
<p><b>See also</b> <a href="qwebpage.html#loadStarted">loadStarted</a>() and <a href="qwebpage.html#Extension-enum">ErrorPageExtension</a>.</p>
<h3 class="fn"><a name="loadProgress" />void loadProgress (int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when the global progress status changes.
The current value is provided by <i>progress</i> and scales from 0
to 100, which is the default range of <a href="qprogressbar.html">QProgressBar</a>. It accumulates changes from
all the child frames.</p>
<p><b>See also</b> <a href="qwebpage.html#bytesReceived">bytesReceived</a>().</p>
<h3 class="fn"><a name="loadStarted" />void loadStarted ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when a page starts loading content.</p>
<p><b>See also</b> <a href="qwebpage.html#loadFinished">loadFinished</a>().</p>
<h3 class="fn"><a name="menuBarVisibilityChangeRequested" />void menuBarVisibilityChangeRequested (bool)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the visibility of the menubar in
a web browser window that hosts <a href="qwebpage.html">QWebPage</a> should be changed to
<i>visible</i>.</p>
<h3 class="fn"><a name="microFocusChanged" />void microFocusChanged ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when for example the position of the
cursor in an editable form element changes. It is used to inform
input methods about the new on-screen position where the user is
able to enter text. This signal is usually connected to the
<a href="qwidget.html#updateMicroFocus">QWidget.updateMicroFocus</a>()
slot.</p>
<h3 class="fn"><a name="printRequested" />void printRequested ( ::QWebFrame*)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the page requests the web
browser to print <i>frame</i>, for example through the JavaScript
<tt>window.print()</tt> call.</p>
<p><b>See also</b> <a href="qwebframe.html#print">QWebFrame.print</a>() and <a href="qprintpreviewdialog.html">QPrintPreviewDialog</a>.</p>
<h3 class="fn"><a name="repaintRequested" />void repaintRequested (const ::QRect&)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever this <a href="qwebpage.html">QWebPage</a> should be updated. It's useful when
rendering a <a href="qwebpage.html">QWebPage</a> without a <a href="qwebview.html">QWebView</a> or <a href="qgraphicswebview.html">QGraphicsWebView</a>. <i>dirtyRect</i>
contains the area that needs to be updated. To paint the <a href="qwebpage.html">QWebPage</a> get the <a href="qwebpage.html#mainFrame">mainFrame</a>() and call the
render(<a href="qpainter.html">QPainter</a>*, const <a href="qregion.html">QRegion</a>&) method with the <i>dirtyRect</i>
as the second parameter.</p>
<p><b>See also</b> <a href="qwebpage.html#mainFrame">mainFrame</a>() and <a href="qwebpage.html#view">view</a>().</p>
<h3 class="fn"><a name="restoreFrameStateRequested" />void restoreFrameStateRequested ( ::QWebFrame*)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when the load of <i>frame</i> is finished
and the application may now update its state accordingly.</p>
<p>This function was introduced in Qt 4.5.</p>
<h3 class="fn"><a name="saveFrameStateRequested" />void saveFrameStateRequested ( ::QWebFrame*, ::QWebHistoryItem*)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted shortly before the history of navigated
pages in <i>frame</i> is changed, for example when navigating back
in the history.</p>
<p>The provided <a href="qwebhistoryitem.html">QWebHistoryItem</a>,
<i>item</i>, holds the history entry of the frame before the
change.</p>
<p>A potential use-case for this signal is to store custom data in
the <a href="qwebhistoryitem.html">QWebHistoryItem</a> associated
to the frame, using <a href="qwebhistoryitem.html#setUserData">QWebHistoryItem.setUserData</a>().</p>
<p>This function was introduced in Qt 4.5.</p>
<h3 class="fn"><a name="scrollRequested" />void scrollRequested (int,int,const ::QRect&)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the content given by
<i>rectToScroll</i> needs to be scrolled <i>dx</i> and <i>dy</i>
downwards and no view was set.</p>
<p><b>See also</b> <a href="qwebpage.html#view">view</a>().</p>
<h3 class="fn"><a name="selectionChanged" />void selectionChanged ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the selection changes, either
interactively or programmatically (e.g. by calling <a href="qwebpage.html#triggerAction">triggerAction</a>() with a selection
action).</p>
<p><b>See also</b> <a href="qwebpage.html#selectedText-prop">selectedText</a>().</p>
<h3 class="fn"><a name="statusBarMessage" />void statusBarMessage (const QString&)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when the statusbar <i>text</i> is changed
by the page.</p>
<h3 class="fn"><a name="statusBarVisibilityChangeRequested" />void statusBarVisibilityChangeRequested (bool)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the visibility of the statusbar
in a web browser window that hosts <a href="qwebpage.html">QWebPage</a> should be changed to
<i>visible</i>.</p>
<h3 class="fn"><a name="toolBarVisibilityChangeRequested" />void toolBarVisibilityChangeRequested (bool)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the visibility of the toolbar in
a web browser window that hosts <a href="qwebpage.html">QWebPage</a> should be changed to
<i>visible</i>.</p>
<h3 class="fn"><a name="unsupportedContent" />void unsupportedContent ( ::QNetworkReply*)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when <a href="qwebpage.html#ErrorDomain-enum">WebKit</a> cannot handle a link
the user navigated to or a web server's response includes a
"Content-Disposition" header with the 'attachment' directive. If
"Content-Disposition" is present in <i>reply</i>, the web server is
indicating that the client should prompt the user to save the
content regardless of content-type. See RFC 2616 sections 19.5.1
for details about Content-Disposition.</p>
<p>At signal emission time the meta-data of the <a href="qnetworkreply.html">QNetworkReply</a> <i>reply</i> is
available.</p>
<p><b>Note:</b> The receiving slot is responsible for deleting the
<a href="qnetworkreply.html">QNetworkReply</a> <i>reply</i>.</p>
<p><b>Note:</b> This signal is only emitted if the <a href="qwebpage.html#forwardUnsupportedContent-prop">forwardUnsupportedContent</a>
property is set to true.</p>
<p><b>See also</b> <a href="qwebpage.html#downloadRequested">downloadRequested</a>().</p>
<h3 class="fn"><a name="viewportChangeRequested" />void viewportChangeRequested ()</h3><p>This is the default overload of this signal.</p><p>Page authors can provide the supplied values by using the
viewport meta tag. More information about this can be found at
<a href="http://developer.apple.com/safari/library/documentation/appleapplications/reference/safariwebcontent/usingtheviewport/usingtheviewport.html">
Safari Reference Library: Using the Viewport Meta Tag</a>.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qwebpage-viewportattributes.html">QWebPage.ViewportAttributes</a>,
<a href="qwebpage.html#preferredContentsSize-prop">setPreferredContentsSize</a>(),
and <a href="qgraphicsitem.html#setScale">QGraphicsWebView.setScale</a>().</p>
<h3 class="fn"><a name="windowCloseRequested" />void windowCloseRequested ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the page requests the web
browser window to be closed, for example through the JavaScript
<tt>window.close()</tt> call.</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.12.1 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qt.io">The Qt Company</a> 2015</td><td align="right" width="25%">Qt 4.8.7</td></tr></table></div></address></body></html>
|