5#ifndef QAPPLICATIONSTATIC_H
6#define QAPPLICATIONSTATIC_H
8#include <QtCore/QMutex>
9#include <QtCore/qcoreapplication.h>
10#include <QtCore/qglobalstatic.h>
19 using Type =
typename QAS::QAS_Type;
55 "The application static was used without a QCoreApplication instance");
72#define Q_APPLICATION_STATIC(TYPE, NAME, ...) \
73 namespace { struct Q_QAS_ ## NAME { \
74 typedef TYPE QAS_Type; \
75 static void innerFunction(void *pointer) \
76 noexcept(noexcept(std::remove_cv_t<QAS_Type>(__VA_ARGS__))) \
78 new (pointer) QAS_Type(__VA_ARGS__); \
81 static QGlobalStatic<QtGlobalStatic::ApplicationHolder<Q_QAS_ ## NAME>> NAME;\
static QCoreApplication * instance() noexcept
Returns a pointer to the application's QCoreApplication (or QGuiApplication/QApplication) instance.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
void destroyed(QObject *=nullptr)
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointe...
Combined button and popup list for selecting options.
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
#define Q_ASSERT_X(cond, x, msg)
QApplication app(argc, argv)
[0]
ApplicationHolder()=default
typename QAS::QAS_Type Type
static constexpr bool MutexLockIsNoexcept
static Q_CONSTINIT struct QtGlobalStatic::ApplicationHolder::@30 storage
static constexpr bool ConstructionIsNoexcept
static Q_CONSTINIT QBasicAtomicInteger< qint8 > guard
PlainType * pointer() noexcept(MutexLockIsNoexcept &&ConstructionIsNoexcept)
static Q_CONSTINIT QBasicMutex mutex
std::remove_cv_t< Type > PlainType
static PlainType * realPointer()