コード例 #1
0
    def testPlugin(self):
        view = QWebView()
        fac = PluginFactory()
        view.page().setPluginFactory(fac)
        QWebSettings.globalSettings().setAttribute(QWebSettings.PluginsEnabled, True)

        view.load(QUrl(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'qmlplugin', 'index.html')))

        view.resize(840, 600)
        view.show()

        QTimer.singleShot(500, self.app.quit)

        self.app.exec_()
コード例 #2
0
def main():

    app = QApplication([])

    view = QWebView()
    fac = PluginFactory()
    view.page().setPluginFactory(fac)
    QWebSettings.globalSettings().setAttribute(QWebSettings.PluginsEnabled,
                                               True)

    view.load(QUrl(sys.argv[1]))

    view.resize(840, 600)
    view.show()

    return app.exec_()
コード例 #3
0
ファイル: qml_plugin_test.py プロジェクト: zhoub/pyside2
    def testPlugin(self):
        view = QWebView()
        fac = PluginFactory()
        view.page().setPluginFactory(fac)
        QWebSettings.globalSettings().setAttribute(QWebSettings.PluginsEnabled,
                                                   True)

        view.load(
            QUrl(
                os.path.join(os.path.abspath(os.path.dirname(__file__)),
                             'qmlplugin', 'index.html')))

        view.resize(840, 600)
        view.show()

        QTimer.singleShot(500, self.app.quit)

        self.app.exec_()