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
qobject.h
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// Copyright (C) 2013 Olivier Goffart <ogoffart@woboq.com>
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4// Qt-Security score:significant reason:default
5
6#ifndef QOBJECT_H
7#define QOBJECT_H
8
9#ifndef QT_NO_QOBJECT
10
11#include <QtCore/qobjectdefs.h>
12#include <QtCore/qstring.h>
13#include <QtCore/qbytearray.h>
14#include <QtCore/qlist.h>
15#ifdef QT_INCLUDE_COMPAT
16#include <QtCore/qcoreevent.h>
17#endif
18#include <QtCore/qscopedpointer.h>
19#include <QtCore/qmetatype.h>
20
21#include <QtCore/qobject_impl.h>
22#include <QtCore/qbindingstorage.h>
23#include <QtCore/qtcoreexports.h>
24
25#include <chrono>
26
28
29
30template <typename T> class QBindable;
31class QEvent;
32class QTimerEvent;
33class QChildEvent;
34struct QMetaObject;
35class QVariant;
36class QObjectPrivate;
37class QObject;
38class QThread;
39class QWidget;
40class QAccessibleWidget;
41#if QT_CONFIG(regularexpression)
42class QRegularExpression;
43#endif
44struct QDynamicMetaObjectData;
45
47
48#if QT_CORE_REMOVED_SINCE(6, 7)
49Q_CORE_EXPORT void qt_qFindChildren_helper(const QObject *parent, const QString &name,
50 const QMetaObject &mo, QList<void *> *list, Qt::FindChildOptions options);
51#endif
52Q_CORE_EXPORT void qt_qFindChildren_helper(const QObject *parent, QAnyStringView name,
53 const QMetaObject &mo, QList<void *> *list,
54 Qt::FindChildOptions options);
55#if QT_CORE_REMOVED_SINCE(6, 7)
56Q_CORE_EXPORT void qt_qFindChildren_helper(const QObject *parent, const QMetaObject &mo,
57 QList<void *> *list, Qt::FindChildOptions options);
58#endif
59Q_CORE_EXPORT void qt_qFindChildren_helper(const QObject *parent, const QRegularExpression &re,
60 const QMetaObject &mo, QList<void *> *list, Qt::FindChildOptions options);
61#if QT_CORE_REMOVED_SINCE(6, 7)
62Q_CORE_EXPORT QObject *qt_qFindChild_helper(const QObject *parent, const QString &name, const QMetaObject &mo, Qt::FindChildOptions options);
63#endif
64Q_CORE_EXPORT QObject *qt_qFindChild_helper(const QObject *parent, QAnyStringView name,
65 const QMetaObject &mo, Qt::FindChildOptions options);
66
67class Q_CORE_EXPORT QObjectData
68{
69 Q_DISABLE_COPY(QObjectData)
70public:
71 QObjectData() = default;
72 virtual ~QObjectData() = 0;
73 QObject *q_ptr;
74 QObject *parent;
76
77 uint isWidget : 1;
78 uint blockSig : 1;
79 uint wasDeleted : 1;
83 uint isWindow : 1; // for QWindow
85 uint isQuickItem : 1;
86 uint willBeWidget : 1; // for handling widget-specific bits in QObject's ctor
87 uint wasWidget : 1; // for properly cleaning up in QObject's dtor
89 uint unused : 20;
91 QDynamicMetaObjectData *metaObject;
93
94#if QT_CORE_REMOVED_SINCE(6, 9) && defined(Q_COMPILER_MANGLES_RETURN_TYPE)
95 QMetaObject *dynamicMetaObject() const;
96#else
97 const QMetaObject *dynamicMetaObject() const;
98#endif
99
100#ifdef QT_DEBUG
101 enum { CheckForParentChildLoopsWarnDepth = 4096 };
102#endif
103};
104
105class Q_CORE_EXPORT QObject
106{
107 Q_OBJECT
108
109 Q_PROPERTY(QString objectName READ objectName WRITE setObjectName NOTIFY objectNameChanged
110 BINDABLE bindableObjectName)
111 Q_DECLARE_PRIVATE(QObject)
112
113public:
114 Q_INVOKABLE explicit QObject(QObject *parent = nullptr);
115 virtual ~QObject();
116
117 virtual bool event(QEvent *event);
118 virtual bool eventFilter(QObject *watched, QEvent *event);
119
120#if defined(QT_NO_TRANSLATION) || defined(Q_QDOC)
121 static QString tr(const char *sourceText, const char * = nullptr, int = -1)
122 { return QString::fromUtf8(sourceText); }
123#endif // QT_NO_TRANSLATION
124
125 QString objectName() const;
126#if QT_CORE_REMOVED_SINCE(6, 4)
127 void setObjectName(const QString &name);
128#endif
129 Q_WEAK_OVERLOAD
130 void setObjectName(const QString &name) { doSetObjectName(name); }
131 void setObjectName(QAnyStringView name);
132 QBindable<QString> bindableObjectName();
133
134 inline bool isWidgetType() const { return d_ptr->isWidget; }
135 inline bool isWindowType() const { return d_ptr->isWindow; }
136 inline bool isQuickItemType() const { return d_ptr->isQuickItem; }
137
138 bool isQmlExposed() const noexcept;
139
140 inline bool signalsBlocked() const noexcept { return d_ptr->blockSig; }
141 bool blockSignals(bool b) noexcept;
142
143 QThread *thread() const;
144#if QT_CORE_REMOVED_SINCE(6, 7)
145 void moveToThread(QThread *thread);
146#endif
147 bool moveToThread(QThread *thread QT6_DECL_NEW_OVERLOAD_TAIL);
148
149 int startTimer(int interval, Qt::TimerType timerType = Qt::CoarseTimer);
150
151#if QT_CORE_REMOVED_SINCE(6, 8)
152 int startTimer(std::chrono::milliseconds time, Qt::TimerType timerType = Qt::CoarseTimer);
153#endif
154 int startTimer(std::chrono::nanoseconds time, Qt::TimerType timerType = Qt::CoarseTimer);
155
156 void killTimer(int id);
157 void killTimer(Qt::TimerId id);
158
159 template<typename T>
160 T findChild(QAnyStringView aName, Qt::FindChildOptions options = Qt::FindChildrenRecursively) const
161 {
162 typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type ObjType;
163 static_assert(QtPrivate::HasQ_OBJECT_Macro<ObjType>::Value,
164 "No Q_OBJECT in the class passed to QObject::findChild");
165 return static_cast<T>(qt_qFindChild_helper(this, aName, ObjType::staticMetaObject, options));
166 }
167
168 template<typename T>
169 QList<T> findChildren(QAnyStringView aName, Qt::FindChildOptions options = Qt::FindChildrenRecursively) const
170 {
171 typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type ObjType;
172 static_assert(QtPrivate::HasQ_OBJECT_Macro<ObjType>::Value,
173 "No Q_OBJECT in the class passed to QObject::findChildren");
174 QList<T> list;
175 qt_qFindChildren_helper(this, aName, ObjType::staticMetaObject,
176 reinterpret_cast<QList<void *> *>(&list), options);
177 return list;
178 }
179
180 template<typename T>
181 T findChild(Qt::FindChildOptions options = Qt::FindChildrenRecursively) const
182 {
183 return findChild<T>({}, options);
184 }
185
186 template<typename T>
187 QList<T> findChildren(Qt::FindChildOptions options = Qt::FindChildrenRecursively) const
188 {
189 return findChildren<T>(QAnyStringView{}, options);
190 }
191
192#if QT_CONFIG(regularexpression)
193 template<typename T>
194 inline QList<T> findChildren(const QRegularExpression &re, Qt::FindChildOptions options = Qt::FindChildrenRecursively) const
195 {
196 typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type ObjType;
197 static_assert(QtPrivate::HasQ_OBJECT_Macro<ObjType>::Value,
198 "No Q_OBJECT in the class passed to QObject::findChildren");
199 QList<T> list;
200 qt_qFindChildren_helper(this, re, ObjType::staticMetaObject,
201 reinterpret_cast<QList<void *> *>(&list), options);
202 return list;
203 }
204#endif // QT_CONFIG(regularexpression)
205
206 inline const QObjectList &children() const { return d_ptr->children; }
207
208 void setParent(QObject *parent);
209 void installEventFilter(QObject *filterObj);
210 void removeEventFilter(QObject *obj);
211
212 static QMetaObject::Connection connect(const QObject *sender, const char *signal,
213 const QObject *receiver, const char *member, Qt::ConnectionType = Qt::AutoConnection);
214
215 static QMetaObject::Connection connect(const QObject *sender, const QMetaMethod &signal,
216 const QObject *receiver, const QMetaMethod &method,
217 Qt::ConnectionType type = Qt::AutoConnection);
218
219 inline QMetaObject::Connection connect(const QObject *sender, const char *signal,
220 const char *member, Qt::ConnectionType type = Qt::AutoConnection) const;
221
222#ifdef Q_QDOC
223 template<typename PointerToMemberFunction>
224 static QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type = Qt::AutoConnection);
225 template<typename PointerToMemberFunction, typename Functor>
226 static QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor);
227 template<typename PointerToMemberFunction, typename Functor>
228 static QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type = Qt::AutoConnection);
229#else
230 //connect with context
231 template <typename Func1, typename Func2>
232 static inline QMetaObject::Connection
233 connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal,
234 const typename QtPrivate::ContextTypeForFunctor<Func2>::ContextType *context, Func2 &&slot,
235 Qt::ConnectionType type = Qt::AutoConnection)
236 {
237 typedef QtPrivate::FunctionPointer<Func1> SignalType;
238 typedef QtPrivate::FunctionPointer<std::decay_t<Func2>> SlotType;
239
240 if constexpr (SlotType::ArgumentCount != -1) {
241 static_assert((QtPrivate::AreArgumentsCompatible<typename SlotType::ReturnType, typename SignalType::ReturnType>::value),
242 "Return type of the slot is not compatible with the return type of the signal.");
243 } else {
244 constexpr int FunctorArgumentCount = QtPrivate::ComputeFunctorArgumentCount<std::decay_t<Func2>, typename SignalType::Arguments>::Value;
245 [[maybe_unused]]
246 constexpr int SlotArgumentCount = (FunctorArgumentCount >= 0) ? FunctorArgumentCount : 0;
247 typedef typename QtPrivate::FunctorReturnType<std::decay_t<Func2>, typename QtPrivate::List_Left<typename SignalType::Arguments, SlotArgumentCount>::Value>::type SlotReturnType;
248
249 static_assert((QtPrivate::AreArgumentsCompatible<SlotReturnType, typename SignalType::ReturnType>::value),
250 "Return type of the slot is not compatible with the return type of the signal.");
251 }
252
253 static_assert(QtPrivate::HasQ_OBJECT_Macro<typename SignalType::Object>::Value,
254 "No Q_OBJECT in the class with the signal");
255
256 //compilation error if the arguments does not match.
257 static_assert(int(SignalType::ArgumentCount) >= int(SlotType::ArgumentCount),
258 "The slot requires more arguments than the signal provides.");
259
260 const int *types = nullptr;
261 if (type == Qt::QueuedConnection || type == Qt::BlockingQueuedConnection)
262 types = QtPrivate::ConnectionTypes<typename SignalType::Arguments>::types();
263
264 void **pSlot = nullptr;
265 if constexpr (std::is_member_function_pointer_v<std::decay_t<Func2>>) {
266 pSlot = const_cast<void **>(reinterpret_cast<void *const *>(&slot));
267 } else {
268 Q_ASSERT_X((type & Qt::UniqueConnection) == 0, "",
269 "QObject::connect: Unique connection requires the slot to be a pointer to "
270 "a member function of a QObject subclass.");
271 }
272
273 return connectImpl(sender, reinterpret_cast<void **>(&signal), context, pSlot,
274 QtPrivate::makeCallableObject<Func1>(std::forward<Func2>(slot)),
275 type, types, &SignalType::Object::staticMetaObject);
276 }
277
278#ifndef QT_NO_CONTEXTLESS_CONNECT
279 //connect without context
280 template <typename Func1, typename Func2>
281 static inline QMetaObject::Connection
282 connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, Func2 &&slot)
283 {
284 return connect(sender, signal, sender, std::forward<Func2>(slot), Qt::DirectConnection);
285 }
286#endif // QT_NO_CONTEXTLESS_CONNECT
287#endif //Q_QDOC
288
289 static bool disconnect(const QObject *sender, const char *signal,
290 const QObject *receiver, const char *member);
291 static bool disconnect(const QObject *sender, const QMetaMethod &signal,
292 const QObject *receiver, const QMetaMethod &member);
293 inline bool disconnect(const char *signal = nullptr,
294 const QObject *receiver = nullptr, const char *member = nullptr) const
295 { return disconnect(this, signal, receiver, member); }
296 inline bool disconnect(const QObject *receiver, const char *member = nullptr) const
297 { return disconnect(this, nullptr, receiver, member); }
298#ifndef QT_NO_DISCONNECT_CONST_CONNECTION
299 static bool disconnect(const QMetaObject::Connection &);
300#endif
301 static bool disconnect(QMetaObject::Connection &);
302 static bool disconnect(QMetaObject::Connection &&conn)
303 { return disconnect(conn); } // call lvalue overload
304
305#ifdef Q_QDOC
306 template<typename PointerToMemberFunction>
307 static bool disconnect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method);
308#else
309 template <typename Func1, typename Func2>
310 static inline bool disconnect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal,
311 const typename QtPrivate::FunctionPointer<Func2>::Object *receiver, Func2 slot)
312 {
313 typedef QtPrivate::FunctionPointer<Func1> SignalType;
314 typedef QtPrivate::FunctionPointer<Func2> SlotType;
315
316 static_assert(QtPrivate::HasQ_OBJECT_Macro<typename SignalType::Object>::Value,
317 "No Q_OBJECT in the class with the signal");
318
319 //compilation error if the arguments does not match.
320 static_assert((QtPrivate::CheckCompatibleArguments<typename SignalType::Arguments, typename SlotType::Arguments>::value),
321 "Signal and slot arguments are not compatible.");
322
323 return disconnectImpl(sender, reinterpret_cast<void **>(&signal), receiver, reinterpret_cast<void **>(&slot),
324 &SignalType::Object::staticMetaObject);
325 }
326 template <typename Func1>
327 static inline bool disconnect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal,
328 const QObject *receiver, void **zero)
329 {
330 // This is the overload for when one wish to disconnect a signal from any slot. (slot=nullptr)
331 // Since the function template parameter cannot be deduced from '0', we use a
332 // dummy void ** parameter that must be equal to 0
333 Q_ASSERT(!zero);
334 typedef QtPrivate::FunctionPointer<Func1> SignalType;
335 return disconnectImpl(sender, reinterpret_cast<void **>(&signal), receiver, zero,
336 &SignalType::Object::staticMetaObject);
337 }
338#endif //Q_QDOC
339
340 void dumpObjectTree() const;
341 void dumpObjectInfo() const;
342
343 QT_CORE_INLINE_SINCE(6, 6)
344 bool setProperty(const char *name, const QVariant &value);
345 inline bool setProperty(const char *name, QVariant &&value);
346 QVariant property(const char *name) const;
347 QList<QByteArray> dynamicPropertyNames() const;
348 QBindingStorage *bindingStorage() { return &d_ptr->bindingStorage; }
349 const QBindingStorage *bindingStorage() const { return &d_ptr->bindingStorage; }
350
351Q_SIGNALS:
352 void destroyed(QObject * = nullptr);
353 void objectNameChanged(const QString &objectName, QPrivateSignal);
354
355public:
356 inline QObject *parent() const { return d_ptr->parent; }
357
358 inline bool inherits(const char *classname) const
359 {
360 return const_cast<QObject *>(this)->qt_metacast(classname) != nullptr;
361 }
362
363public Q_SLOTS:
364 void deleteLater();
365
366protected:
367 QObject *sender() const;
368 int senderSignalIndex() const;
369 int receivers(const char *signal) const;
370 bool isSignalConnected(const QMetaMethod &signal) const;
371
372 virtual void timerEvent(QTimerEvent *event);
373 virtual void childEvent(QChildEvent *event);
374 virtual void customEvent(QEvent *event);
375
376 virtual void connectNotify(const QMetaMethod &signal);
377 virtual void disconnectNotify(const QMetaMethod &signal);
378
379protected:
380 QObject(QObjectPrivate &dd, QObject *parent = nullptr);
381
382protected:
383 QScopedPointer<QObjectData> d_ptr;
384
385 friend struct QMetaObject;
386 friend struct QMetaObjectPrivate;
387 friend class QMetaCallEvent;
388 friend class QApplication;
389 friend class QApplicationPrivate;
390 friend class QCoreApplication;
391 friend class QCoreApplicationPrivate;
392 friend class QWidget;
393 friend class QAccessibleWidget;
394 friend class QThreadData;
395
396private:
397 void doSetObjectName(const QString &name);
398#if QT_CORE_REMOVED_SINCE(6, 10)
399 bool doSetProperty(const char *name, const QVariant *lvalue, QVariant *rvalue);
400#endif
401 bool doSetProperty(const char *name, const QVariant &value, QVariant *rvalue);
402
403 Q_DISABLE_COPY(QObject)
404
405private:
406 static QMetaObject::Connection connectImpl(const QObject *sender, void **signal,
407 const QObject *receiver, void **slotPtr,
408 QtPrivate::QSlotObjectBase *slot, Qt::ConnectionType type,
409 const int *types, const QMetaObject *senderMetaObject);
410
411 static bool disconnectImpl(const QObject *sender, void **signal, const QObject *receiver, void **slot,
412 const QMetaObject *senderMetaObject);
413
414};
415
416inline QMetaObject::Connection QObject::connect(const QObject *asender, const char *asignal,
417 const char *amember, Qt::ConnectionType atype) const
418{ return connect(asender, asignal, this, amember, atype); }
419
420#if QT_CORE_INLINE_IMPL_SINCE(6, 6)
421bool QObject::setProperty(const char *name, const QVariant &value)
422{
423 return doSetProperty(name, value, nullptr);
424}
425#endif // inline since 6.6
426bool QObject::setProperty(const char *name, QVariant &&value)
427{
428 return doSetProperty(name, value, &value);
429}
430
431template <class T>
432inline T qobject_cast(QObject *object)
433{
434 return QtPrivate::qobject_cast_helper<T>(object);
435}
436
437template <class T>
438inline T qobject_cast(const QObject *object)
439{
440 static_assert(std::is_const_v<std::remove_pointer_t<T>>,
441 "qobject_cast cannot cast away constness (use const_cast)");
442 return QtPrivate::qobject_cast_helper<T>(object);
443}
444
445template <class T> constexpr const char * qobject_interface_iid() = delete;
446template <class T> inline T *
447qobject_iid_cast(QObject *object, const char *IId = qobject_interface_iid<T *>())
448{
449 return reinterpret_cast<T *>((object ? object->qt_metacast(IId) : nullptr));
450}
451template <class T> inline std::enable_if_t<std::is_const<T>::value, T *>
452qobject_iid_cast(const QObject *object)
453{
454 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-const-cast)
455 QObject *o = const_cast<QObject *>(object);
456 return qobject_iid_cast<std::remove_cv_t<T>>(o);
457}
458
459#if defined(Q_QDOC)
460# define Q_DECLARE_INTERFACE(IFace, IId)
461#elif !defined(Q_MOC_RUN)
462# define Q_DECLARE_INTERFACE(IFace, IId)
463 template <> constexpr const char *qobject_interface_iid<IFace *>()
464 { return IId; }
465 template <> inline IFace *qobject_cast<IFace *>(QObject *object)
466 { return qobject_iid_cast<IFace>(object); }
467 template <> inline const IFace *qobject_cast<const IFace *>(const QObject *object)
468 { return qobject_iid_cast<const IFace>(object); }
469#endif // Q_MOC_RUN
470
471inline const QBindingStorage *qGetBindingStorage(const QObject *o)
472{
473 return o->bindingStorage();
474}
476{
477 return o->bindingStorage();
478}
479
480#ifndef QT_NO_DEBUG_STREAM
481Q_CORE_EXPORT QDebug operator<<(QDebug, const QObject *);
482#endif
483
485{
486public:
488 inline explicit QSignalBlocker(QObject *o) noexcept;
490 inline explicit QSignalBlocker(QObject &o) noexcept;
491 inline ~QSignalBlocker();
492
494 inline QSignalBlocker(QSignalBlocker &&other) noexcept;
495 inline QSignalBlocker &operator=(QSignalBlocker &&other) noexcept;
496
497 inline void reblock() noexcept;
498 inline void unblock() noexcept;
499 inline void dismiss() noexcept;
500
501private:
503 QObject *m_o;
504 bool m_blocked;
505 bool m_inhibited;
506};
507
508QSignalBlocker::QSignalBlocker(QObject *o) noexcept
509 : m_o(o),
510 m_blocked(o && o->blockSignals(true)),
511 m_inhibited(false)
512{}
513
514QSignalBlocker::QSignalBlocker(QObject &o) noexcept
515 : m_o(&o),
516 m_blocked(o.blockSignals(true)),
517 m_inhibited(false)
518{}
519
520QSignalBlocker::QSignalBlocker(QSignalBlocker &&other) noexcept
521 : m_o(other.m_o),
522 m_blocked(other.m_blocked),
523 m_inhibited(other.m_inhibited)
524{
525 other.m_o = nullptr;
526}
527
529{
530 if (this != &other) {
531 // if both *this and other block the same object's signals:
532 // unblock *this iff our dtor would unblock, but other's wouldn't
533 if (m_o != other.m_o || (!m_inhibited && other.m_inhibited))
534 unblock();
535 m_o = other.m_o;
536 m_blocked = other.m_blocked;
537 m_inhibited = other.m_inhibited;
538 // disable other:
539 other.m_o = nullptr;
540 }
541 return *this;
542}
543
545{
546 if (m_o && !m_inhibited)
547 m_o->blockSignals(m_blocked);
548}
549
550void QSignalBlocker::reblock() noexcept
551{
552 if (m_o)
553 m_o->blockSignals(true);
554 m_inhibited = false;
555}
556
557void QSignalBlocker::unblock() noexcept
558{
559 if (m_o)
560 m_o->blockSignals(m_blocked);
561 m_inhibited = true;
562}
563
564void QSignalBlocker::dismiss() noexcept
565{
566 m_o = nullptr;
567}
568
569namespace QtPrivate {
570 inline QObject & deref_for_methodcall(QObject &o) { return o; }
571 inline QObject & deref_for_methodcall(QObject *o) { return *o; }
572}
573#define Q_SET_OBJECT_NAME(obj) QT_PREPEND_NAMESPACE(QtPrivate)::deref_for_methodcall(obj).setObjectName(QLatin1StringView(#obj))
574
575QT_END_NAMESPACE
576
577#endif
578
579#endif // QOBJECT_H
QDynamicMetaObjectData * metaObject
Definition qobject.h:91
uint isDeletingChildren
Definition qobject.h:80
uint isWindow
Definition qobject.h:83
uint receiveChildEvents
Definition qobject.h:82
uint wasDeleted
Definition qobject.h:79
QObject * q_ptr
Definition qobject.h:73
uint deleteLaterCalled
Definition qobject.h:84
uint receiveParentEvents
Definition qobject.h:88
const QMetaObject * dynamicMetaObject() const
Definition qobject.cpp:163
uint unused
Definition qobject.h:89
uint isQuickItem
Definition qobject.h:85
uint isWidget
Definition qobject.h:77
uint sendChildEvents
Definition qobject.h:81
QAtomicInt postedEvents
Definition qobject.h:90
QObjectList children
Definition qobject.h:75
uint blockSig
Definition qobject.h:78
uint wasWidget
Definition qobject.h:87
uint willBeWidget
Definition qobject.h:86
QObject * parent
Definition qobject.h:74
QBindingStorage bindingStorage
Definition qobject.h:92
\inmodule QtCore
Definition qobject.h:106
friend class QWidget
Definition qpainter.h:432
Exception-safe wrapper around QObject::blockSignals().
Definition qobject.h:485
void dismiss() noexcept
Definition qobject.h:564
void unblock() noexcept
Temporarily restores the QObject::signalsBlocked() state to what it was before this QSignalBlocker's ...
Definition qobject.h:557
void reblock() noexcept
Re-blocks signals after a previous unblock().
Definition qobject.h:550
QSignalBlocker & operator=(QSignalBlocker &&other) noexcept
Move-assigns this signal blocker from other.
Definition qobject.h:528
~QSignalBlocker()
Destructor.
Definition qobject.h:544
Combined button and popup list for selecting options.
QObject & deref_for_methodcall(QObject *o)
Definition qobject.h:571
QObject & deref_for_methodcall(QObject &o)
Definition qobject.h:570
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
Definition qdir.cpp:2582
std::enable_if_t< std::is_const< T >::value, T * > qobject_iid_cast(const QObject *object)
Definition qobject.h:452
const QBindingStorage * qGetBindingStorage(const QObject *o)
Definition qobject.h:471
constexpr const char * qobject_interface_iid()=delete
Q_CORE_EXPORT void qt_qFindChildren_helper(const QObject *parent, QAnyStringView name, const QMetaObject &mo, QList< void * > *list, Qt::FindChildOptions options)
Definition qobject.cpp:2208
T qobject_cast(QObject *object)
\variable QObject::staticMetaObject
Definition qobject.h:432
T * qobject_iid_cast(QObject *object, const char *IId=qobject_interface_iid< T * >())
Definition qobject.h:447
QList< QObject * > QObjectList
Definition qobject.h:46
Q_CORE_EXPORT void qt_qFindChildren_helper(const QObject *parent, const QRegularExpression &re, const QMetaObject &mo, QList< void * > *list, Qt::FindChildOptions options)
T qobject_cast(const QObject *object)
Definition qobject.h:438
QBindingStorage * qGetBindingStorage(QObject *o)
Definition qobject.h:475
QT_BEGIN_NAMESPACE constexpr UINT KillProcessExitCode