It now works: QString scriptSource = "if (typeof Wizard_OnNext == 'function') { wizard.nextButtonClicked.connect(Wizard_OnNext); }"; ui.webView->page()->mainFrame()->evaluateJavaScript(scriptSource);