Re: [Development] New approach to hi-dpi and coordinate system for layouts in Qt 6

2017-09-22 Thread Stephen Kelly via Development
> It's not like devices change DPI, though if
> you have multiple monitors this assumption may be invalid if the user moves
> the window to between screens or another screen.

This is indeed the topic of this thread. The other issues you raise look like 
they should be raised on another thread.

Thanks,

Stephen.
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] New approach to hi-dpi and coordinate system for layouts in Qt 6

2017-09-22 Thread Jason H
First let me say that I have no idea what I'm talking about.

That said, given all the times I've used Qt and experienced issues,
I only remember had problems when dealing with fonts, and the Canvas element on 
IOS. (I think the Canvas still is blurry)
I've used headless Qt for printing charts (remember Qt Charts?) and all the 
words came out elided. (Qt 5.2 on Amazon AMI). Rendering at 72 DPI worked but 
300 DPI was the problem. IN the end I was never happy, I kept the strings short 
to avoid eliding and scaled the text up while also increasing the DPI. 
Similarly, iOS seemed to have the most font issues. I liked the idea of using 
point size for text, but it wouldn't ever behave how it should (there were some 
other issues with not being able to find what size text was, I think this has 
been fixed)

Given all my problems, I found myself wondering why points vs pixels was so 
hard? The I figured everything specified in points should be converted to 
display pixels via device metrics? It's not like devices change DPI, though if 
you have multiple monitors this assumption may be invalid if the user moves the 
window to between screens or another screen. 



___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] New approach to hi-dpi and coordinate system for layouts in Qt 6

2017-09-22 Thread Stephen Kelly via Development


> From: doom.ooseve...@gmail.com [mailto:doom.ooseve...@gmail.com] On Behalf Of 
> Jean-Michaël Celerier
> Sent: Friday 22 September 2017 13:25
> To: Stephen Kelly 
> Cc: Jean-Michaël Celerier ; 
> development@qt-project.org
> Subject: Re: [Development] New approach to hi-dpi and coordinate system for 
> layouts in Qt 6
> 
> Indeed, this seemed too easy :p 

Right ;p.

> Sligthly related, but the second approach with the coordinates makes me 
> remember
> this bug report (about QML, but the problem space is similar and proposed 
> solutions involved adding units to values): 
> https://bugreports.qt.io/browse/QTBUG-11655

This is a request for physical units.  I mentioned physical units in my 
previous 
mail, but I don't know how important they are for this design, which is not so 
much 
concerned about units, as such, but about multiple screens with different DPIs 
etc.

> > A disadvantage of the QCoordinate approach is that the values are not 
> > comparable
> > to each other without a screen. 
> 
> There is also the problem of a single Qt window between multiple screens with 
> different DPI so it'd be at least one screen per coordinate

I think that's out of scope.  Windows API doesn't even allow accounting for 
that.  Maybe you can go low-level and find some work around, but it's not 
really 
something applications (even outside of Qt) do.

> (maybe even worse if 
> someone wants to use a QCoordinate for computing a distance that would span 
> multiple screens ?)
> 
> > One of the issues raised so far is that this QCoordinate stores only
> > pixels and points, 
> 
> shouldn't this be implemented as a variant instead ? (I mean, Qt6 *will* 
> require C++17, right ? :p) 

Nope. The point is that *both* pixels and points must be stored.  std::variant 
is a sum type.  That's not what's needed here.

Thanks,

Stephen.
 

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] New approach to hi-dpi and coordinate system for layouts in Qt 6

2017-09-22 Thread Stephen Kelly via Development

Hi Jean-Michaël,

The issue is layouting, not painting. Sorry for not making that clear.

Feel free to modify the example code I posted if you think you have a general 
solution with QPen::setCosmetic alone to fix the layout issues.

Thanks,

Stephen.

From: doom.ooseve...@gmail.com [mailto:doom.ooseve...@gmail.com] On Behalf Of 
Jean-Michaël Celerier
Sent: Thursday 21 September 2017 11:29
To: Stephen Kelly 
Cc: development@qt-project.org
Subject: Re: [Development] New approach to hi-dpi and coordinate system for 
layouts in Qt 6

> making it impossible to specify 'a one/two pixel border'
Correct me if I am wrong, but isn't this what QPen::setCosmetic is used for ?
Best,
Jean-Michaël



---
Jean-Michaël Celerier
http://www.jcelerier.name

On Thu, Sep 21, 2017 at 11:37 AM, Stephen Kelly via Development 
> wrote:

Hi,

