diff options
author | Morten Johan Sørvig <morten.sorvig@digia.com> | 2013-03-01 11:38:19 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-17 08:12:25 +0100 |
commit | b74ba4e198256f9c4a4c8af02a1339bf0ecc41aa (patch) | |
tree | 496905f00850e39ef0d97ce49d4e975e98e1e5d9 | |
parent | b11317a64339f5a4bcffc8234ecaf15c7fb416f2 (diff) | |
download | qtbase-b74ba4e198256f9c4a4c8af02a1339bf0ecc41aa.tar.gz |
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 <gabriel.dedietrich@digia.com>
-rw-r--r-- | src/corelib/global/qnamespace.h | 1 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.qdoc | 8 |
2 files changed, 9 insertions, 0 deletions
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 */ |