From b74ba4e198256f9c4a4c8af02a1339bf0ecc41aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Fri, 1 Mar 2013 11:38:19 +0100 Subject: Add Qt::AA_UseHighDpiPixmaps. Setting this attribute enables QIcon::pixmap() to return high-dpi pixmaps when running on "retina" type displays. This requires an opt-in flag since the returned pixmap can be larger than the requested size, which is a change in previous documented behaviour that can break existing code. Change-Id: I5ff3d25c68de24aa4eda7ad1f8aa9199da04707e Reviewed-by: Gabriel de Dietrich --- src/corelib/global/qnamespace.h | 1 + src/corelib/global/qnamespace.qdoc | 8 ++++++++ 2 files changed, 9 insertions(+) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 0ae0fdf57c..f130288a24 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -498,6 +498,7 @@ public: AA_X11InitThreads = 10, AA_SynthesizeTouchForUnhandledMouseEvents = 11, AA_SynthesizeMouseForUnhandledTouchEvents = 12, + AA_UseHighDpiPixmaps = 13, // Add new attributes before this line AA_AttributeCount diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index b065507645..0d9cacdb1f 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -167,6 +167,14 @@ to left button mouse events instead. This attribute is enabled by default. + \value AA_UseHighDpiPixmaps Make QIcon::pixmap() generate high-dpi pixmaps + that can be larger than the requested size. Such pixmaps will have + devicePixelRatio set to a value higher than 1. + + After setting this attribute application code that uses pixmap + sizes in layout geometry calculations should typically divide by + QPixmap::devicePixelRatio() to get device-independent layout geometry. + \omitvalue AA_AttributeCount */ -- cgit v1.2.3