Disable Windows DPI Awareness only for printing
Hi,
I am working on GUI application under Windows 7 using Qt 5.5. The basic purpose of the application is to visualize and print some data (both, text and simple graphics).
During testing, I realized that the printout (and also the visualization in a simple form using Qt scene and GraphicsView) doesn't look good in case DPI scaling is set to e.g. 150 %. The text seems a lot larger (1.5 times larger), however the graphics remain same in size as working with 100 % DPI scaling.
I set the dpiawareness of my application to 0 (via qt.conf file). By doing that, the printout looks pretty well, independent of DPI scaling setting. However the app itself looks a little blurry (e.g. Open File Dialog, etc. ...).
Is there a way to leave the application's dpiawareness on the default value while ensuring that the printout looks always the same, independent of DPI scaling setting?
Re: Disable Windows DPI Awareness only for printing
How do you print?
By passing a QPrinter to QGraphicsScene::render()?
Cheers,
_
Re: Disable Windows DPI Awareness only for printing
Yes. Pretty much like this:
Code:
QPrinter printer
( QPrinterInfo
::defaultPrinter() );
m_pScene->render( &painter, ... );
Re: Disable Windows DPI Awareness only for printing
Hmm.
In Qt 5.6 you could have tried switching to Qt::AA_DisableHighDpiScaling during printing, but I didn't find any indication is something like that is also possible in 5.5 during runtime.
Cheers,
_