Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt: How to use AA_UseHighDpiPixmaps for two monitors

I'm using two monitors: Retina and Normal.

I read this article http://blog.qt.io/blog/2013/04/25/retina-display-support-for-mac-os-ios-and-x11/

There are:

QIcon::pixmap() has been modified to return a larger pixmap on high-dpi systems. This is a behavior change and can break existing code, so it’s controlled by the AA_UseHighDpiPixmaps application attribute:

qApp->setAttribute(Qt::AA_UseHighDpiPixmaps);

When I set this attribute and run program with one of main monitors, all images look normal.

But if two monitors are active: images in normal monitor look terrible. Qt selects @2x images for normal monitor and resizes their.

How to solve my problem with two monitors?

like image 874
fhdnsYa Avatar asked Apr 27 '15 11:04

fhdnsYa


1 Answers

Try add

   QAppplication::setAttribute(Qt::AA_EnableHighDpiScaling) 

to your main

like image 83
RX-0 Avatar answered Oct 23 '22 10:10

RX-0