Qt 5 has several approaches to attempting to size/scale a UI when moving 
between screens which have
different APIs.  There is a summary here:

https://vicrucann.github.io/tutorials/osg-qt-high-dpi/

The approaches available currently either

1) scale everything after rendering (eg with SetProcessDPIAware())
2) scale coordinates to screen metrics before rendering 
(QApplication::setAttribute(Qt::AA_EnableHighDpiScaling))

The first approach gives a blurry result because of up/down scaling and is not 
satisfying.

The second approach scales all coordinates, making it impossible to specify 'a 
one/two pixel border' without that getting scaled too. Additionally, the 
AA_EnableHighDpiScaling will only apply integer scaling, so on a screen with 
150% scaling, the widget is scaled to 200%.

Adding a floating-point based API would not be a solution because it would 
result in painting artefacts.  This is an important point.  An approach like 
that won't satisfy designers.  The approach in

https://codereview.qt-project.org/#/c/157174/

resolves a scaling issue but does not address painting artefacts.

So, we need to find flexible and imaginative solutions.

I've had a discussion on IRC with Morten, who worked on QUIP-8.  That QUIP 
doesn't (yet?) go as far as approaches to addressing the problem, so I am 
writing here to see if there is wider interest in the topic.  One of the points 
he made is that some users are happy with the current state of Qt APIs and 
behavior, or would be happy with downsampling after rendering (blurry).

I don't know how widespread that acceptance would be, but I've worked on 
several teams where it would not be acceptable.

The underlying problem is that the Qt APIs do not provide a way to specify the 
units to use in layouts AND to combine values with those units.  We need to be 
able to specify coordinates which will be scaled to an appropriate number of 
pixels on the screen, but also to be able to specify coordinates in exact 
pixels (common for things like having a 'one/two pixel border' etc).  Then, Qt 
should compute the actual number of pixels to paint based on the current screen.

The approach we discussed (this is only the ideas-stage, remember!) with Morten 
is to change APIs which specify layouts to use a new unit-sensitive coordinate 
type instead of int.  This new QCoordinate type stores values in both points 
and pixels and has a toPixels method which computes the required pixel value 
for the screen.

https://gist.github.com/anonymous/d08e0e79b05237a765e23849bbe2a78d

QCoordinates can be created with C++11 user-defined literal niftyness:

  auto coord = 34_pt + 4_px;

This also implies a requirement to have QSize/QPoint etc equivalents based on 
QCoordinate.  We haven't put much thought into this code duplicatation etc, 
focusing only on whether we can solve the problems with this approach (or 
another approach?) 

Re: [Development] MAINTAINERS: your action needed

2017-09-22 Thread Denis Shienkov

https://codereview.qt-project.org/#/c/206395/

:)


22.09.2017 14:33, Jani Heikkinen пишет:

Use (which should be already in every changes file)


*   Qt 5.9.2 Changes
*


Jani

From: Denis Shienkov 
Sent: Friday, September 22, 2017 2:31 PM
To: Jani Heikkinen; Edward Welbourne; development@qt-project.org
Subject: Re: [Development] MAINTAINERS: your action needed

  >  Let's use that one; it is now in every changes file

What's use? I do not understand.


22.09.2017 14:07, Jani Heikkinen пишет:

Hi all,

There has been different ways of doing this. I some modules there has been that 
library one, some other the one we used at this time. Let's use that one; it is 
now in every changes file

br,
Jani

From: Development  on behalf 
of Denis Shienkov 
Sent: Friday, September 22, 2017 1:27 PM
To: Edward Welbourne; development@qt-project.org
Subject: Re: [Development] MAINTAINERS: your action needed

Previously, we (e.g. in qtserialport module) had this:


*   Library*


My question is: do we need to modify this "Qt 5.9.2 Changes" header? :)

BR,
Denis

22.09.2017 13:24, Edward Welbourne пишет:

Denis Shienkov (22 September 2017 11:39)

do we need to keep this:


*   Qt 5.9.2 Changes *


as is?

What were you thinking of changing about it ?

Eddy.

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] MAINTAINERS: your action needed

2017-09-22 Thread Jani Heikkinen
Use (which should be already in every changes file)


*   Qt 5.9.2 Changes
*


Jani

From: Denis Shienkov 
Sent: Friday, September 22, 2017 2:31 PM
To: Jani Heikkinen; Edward Welbourne; development@qt-project.org
Subject: Re: [Development] MAINTAINERS: your action needed

 >  Let's use that one; it is now in every changes file

What's use? I do not understand.


