fflush(stderr);
}
- if (msgType == QtFatalMsg || (msgType == QtWarningMsg && (!qgetenv("QT_FATAL_WARNINGS").isNull())))
+ static const bool fatalwarnings = qgetenv("QT_FATAL_WARNINGS").isNull();
+ if (msgType == QtFatalMsg || (msgType == QtWarningMsg && !fatalwarnings))
abort(); // trap; generates core dump
}
#ifndef QT_NO_DEBUG
inline bool qt_graphicsLayoutDebug()
{
- static int checked_env = -1;
- if(checked_env == -1)
- checked_env = !!qgetenv("QT_GRAPHICSLAYOUT_DEBUG").toInt();
+ static const int checked_env = !!qgetenv("QT_GRAPHICSLAYOUT_DEBUG").toInt();
return checked_env;
}
#endif
//
QString style;
#ifdef QT_BUILD_INTERNAL
- QString envStyle = QString::fromLocal8Bit(qgetenv("QT_STYLE_OVERRIDE"));
+ static const QString envStyle = QString::fromLocal8Bit(qgetenv("QT_STYLE_OVERRIDE"));
#endif
if (!QApplicationPrivate::styleOverride.isEmpty()) {
style = QApplicationPrivate::styleOverride;
{
#ifndef QT_NO_LIBRARY
- QString key = QString::fromLocal8Bit(qgetenv("QT_PLATFORM_PLUGIN"));
+ static QString key = QString::fromLocal8Bit(qgetenv("QT_PLATFORM_PLUGIN"));
if (key.isEmpty()) {
key = QString::fromLocal8Bit(qgetenv("DESKTOP_SESSION"));
}
#ifndef QT_NO_DEBUG
static bool layoutDebug()
{
- static int checked_env = -1;
- if(checked_env == -1)
- checked_env = !!qgetenv("QT_LAYOUT_DEBUG").toInt();
-
+ static const int checked_env = !!qgetenv("QT_LAYOUT_DEBUG").toInt();
return checked_env;
}
#endif
}
}
- static int paintOnScreenEnv = -1;
- if (paintOnScreenEnv == -1)
- paintOnScreenEnv = qgetenv("QT_ONSCREEN_PAINT").toInt() > 0 ? 1 : 0;
- if (paintOnScreenEnv == 1)
+ static const int paintOnScreenEnv = qgetenv("QT_ONSCREEN_PAINT").toInt();
+ if (paintOnScreenEnv)
setAttribute(Qt::WA_PaintOnScreen);
if (QApplication::testAttribute(Qt::AA_NativeWindows))
QApplication::sendEvent(q, &e);
}
if (isResize) {
- static bool slowResize = qgetenv("QT_SLOW_TOPLEVEL_RESIZE").toInt();
+ static const bool slowResize = qgetenv("QT_SLOW_TOPLEVEL_RESIZE").toInt();
// If we have a backing store with static contents, we have to disable the top-level
// resize optimization in order to get invalidated regions for resized widgets.
// The optimization discards all invalidateBuffer() calls since we're going to
Q_ASSERT(tlw);
#if !defined(QT_NO_DEBUG)
- static int flushUpdate = qgetenv("QT_FLUSH_UPDATE").toInt();
+ static const int flushUpdate = qgetenv("QT_FLUSH_UPDATE").toInt();
if (flushUpdate > 0)
QWidgetBackingStore::showYellowThing(widget, region, flushUpdate * 10, false);
#endif
//The performance hit by doing this should be negligible. However, be aware that
//using this FPS when you have > 1 windowsurface can give you inaccurate FPS
- static bool fpsDebug = qgetenv("QT_DEBUG_FPS").toInt();
+ static const bool fpsDebug = qgetenv("QT_DEBUG_FPS").toInt();
if (fpsDebug) {
static QTime time = QTime::currentTime();
static int frames = 0;
if (x->inTopLevelResize)
return;
- static int accelEnv = -1;
- if (accelEnv == -1) {
- accelEnv = qgetenv("QT_NO_FAST_MOVE").toInt() == 0;
- }
+ static const int accelEnv = qgetenv("QT_NO_FAST_MOVE").toInt() == 0;
QWidget *pw = q->parentWidget();
QPoint toplevelOffset = pw->mapTo(tlw, QPoint());
if (!wbs)
return;
- static int accelEnv = -1;
- if (accelEnv == -1) {
- accelEnv = qgetenv("QT_NO_FAST_SCROLL").toInt() == 0;
- }
+ static const int accelEnv = qgetenv("QT_NO_FAST_SCROLL").toInt() == 0;
QRect scrollRect = rect & clipRect();
bool overlapped = false;