当前位置: 首页>>代码示例>>Python>>正文


Python QtWebKit.QWebView方法代码示例

本文整理汇总了Python中PyQt4.QtWebKit.QWebView方法的典型用法代码示例。如果您正苦于以下问题:Python QtWebKit.QWebView方法的具体用法?Python QtWebKit.QWebView怎么用?Python QtWebKit.QWebView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt4.QtWebKit的用法示例。


在下文中一共展示了QtWebKit.QWebView方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_code

# 需要导入模块: from PyQt4 import QtWebKit [as 别名]
# 或者: from PyQt4.QtWebKit import QWebView [as 别名]
def get_code(url, size=(640, 480), title="Google authentication"):
    """Open a QT webkit window and return the access code."""
    app = QtGui.QApplication([])
    dialog = QtGui.QDialog()
    dialog.setWindowTitle(title)
    dialog.resize(*size)
    webview = QtWebKit.QWebView()
    webpage = QtWebKit.QWebPage()
    webview.setPage(webpage)           
    webpage.loadFinished.connect(lambda: _on_qt_page_load_finished(dialog, webview))
    webview.setUrl(QtCore.QUrl.fromEncoded(url))
    layout = QtGui.QGridLayout()
    layout.addWidget(webview)
    dialog.setLayout(layout)
    dialog.authorization_code = None
    dialog.show()
    app.exec_()
    return dialog.authorization_code 
开发者ID:tokland,项目名称:shoogle,代码行数:20,代码来源:browser.py

示例2: propose_rebuy_qt

# 需要导入模块: from PyQt4 import QtWebKit [as 别名]
# 或者: from PyQt4.QtWebKit import QWebView [as 别名]
def propose_rebuy_qt(amount):
    web = QWebView()
    box = QMessageBox()
    box.setFixedSize(200, 200)

    credentials = read_local_oauth_credentials()
    questionText = _('Rebuy ') + format_satoshis(amount) + _(' BTC?')
    if credentials:
        credentials.refresh()
    if credentials and not credentials.invalid:
        credentials.store_locally()
        totalPrice = get_coinbase_total_price(credentials, amount)
        questionText += _('\n(Price: ') + totalPrice + _(')')

    if not question(box, questionText):
        return

    if credentials:
        do_buy(credentials, amount)
    else:
        do_oauth_flow(web, amount)
    return web 
开发者ID:mazaclub,项目名称:encompass,代码行数:24,代码来源:coinbase_buyback.py

示例3: mainPyQt4Simple

# 需要导入模块: from PyQt4 import QtWebKit [as 别名]
# 或者: from PyQt4.QtWebKit import QWebView [as 别名]
def mainPyQt4Simple():
    # 必要なモジュールのimport
    from PyQt4.QtCore import QUrl
    from PyQt4.QtGui import QApplication
    from PyQt4.QtWebKit import QWebView

    url = 'https://github.com/tody411/PyIntroduction'

    app = QApplication(sys.argv)

    # QWebViewによるWebページ表示
    browser = QWebView()
    browser.load(QUrl(url))
    browser.show()

    sys.exit(app.exec_())

## PyQt4でのWebブラウザー作成(Youtube用). 
开发者ID:tody411,项目名称:PyIntroduction,代码行数:20,代码来源:web_browser.py

示例4: setupUi

