QCoreApplication *QCoreApplication::self = 0;
QAbstractEventDispatcher *QCoreApplicationPrivate::eventDispatcher = 0;
-uint QCoreApplicationPrivate::attribs;
+std::bitset<Qt::AA_AttributeCount> QCoreApplicationPrivate::attribs;
#ifdef Q_OS_UNIX
Qt::HANDLE qt_application_thread_id = 0;
*/
void QCoreApplication::setAttribute(Qt::ApplicationAttribute attribute, bool on)
{
- if (on)
- QCoreApplicationPrivate::attribs |= 1 << attribute;
- else
- QCoreApplicationPrivate::attribs &= ~(1 << attribute);
+ QCoreApplicationPrivate::attribs.set(attribute, on);
}
/*!
*/
bool QCoreApplication::testAttribute(Qt::ApplicationAttribute attribute)
{
- return QCoreApplicationPrivate::testAttribute(attribute);
+ return QCoreApplicationPrivate::attribs.test(attribute);
}
#include "QtCore/qsettings.h"
#include "qobject_p.h"
+#include <bitset>
QT_BEGIN_NAMESPACE
static bool is_app_running;
static bool is_app_closing;
- static uint attribs;
- static inline bool testAttribute(uint flag)
- { return attribs & (1 << flag); }
+ static std::bitset<Qt::AA_AttributeCount> attribs;
#ifndef QT_NO_SETTINGS
static QSettings *staticConf();
#endif
if (++QWidgetPrivate::instanceCounter > QWidgetPrivate::maxInstances)
QWidgetPrivate::maxInstances = QWidgetPrivate::instanceCounter;
- if (QApplicationPrivate::testAttribute(Qt::AA_ImmediateWidgetCreation))
+ if (QApplication::testAttribute(Qt::AA_ImmediateWidgetCreation))
q->create();
if (paintOnScreenEnv == 1)
setAttribute(Qt::WA_PaintOnScreen);
- if (QApplicationPrivate::testAttribute(Qt::AA_NativeWindows))
+ if (QApplication::testAttribute(Qt::AA_NativeWindows))
setAttribute(Qt::WA_NativeWindow);
#ifdef ALIEN_DEBUG
oldBs->moveStaticWidgets(this);
}
- if (QApplicationPrivate::testAttribute(Qt::AA_ImmediateWidgetCreation)
+ if (QApplication::testAttribute(Qt::AA_ImmediateWidgetCreation)
&& !testAttribute(Qt::WA_WState_Created))
create();