0

I need to show some dynamic web content in my application (let it be application help materials).

I used Qt5.4 with QWebView there. But after switching to Qt5.6 I noticed that QWebKit is deprecated and not supported any more. Thus I decided to replace QWebKit functionality with one from the QWebEngine. After replacing QWebView with QWebEngineView I investigated that some empty folders are created in user folder after launching my application. For example: .QtWebEngineProcess folder and folder which called like my application with dot at the begining.

Is it normal? How can I prevent creating such folders? Any option to disable such behaviour?

IAmInPLS
  • 4,051
  • 4
  • 24
  • 57
Vasyl
  • 404
  • 1
  • 6
  • 19

1 Answers1

0

QWebEngine needs this folder to store some temporal files: like cookies, cache data... See QWebEngineProfile for more details (http://doc.qt.io/qt-5/qwebengineprofile.html#PersistentCookiesPolicy-enum). You could select the default folder in some place:

QWebEngineProfile* defaultProfile = QWebEngineProfile::defaultProfile();
defaultProfile->setCachePath("your folder");
defaultProfile->setPersistentStoragePath("your folder");

Or you can disable it, by changing cookies policy:

QWebEngineProfile::defaultProfile()->setPersistentCookiesPolicy(QWebEngineProfile::NoPersistentCookies);

One more thing, QWebEngine need some folders with translations files, resources ... which should be attached with your exe file to works fine. You can execute in the Qt terminals (example in Windows) in your exe folder:

windeployqt .

and Qt will copy all the files you need. See http://doc.qt.io/qt-5/windows-deployment.html for more details =)

mohabouje
  • 3,867
  • 2
  • 14
  • 28
  • My application does not require to store any cookies and data cache. So I don`t want any excessive folders in user directory. – Vasyl Jul 14 '16 at 16:05
  • So just disable coockies storage: QWebEngineProfile::defaultProfile()->setPersistentCookiesPolicy(QWebEngineProfile::NoPersistentCookies); – mohabouje Jul 14 '16 at 19:12
  • Thanks! I did it. Also I removed all unnecessary folder from user directory. But .QtWebEngineProcess folder still appeared in user folder after my application start. – Vasyl Jul 15 '16 at 13:53