0

I'm using QT 5.8 and trying to load webpage using QAxWidget (set to IE) that displays HTML 5 empty canvas.

QString url = "https://h3manth.com/demo/canvas/full-page.html";
ui.browser->dynamicCall("Navigate(const QString&)", url);

Running the same url directly in IE works fine. But when running it from my simple QT application I'm getting script error:

enter image description here

And getting the blank view as a result even when pressing 'Yes' in the dialog.

Any ideas for possible solution?

marcin
  • 125
  • 1
  • 14
  • Please post a complete minimum example to demonstrate what's going on. Put everything into a single `main.cpp` file, and edit the question to include that. – Kuba hasn't forgotten Monica Mar 28 '17 at 20:34
  • 1
    try logging out the user agent string, I'm assuming that 'IE' uses some old IE version on your system. – LJᛃ Mar 28 '17 at 23:52
  • Any particular reason of using IE with QAxWidget instead of QWebEngineView ? – Kamil Klimek Mar 29 '17 at 07:42
  • @LJᛃ - thanks I will try user agent string and post results here. – marcin Mar 29 '17 at 09:06
  • @KamilKlimek - QT WebEngine takes 400MB of RAM when running on 4K monitor in full screen mode and displaying only empty canvas (I tested by opening this url: "https://h3manth.com/demo/canvas/full-page.html"). That's way too much. – marcin Mar 29 '17 at 09:08
  • @LJᛃ Printing the web agent reveled that embedded IE was really old (Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; Win64; x64; Trident/7.0; .NET4.0C; .NET4.0E)) I also found the solution how to make sure IE 11 is used instead, it has to be done by modifying the reg keys: https://msdn.microsoft.com/en-us/library/ee330730(v=vs.85).aspx So after setting the right reg keys, restarting the machine everything was working fine and the user agent reported: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko – marcin Mar 29 '17 at 10:52
  • @KamilKlimek, I exaggerated the memory consumption by QTWebEngine. So it was not 400MB on 4K monitor when opening (https://h3manth.com/demo/canvas/full-page.html) It was 207MB for the simple app that was only using the QTWebEngine and 14MB for the qt webengine process. – marcin Mar 29 '17 at 11:00

1 Answers1

0

Modifying the reg keys as described on msdn: msdn.microsoft.com/en-us/library/ee330730(v=vs.85).asp ensures using the intended IE version for "embedded" browser

marcin
  • 125
  • 1
  • 14