2

I want to emulate html rendering on a device mobile using Qt webkit integration.

In chrome developer tools there is an option to do this which changes window.screen property according to user input. I searched for a solution for 2 days but it seems that Qt does not provide a functionality through its api for overriding device screen size.(for web page size or viewport size there is an option but I need to override device screen size)

It seems that in webkitgtk+ there is such functionality: After calling webkit_viewport_attributes_recompute () function the viewport-attributes-recompute-requested event is emited and the device size can be overriden.

http://webkitgtk.org/reference/webkitgtk/stable/WebKitViewportAttributes.html

Emil Condrea
  • 9,705
  • 7
  • 33
  • 52
  • Qt exposes those at least to QML via WebKit.Experimental (see http://code.woboq.org/qt5/qtwebkit/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp.html, search for "deviceWidth"), not sure if non-QML APIs expose this too, though (requires studying the docs and sources). – mlvljr Sep 12 '14 at 08:28

0 Answers0