Am 11.02.2014 um 22:43 schrieb VStevenP <vstevenpa...@yahoo.com>:

> Or perhaps the behavior I mentioned below is a feature? 

Yes, it's a feature ;)

You want to get familiar with the concept of "points" vs "pixels" (-> check the 
Apple developer docs, search for "retina" and the like) and how Qt implements 
that.

This is probably a good starting pixe^w point:

  
https://blog.qt.digia.com/blog/2013/04/25/retina-display-support-for-mac-os-ios-and-x11/

Basically: when you want to draw a rectangle of a given width and height, don't 
think in pixels! Think in (device-independent) points instead.

Qt (and in the end Cocoa) will make sure that it has the same physical 
dimension on a HiDPI (aka "Retina") and a "normal DPI" screen (which have the 
same physical dimension) by fiddling around with the proper "scale" factors (in 
the Cocoa/Apple world that scale factor is always exactly 2.0 for Retina 
displays).

If it comes to images you usually need to provide two versions of your assets: 
a "normal resolution" and a "@2x" resolution.

E.g. a QIcon then properly chooses the right version for you.

When it comes to QPixmaps then you want to read about 
QPixmap::setDevicePixelRatio.

When it comes to drawing lines, rectangles and text with QPainter (and QtQuick 
2 I assume) then you don't need to bother - Qt/Cocoa does it all for you (as 
long as you think in "points", that is).

Sorry, don't know much about QtQuick, but I assume it's all "pretty much the 
same logic" there ;)


Cheers,
  Oliver
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to