Reputation: 1
I.m using Qt 6.6.3, VS 2022, python 311 to plot something like 3D image. When I create QWebEngineView object like
ui.setupUi(this);
webEnginePlot = new QWebEngineView(tabPlot);
webEnginePlot->setObjectName("webEnginePlot");
webEnginePlot->setUrl(QUrl(QString::fromUtf8("about:blank")));
MainWindow include
[ MenuBar ] [QDockWidget QStackedWidget]
QDockWidget on the left, QStackedWidget on the right. QDockWidget include QTreeView, QStackedWidget include QWebEngine
Question 1: Why the whole surface flashing(or hide, or white screen) 1 or 2 seconds? I found out it is loading QtWebEngineProcessd.exe
When I try to new QWebEngineView() before QTreeView init, nothing wrong. And when I init QTreeView first, then new QWebEngineView(), and the whole soft began to flashing(or hide, or white screen) to loading the QtWebEngineProcessd;
Question 2: I use C++ PythonAPI to draw a plot using plotly, and come out a file like a.html, and then I load the html file with QWebEngineView, and it showed up "js: Uncaught Error: Something went wrong with axis scaling"
QUrl localUrl = QUrl::fromLocalFile(htmlFile);
ui.webEnginePlot->setUrl(localUrl);
ui.webEnginePlot->show();
But when I enter the QWidget and click my button to draw it again, and it works. Why when initializing, it will report an error?
How to solve the problem. Help me please!
Upvotes: 0
Views: 66