summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2014-09-08 17:24:48 +0200
committerMarc Mutz <marc.mutz@kdab.com>2014-10-03 19:00:30 +0200
commit0356f5a36d291556f149890b3027b19cd7222aee (patch)
tree0b851d52df4024be55e0882726afc3de77d6f1ca
parentc6752c5aa19c4aa7ef2193878063f44d979b1cf6 (diff)
QWidget: use qEnvironmentVariableIntValue()
It doesn't allocate memory, so cannot throw and is a lot faster than qgetenv(). Change-Id: I5b5aec194aab66c7cea8da736655cc7270ade272 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
-rw-r--r--src/widgets/kernel/qwidget.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 423bb33cc2..c6fcb98f52 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -1285,7 +1285,7 @@ void QWidget::create(WId window, bool initializeWindow, bool destroyOldWindow)
static int paintOnScreenEnv = -1;
if (paintOnScreenEnv == -1)
- paintOnScreenEnv = qgetenv("QT_ONSCREEN_PAINT").toInt() > 0 ? 1 : 0;
+ paintOnScreenEnv = qEnvironmentVariableIntValue("QT_ONSCREEN_PAINT") > 0 ? 1 : 0;
if (paintOnScreenEnv == 1)
setAttribute(Qt::WA_PaintOnScreen);
@@ -2112,7 +2112,7 @@ void QWidgetPrivate::subtractOpaqueSiblings(QRegion &sourceRegion, bool *hasDirt
bool alsoNonOpaque) const
{
Q_Q(const QWidget);
- static int disableSubtractOpaqueSiblings = qgetenv("QT_NO_SUBTRACTOPAQUESIBLINGS").toInt();
+ static int disableSubtractOpaqueSiblings = qEnvironmentVariableIntValue("QT_NO_SUBTRACTOPAQUESIBLINGS");
if (disableSubtractOpaqueSiblings || q->isWindow())
return;