Solved in QWebEngineView, QWebEnginePage , how can I restore scroll positions?
-
Hi Everybody,
I can save scroll position with QWebEnginePage::scrollPosition . How can I reload the positions when the program restarted. I am using QWebEngineView. -
Hi ,
do u want to get the value saved , to read again when the program is launched once again.
in that case use QSettings.Thanks,
-
No, I don't. I mean that I am searching a method to reload the position data back, for example, QWebEnginePage::setScrollPosition. But I didn't find any method like that. There is a bug report here. Is there a way to set scroll positions back?
-
@CKurdu By now I guess only javascript is useable
QWebEngineView()->page()->runJavaScript(QString("window.scrollTo(%1, %2);").arg(scrollX).arg(scrollY));
-
Thanks,
The code solved my problem.