QtBase  v6.3.1
qobject_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2019 The Qt Company Ltd.
4 ** Copyright (C) 2013 Olivier Goffart <ogoffart@woboq.com>
5 ** Contact: https://www.qt.io/licensing/
6 **
7 ** This file is part of the QtCore module of the Qt Toolkit.
8 **
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see https://www.qt.io/terms-conditions. For further
16 ** information use the contact form at https://www.qt.io/contact-us.
17 **
18 ** GNU Lesser General Public License Usage
19 ** Alternatively, this file may be used under the terms of the GNU Lesser
20 ** General Public License version 3 as published by the Free Software
21 ** Foundation and appearing in the file LICENSE.LGPL3 included in the
22 ** packaging of this file. Please review the following information to
23 ** ensure the GNU Lesser General Public License version 3 requirements
24 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
25 **
26 ** GNU General Public License Usage
27 ** Alternatively, this file may be used under the terms of the GNU
28 ** General Public License version 2.0 or (at your option) the GNU General
29 ** Public license version 3 or any later version approved by the KDE Free
30 ** Qt Foundation. The licenses are as published by the Free Software
31 ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
32 ** included in the packaging of this file. Please review the following
33 ** information to ensure the GNU General Public License requirements will
34 ** be met: https://www.gnu.org/licenses/gpl-2.0.html and
35 ** https://www.gnu.org/licenses/gpl-3.0.html.
36 **
37 ** $QT_END_LICENSE$
38 **
39 ****************************************************************************/
40 
41 #ifndef QOBJECT_P_H
42 #define QOBJECT_P_H
43 
44 //
45 // W A R N I N G
46 // -------------
47 //
48 // This file is not part of the Qt API. It exists for the convenience
49 // of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header
50 // file may change from version to version without notice, or even be removed.
51 //
52 // We mean it.
53 //
54 
55 #include <QtCore/private/qglobal_p.h>
56 #include "QtCore/qcoreevent.h"
57 #include "QtCore/qlist.h"
58 #include "QtCore/qobject.h"
59 #include "QtCore/qpointer.h"
60 #include "QtCore/qsharedpointer.h"
61 #include "QtCore/qvariant.h"
62 #include "QtCore/qproperty.h"
63 #include "QtCore/private/qproperty_p.h"
64 
66 
67 class QVariant;
68 class QThreadData;
69 class QObjectConnectionListVector;
71 
72 /* for Qt Test */
74 {
75  typedef void (*BeginCallback)(QObject *caller, int signal_or_method_index, void **argv);
76  typedef void (*EndCallback)(QObject *caller, int signal_or_method_index);
81 };
82 void Q_CORE_EXPORT qt_register_signal_spy_callbacks(QSignalSpyCallbackSet *callback_set);
83 
85 
87 
88 class Q_CORE_EXPORT QAbstractDeclarativeData
89 {
90 public:
91  static void (*destroyed)(QAbstractDeclarativeData *, QObject *);
92  static void (*signalEmitted)(QAbstractDeclarativeData *, QObject *, int, void **);
93  static int (*receivers)(QAbstractDeclarativeData *, const QObject *, int);
94  static bool (*isSignalConnected)(QAbstractDeclarativeData *, const QObject *, int);
95  static void (*setWidgetParent)(QObject *, QObject *); // Used by the QML engine to specify parents for widgets. Set by QtWidgets.
96 };
97 
98 class Q_CORE_EXPORT QObjectPrivate : public QObjectData
99 {
100 public:
101  Q_DECLARE_PUBLIC(QObject)
102 
103  struct ExtraData
104  {
105  ExtraData(QObjectPrivate *ptr) : parent(ptr) { }
106 
107  inline void setObjectNameForwarder(const QString &name)
108  {
109  parent->q_func()->setObjectName(name);
110  }
111 
112  inline void nameChangedForwarder(const QString &name)
113  {
114  Q_EMIT parent->q_func()->objectNameChanged(name, QObject::QPrivateSignal());
115  }
116 
125  };
126 
127  typedef void (*StaticMetaCallFunction)(QObject *, QMetaObject::Call, int, void **);
128  struct Connection;
129  struct SignalVector;
130 
132  union {
133  // linked list of orphaned connections that need cleaning up
135  // linked list of connections connected to slots in this object
137  };
138 
140  {
141  if (reinterpret_cast<quintptr>(c) & 1)
142  return reinterpret_cast<SignalVector *>(reinterpret_cast<quintptr>(c) & ~quintptr(1u));
143  return nullptr;
144  }
146  return reinterpret_cast<Connection *>(reinterpret_cast<quintptr>(v) | quintptr(1u));
147  }
148  };
149 
151  {
152  // linked list of connections connected to slots in this object, next is in base class
154  // linked list of connections connected to signals in this object
157 
161  union {
162  StaticMetaCallFunction callFunction;
164  };
167  uint id = 0;
170  signed int signal_index : 27; // In signal range (see QObjectPrivate::signalIndex())
171  ushort connectionType : 2; // 0 == auto, 1 == direct, 2 == queued, 3 == blocking
175  Connection() : ref_(2), ownArgumentTypes(true) {
176  //ref_ is 2 for the use in the internal lists, and for the use in QMetaObject::Connection
177  }
178  ~Connection();
179  int method() const { Q_ASSERT(!isSlotObject); return method_offset + method_relative; }
180  void ref() { ref_.ref(); }
182  {
183  if (isSlotObject) {
184  slotObj->destroyIfLastRef();
185  isSlotObject = false;
186  }
187  }
188  void deref()
189  {
190  if (!ref_.deref()) {
191  Q_ASSERT(!receiver.loadRelaxed());
192  Q_ASSERT(!isSlotObject);
193  delete this;
194  }
195  }
196  };
197  // ConnectionList is a singly-linked list
198  struct ConnectionList {
201  };
202 
203  struct Sender
204  {
205  Sender(QObject *receiver, QObject *sender, int signal)
206  : receiver(receiver), sender(sender), signal(signal)
207  {
208  if (receiver) {
209  ConnectionData *cd = receiver->d_func()->connections.loadRelaxed();
210  previous = cd->currentSender;
211  cd->currentSender = this;
212  }
213  }
215  {
216  if (receiver)
217  receiver->d_func()->connections.loadRelaxed()->currentSender = previous;
218  }
220  {
221  Sender *s = this;
222  while (s) {
223  s->receiver = nullptr;
224  s = s->previous;
225  }
226  }
230  int signal;
231  };
232 
235  // ConnectionList signals[]
237  {
238  return reinterpret_cast<ConnectionList *>(this + 1)[i + 1];
239  }
240  const ConnectionList &at(int i) const
241  {
242  return reinterpret_cast<const ConnectionList *>(this + 1)[i + 1];
243  }
244  int count() const { return static_cast<int>(allocated); }
245  };
246 
247  /*
248  This contains the all connections from and to an object.
249 
250  The signalVector contains the lists of connections for a given signal. The index in the vector correspond
251  to the signal index. The signal index is the one returned by QObjectPrivate::signalIndex (not
252  QMetaObject::indexOfSignal). allsignals contains a list of special connections that will get invoked on
253  any signal emission. This is done by connecting to signal index -1.
254 
255  This vector is protected by the object mutex (signalSlotLock())
256 
257  Each Connection is also part of a 'senders' linked list. This one contains all connections connected
258  to a slot in this object. The mutex of the receiver must be locked when touching the pointers of this
259  linked list.
260  */
261  struct ConnectionData {
262  // the id below is used to avoid activating new connections. When the object gets
263  // deleted it's set to 0, so that signal emission stops
267  Connection *senders = nullptr;
268  Sender *currentSender = nullptr; // object currently activating the object
270 
272  {
273  Q_ASSERT(ref.loadRelaxed() == 0);
274  auto *c = orphaned.fetchAndStoreRelaxed(nullptr);
275  if (c)
276  deleteOrphaned(c);
277  SignalVector *v = signalVector.loadRelaxed();
278  if (v) {
279  v->~SignalVector();
280  free(v);
281  }
282  }
283 
284  // must be called on the senders connection data
285  // assumes the senders and receivers lock are held
286  void removeConnection(Connection *c);
287  enum LockPolicy {
289  // Beware that we need to temporarily release the lock
290  // and thus calling code must carefully consider whether
291  // invariants still hold.
292  AlreadyLockedAndTemporarilyReleasingLock
293  };
294  void cleanOrphanedConnections(QObject *sender, LockPolicy lockPolicy = NeedToLock)
295  {
296  if (orphaned.loadRelaxed() && ref.loadAcquire() == 1)
297  cleanOrphanedConnectionsImpl(sender, lockPolicy);
298  }
299  void cleanOrphanedConnectionsImpl(QObject *sender, LockPolicy lockPolicy);
300 
302  {
303  return signalVector.loadRelaxed()->at(signal);
304  }
305 
307  {
308  SignalVector *vector = this->signalVector.loadRelaxed();
309  if (vector && vector->allocated > size)
310  return;
311  size = (size + 7) & ~7;
312  void *ptr = malloc(sizeof(SignalVector) + (size + 1) * sizeof(ConnectionList));
313  auto newVector = new (ptr) SignalVector;
314 
315  int start = -1;
316  if (vector) {
317  // not (yet) existing trait:
318  //static_assert(std::is_relocatable_v<SignalVector>);
319  //static_assert(std::is_relocatable_v<ConnectionList>);
320  memcpy(newVector, vector, sizeof(SignalVector) + (vector->allocated + 1) * sizeof(ConnectionList));
321  start = vector->count();
322  }
323  for (int i = start; i < int(size); ++i)
324  new (&newVector->at(i)) ConnectionList();
325  newVector->next = nullptr;
326  newVector->allocated = size;
327 
328  signalVector.storeRelaxed(newVector);
329  if (vector) {
330  Connection *o = nullptr;
331  /* No ABA issue here: When adding a node, we only care about the list head, it doesn't
332  * matter if the tail changes.
333  */
334  do {
335  o = orphaned.loadRelaxed();
336  vector->nextInOrphanList = o;
337  } while (!orphaned.testAndSetRelease(o, ConnectionOrSignalVector::fromSignalVector(vector)));
338 
339  }
340  }
341  int signalVectorCount() const
342  {
343  return signalVector.loadAcquire() ? signalVector.loadRelaxed()->count() : -1;
344  }
345 
346  static void deleteOrphaned(ConnectionOrSignalVector *c);
347  };
348 
350  virtual ~QObjectPrivate();
351  void deleteChildren();
352  // used to clear binding storage early in ~QObject
353  void clearBindingStorage();
354 
355  inline void checkForIncompatibleLibraryVersion(int version) const;
356 
357  void setParent_helper(QObject *);
358  void moveToThread_helper();
359  void setThreadData_helper(QThreadData *currentData, QThreadData *targetData);
360  void _q_reregisterTimers(void *pointer);
361 
362  bool isSender(const QObject *receiver, const char *signal) const;
363  QObjectList receiverList(const char *signal) const;
364  QObjectList senderList() const;
365 
366  void addConnection(int signal, Connection *c);
367 
368  static QObjectPrivate *get(QObject *o) { return o->d_func(); }
369  static const QObjectPrivate *get(const QObject *o) { return o->d_func(); }
370 
371  int signalIndex(const char *signalName, const QMetaObject **meta = nullptr) const;
372  bool isSignalConnected(uint signalIdx, bool checkDeclarative = true) const;
373  bool maybeSignalConnected(uint signalIndex) const;
374  inline bool isDeclarativeSignalConnected(uint signalIdx) const;
375 
376  // To allow abitrary objects to call connectNotify()/disconnectNotify() without making
377  // the API public in QObject. This is used by QQmlNotifierEndpoint.
378  inline void connectNotify(const QMetaMethod &signal);
379  inline void disconnectNotify(const QMetaMethod &signal);
380 
381  template <typename Func1, typename Func2>
382  static inline QMetaObject::Connection connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal,
383  const typename QtPrivate::FunctionPointer<Func2>::Object *receiverPrivate, Func2 slot,
385 
386  template <typename Func1, typename Func2>
387  static inline bool disconnect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal,
388  const typename QtPrivate::FunctionPointer<Func2>::Object *receiverPrivate, Func2 slot);
389 
390  static QMetaObject::Connection connectImpl(const QObject *sender, int signal_index,
391  const QObject *receiver, void **slot,
392  QtPrivate::QSlotObjectBase *slotObj, int type,
393  const int *types, const QMetaObject *senderMetaObject);
394  static QMetaObject::Connection connect(const QObject *sender, int signal_index, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type);
395  static QMetaObject::Connection connect(const QObject *sender, int signal_index,
396  const QObject *receiver,
399  static bool disconnect(const QObject *sender, int signal_index, void **slot);
400  static bool disconnect(const QObject *sender, int signal_index, const QObject *receiver,
401  void **slot);
402  static bool disconnect(Connection *c);
403 
405  {
406  if (connections.loadRelaxed())
407  return;
408  ConnectionData *cd = new ConnectionData;
409  cd->ref.ref();
410  connections.storeRelaxed(cd);
411  }
412 
413 public:
414  mutable ExtraData *extraData; // extra data set by the user
415  // This atomic requires acquire/release semantics in a few places,
416  // e.g. QObject::moveToThread must synchronize with QCoreApplication::postEvent,
417  // because postEvent is thread-safe.
418  // However, most of the code paths involving QObject are only reentrant and
419  // not thread-safe, so synchronization should not be necessary there.
420  QAtomicPointer<QThreadData> threadData; // id of the thread that owns the object
421 
424 
425  union {
426  QObject *currentChildBeingDeleted; // should only be used when QObjectData::isDeletingChildren is set
427  QAbstractDeclarativeData *declarativeData; //extra data used by the declarative module
428  };
429 
430  // these objects are all used to indicate that a QObject was deleted
431  // plus QPointer, which keeps a separate list
433 };
434 
436 
437 /*
438  Catch mixing of incompatible library versions.
439 
440  Should be called from the constructor of every non-final subclass
441  of QObjectPrivate, to ensure we catch incompatibilities between
442  the intermediate base and subclasses thereof.
443 */
445 {
446 #if defined(QT_BUILD_INTERNAL)
447  // Don't check the version parameter in internal builds.
448  // This allows incompatible versions to be loaded, possibly for testing.
449  Q_UNUSED(version);
450 #else
452  qFatal("Cannot mix incompatible Qt library (%d.%d.%d) with this library (%d.%d.%d)",
453  (version >> 16) & 0xff, (version >> 8) & 0xff, version & 0xff,
454  (QObjectPrivateVersion >> 16) & 0xff, (QObjectPrivateVersion >> 8) & 0xff, QObjectPrivateVersion & 0xff);
455  }
456 #endif
457 }
458 
459 inline bool QObjectPrivate::isDeclarativeSignalConnected(uint signal_index) const
460 {
463 }
464 
466 {
468 }
469 
471 {
473 }
474 
475 namespace QtPrivate {
476 
477 template <typename Func>
479 {
480  Func f;
481  Func &func() noexcept { return f; }
482 };
483 
484 template <typename Func>
486 {
487  Func &func() noexcept { return *this; }
488  using Func::Func;
489 };
490 
491 template <typename Func>
492 using FunctionStorage = typename std::conditional_t<
493  std::conjunction_v<
494  std::is_empty<Func>,
495  std::negation<std::is_final<Func>>
496  >,
499  >;
500 
501 template <typename ObjPrivate> inline void assertObjectType(QObjectPrivate *d)
502 {
503  using Obj = std::remove_pointer_t<decltype(std::declval<ObjPrivate *>()->q_func())>;
504  assertObjectType<Obj>(d->q_ptr);
505 }
506 
507 template<typename Func, typename Args, typename R>
509 {
511  static void impl(int which, QSlotObjectBase *this_, QObject *r, void **a, bool *ret)
512  {
513  switch (which) {
514  case Destroy:
515  delete static_cast<QPrivateSlotObject*>(this_);
516  break;
517  case Call:
518  FuncType::template call<Args, R>(static_cast<QPrivateSlotObject*>(this_)->func(),
519  static_cast<typename FuncType::Object *>(QObjectPrivate::get(r)), a);
520  break;
521  case Compare:
522  *ret = *reinterpret_cast<Func *>(a) == static_cast<QPrivateSlotObject*>(this_)->func();
523  break;
524  case NumOperations: ;
525  }
526  }
527 public:
528  explicit QPrivateSlotObject(Func f) : QSlotObjectBase(&impl), FunctionStorage<Func>{std::move(f)} {}
529 };
530 } //namespace QtPrivate
531 
532 template <typename Func1, typename Func2>
534  const typename QtPrivate::FunctionPointer<Func2>::Object *receiverPrivate, Func2 slot,
536 {
537  typedef QtPrivate::FunctionPointer<Func1> SignalType;
538  typedef QtPrivate::FunctionPointer<Func2> SlotType;
540  "No Q_OBJECT in the class with the signal");
541 
542  //compilation error if the arguments does not match.
543  static_assert(int(SignalType::ArgumentCount) >= int(SlotType::ArgumentCount),
544  "The slot requires more arguments than the signal provides.");
546  "Signal and slot arguments are not compatible.");
548  "Return type of the slot is not compatible with the return type of the signal.");
549 
550  const int *types = nullptr;
553 
554  return QObject::connectImpl(sender, reinterpret_cast<void **>(&signal),
555  receiverPrivate->q_ptr, reinterpret_cast<void **>(&slot),
557  typename SignalType::ReturnType>(slot),
558  type, types, &SignalType::Object::staticMetaObject);
559 }
560 
561 template <typename Func1, typename Func2>
563  const typename QtPrivate::FunctionPointer< Func2 >::Object* receiverPrivate, Func2 slot)
564 {
565  typedef QtPrivate::FunctionPointer<Func1> SignalType;
566  typedef QtPrivate::FunctionPointer<Func2> SlotType;
568  "No Q_OBJECT in the class with the signal");
569  //compilation error if the arguments does not match.
571  "Signal and slot arguments are not compatible.");
572  return QObject::disconnectImpl(sender, reinterpret_cast<void **>(&signal),
573  receiverPrivate->q_ptr, reinterpret_cast<void **>(&slot),
574  &SignalType::Object::staticMetaObject);
575 }
576 
579 
580 class QSemaphore;
581 class Q_CORE_EXPORT QAbstractMetaCallEvent : public QEvent
582 {
583 public:
584  QAbstractMetaCallEvent(const QObject *sender, int signalId, QSemaphore *semaphore = nullptr)
585  : QEvent(MetaCall), signalId_(signalId), sender_(sender)
586 #if QT_CONFIG(thread)
587  , semaphore_(semaphore)
588 #endif
589  { Q_UNUSED(semaphore); }
591 
592  virtual void placeMetaCall(QObject *object) = 0;
593 
594  inline const QObject *sender() const { return sender_; }
595  inline int signalId() const { return signalId_; }
596 
597 private:
598  int signalId_;
599  const QObject *sender_;
600 #if QT_CONFIG(thread)
601  QSemaphore *semaphore_;
602 #endif
603 };
604 
605 class Q_CORE_EXPORT QMetaCallEvent : public QAbstractMetaCallEvent
606 {
607 public:
608  // blocking queued with semaphore - args always owned by caller
609  QMetaCallEvent(ushort method_offset, ushort method_relative,
611  const QObject *sender, int signalId,
612  void **args, QSemaphore *semaphore);
614  const QObject *sender, int signalId,
615  void **args, QSemaphore *semaphore);
616 
617  // queued - args allocated by event, copied by caller
618  QMetaCallEvent(ushort method_offset, ushort method_relative,
620  const QObject *sender, int signalId,
621  int nargs);
623  const QObject *sender, int signalId,
624  int nargs);
625 
626  ~QMetaCallEvent() override;
627 
628  inline int id() const { return d.method_offset_ + d.method_relative_; }
629  inline const void * const* args() const { return d.args_; }
630  inline void ** args() { return d.args_; }
631  inline const QMetaType *types() const { return reinterpret_cast<QMetaType *>(d.args_ + d.nargs_); }
632  inline QMetaType *types() { return reinterpret_cast<QMetaType *>(d.args_ + d.nargs_); }
633 
634  virtual void placeMetaCall(QObject *object) override;
635 
636 private:
637  inline void allocArgs();
638 
639  struct Data {
640  QtPrivate::QSlotObjectBase *slotObj_;
641  void **args_;
643  int nargs_;
644  ushort method_offset_;
645  ushort method_relative_;
646  } d;
647  // preallocate enough space for three arguments
648  alignas(void *) char prealloc_[3 * sizeof(void *) + 3 * sizeof(QMetaType)];
649 };
650 
652 {
654 public:
655  explicit inline QBoolBlocker(bool &b, bool value = true) : block(b), reset(b) { block = value; }
656  inline ~QBoolBlocker() { block = reset; }
657 
658 private:
659  bool &block;
660  bool reset;
661 };
662 
663 void Q_CORE_EXPORT qDeleteInEventHandler(QObject *o);
664 
666 struct Q_CORE_EXPORT QDynamicMetaObjectData
667 {
668  virtual ~QDynamicMetaObjectData();
669  virtual void objectDestroyed(QObject *) { delete this; }
670 
672  virtual int metaCall(QObject *, QMetaObject::Call, int _id, void **) = 0;
673 };
674 
675 struct Q_CORE_EXPORT QAbstractDynamicMetaObject : public QDynamicMetaObjectData, public QMetaObject
676 {
678 
679  QMetaObject *toDynamicMetaObject(QObject *) override { return this; }
680  virtual int createProperty(const char *, const char *) { return -1; }
681  int metaCall(QObject *, QMetaObject::Call c, int _id, void **a) override
682  { return metaCall(c, _id, a); }
683  virtual int metaCall(QMetaObject::Call, int _id, void **) { return _id; } // Compat overload
684 };
685 
687 {
688  return &o->bindingStorage;
689 }
691 {
692  return &o->bindingStorage;
693 }
695 {
696  return &ed->parent->bindingStorage;
697 }
699 {
700  return &ed->parent->bindingStorage;
701 }
702 
704 
705 #endif // QOBJECT_P_H
small capitals from c petite p scientific i
[1]
Definition: afcover.h:80
#define value
[5]
static bool(* isSignalConnected)(QAbstractDeclarativeData *, const QObject *, int)
Definition: qobject_p.h:94
const QObject * sender() const
Definition: qobject_p.h:594
virtual void placeMetaCall(QObject *object)=0
QAbstractMetaCallEvent(const QObject *sender, int signalId, QSemaphore *semaphore=nullptr)
Definition: qobject_p.h:584
int signalId() const
Definition: qobject_p.h:595
The QAtomicInt class provides platform-independent atomic operations on int.
Definition: qatomic.h:158
The QAtomicPointer class is a template class that provides platform-independent atomic operations on ...
Definition: qatomic.h:172
bool ref() noexcept
Definition: qbasicatomic.h:101
bool deref() noexcept
Definition: qbasicatomic.h:102
bool testAndSetRelease(Type expectedValue, Type newValue) noexcept
Definition: qbasicatomic.h:243
Type loadAcquire() const noexcept
Definition: qbasicatomic.h:233
Type loadRelaxed() const noexcept
Definition: qbasicatomic.h:226
void storeRelaxed(Type newValue) noexcept
Definition: qbasicatomic.h:227
Type fetchAndStoreRelaxed(Type newValue) noexcept
Definition: qbasicatomic.h:260
QBoolBlocker(bool &b, bool value=true)
Definition: qobject_p.h:655
The QEvent class is the base class of all event classes. Event objects contain event parameters.
Definition: qcoreevent.h:58
The QExplicitlySharedDataPointer class represents a pointer to an explicitly shared object.
Definition: qshareddata.h:161
qsizetype count() const noexcept
Definition: qlist.h:415
QMetaType * types()
Definition: qobject_p.h:632
int id() const
Definition: qobject_p.h:628
const void *const * args() const
Definition: qobject_p.h:629
void ** args()
Definition: qobject_p.h:630
const QMetaType * types() const
Definition: qobject_p.h:631
The QMetaMethod class provides meta-data about a member function.
Definition: qmetaobject.h:54
The QMetaType class manages named types in the meta-object system.
Definition: qmetatype.h:328
QObject * q_ptr
Definition: qobject.h:98
The QObject class is the base class of all Qt objects.
Definition: qobject.h:125
virtual void connectNotify(const QMetaMethod &signal)
Definition: qobject.cpp:3291
virtual void disconnectNotify(const QMetaMethod &signal)
Definition: qobject.cpp:3326
ExtraData * extraData
Definition: qobject_p.h:414
void ensureConnectionData()
Definition: qobject_p.h:404
void checkForIncompatibleLibraryVersion(int version) const
Definition: qobject_p.h:444
QAtomicPointer< ConnectionData > connections
Definition: qobject_p.h:423
static QMetaObject::Connection connect(const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
Definition: qobject_p.h:533
static const QObjectPrivate * get(const QObject *o)
Definition: qobject_p.h:369
void connectNotify(const QMetaMethod &signal)
Definition: qobject_p.h:465
void(* StaticMetaCallFunction)(QObject *, QMetaObject::Call, int, void **)
Definition: qobject_p.h:127
QAtomicPointer< QtSharedPointer::ExternalRefCountData > sharedRefcount
Definition: qobject_p.h:432
QObject * currentChildBeingDeleted
Definition: qobject_p.h:426
static bool disconnect(const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot)
Definition: qobject_p.h:562
void disconnectNotify(const QMetaMethod &signal)
Definition: qobject_p.h:470
QAbstractDeclarativeData * declarativeData
Definition: qobject_p.h:427
static QObjectPrivate * get(QObject *o)
Definition: qobject_p.h:368
QAtomicPointer< QThreadData > threadData
Definition: qobject_p.h:420
bool isDeclarativeSignalConnected(uint signalIdx) const
Definition: qobject_p.h:459
The QSemaphore class provides a general counting semaphore.
Definition: qsemaphore.h:55
The QString class provides a Unicode character string.
Definition: qstring.h:388
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:95
auto signalIndex
auto signal
int const char * version
Definition: zlib.h:814
#define true
Definition: ftrandom.c:51
ConnectionType
Definition: qnamespace.h:1304
@ AutoConnection
Definition: qnamespace.h:1305
@ BlockingQueuedConnection
Definition: qnamespace.h:1308
@ QueuedConnection
Definition: qnamespace.h:1307
void assertObjectType(QObjectPrivate *d)
Definition: qobject_p.h:501
typename std::conditional_t< std::conjunction_v< std::is_empty< Func >, std::negation< std::is_final< Func > > >, FunctionStorageEmptyBaseClassOptimization< Func >, FunctionStorageByValue< Func > > FunctionStorage
Definition: qobject_p.h:499
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro vuzp8 reg2 vuzp d d &reg2 endm macro vzip8 reg2 vzip d d &reg2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld endif[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1 beq endif SRC MASK if dst_r_bpp DST_R else add endif PF add sub src_basereg pixdeinterleave mask_basereg pixdeinterleave dst_r_basereg process_pixblock_head pixblock_size cache_preload_simple process_pixblock_tail pixinterleave dst_w_basereg irp beq endif process_pixblock_tail_head tst beq irp if pixblock_size chunk_size tst beq pixld SRC pixld MASK if DST_R else pixld DST_R endif if
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro vuzp8 reg2 vuzp d d &reg2 endm macro vzip8 reg2 vzip d d &reg2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld if[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1(dst_w_bpp<=(lowbit *8)) &&((lowbit *8)<(pixblock_size *dst_w_bpp)) .if lowbit< 16 tst DST_R
[3]
void
Definition: png.h:1080
#define Q_UNLIKELY(x)
EGLOutputLayerEXT EGLint EGLAttrib value
#define Q_DISABLE_COPY_MOVE(Class)
Definition: qglobal.h:519
#define QT_VERSION
Definition: qglobal.h:58
size_t quintptr
Definition: qglobal.h:310
unsigned int uint
Definition: qglobal.h:334
unsigned short ushort
Definition: qglobal.h:333
#define QT_CONFIG(feature)
Definition: qglobal.h:107
#define qFatal
Definition: qlogging.h:181
const QBindingStorage * qGetBindingStorage(const QObjectPrivate *o)
Definition: qobject_p.h:686
Q_CORE_EXPORT QBasicAtomicPointer< QSignalSpyCallbackSet > qt_signal_spy_callback_set
Definition: qobject.cpp:86
void Q_CORE_EXPORT qDeleteInEventHandler(QObject *o)
Definition: qobject.cpp:4806
void Q_CORE_EXPORT qt_register_signal_spy_callbacks(QSignalSpyCallbackSet *callback_set)
Definition: qobject.cpp:88
Q_DECLARE_TYPEINFO(QObjectPrivate::ConnectionList, Q_RELOCATABLE_TYPE)
@ QObjectPrivateVersion
Definition: qobject_p.h:86
GLenum type
Definition: qopengl.h:270
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLboolean r
[2]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLsizei GLenum GLenum * types
GLfloat GLfloat f
GLuint start
GLint ref
GLuint name
GLboolean reset
Definition: qopenglext.h:2748
GLenum func
Definition: qopenglext.h:663
const GLubyte * c
Definition: qopenglext.h:12701
GLsizei const void * pointer
Definition: qopenglext.h:384
GLdouble s
[6]
Definition: qopenglext.h:235
#define Q_ASSERT(cond)
Definition: qrandom.cpp:84
#define Q_EMIT
Definition: qtmetamacros.h:83
@ Q_RELOCATABLE_TYPE
Definition: qtypeinfo.h:156
Q_UNUSED(salary)
[21]
QList< int > vector
[14]
connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection)
myObject disconnect()
[26]
virtual int createProperty(const char *, const char *)
Definition: qobject_p.h:680
int metaCall(QObject *, QMetaObject::Call c, int _id, void **a) override
Definition: qobject_p.h:681
virtual int metaCall(QMetaObject::Call, int _id, void **)
Definition: qobject_p.h:683
QMetaObject * toDynamicMetaObject(QObject *) override
Definition: qobject_p.h:679
virtual QMetaObject * toDynamicMetaObject(QObject *)=0
virtual void objectDestroyed(QObject *)
Definition: qobject_p.h:669
virtual int metaCall(QObject *, QMetaObject::Call, int _id, void **)=0
The QMetaObject class contains meta-information about Qt objects.
Definition: qobjectdefs.h:165
QAtomicInteger< uint > currentConnectionId
Definition: qobject_p.h:264
QAtomicPointer< Connection > orphaned
Definition: qobject_p.h:269
ConnectionList & connectionsForSignal(int signal)
Definition: qobject_p.h:301
void resizeSignalVector(uint size)
Definition: qobject_p.h:306
void cleanOrphanedConnections(QObject *sender, LockPolicy lockPolicy=NeedToLock)
Definition: qobject_p.h:294
QAtomicPointer< SignalVector > signalVector
Definition: qobject_p.h:266
QAtomicPointer< const int > argumentTypes
Definition: qobject_p.h:165
QAtomicPointer< QThreadData > receiverThreadData
Definition: qobject_p.h:160
QAtomicPointer< Connection > nextConnectionList
Definition: qobject_p.h:155
QAtomicPointer< QObject > receiver
Definition: qobject_p.h:159
Connection * prevConnectionList
Definition: qobject_p.h:156
QtPrivate::QSlotObjectBase * slotObj
Definition: qobject_p.h:163
StaticMetaCallFunction callFunction
Definition: qobject_p.h:162
QAtomicPointer< Connection > last
Definition: qobject_p.h:200
QAtomicPointer< Connection > first
Definition: qobject_p.h:199
static SignalVector * asSignalVector(ConnectionOrSignalVector *c)
Definition: qobject_p.h:139
ConnectionOrSignalVector * nextInOrphanList
Definition: qobject_p.h:134
static Connection * fromSignalVector(SignalVector *v)
Definition: qobject_p.h:145
Q_OBJECT_COMPAT_PROPERTY(QObjectPrivate::ExtraData, QString, objectName, &QObjectPrivate::ExtraData::setObjectNameForwarder, &QObjectPrivate::ExtraData::nameChangedForwarder) QObjectPrivate *parent
void nameChangedForwarder(const QString &name)
Definition: qobject_p.h:112
QList< int > runningTimers
Definition: qobject_p.h:119
QList< QVariant > propertyValues
Definition: qobject_p.h:118
void setObjectNameForwarder(const QString &name)
Definition: qobject_p.h:107
QList< QPointer< QObject > > eventFilters
Definition: qobject_p.h:120
ExtraData(QObjectPrivate *ptr)
Definition: qobject_p.h:105
QList< QByteArray > propertyNames
Definition: qobject_p.h:117
Sender(QObject *receiver, QObject *sender, int signal)
Definition: qobject_p.h:205
const ConnectionList & at(int i) const
Definition: qobject_p.h:240
ConnectionList & at(int i)
Definition: qobject_p.h:236
void(* BeginCallback)(QObject *caller, int signal_or_method_index, void **argv)
Definition: qobject_p.h:75
BeginCallback slot_begin_callback
Definition: qobject_p.h:78
EndCallback slot_end_callback
Definition: qobject_p.h:80
EndCallback signal_end_callback
Definition: qobject_p.h:79
BeginCallback signal_begin_callback
Definition: qobject_p.h:77
void(* EndCallback)(QObject *caller, int signal_or_method_index)
Definition: qobject_p.h:76
static const int * types()
Definition: qobject_impl.h:71
List_Append< List< typename L::Car >, typename List_Left< typename L::Cdr, N - 1 >::Value >::Value Value
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent