summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsview.cpp
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-05-29 11:20:42 (GMT)
committerAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-06-09 07:29:28 (GMT)
commitf582ed67c29e2406adeb0a52c7a68a51e0c2e8ee (patch)
tree2d353caf70eb15bf6ddf954231ee5b2cdd55fd49 /src/gui/graphicsview/qgraphicsview.cpp
parent32c09e7a36ecd41e8beb2a1f947944502793fd84 (diff)
downloadQt-f582ed67c29e2406adeb0a52c7a68a51e0c2e8ee.zip
Qt-f582ed67c29e2406adeb0a52c7a68a51e0c2e8ee.tar.gz
Qt-f582ed67c29e2406adeb0a52c7a68a51e0c2e8ee.tar.bz2
Only call qgetenv("QGRAPHICSVIEW_DIRECT") once.
Diffstat (limited to 'src/gui/graphicsview/qgraphicsview.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp
index 68c0e39..369301e 100644
--- a/src/gui/graphicsview/qgraphicsview.cpp
+++ b/src/gui/graphicsview/qgraphicsview.cpp
@@ -3313,9 +3313,8 @@ void QGraphicsView::paintEvent(QPaintEvent *event)
int backgroundTime = stopWatch.elapsed() - exposedTime;
#endif
- const char *directEnv = getenv("QGRAPHICSVIEW_DIRECT");
- bool overrideDirectPaint = directEnv && atoi(directEnv) != 0;
- if (overrideDirectPaint || (d->optimizationFlags & BypassDrawItems)) {
+ static int directEnv = getenv("QGRAPHICSVIEW_DIRECT").toInt();
+ if (directEnv || (d->optimizationFlags & BypassDrawItems)) {
d->scene->d_func()->drawSubtreeRecursive(0, &painter, viewTransform, viewTransform, exposedRegion,
viewport(), d->optimizationFlags);
} else {