QGraphicsWebView Class Reference
[QtWebKit module]
该QGraphicsWebView类允许Web内容被添加到一个GraphicsView。More…
Methods
__init__ (self, QGraphicsItem parent = None)
back (self)
contextMenuEvent (self, QGraphicsSceneContextMenuEvent)
dragEnterEvent (self, QGraphicsSceneDragDropEvent)
dragLeaveEvent (self, QGraphicsSceneDragDropEvent)
dragMoveEvent (self, QGraphicsSceneDragDropEvent)
dropEvent (self, QGraphicsSceneDragDropEvent)
bool event (self, QEvent)
bool findText (self, QString subString, QWebPage.FindFlags options = 0)
focusInEvent (self, QFocusEvent)
bool focusNextPrevChild (self, bool next)
focusOutEvent (self, QFocusEvent)
forward (self)
QWebHistory history (self)
hoverLeaveEvent (self, QGraphicsSceneHoverEvent)
hoverMoveEvent (self, QGraphicsSceneHoverEvent)
QIcon icon (self)
inputMethodEvent (self, QInputMethodEvent)
QVariant inputMethodQuery (self, Qt.InputMethodQuery query)
bool isModified (self)
bool isTiledBackingStoreFrozen (self)
QVariant itemChange (self, QGraphicsItem.GraphicsItemChange change, QVariant value)
keyPressEvent (self, QKeyEvent)
keyReleaseEvent (self, QKeyEvent)
load (self, QUrl url)
load (self, QNetworkRequest request, QNetworkAccessManager.Operation operation = QNetworkAccessManager.GetOperation, QByteArray body = QByteArray())
mouseDoubleClickEvent (self, QGraphicsSceneMouseEvent)
mouseMoveEvent (self, QGraphicsSceneMouseEvent)
mousePressEvent (self, QGraphicsSceneMouseEvent)
mouseReleaseEvent (self, QGraphicsSceneMouseEvent)
QWebPage page (self)
QAction pageAction (self, QWebPage.WebAction action)
paint (self, QPainter painter, QStyleOptionGraphicsItem option, QWidget widget = None)
reload (self)
QPainter.RenderHints renderHints (self)
bool resizesToContents (self)
bool sceneEvent (self, QEvent)
setContent (self, QByteArray data, QString mimeType = QString(), QUrl baseUrl = QUrl())
setGeometry (self, QRectF rect)
setHtml (self, QString html, QUrl baseUrl = QUrl())
setPage (self, QWebPage)
setRenderHint (self, QPainter.RenderHint hint, bool enabled = True)
setRenderHints (self, QPainter.RenderHints hints)
setResizesToContents (self, bool enabled)
setTiledBackingStoreFrozen (self, bool frozen)
QWebSettings settings (self)
setUrl (self, QUrl)
setZoomFactor (self, float)
QSizeF sizeHint (self, Qt.SizeHint which, QSizeF constraint)
stop (self)
QString title (self)
triggerPageAction (self, QWebPage.WebAction action, bool checked = False)
updateGeometry (self)
QUrl url (self)
wheelEvent (self, QGraphicsSceneWheelEvent)
float zoomFactor (self)
Qt Signals
void iconChanged ()
void linkClicked (const QUrl&)
void loadFinished (bool)
void loadProgress (int)
void loadStarted ()
void statusBarMessage (const QString&)
void titleChanged (const QString&)
void urlChanged (const QUrl&)
Detailed Description
该QGraphicsWebView类允许Web内容被添加到一个GraphicsView。
这个类的一个实例呈现从URL网页内容或提供的数据,使用的功能QtWebKit模块。
如果该项目的宽度和高度都没有设置,它们将默认为800和600 ,分别为。如果网页内容比越大,滚动条,如果没有明确禁止将被显示。
Browser Features
许多所提供的功能,信号和属性QWebView也可用于这一项目,使其成为简单,适应现有的代码使用QGraphicsWebView代替QWebView。
该项目采用的是QWebPage反对执行Web内容的呈现,这样就可以用得到page()函数,使文档本身进行访问和修改。
与QWebView使用项目记录浏览历史记录QWebHistory对象,访问使用history()函数。该QWebSettings对象,定义了浏览器的配置可以用以下方式获得settings( )函数,使像插件支持自定义每个项目的功能。
Method Documentation
QGraphicsWebView.__init__ (self, QGraphicsItem parent = None)
该parent的说法,如果不是没有,原因self通过Qt的,而不是PyQt的拥有。
构造一个空QGraphicsWebView与父parent。
See also load( ) 。
QGraphicsWebView.back (self)
这种方法也是一个Qt槽与C + +的签名void back()
。
便利插槽加载以前的文档中通过导航链接建立文件清单。什么都不做,如果没有以前的文档。
See also forward( ) 。
QGraphicsWebView.contextMenuEvent (self, QGraphicsSceneContextMenuEvent)
从重新实现QGraphicsItem.contextMenuEvent( ) 。
QGraphicsWebView.dragEnterEvent (self, QGraphicsSceneDragDropEvent)
从重新实现QGraphicsItem.dragEnterEvent( ) 。
QGraphicsWebView.dragLeaveEvent (self, QGraphicsSceneDragDropEvent)
从重新实现QGraphicsItem.dragLeaveEvent( ) 。
QGraphicsWebView.dragMoveEvent (self, QGraphicsSceneDragDropEvent)
从重新实现QGraphicsItem.dragMoveEvent( ) 。
QGraphicsWebView.dropEvent (self, QGraphicsSceneDragDropEvent)
从重新实现QGraphicsItem.dropEvent( ) 。
bool QGraphicsWebView.event (self, QEvent)
从重新实现QObject.event( ) 。
bool QGraphicsWebView.findText (self, QString subString, QWebPage.FindFlags options = 0)
查找指定的字符串,subString在该页面中,使用给定的options。
如果HighlightAllOccurrences标志传递,函数将突出存在于页面中的所有事件。所有后续调用将延长的亮点,而不是取代它,以出现新的字符串。
如果HighlightAllOccurrences标志不通过,该函数将选择的发生,所有后续调用将取代目前出现的下一个。
要清除选择,只传递一个空字符串。
返回True如果subString结果发现,否则返回False 。
See also QWebPage.selectedText()和QWebPage.selectionChanged( ) 。
QGraphicsWebView.focusInEvent (self, QFocusEvent)
从重新实现QGraphicsItem.focusInEvent( ) 。
bool QGraphicsWebView.focusNextPrevChild (self, bool next)
从重新实现QGraphicsWidget.focusNextPrevChild( ) 。
QGraphicsWebView.focusOutEvent (self, QFocusEvent)
从重新实现QGraphicsItem.focusOutEvent( ) 。
QGraphicsWebView.forward (self)
这种方法也是一个Qt槽与C + +的签名void forward()
。
便利插槽,加载下一个文档中通过导航链接建立文件清单。什么都不做,如果没有下一个文件。
See also back( ) 。
QWebHistory QGraphicsWebView.history (self)
[
返回一个指针,指向的导航网页视图的历史。
它相当于
view->page()->history();
QGraphicsWebView.hoverLeaveEvent (self, QGraphicsSceneHoverEvent)
]($docs-qwebhistory.html)
从重新实现QGraphicsItem.hoverLeaveEvent( ) 。
QGraphicsWebView.hoverMoveEvent (self, QGraphicsSceneHoverEvent)
从重新实现QGraphicsItem.hoverMoveEvent( ) 。
QIcon QGraphicsWebView.icon (self)
[
QGraphicsWebView.inputMethodEvent (self, QInputMethodEvent)
]($docs-qicon.html)
从重新实现QGraphicsItem.inputMethodEvent( ) 。
QVariant QGraphicsWebView.inputMethodQuery (self, Qt.InputMethodQuery query)
从重新实现QGraphicsItem.inputMethodQuery( ) 。
bool QGraphicsWebView.isModified (self)
bool QGraphicsWebView.isTiledBackingStoreFrozen (self)
QVariant QGraphicsWebView.itemChange (self, QGraphicsItem.GraphicsItemChange change, QVariant value)
从重新实现QGraphicsItem.itemChange( ) 。
QGraphicsWebView.keyPressEvent (self, QKeyEvent)
从重新实现QGraphicsItem.keyPressEvent( ) 。
QGraphicsWebView.keyReleaseEvent (self, QKeyEvent)
从重新实现QGraphicsItem.keyReleaseEvent( ) 。
QGraphicsWebView.load (self, QUrl url)
指定的负载url并显示它。
Note:该视图保持不变,直到足够的数据已经到达,以显示新url。
See also setUrl( )url()和urlChanged( ) 。
QGraphicsWebView.load (self, QNetworkRequest request, QNetworkAccessManager.Operation operation = QNetworkAccessManager.GetOperation, QByteArray body = QByteArray())
加载一个网络请求,request使用中规定的方法operation。
body是可选的,并且仅用于POST操作。
Note:该视图保持不变,直到足够的数据已经到达,以显示新的URL。
See also url()和urlChanged( ) 。
QGraphicsWebView.mouseDoubleClickEvent (self, QGraphicsSceneMouseEvent)
从重新实现QGraphicsItem.mouseDoubleClickEvent( ) 。
QGraphicsWebView.mouseMoveEvent (self, QGraphicsSceneMouseEvent)
从重新实现QGraphicsItem.mouseMoveEvent( ) 。
QGraphicsWebView.mousePressEvent (self, QGraphicsSceneMouseEvent)
从重新实现QGraphicsItem.mousePressEvent( ) 。
QGraphicsWebView.mouseReleaseEvent (self, QGraphicsSceneMouseEvent)
从重新实现QGraphicsItem.mouseReleaseEvent( ) 。
QWebPage QGraphicsWebView.page (self)
[
返回一个指针,指向底层的网页。
]($docs-qwebpage.html)
QAction QGraphicsWebView.pageAction (self, QWebPage.WebAction action)
返回一个指针,指向一个QAction封装指定网络行动action。
QGraphicsWebView.paint (self, QPainter painter, QStyleOptionGraphicsItem option, QWidget widget = None)
从重新实现QGraphicsItem.paint( ) 。
QGraphicsWebView.reload (self)
这种方法也是一个Qt槽与C + +的签名void reload()
。
重新加载当前文档。
See also stop()和loadStarted( ) 。
QPainter.RenderHints QGraphicsWebView.renderHints (self)
[
bool QGraphicsWebView.resizesToContents (self)
bool QGraphicsWebView.sceneEvent (self, QEvent)
]($docs-index.htm)
从重新实现QGraphicsItem.sceneEvent( ) 。
QGraphicsWebView.setContent (self, QByteArray data, QString mimeType = QString(), QUrl baseUrl = QUrl())
设置捲筒纸graphicsitem的内容以指定的内容data。如果mimeType参数为空它是目前假设内容是HTML,但在未来的版本中,我们可能会引入自动检测。
在内容引用的外部对象的位置相对baseUrl。
该data立即加载;外部对象异步加载。
See also load( )setHtml()和QWebFrame.toHtml( ) 。
QGraphicsWebView.setGeometry (self, QRectF rect)
从重新实现QGraphicsLayoutItem.setGeometry( ) 。
QGraphicsWebView.setHtml (self, QString html, QUrl baseUrl = QUrl())
设置Web视图的内容的指定html。
外部对象,如样式表或HTML文档中引用的图片的位置相对于baseUrl。
该html立即加载;外部对象异步加载。
使用此方法时, WebKit的假定外部资源,例如JavaScript程序或样式表,除非另有规定被编码为UTF -8 。例如,外部脚本的编码可以通过HTML脚本标记的charset属性来指定。备选地,编码也可以由Web服务器指定。
这相当于一个方便的功能,使用setContent ( HTML , “为text / html ” , baseURL即可) 。
Warning:此功能仅用于HTML ,为其他MIME类型(即XHTML , SVG )setContent( )应该使用。
See also load( )setContent( )QWebFrame.toHtml()和QWebFrame.setContent( ) 。
QGraphicsWebView.setPage (self, QWebPage)
品牌page网页graphicsitem的新网页。
父QObject该页面提供的仍然是对象的所有者。如果当前文档是Web视图的孩子,它会被删除。
See also page( ) 。
QGraphicsWebView.setRenderHint (self, QPainter.RenderHint hint, bool enabled = True)
If enabled诚然,启用指定的渲染hint否则禁用它。
此功能被引入Qt的4.8 。
See also renderHints和QPainter.renderHints( ) 。
QGraphicsWebView.setRenderHints (self, QPainter.RenderHints hints)
QGraphicsWebView.setResizesToContents (self, bool enabled)
QGraphicsWebView.setTiledBackingStoreFrozen (self, bool frozen)
QWebSettings QGraphicsWebView.settings (self)
[
返回一个指针,指向视图/页面设置特定对象。
它相当于
view->page()->settings();
]($docs-qwebsettings.html)
See also QWebSettings.globalSettings( ) 。
QGraphicsWebView.setUrl (self, QUrl)
QGraphicsWebView.setZoomFactor (self, float)
QSizeF QGraphicsWebView.sizeHint (self, Qt.SizeHint which, QSizeF constraint)
从重新实现QGraphicsLayoutItem.sizeHint( ) 。
QGraphicsWebView.stop (self)
这种方法也是一个Qt槽与C + +的签名void stop()
。
便利插槽,停止加载该文件。
See also reload()和loadFinished( ) 。
QString QGraphicsWebView.title (self)
QGraphicsWebView.triggerPageAction (self, QWebPage.WebAction action, bool checked = False)
触发指定的action。如果是指定了辨认的动作checked假定状态。
See also pageAction( ) 。
QGraphicsWebView.updateGeometry (self)
从重新实现QGraphicsLayoutItem.updateGeometry( ) 。
QUrl QGraphicsWebView.url (self)
[
QGraphicsWebView.wheelEvent (self, QGraphicsSceneWheelEvent)
]($docs-qurl.html)
从重新实现QGraphicsItem.wheelEvent( ) 。
float QGraphicsWebView.zoomFactor (self)
Qt Signal Documentation
void iconChanged ()
这是该信号的默认超载。
这个信号时页面的图标被加载或改变被发射。
为了让图标加载,则需要使用设置一个图标数据库路径QWebSettings.setIconDatabasePath( ) 。
See also icon()和QWebSettings.setIconDatabasePath( ) 。
void linkClicked (const QUrl&)
这是该信号的默认超载。
每当用户点击一个链接这个信号被发射以及页面的linkDelegationPolicy属性设置为处理委讬给指定的链接url。
See also QWebPage.linkDelegationPolicy( ) 。
void loadFinished (bool)
这是该信号的默认超载。
当页面的加载完成时,这个信号被发射。ok将指示负载是否成功,或发生任何错误。
See also loadStarted( ) 。
void loadProgress (int)
这是该信号的默认超载。
每个网页中的元素完成加载和整体加载进度前进时,这个信号被发射。
这个信号可以跟踪所有子帧的进展。
电流值是由所提供progress和秤从0到100 ,这是默认范围QProgressBar。
See also loadStarted()和loadFinished( ) 。
void loadStarted ()
这是该信号的默认超载。
当开始页面的新负载,这个信号被发射。
See also loadProgress()和loadFinished( ) 。
void statusBarMessage (const QString&)
这是该信号的默认超载。
这个信号被发射时,状态栏text由页改变。
void titleChanged (const QString&)
这是该信号的默认超载。
这个信号被发射时的title的主框架的改变。
See also title( ) 。
void urlChanged (const QUrl&)
这是该信号的默认超载。
这个信号被发射时的url的观点变化。