Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qrecursionwatcher_p.h
Go to the documentation of this file.
1// Copyright (C) 2018 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
4#ifndef QRECURSIONWATCHER_P_H
5#define QRECURSIONWATCHER_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/private/qglobal_p.h>
19
21
22class QRecursionNode;
24public:
25 inline QRecursionNode();
26 bool *_r;
27};
28
29template<class T, QRecursionNode T::*Node>
31public:
32 inline QRecursionWatcher(T *);
34 inline bool hasRecursed() const;
35private:
36 T *_t;
37 bool _r;
38};
39
44
45template<class T, QRecursionNode T::*Node>
47: _t(t), _r(false)
48{
49 if ((_t->*Node)._r) *(_t->*Node)._r = true;
50 (_t->*Node)._r = &_r;
51}
52
53template<class T, QRecursionNode T::*Node>
55{
56 if ((_t->*Node)._r == &_r) (_t->*Node)._r = nullptr;
57}
58
59template<class T, QRecursionNode T::*Node>
61{
62 return _r;
63}
64
66
67#endif // QRECURSIONWATCHER_P_H
Definition lalr.h:136
Combined button and popup list for selecting options.
GLdouble GLdouble t
Definition qopenglext.h:243
QObject::connect nullptr