Re: [Development] High-dpi Qt best practices

2012-10-11 Thread Samuel Rødal
On 10/11/2012 10:16 AM, Sorvig Morten wrote: > > On Oct 11, 2012, at 9:36 AM, Samuel Rødal > wrote: > >> On 10/11/2012 08:23 AM, Ziller Eike wrote: >>> >>> On 10.10.2012, at 16:56, Olivier Goffart wrote: >>> >>> If you'd now be able to change the unit in Qt to "pixel metrics" for >>> certain wid

Re: [Development] High-dpi Qt best practices

2012-10-11 Thread Sorvig Morten
On Oct 11, 2012, at 9:36 AM, Samuel Rødal wrote: > On 10/11/2012 08:23 AM, Ziller Eike wrote: >> >> On 10.10.2012, at 16:56, Olivier Goffart wrote: >> >> If you'd now be able to change the unit in Qt to "pixel metrics" for >> certain widgets (and optionally sub widgets) where you really want

Re: [Development] High-dpi Qt best practices

2012-10-11 Thread Bache-Wiig Jens
> > The only thing is about QPen. should we draw lines twice as large? that is > bascically what QPen::isCosmetic is for Absolutely. The problem is that for some reason we have cosmetic as the default. In practice people hardly use cosmetic pens for what it was designed for, it is imply treate

Re: [Development] High-dpi Qt best practices

2012-10-11 Thread Samuel Rødal
On 10/11/2012 08:23 AM, Ziller Eike wrote: > > On 10.10.2012, at 16:56, Olivier Goffart wrote: > > If you'd now be able to change the unit in Qt to "pixel metrics" for > certain widgets (and optionally sub widgets) where you really want to > take advantage of each and every pixel in e.g. painting c

Re: [Development] High-dpi Qt best practices

2012-10-10 Thread Ziller Eike
On 10.10.2012, at 16:56, Olivier Goffart wrote: What is wrong with this alternative: All the API stays always in pixel (QIcon, QWidget::geometry, ...) QCoreApplication::setAttribute(Qt::AA_MacHighDPI) (should it maybe be even be set by default?) Setting it as default would make it impossible

Re: [Development] High-dpi Qt best practices

2012-10-10 Thread Rutledge Shawn
On 10 Oct 2012, at 4:56 PM, Olivier Goffart wrote: > What is wrong with this alternative: > > All the API stays always in pixel (QIcon, QWidget::geometry, ...) > > QCoreApplication::setAttribute(Qt::AA_MacHighDPI) > (should it maybe be even be set by default?) > > If that is set, everything i

Re: [Development] High-dpi Qt best practices

2012-10-10 Thread Olivier Goffart
What is wrong with this alternative: All the API stays always in pixel (QIcon, QWidget::geometry, ...) QCoreApplication::setAttribute(Qt::AA_MacHighDPI) (should it maybe be even be set by default?) If that is set, everything is in pixel, but the default font size is twice as big, the mac style

Re: [Development] High-dpi Qt best practices

2012-10-10 Thread Sorvig Morten
On Oct 9, 2012, at 1:55 PM, Christoph Feck wrote: > On Tuesday 09 October 2012 10:37:50 Sorvig Morten wrote: >> While preparing an upcoming blog entry I've collected some best >> practices regarding raster graphics (QImage and QPixmap). These >> apply to internal Qt development as well. The patc

Re: [Development] High-dpi Qt best practices

2012-10-09 Thread Thiago Macieira
On terça-feira, 9 de outubro de 2012 19.53.06, Sorvig Morten wrote: > Thiago: > >On terça-feira, 9 de outubro de 2012 09.46.37, Sorvig Morten wrote: > >> I'm re-defining it to be the size in points. I think this intuitive, you > >> are asking QIcon::pixmap() for pixmap suitable for covering this ma

Re: [Development] High-dpi Qt best practices

2012-10-09 Thread Sorvig Morten
On Oct 9, 2012, at 1:53 PM, Olivier Goffart wrote: > This is a behaviour change that breaks existing code (in applications and in Qt), so it's opt-in via QT_HIDPI_AWARE. > > I don't think having opt in like that is a good idea. It will be a mess when > you mix different libraries o

Re: [Development] High-dpi Qt best practices

2012-10-09 Thread Sorvig Morten
Thiago: >On terça-feira, 9 de outubro de 2012 09.46.37, Sorvig Morten wrote: >> I'm re-defining it to be the size in points. I think this intuitive, you are >> asking QIcon::pixmap() for pixmap suitable for covering this many units on >> screen - not for a pixmap of a specific size. > > When you wr

Re: [Development] High-dpi Qt best practices

2012-10-09 Thread Thiago Macieira
On terça-feira, 9 de outubro de 2012 09.46.37, Sorvig Morten wrote: > I'm re-defining it to be the size in points. I think this intuitive, you are > asking QIcon::pixmap() for pixmap suitable for covering this many units on > screen - not for a pixmap of a specific size. When you write the documen

