QWebEngineView high DPI awareness
mbise1993 last edited by mbise1993
Hi all, I'm developing an application that uses QWebEngineView for the UI. I've been iterating on the UI part of it using Chrome to take advantage of hot reloading, but I just noticed after testing it out with the QWebEngineView that the scaling is different. I'm on Windows 10 and have my scale setting set to 125%, and Chrome appears to respect that, but in the Qt app everything is much smaller. I'm calling
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);first thing in
main, but it appears to have no affect since when I disable it, everything looks the same. If I set the
QT_SCALE_FACTORto 1.25 then things appear as expected, but that would require me to calculate the user's scaling settings manually, which I guess wouldn't be a huge deal but I would like to avoid it if possible. I admittedly only have a basic understanding of high DPI settings, so am I wrong in thinking that what I see in QtWebEngineView should be the same as what I see in Chrome? Or is there a setting that I'm missing or another explanation for this behavior? Thanks!!