Skip to content
  • 0 Votes
    8 Posts
    2k Views
    JoeCFDJ
    @Tiny-Leaf Try the following code. The length of three segments should be same. drawLine(ctx, 50, 50, 150, 50); drawLine(ctx, 150, 50, 50, 50); drawLine(ctx, 150, 100, 50, 100); function drawLine(ctx, x1, y1, x2, y2) { ctx.beginPath() ctx.moveTo(x1, y1) ctx.lineTo(x2, y2) ctx.stroke() } BTW: you may somehow avoid to draw a line twice if possible. It is not efficient.
  • Get confirmation that a key has reached JS

    Solved Qt WebKit webview webkit jscript keyevent
    33
    0 Votes
    33 Posts
    14k Views
    McLionM
    Finally coming back to this ... and found the issue :-) DBGWebPage *NewPage = new DBGWebPage(webGUI); The new Page was not a child of the correct object. I checked pointers as suggested. The connect of the JS bridge showed no issues. However, the first call from JS (signal javaScriptWindowObjectCleared() calling my populateJavaScriptWindowObject()) crashed on QWebFrame * webGUIframe = qobject_cast<QWebFrame *>(sender()); QWebView * webGUI = (QWebView*)(webGUIframe->parent())->parent(); obviously because it was pointing to 'nothing' instead of a QWebView. Thank you guys for all the hints.