Compose pointer to property of object
Solved
General and Desktop
-
You're most probably dereferencing a null pointer. Signal 11 means SIGSEGV (segmentation error).
wrote on 6 Apr 2016, 08:21 last edited by@jsulm
Yes - Thanks . Problem loacted, but not yet solved:void QTGUI_MainWindow::populateJavaScriptWindowObject() { QWebView * webGUI = qobject_cast<QWebView *>(sender()); webGUI->page()->mainFrame()->addToJavaScriptWindowObject("NativeBridge", this); }
The sender is the JS and not the QWebView and so I do not get the pointer to the QWebView that I need. Instead, the pointer is 0x0 and then - of course - the addToJ... crashes.
Any idea how I get the pointer to the QWebView from which the JS is sending?
Thanks -
What is JS?
-
wrote on 6 Apr 2016, 11:33 last edited by
I posted this as a separate question in the WebKit group.
-
wrote on 6 Apr 2016, 14:57 last edited by
Got it solved :-)
QWebFrame * webGUIframe = qobject_cast<QWebFrame >(sender());
QWebView * webGUI = (QWebView)(webGUIframe->parent())->parent();
webGUI->page()->mainFrame()->addToJavaScriptWindowObject("NativeBridge", this);
21/25