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;
70#define Q_APPLICATION_STATIC(TYPE, NAME, ...) \
71 namespace { struct Q_QAS_ ## NAME { \
72 typedef TYPE QAS_Type; \
73 static void innerFunction(void *pointer) \
74 noexcept(noexcept(std::remove_cv_t<QAS_Type>(__VA_ARGS__))) \
76 new (pointer) QAS_Type(__VA_ARGS__); \
79 static QGlobalStatic<QtGlobalStatic::ApplicationHolder<Q_QAS_ ## NAME>> NAME;\
void storeRelaxed(T newValue) noexcept
T loadAcquire() const noexcept
void storeRelease(T newValue) noexcept
T loadRelaxed() const noexcept
static QCoreApplication * instance() noexcept
Returns a pointer to the application's QCoreApplication (or QGuiApplication/QApplication) instance.
void lock() noexcept
Locks the mutex.
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
QApplication app(argc, argv)
[0]
ApplicationHolder()=default
static Q_CONSTINIT struct QtGlobalStatic::ApplicationHolder::@28 storage
typename QAS::QAS_Type Type
static constexpr bool MutexLockIsNoexcept
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()