summaryrefslogtreecommitdiffstats
path: root/src/widgets/graphicsview
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2014-09-09 11:48:38 +0200
committerMarc Mutz <marc.mutz@kdab.com>2014-09-12 09:59:11 +0200
commitf826039e09784211ee1a61a3f52330baebb1f208 (patch)
treec38cf6fa813b13c4b937ff3922d4b89cd54d451b /src/widgets/graphicsview
parent099f188bc8b21ae96d7839c4bae636b922b9e988 (diff)
QGraphicsView: use qEnvironmentVariableIntValue()
It doesn't allocate memory, so cannot throw and is a lot faster than qgetenv(). Change-Id: I774ae9011b855f746b5e3fdf25995d81ec60b82a Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Diffstat (limited to 'src/widgets/graphicsview')
-rw-r--r--src/widgets/graphicsview/qgraphicslayout_p.h2
-rw-r--r--src/widgets/graphicsview/qgraphicsscene.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/graphicsview/qgraphicslayout_p.h b/src/widgets/graphicsview/qgraphicslayout_p.h
index 4257e5bc94..e2f3bf778a 100644
--- a/src/widgets/graphicsview/qgraphicslayout_p.h
+++ b/src/widgets/graphicsview/qgraphicslayout_p.h
@@ -73,7 +73,7 @@ inline bool qt_graphicsLayoutDebug()
{
static int checked_env = -1;
if(checked_env == -1)
- checked_env = !!qgetenv("QT_GRAPHICSLAYOUT_DEBUG").toInt();
+ checked_env = !!qEnvironmentVariableIntValue("QT_GRAPHICSLAYOUT_DEBUG");
return checked_env;
}
#endif
diff --git a/src/widgets/graphicsview/qgraphicsscene.cpp b/src/widgets/graphicsview/qgraphicsscene.cpp
index df74352e2b..a39ffee419 100644
--- a/src/widgets/graphicsview/qgraphicsscene.cpp
+++ b/src/widgets/graphicsview/qgraphicsscene.cpp
@@ -4918,7 +4918,7 @@ void QGraphicsScenePrivate::draw(QGraphicsItem *item, QPainter *painter, const Q
if (painterStateProtection || restorePainterClip)
painter->restore();
- static int drawRect = qgetenv("QT_DRAW_SCENE_ITEM_RECTS").toInt();
+ static int drawRect = qEnvironmentVariableIntValue("QT_DRAW_SCENE_ITEM_RECTS");
if (drawRect) {
QPen oldPen = painter->pen();
QBrush oldBrush = painter->brush();