Re: [Development] High-dpi Qt best practices

2012-10-09 Thread Samuel Rødal
On 10/09/2012 01:53 PM, Olivier Goffart wrote: > On Tuesday 09 October 2012 10:50:26 Sorvig Morten wrote: >> On Oct 9, 2012, at 12:21 PM, Olivier Goffart >> Pixmaps and images _always_ have exactly QPixmap::size() pixels. >> >>> Maybe we can introduce QSizePt >>> Code would look like >>> QPixmap p

Re: [Development] High-dpi Qt best practices

2012-10-09 Thread Christoph Feck
On Tuesday 09 October 2012 10:37:50 Sorvig Morten wrote: > While preparing an upcoming blog entry I've collected some best > practices regarding raster graphics (QImage and QPixmap). These > apply to internal Qt development as well. The patch is still > pending so they are open for discussion. >Fr

Re: [Development] High-dpi Qt best practices

2012-10-09 Thread Olivier Goffart
On Tuesday 09 October 2012 10:50:26 Sorvig Morten wrote: > On Oct 9, 2012, at 12:21 PM, Olivier Goffart > > wrote: > > On Tuesday 09 October 2012 09:46:37 Sorvig Morten wrote: > >> On Oct 9, 2012, at 11:32 AM, Olivier Goffart > >> > >> wrote: > >>> But QSize is already the size in pixel. > >>>

Re: [Development] High-dpi Qt best practices

2012-10-09 Thread Olivier Goffart
On Tuesday 09 October 2012 09:46:37 Sorvig Morten wrote: > On Oct 9, 2012, at 11:32 AM, Olivier Goffart > > wrote: > > But QSize is already the size in pixel. > > Or do you mean that QIcon::pixmap could return a pixmap that is larger > > than > > the given QSize, scaled with some magic heuristic

Re: [Development] High-dpi Qt best practices

2012-10-09 Thread Pritam
On Tuesday 09 October 2012 03:01 PM, Sorvig Morten wrote: > On Oct 9, 2012, at 10:59 AM, Pritam > wrote: >> Forgive my ignorance, but I didn't understand. AFAIK most of Qt API is >> in pixels. Do you mean after this patch, one should treat all API as points? > No problem, the concepts are new an

Re: [Development] High-dpi Qt best practices

2012-10-09 Thread Sorvig Morten
On Oct 9, 2012, at 11:31 AM, Ziller Eike wrote: > > Afaik setting environment variables is prohibited / not working e.g. on iOS, > so it would be good to have additional means to achieve this. Yes, right now it only controls QIcon::pixmap() and if that is all it will end up doing we might as

Re: [Development] High-dpi Qt best practices

2012-10-09 Thread Sorvig Morten
On Oct 9, 2012, at 11:32 AM, Olivier Goffart wrote: > But QSize is already the size in pixel. > Or do you mean that QIcon::pixmap could return a pixmap that is larger than > the given QSize, scaled with some magic heuristics. That is not really > intuitive. (and violate the current documentati

Re: [Development] High-dpi Qt best practices

2012-10-09 Thread Olivier Goffart
On Tuesday 09 October 2012 14:29:39 Pritam wrote: > On Tuesday 09 October 2012 02:07 PM, Sorvig Morten wrote: > > While preparing an upcoming blog entry I've collected some best practices > > regarding raster graphics (QImage and QPixmap). These apply to internal > > Qt development as well. The pat

Re: [Development] High-dpi Qt best practices

2012-10-09 Thread Sorvig Morten
On Oct 9, 2012, at 10:59 AM, Pritam wrote: > Forgive my ignorance, but I didn't understand. AFAIK most of Qt API is > in pixels. Do you mean after this patch, one should treat all API as points? No problem, the concepts are new and I'm still figuring out how they apply to Qt and how to best pr

Re: [Development] High-dpi Qt best practices

2012-10-09 Thread Ziller Eike
On 9 Oct 2012, at 10:59, Pritam wrote: > On Tuesday 09 October 2012 02:07 PM, Sorvig Morten wrote: >> While preparing an upcoming blog entry I've collected some best practices >> regarding raster graphics (QImage and QPixmap). These apply to internal Qt >> development as well. The patch is sti

Re: [Development] High-dpi Qt best practices

2012-10-09 Thread Pritam
On Tuesday 09 October 2012 02:07 PM, Sorvig Morten wrote: > While preparing an upcoming blog entry I've collected some best practices > regarding raster graphics (QImage and QPixmap). These apply to internal Qt > development as well. The patch is still pending so they are open for > discussion.

[Development] High-dpi Qt best practices

2012-10-09 Thread Sorvig Morten
While preparing an upcoming blog entry I've collected some best practices regarding raster graphics (QImage and QPixmap). These apply to internal Qt development as well. The patch is still pending so they are open for discussion. (I use image and pixmap interchangeably here, most points apply to