本文整理汇总了Python中PySide.QtWebKit.QWebView.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QWebView.__init__方法的具体用法?Python QWebView.__init__怎么用?Python QWebView.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtWebKit.QWebView
的用法示例。
在下文中一共展示了QWebView.__init__方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PySide.QtWebKit import QWebView [as 别名]
# 或者: from PySide.QtWebKit.QWebView import __init__ [as 别名]
def __init__(self, parent=None, userData=None,inspector = True):
QWebView.__init__(self, parent)
settings = QWebSettings.globalSettings()
settings.setFontFamily(QWebSettings.StandardFont, 'Helvetica')
settings.setFontSize(QWebSettings.DefaultFontSize, 12)
self.webpage = page = PtWebPage(self)
self.setPage(page)
self.connect(self, SIGNAL('loadFinished(bool)'), self.onLoadFinished)
self.settings().setAttribute(
QWebSettings.WebAttribute.DeveloperExtrasEnabled, True)
#path = os.getcwd()
#self.settings().setUserStyleSheetUrl(QUrl.fromLocalFile(path + "/myCustom.css"))
font = QFont("Helvetica")
font.setPixelSize(12)
self.setFont(font)
# or globally:
# QWebSettings.globalSettings().setAttribute(
# QWebSettings.WebAttribute.DeveloperExtrasEnabled, True)
if inspector:
self.inspector = QWebInspector()
self.inspector.setPage(self.page())
self.inspector.hide()
self.page().setLinkDelegationPolicy(QWebPage.DelegateAllLinks)
self.page().linkClicked.connect(self._on_page_link_clicked)
示例2: __init__
# 需要导入模块: from PySide.QtWebKit import QWebView [as 别名]
# 或者: from PySide.QtWebKit.QWebView import __init__ [as 别名]
def __init__(self, app):
QWebView.__init__(self)
# By storing a reference to the application which started this
# instance, we will be able to close the application once we get what
# we want
self.parent_app = app
# connect the loadFinished signal to a method defined by us.
# loadFinished is the signal which is triggered when a page is loaded
self.loadFinished.connect(self._load_finished)
示例3: __init__
# 需要导入模块: from PySide.QtWebKit import QWebView [as 别名]
# 或者: from PySide.QtWebKit.QWebView import __init__ [as 别名]
def __init__(self, authorize_url):
"""
Custom Webview widget to handle authentication of an authorisation url.
authorize_url is string returned via flow_from_clientsecrets.step1_get_authorize_url object
If Authorization is successful, returns an access code required for step2 of oauth flow object
"""
QWebView.__init__(self)
self.URL = QUrl.fromPercentEncoding(str(authorize_url))
self.setUrl(self.URL)
self.titleChanged.connect(self.handleTitleChange)
self.load(self.URL)
self.setWindowFlags(Qt.WindowStaysOnTopHint | Qt.Popup)
示例4: __init__
# 需要导入模块: from PySide.QtWebKit import QWebView [as 别名]
# 或者: from PySide.QtWebKit.QWebView import __init__ [as 别名]
def __init__ ( self, parent, editor ):
""" Initializes the object.
"""
QWebView.__init__( self, parent )
self._editor = editor
示例5: __init__
# 需要导入模块: from PySide.QtWebKit import QWebView [as 别名]
# 或者: from PySide.QtWebKit.QWebView import __init__ [as 别名]
def __init__(self,*args):
QWebView.__init__(self)
示例6: __init__
# 需要导入模块: from PySide.QtWebKit import QWebView [as 别名]
# 或者: from PySide.QtWebKit.QWebView import __init__ [as 别名]
def __init__(self, display=True):
self.app = QApplication([])
QWebView.__init__(self)
if display:
self.show() # show the browser