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 p = QIcon::pixmap(QSizePt(20,20).toSize(window)); >>> (but then again, i'd say it is bad practice to even hardcode pt size) >> >> I don't know.. to me QSize is just a pair of ints, it does not have a unit. > > We use QSize and not QPoint or QPair<int,int> to take advantage of the C++ > type system. I have the impression that QSize is used everywhere else in > pixel. Or do you have an example where it is not?
Here's an example :) painter->fillRect(QRect(QPoint(0, 0), QSize(10, 10)), Qt::yellow); The size denotes logical or object space coordinates here, not device pixels, since the painter might have any kind of scale or even perspective transform set. -- Samuel _______________________________________________ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development