# 需要导入模块: from PyQt4 import QtWebKit [as 别名]
# 或者: from PyQt4.QtWebKit import QWebView [as 别名]
def setupUi(self, ChangeLog):
        ChangeLog.setObjectName(_fromUtf8("ChangeLog"))
        ChangeLog.resize(714, 557)
        self.verticalLayout = QtGui.QVBoxLayout(ChangeLog)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.webView = QtWebKit.QWebView(ChangeLog)
        self.webView.setUrl(QtCore.QUrl(_fromUtf8("about:blank")))
        self.webView.setObjectName(_fromUtf8("webView"))
        self.verticalLayout.addWidget(self.webView)
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.buttonBox = QtGui.QDialogButtonBox(ChangeLog)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
        self.horizontalLayout.addWidget(self.buttonBox)
        spacerItem = QtGui.QSpacerItem(600000, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.verticalLayout.addLayout(self.horizontalLayout)

        self.retranslateUi(ChangeLog)
        QtCore.QMetaObject.connectSlotsByName(ChangeLog) 
开发者ID:gltn,项目名称:stdm,代码行数:23,代码来源:ui_change_log.py

示例5: __init__

# 需要导入模块: from PyQt4 import QtWebKit [as 别名]
# 或者: from PyQt4.QtWebKit import QWebView [as 别名]
def __init__(self, mem, syms=None, parent=None):
        QtWebKit.QWebView.__init__(self, parent=parent)
        e_memcanvas.MemoryCanvas.__init__(self, mem, syms=syms)

        self.setContent(e_q_html.template, 'application/xhtml+xml')
        #self.setHtml(e_q_html.template)
        frame = self.page().mainFrame()
        self._canv_cache = None
        self._canv_rend_middle = False

        self._canv_curva = None
        self._canv_rendtagid = '#memcanvas'
        self._canv_hotkeys = {}

        self.page().mainFrame().addToJavaScriptWindowObject('vnav', self) 
开发者ID:joxeankoret,项目名称:nightmare,代码行数:17,代码来源:memcanvas.py

示例6: keyPressEvent

# 需要导入模块: from PyQt4 import QtWebKit [as 别名]
# 或者: from PyQt4.QtWebKit import QWebView [as 别名]
def keyPressEvent(self, event):

        key = event.key()
        txt = str(event.text())
        #print 'KEY',hex(key),repr(txt)

        mods = int(event.modifiers())

        keytxt = ''
        if key < 255:

            keytxt = chr(key).lower()

            if mods & QMOD_SHIFT:
                keytxt = keytxt.upper()

            if mods & QMOD_CTRL:
                keytxt = 'ctrl+' + keytxt

        #print 'KEYTXT: %s' % keytxt

        handler = self._canv_hotkeys.get(keytxt)
        if handler == None:
            handler = self._canv_hotkeys.get(key)

        if handler != None:
            handler(self, key)
            event.accept()

        return QtWebKit.QWebView.keyPressEvent(self, event) 
开发者ID:joxeankoret,项目名称:nightmare,代码行数:32,代码来源:memcanvas.py

示例7: __init__

# 需要导入模块: from PyQt4 import QtWebKit [as 别名]
# 或者: from PyQt4.QtWebKit import QWebView [as 别名]
def __init__(self, oa_url, oa_result_base, args):
        super(OAuth2Application, self).__init__(args)
        self.oa_result_base = oa_result_base
        self.oa_result = oa_result_base
        self.browser = QWebView()
        self.browser.loadFinished.connect(self.__result_available)
        self.browser.load(QUrl(oa_url))
        self.browser.show()
        self.exec_() 
开发者ID:scusjs,项目名称:baiduyun,代码行数:11,代码来源:oauth_ui.py

示例8: tryout_with_qt

# 需要导入模块: from PyQt4 import QtWebKit [as 别名]
# 或者: from PyQt4.QtWebKit import QWebView [as 别名]
def tryout_with_qt():
    import sys
    from PyQt4 import QtCore, QtWebKit, QtWidgets
    from os.path import join, dirname
    import ibeis.viz

    class Browser(QtWebKit.QWebView):

        def __init__(self):
            super(Browser, self).__init__()
            self.loadFinished.connect(self._result_available)

        def _result_available(self, ok):
            pass
            #frame = self.page().mainFrame()
            #print(unicode(frame.toHtml()).encode('utf-8'))

    app = QtWidgets.QApplication(sys.argv)

    view = Browser()
    view.show()
    path = join(dirname(ibeis.viz.__file__), 'd3_example.html')
    view.load(QtCore.QUrl(path))
    view.page().settings().setAttribute(
        QtWebKit.QWebSettings.DeveloperExtrasEnabled, True
    )

    insp = QtWebKit.QWebInspector()
    insp.setPage(view.page())
    insp.show()

    app.exec_() 
开发者ID:Erotemic,项目名称:ibeis,代码行数:34,代码来源:viz_graph.py

示例9: mainPyQt4Youtube

# 需要导入模块: from PyQt4 import QtWebKit [as 别名]
# 或者: from PyQt4.QtWebKit import QWebView [as 别名]
def mainPyQt4Youtube():
    # 必要なモジュールのimport
    from PyQt4.QtCore import QUrl
    from PyQt4.QtGui import QApplication
    from PyQt4.QtWebKit import QWebView, QWebSettings
    from PyQt4.QtNetwork import QNetworkProxyFactory

    url = 'https://www.youtube.com/?hl=ja&gl=JP'

    app = QApplication(sys.argv)

    # Youtube動画を読み込むための設定
    QNetworkProxyFactory.setUseSystemConfiguration(True)
    QWebSettings.globalSettings().setAttribute(QWebSettings.PluginsEnabled, True)
    QWebSettings.globalSettings().setAttribute(QWebSettings.DnsPrefetchEnabled, True)
    QWebSettings.globalSettings().setAttribute(QWebSettings.JavascriptEnabled, True)
    QWebSettings.globalSettings().setAttribute(QWebSettings.OfflineStorageDatabaseEnabled, True)
    QWebSettings.globalSettings().setAttribute(QWebSettings.AutoLoadImages, True)
    QWebSettings.globalSettings().setAttribute(QWebSettings.LocalStorageEnabled, True)
    QWebSettings.globalSettings().setAttribute(QWebSettings.PrivateBrowsingEnabled, True)
    QWebSettings.globalSettings().setAttribute(QWebSettings.DeveloperExtrasEnabled, True)

    # QWebViewによるWebページ表示
    browser = QWebView()
    browser.load(QUrl(url))
    browser.setEnabled(True)
    browser.show()
    sys.exit(app.exec_())


## PyQt5でのWebブラウザー作成. 
开发者ID:tody411,项目名称:PyIntroduction,代码行数:33,代码来源:web_browser.py

示例10: __init__

# 需要导入模块: from PyQt4 import QtWebKit [as 别名]
# 或者: from PyQt4.QtWebKit import QWebView [as 别名]
def __init__(self, parent=None):
        QWidget.__init__(self, parent, Qt.WindowStaysOnTopHint | Qt.Window)
        self.setVisible(False)

        self._view_help = QWebView(self)
        self._view_help.load(resource_html("helppage.html"))
        self._view_help.show()

        f_layout = QHBoxLayout()
        f_layout.addWidget(self._view_help)

        self.setLayout(f_layout) 
开发者ID:equinor,项目名称:segyviewer,代码行数:14,代码来源:helpwindow.py

示例11: __init__

# 需要导入模块: from PyQt4 import QtWebKit [as 别名]
# 或者: from PyQt4.QtWebKit import QWebView [as 别名]
def __init__(self):
        QtWebKit.QWebView.__init__(self)
        self.installEventFilter(self) 
开发者ID:EricsonWillians,项目名称:Open-Browser,代码行数:5,代码来源:run.py

示例12: loadUrl

# 需要导入模块: from PyQt4 import QtWebKit [as 别名]
# 或者: from PyQt4.QtWebKit import QWebView [as 别名]
def loadUrl(self, url):
        view = QtWebKit.QWebView()
        view.connect(view, QtCore.SIGNAL('loadFinished(bool)'), self.loadFinished)
        view.connect(view, QtCore.SIGNAL('linkClicked(const QUrl&)'), self.linkClicked)
        view.page().setLinkDelegationPolicy(QtWebKit.QWebPage.DelegateAllLinks)
        self.dbx_tabWidget.setCurrentIndex(self.dbx_tabWidget.addTab(view, 'loading...'))
        view.load(url) 
开发者ID:EricsonWillians,项目名称:Open-Browser,代码行数:9,代码来源:run.py

示例13: initUI

# 需要导入模块: from PyQt4 import QtWebKit [as 别名]
# 或者: from PyQt4.QtWebKit import QWebView [as 别名]
def initUI(self):
        self.browser = QtWebKit.QWebView()
        file_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "help.html"))
        local_url = QtCore.QUrl.fromLocalFile(file_path)
        self.browser.load(local_url)

        self.mainLayout = QtGui.QHBoxLayout()
        self.mainLayout.addWidget(self.browser)
        self.setLayout(self.mainLayout) 
开发者ID:tb2097,项目名称:wacom-gui,代码行数:11,代码来源:help.py

示例14: show_docs

# 需要导入模块: from PyQt4 import QtWebKit [as 别名]
# 或者: from PyQt4.QtWebKit import QWebView [as 别名]
def show_docs(self):
        self.docs = QWebView()
        self.docs.load(QUrl("https://pandapower.readthedocs.io"))
        self.docs.setWindowTitle("pandapower Documentation")
        self.docs.show() 
开发者ID:Tooblippe,项目名称:pandapower_gui,代码行数:7,代码来源:pandapower_gui.py


注:本文中的PyQt4.QtWebKit.QWebView方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。