[Development] Revisiting high-DPI configuration options

Morten Sorvig Morten.Sorvig at qt.io
Tue Jul 19 15:04:46 CEST 2016


> On 19 Jul 2016, at 10:57, Prav <pr12og2 at programist.ru> wrote:
> 
> May be Qt need to move accents from getting right DPI to making it user changeable ... FRACTIONALLY (as a good new practice)!
> Like 10-20 % steps ... not just 2,3,4,5.
> 
> I do not see much trend in Qt-discussions/apps-interfaces about user-defined scale factor. But only THIS is important to user.
> And NOT DPI ;)


I would like to separate the use cases of adapting to hardware with
different DPI and adapting to user preferences. We can support both
and they don’t have to be mutually exclusive. They may share 
implementation details.

Is user control an OS setting or an application setting? Many
windowing systems have global font preferences which Qt should respect.

If we want to re-use the existing high-DPI work we can add

	QGuiApplication::setGlobalScaleFactor(qreal factor);

Setting the factor to something other than 1 would uniformly scale all
application windows. This would interact with the current high-DPI support:
a factor of 1.5 on a 2x display gives an effective devicePixelRatio of 3,
ensuing a consistent visual UI size.

Morten



More information about the Development mailing list