xcb: use qEnvironmentVariableIntValue()
It doesn't allocate memory, so cannot throw and is a lot faster than qgetenv(). Change-Id: Ie625d79352fa166e45939ef8f0a5e0cc32f8e801 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>bb10
parent
dcb48c6dc6
commit
099f188bc8
|
|
@ -328,7 +328,7 @@ QDpi QXcbScreen::logicalDpi() const
|
|||
|
||||
qreal QXcbScreen::devicePixelRatio() const
|
||||
{
|
||||
static int override_dpr = qgetenv("QT_DEVICE_PIXEL_RATIO").toInt();
|
||||
static int override_dpr = qEnvironmentVariableIntValue("QT_DEVICE_PIXEL_RATIO");
|
||||
static bool auto_dpr = qgetenv("QT_DEVICE_PIXEL_RATIO").toLower() == "auto";
|
||||
if (override_dpr > 0)
|
||||
return override_dpr;
|
||||
|
|
|
|||
Loading…
Reference in New Issue