Re: [Development] High-dpi Qt best practices

2012-10-11 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-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 code,

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 treated

Re: [Development] High-dpi Qt best practices

2012-10-11 Thread Sorvig Morten
On Oct 11, 2012, at 9:36 AM, Samuel Rødal samuel.ro...@digia.com 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

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 samuel.ro...@digia.com 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

Re: [Development] High-dpi Qt best practices

2012-10-10 Thread Sorvig Morten
On Oct 9, 2012, at 1:55 PM, Christoph Feck christ...@maxiom.de 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

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

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 is in

[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

Re: [Development] High-dpi Qt best practices

2012-10-09 Thread Ziller Eike
On 9 Oct 2012, at 10:59, Pritam pritam_ghang...@infosys.com 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

Re: [Development] High-dpi Qt best practices

2012-10-09 Thread Sorvig Morten
On Oct 9, 2012, at 10:59 AM, Pritam pritam_ghang...@infosys.com 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

Re: [Development] High-dpi Qt best practices

2012-10-09 Thread Sorvig Morten
On Oct 9, 2012, at 11:32 AM, Olivier Goffart oliv...@woboq.com 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

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 pritam_ghang...@infosys.com 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,

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 oliv...@woboq.com 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

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 oliv...@woboq.com wrote: On Tuesday 09 October 2012 09:46:37 Sorvig Morten wrote: On Oct 9, 2012, at 11:32 AM, Olivier Goffart oliv...@woboq.com wrote: But QSize is already the

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. From

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 oliv...@woboq.com Pixmaps and images _always_ have exactly QPixmap::size() pixels. Maybe we can introduce QSizePt Code would look like QPixmap

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

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 write the

Re: [Development] High-dpi Qt best practices

2012-10-09 Thread Sorvig Morten
On Oct 9, 2012, at 1:53 PM, Olivier Goffart oliv...@woboq.com 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

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 many