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