0

javascriptMuExport in webview through pyside(Python package)?

i need to open a webview panel in RV pointing to a custom webpage when the user clicks a button or presses a key. The issue is that i am not able to initialise the default webview using the following code which causes RV to crash:
...
MuSymbol("webview.WebViewMode.initView")(MuSymbol('rvui.minorModeFromName')("webview"), 0, "http://google.com", "We", False, True, 300)
...

so instead i tried creating my own python package where i initialse a minor mode which attaches a webview to a dockwidget, the issue there is that i am not able to export rvsession to the webview's mainFrame using the following code which throws a warning:
...
commands.javascriptMuExport(self._widget.webView.page().mainFrame())
...
WARNING: QObject::connect: Cannot connect (null)::javaScriptWindowObjectCleared() to Rv::RvJavaScriptObject::selfInstall()

and the webview's inspector says that rvsession is a undeclared variable.

Is there a recommended way of using the builtin webview ?

1 条评论

  • 0
    Avatar
    Badri Gs

    Solved Using the following:

    ...

    commands.javascriptExport( getCppPointer(webView.page().mainFrame())[0] )

    ...

    seems like the getCppPointer returns a tuple and JavascriptExport expects a int

    it would be awesome to get some documentation regarding the new qtutils :D

     

请先登录再写评论。