22.09.2017 14:07, Jani Heikkinen пишет:
> Hi all,
>
> There has been different ways of doing this. I some modules there has been 
> that library one, some other the one we used at this time. Let's use that 
> one; it is now in every changes file
>
> br,
> Jani
> 
> From: Development  
> on behalf of Denis Shienkov 
> Sent: Friday, September 22, 2017 1:27 PM
> To: Edward Welbourne; development@qt-project.org
> Subject: Re: [Development] MAINTAINERS: your action needed
>
> Previously, we (e.g. in qtserialport module) had this:
>
> 
> *   Library*
> 
>
> My question is: do we need to modify this "Qt 5.9.2 Changes" header? :)
>
> BR,
> Denis
>
> 22.09.2017 13:24, Edward Welbourne пишет:
>> Denis Shienkov (22 September 2017 11:39)
>>> do we need to keep this:
>>>
>>> 
>>> *   Qt 5.9.2 Changes *
>>> 
>>>
>>> as is?
>> What were you thinking of changing about it ?
>>
>>Eddy.
> ___
> Development mailing list
> Development@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] MAINTAINERS: your action needed

2017-09-22 Thread Denis Shienkov

>  Let's use that one; it is now in every changes file

What's use? I do not understand.


22.09.2017 14:07, Jani Heikkinen пишет:

Hi all,

There has been different ways of doing this. I some modules there has been that 
library one, some other the one we used at this time. Let's use that one; it is 
now in every changes file

br,
Jani

From: Development  on behalf 
of Denis Shienkov 
Sent: Friday, September 22, 2017 1:27 PM
To: Edward Welbourne; development@qt-project.org
Subject: Re: [Development] MAINTAINERS: your action needed

Previously, we (e.g. in qtserialport module) had this:


*   Library*


My question is: do we need to modify this "Qt 5.9.2 Changes" header? :)

BR,
Denis

22.09.2017 13:24, Edward Welbourne пишет:

Denis Shienkov (22 September 2017 11:39)

do we need to keep this:


*   Qt 5.9.2 Changes *


as is?

What were you thinking of changing about it ?

   Eddy.

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] MAINTAINERS: your action needed

2017-09-22 Thread Jani Heikkinen
Hi all,

There has been different ways of doing this. I some modules there has been that 
library one, some other the one we used at this time. Let's use that one; it is 
now in every changes file

br,
Jani

From: Development  on 
behalf of Denis Shienkov 
Sent: Friday, September 22, 2017 1:27 PM
To: Edward Welbourne; development@qt-project.org
Subject: Re: [Development] MAINTAINERS: your action needed

Previously, we (e.g. in qtserialport module) had this:


*   Library*


My question is: do we need to modify this "Qt 5.9.2 Changes" header? :)

BR,
Denis

22.09.2017 13:24, Edward Welbourne пишет:
> Denis Shienkov (22 September 2017 11:39)
>> do we need to keep this:
>>
>> 
>> *   Qt 5.9.2 Changes *
>> 
>>
>> as is?
> What were you thinking of changing about it ?
>
>   Eddy.

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] MAINTAINERS: your action needed

2017-09-22 Thread Denis Shienkov

Previously, we (e.g. in qtserialport module) had this:


*   Library*


My question is: do we need to modify this "Qt 5.9.2 Changes" header? :)

BR,
Denis

22.09.2017 13:24, Edward Welbourne пишет:

Denis Shienkov (22 September 2017 11:39)

do we need to keep this:


*   Qt 5.9.2 Changes *


as is?

What were you thinking of changing about it ?

Eddy.


___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] MAINTAINERS: your action needed

2017-09-22 Thread Denis Shienkov

Hi,

do we need to keep this:


*   Qt 5.9.2 Changes *


as is?


BR,

Denis


22.09.2017 12:34, Jani Heikkinen пишет:

Hi,

We did initial change files for Qt 5.9.2, see 
https://codereview.qt-project.org/#/q/message:%22Add+changes+file+for+Qt+5.9.2%22,n,z

Maintainers: Please do needed modifications immediately and get '+2' . We need 
these to be able to proceed with Qt 5.9.2 release

br,
Jani



___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


[Development] MAINTAINERS: your action needed

2017-09-22 Thread Jani Heikkinen
Hi,

We did initial change files for Qt 5.9.2, see 
https://codereview.qt-project.org/#/q/message:%22Add+changes+file+for+Qt+5.9.2%22,n,z

Maintainers: Please do needed modifications immediately and get '+2' . We need 
these to be able to proceed with Qt 5.9.2 release

br,
Jani



___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development