I am trying to implement the displaying of a web page in Qt.I add one buttoon ,when clicked,update the new html content,and Re-execution the js,but when clicked 2 times,Popup execute 2 times,when clicked 3 times,Popup execute 3 times, I think, it add js to the html content many times. what should i do make the Popup execute 1 times? [I want to clear previous html content when click the button.but i don't know how to do ]
in .h . QWebEngineView *articleWebView;
in .cpp: articleWebView = new QWebEngineView();
in js. function abs() {alert("test");}
QString articleJS = readArticleJs ();
QString funcStr = QString("\n abs(\"%1 \",\"%2\");").arg(highlightWords1).arg(highlightSentece1);
articleJS.append (funcStr);
this->articleWebView->page ()->runJavaScript (articleJS);