Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qeventloop_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QEVENTLOOP_P_H
6#define QEVENTLOOP_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
20#include "qobject_p.h"
21
23
24class Q_AUTOTEST_EXPORT QEventLoopPrivate : public QObjectPrivate
25{
26 Q_DECLARE_PUBLIC(QEventLoop)
27public:
28 inline QEventLoopPrivate()
29 : inExec(false)
30 {
31 returnCode.storeRelaxed(-1);
32 exit.storeRelaxed(true);
33 }
34 ~QEventLoopPrivate() override;
35
36 QAtomicInt quitLockRef;
37
38 QAtomicInt exit; // bool
39 QAtomicInt returnCode;
40 bool inExec;
41
42 void ref()
43 {
44 quitLockRef.ref();
45 }
46
47 void deref()
48 {
49 if (!quitLockRef.deref() && inExec) {
50 qApp->postEvent(q_ptr, new QEvent(QEvent::Quit));
51 }
52 }
53};
54
55QT_END_NAMESPACE
56
57#endif // QEVENTLOOP_P_H
\inmodule QtCore
\inmodule QtCore
Definition qeventloop.h:60
Q_CORE_EXPORT ~QEventLoopLocker()
Destroys this event loop locker object.
\inmodule QtCore
Definition qeventloop.h:17
Combined button and popup list for selecting options.
#define __has_include(x)
#define qApp