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
QObjectPrivate Class Reference

#include <qobject_p.h>

Inherits QObjectData.

Inherited by MyClassPrivate, MyClassPrivate, QAbstractAnimationPrivate, QAbstractEventDispatcherPrivate, QAbstractItemDelegatePrivate, QAbstractItemModelPrivate, QAbstractItemModelTesterPrivate, QAbstractItemModelTesterPrivate, QAbstractNetworkCachePrivate, QAbstractSocketEnginePrivate, QAbstractTextDocumentLayoutPrivate, QActionGroupPrivate, QActionPrivate, QAnimationDriverPrivate, QAudioBufferOutputPrivate, QAudioDecoderPrivate, QButtonGroupPrivate, QCameraPrivate, QCompleterPrivate, QCoreApplicationPrivate, QDBusAbstractAdaptorPrivate, QDBusAbstractInterfacePrivate, QDBusServiceWatcherPrivate, QDBusServiceWatcherPrivate, QDataWidgetMapperPrivate, QDataWidgetMapperPrivate, QDnsLookupPrivate, QDragPrivate, QDtlsClientVerifierPrivate, QDtlsPrivate, QEventLoopPrivate, QFactoryLoaderPrivate, QFactoryLoaderPrivate, QFileSelectorPrivate [private], QFileSystemWatcherPrivate, QFutureWatcherBasePrivate, QGeoAreaMonitorSourcePrivate, QGeoAreaMonitorSourcePrivate, QGeoMapPrivate, QGeoPositionInfoSourcePrivate, QGeoRouteParserPrivate, QGeoSatelliteInfoSourcePrivate, QGeoTileFetcherPrivate, QGeoTiledMapScenePrivate, QGesturePrivate, QGraphicsAnchorPrivate, QGraphicsEffectPrivate, QGraphicsEffectSourcePrivate, QGraphicsSceneIndexPrivate, QGraphicsScenePrivate, QGraphicsTransformPrivate, QHelpSearchEngineCorePrivate, QHelpSearchEngineCorePrivate, QHttpMultiPartPrivate, QHttpNetworkConnectionPrivate, QHttpNetworkReplyPrivate, QIODevicePrivate, QInputDeviceManagerPrivate, QInputDevicePrivate, QInputMethodPrivate, QItemSelectionModelPrivate, QJSEnginePrivate, QLanguageServerPrivate, QLayoutPrivate, QLocalServerPrivate, QMediaCaptureSessionPrivate, QMediaFrameInputPrivate, QMediaPlayerPrivate, QMimeDataPrivate, QMimeDataPrivate, QMoviePrivate, QMoviePrivate, QNetworkAccessBackendPrivate, QNetworkAccessBackendPrivate, QNetworkAccessManagerPrivate, QNetworkConnectionMonitorPrivate, QNetworkConnectionMonitorPrivate, QNetworkConnectionMonitorPrivate, QNetworkConnectionMonitorPrivate, QNetworkConnectionMonitorPrivate, QNetworkConnectionMonitorPrivate, QNetworkCookieJarPrivate, QNetworkInformationPrivate, QNetworkInformationPrivate, QOffscreenSurfacePrivate, QOpenGLContextGroupPrivate, QOpenGLContextPrivate, QOpenGLShaderPrivate, QOpenGLShaderPrivate, QOpenGLShaderProgramPrivate, QOpenGLShaderProgramPrivate, QOpenGLTimeMonitorPrivate, QOpenGLTimeMonitorPrivate, QOpenGLTimerQueryPrivate, QOpenGLTimerQueryPrivate, QOpenGLVertexArrayObjectPrivate, QOpenGLVertexArrayObjectPrivate, QPacketProtocolPrivate, QPacketProtocolPrivate, QPdfWriterPrivate, QPdfWriterPrivate, QPixmapFilterPrivate, QPixmapFilterPrivate, QPlatformInputContextPrivate, QPlatformTextureListPrivate, QPlatformTextureListPrivate, QQC2::QStylePrivate, QQmlApplicationPrivate, QQmlBindPrivate, QQmlBindPrivate, QQmlComponentPrivate, QQmlConnectionsPrivate, QQmlConnectionsPrivate, QQmlContextPrivate, QQmlDebugClientPrivate, QQmlDebugConnectionPrivate, QQmlDebugConnectionPrivate, QQmlDebugServicePrivate, QQmlDebugServicePrivate, QQmlDelegateModelGroupPrivate, QQmlDelegateModelPrivate, QQmlExpressionPrivate, QQmlFileSelectorPrivate, QQmlInstantiatorPrivate, QQmlObjectModelPrivate, QQmlObjectModelPrivate, QQmlPropertyMapPrivate, QQmlPropertyMapPrivate, QQmlTimerPrivate, QQmlTimerPrivate, QQuick3DObjectPrivate, QQuickAbstractAnimationPrivate, QQuickActionGroupAttachedPrivate, QQuickActionGroupAttachedPrivate, QQuickActionGroupPrivate, QQuickActionGroupPrivate, QQuickActionPrivate, QQuickAnchorSetPrivate, QQuickAnchorSetPrivate, QQuickAnchorsPrivate, QQuickAnimationControllerPrivate, QQuickAnimationControllerPrivate, QQuickApplicationWindowAttachedPrivate, QQuickApplicationWindowAttachedPrivate, QQuickAttachedPropertyPropagatorPrivate, QQuickAttachedPropertyPropagatorPrivate, QQuickBehaviorPrivate, QQuickBehaviorPrivate, QQuickBoundaryRulePrivate, QQuickBoundaryRulePrivate, QQuickButtonGroupAttachedPrivate, QQuickButtonGroupAttachedPrivate, QQuickButtonGroupPrivate, QQuickButtonGroupPrivate, QQuickColorDialogImplAttachedPrivate, QQuickDeliveryAgentPrivate, QQuickDialogButtonBoxAttachedPrivate, QQuickDragAttachedPrivate, QQuickFileDialogImplAttachedPrivate, QQuickFolderDialogImplAttachedPrivate, QQuickFontDialogImplAttachedPrivate, QQuickFontLoaderPrivate, QQuickFontLoaderPrivate, QQuickFrameAnimationPrivate, QQuickFrameAnimationPrivate, QQuickImageResponsePrivate, QQuickIndicatorButtonPrivate, QQuickItemGrabResultPrivate, QQuickItemGrabResultPrivate, QQuickItemPrivate, QQuickKeyNavigationAttachedPrivate, QQuickKeysAttachedPrivate, QQuickMessageDialogImplAttachedPrivate, QQuickOverlayAttachedPrivate, QQuickOverlayAttachedPrivate, QQuickPackagePrivate, QQuickPackagePrivate, QQuickPathPrivate, QQuickPointerHandlerPrivate, QQuickPopupAnchorsPrivate, QQuickPopupPrivate, QQuickRangeSliderNodePrivate, QQuickRangeSliderNodePrivate, QQuickRenderControlPrivate, QQuickScrollBarAttachedPrivate, QQuickScrollIndicatorAttachedPrivate, QQuickScrollIndicatorAttachedPrivate, QQuickSplitHandleAttachedPrivate, QQuickSplitViewAttachedPrivate, QQuickStackViewAttachedPrivate, QQuickStateGroupPrivate, QQuickStateGroupPrivate, QQuickStateOperationPrivate, QQuickStatePrivate, QQuickSwipeDelegateAttachedPrivate, QQuickSwipeDelegateAttachedPrivate, QQuickSwipePrivate, QQuickSwipePrivate, QQuickSwipeViewAttachedPrivate, QQuickSwipeViewAttachedPrivate, QQuickSystemPalettePrivate, QQuickSystemPalettePrivate, QQuickTabBarAttachedPrivate, QQuickTabBarAttachedPrivate, QQuickTextAreaAttachedPrivate, QQuickTextAreaAttachedPrivate, QQuickTextControlPrivate, QQuickTextDocumentPrivate, QQuickToolTipAttachedPrivate, QQuickToolTipAttachedPrivate, QQuickTransformPrivate, QQuickTransitionPrivate, QQuickTransitionPrivate, QQuickTumblerAttachedPrivate, QRestAccessManagerPrivate, QSGAbstractRendererPrivate, QSGTexturePrivate, QScreenCapturePrivate, QScreenCapturePrivate, QScreenPrivate, QSessionManagerPrivate, QSettingsPrivate, QSharedImageLoaderPrivate, QSharedImageLoaderPrivate, QShortcutPrivate, QSignalMapperPrivate, QSignalMapperPrivate, QSocketNotifierPrivate, QSocketNotifierPrivate, QSqlDriverPrivate, QStyleHintsPrivate, QStylePrivate, QSvgRendererPrivate, QSvgRendererPrivate, QSyntaxHighlighterPrivate, QSyntaxHighlighterPrivate, QSystemTrayIconPrivate, QTcpServerPrivate, QTextDocumentPrivate, QTextObjectPrivate, QThreadPoolPrivate, QThreadPrivate, QTimeLinePrivate, QTimeLinePrivate, QTimerPrivate, QTranslatorPrivate, QTranslatorPrivate, QUndoGroupPrivate, QUndoGroupPrivate, QValidatorPrivate, QValidatorPrivate, QWavefrontMeshPrivate, QWavefrontMeshPrivate, QWaylandClientExtensionPrivate, QWaylandClientPrivate, QWaylandClientPrivate, QWaylandCompositorExtensionPrivate, QWaylandCompositorPrivate, QWaylandDestroyListenerPrivate, QWaylandDragPrivate, QWaylandDragPrivate, QWaylandInputMethodControlPrivate, QWaylandKeyboardPrivate, QWaylandKeymapPrivate, QWaylandOutputPrivate, QWaylandPointerPrivate, QWaylandQuickHardwareLayerPrivate, QWaylandQuickHardwareLayerPrivate, QWaylandSeatPrivate, QWaylandSurfaceGrabberPrivate, QWaylandSurfaceGrabberPrivate, QWaylandSurfacePrivate, QWaylandTouchPrivate, QWaylandViewPrivate, QWaylandXdgOutputV1Private, QWaylandXdgPopupPrivate, QWaylandXdgToplevelPrivate, QWidgetPrivate, QWidgetTextControlPrivate, QWinEventNotifierPrivate, QWindowCapturePrivate, QWindowCapturePrivate, QWindowPrivate, QtWaylandClient::QWaylandAbstractDecorationPrivate, and QtWaylandClient::QWaylandAbstractDecorationPrivate.

+ Collaboration diagram for QObjectPrivate:

Classes

struct  Connection
 
struct  ConnectionData
 
struct  ConnectionList
 
struct  ConnectionOrSignalVector
 
struct  ExtraData
 
struct  Sender
 
struct  SignalVector
 
struct  TaggedSignalVector
 

Public Types

typedef void(*) StaticMetaCallFunction(QObject *, QMetaObject::Call, int, void **)
 
using ConnectionDataPointer = QExplicitlySharedDataPointer<ConnectionData>
 

Public Member Functions

void ensureExtraData ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
virtual ~QObjectPrivate ()
 
void deleteChildren ()
 
void clearBindingStorage ()
 
void checkForIncompatibleLibraryVersion (int version) const
 
void setParent_helper (QObject *)
 
void moveToThread_helper ()
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData, QBindingStatus *status)
 
QObjectList receiverList (const char *signal) const
 
void ensureConnectionData ()
 
void addConnection (int signal, Connection *c)
 
int signalIndex (const char *signalName, const QMetaObject **meta=nullptr) const
 
bool isSignalConnected (uint signalIdx, bool checkDeclarative=true) const
 
bool maybeSignalConnected (uint signalIndex) const
 
bool isDeclarativeSignalConnected (uint signalIdx) const
 
void connectNotify (const QMetaMethod &signal)
 
void disconnectNotify (const QMetaMethod &signal)
 
void reinitBindingStorageAfterThreadMove ()
 
virtual std::string flagsForDumping () const
 
virtual void writeToDebugStream (QDebug &) const
 
QtPrivate::QPropertyAdaptorSlotObjectgetPropertyAdaptorSlotObject (const QMetaProperty &property)
 
- Public Member Functions inherited from QObjectData
 QObjectData ()=default
 
virtual ~QObjectData ()=0
 
QMetaObjectdynamicMetaObject () const
 

Static Public Member Functions

static bool removeConnection (Connection *c)
 
static QObjectPrivateget (QObject *o)
 
static const QObjectPrivateget (const QObject *o)
 
template<typename Func1 , typename Func2 >
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)
 
template<typename Func1 , typename Func2 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot)
 
static QMetaObject::Connection connectImpl (const QObject *sender, int signal_index, const QObject *receiver, void **slot, QtPrivate::QSlotObjectBase *slotObj, int type, const int *types, const QMetaObject *senderMetaObject)
 
static QMetaObject::Connection connect (const QObject *sender, int signal_index, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type)
 
static QMetaObject::Connection connect (const QObject *sender, int signal_index, const QObject *receiver, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type)
 
static bool disconnect (const QObject *sender, int signal_index, void **slot)
 
static bool disconnect (const QObject *sender, int signal_index, const QObject *receiver, void **slot)
 

Public Attributes

ExtraDataextraData
 
QAtomicPointer< QThreadDatathreadData
 
QAtomicPointer< ConnectionDataconnections
 
union { 
 
   QObject *   currentChildBeingDeleted 
 
   QAbstractDeclarativeData *   declarativeData 
 
};  
 
QAtomicPointer< QtSharedPointer::ExternalRefCountDatasharedRefcount
 
- Public Attributes inherited from QObjectData
QObjectq_ptr
 
QObjectparent
 
QObjectList children
 
uint isWidget: 1
 
uint blockSig: 1
 
uint wasDeleted: 1
 
uint isDeletingChildren: 1
 
uint sendChildEvents: 1
 
uint receiveChildEvents: 1
 
uint isWindow: 1
 
uint deleteLaterCalled: 1
 
uint isQuickItem: 1
 
uint willBeWidget: 1
 
uint wasWidget: 1
 
uint receiveParentEvents: 1
 
uint unused: 20
 
QAtomicInt postedEvents
 
QDynamicMetaObjectDatametaObject
 
QBindingStorage bindingStorage
 

Detailed Description

Definition at line 73 of file qobject_p.h.

Member Typedef Documentation

◆ ConnectionDataPointer

◆ StaticMetaCallFunction

void(*) QObjectPrivate::StaticMetaCallFunction(QObject *, QMetaObject::Call, int, void **)

Definition at line 108 of file qobject_p.h.

Constructor & Destructor Documentation

◆ QObjectPrivate()

QObjectPrivate::QObjectPrivate ( int version = QObjectPrivateVersion)

Definition at line 160 of file qobject.cpp.

◆ ~QObjectPrivate()

QObjectPrivate::~QObjectPrivate ( )
virtual

Definition at line 185 of file qobject.cpp.

Member Function Documentation

◆ addConnection()

void QObjectPrivate::addConnection ( int signal,
Connection * c )
inline

Add the connection c to the list of connections of the sender's object for the specified signal

The signalSlotLock() of the sender and receiver must be locked while calling this function

Will also add the connection in the sender's list of the receiver.

Definition at line 274 of file qobject.cpp.

◆ checkForIncompatibleLibraryVersion()

void QObjectPrivate::checkForIncompatibleLibraryVersion ( int version) const
inline

Definition at line 225 of file qobject_p.h.

◆ clearBindingStorage()

void QObjectPrivate::clearBindingStorage ( )

Definition at line 978 of file qobject.cpp.

◆ connect() [1/3]

QMetaObject::Connection QObjectPrivate::connect ( const QObject * sender,
int signal_index,
const QObject * receiver,
QtPrivate::QSlotObjectBase * slotObjRaw,
Qt::ConnectionType type )
static

Used by QML to connect a signal by index to a slot implemented in JavaScript (wrapped in a custom QSlotObjectBase subclass).

This is an overload that should be used when sender and receiver are different objects.

The signal_index is an index relative to the number of methods.

Definition at line 5460 of file qobject.cpp.

◆ connect() [2/3]

QMetaObject::Connection QObjectPrivate::connect ( const QObject * sender,
int signal_index,
QtPrivate::QSlotObjectBase * slotObj,
Qt::ConnectionType type )
static

Used by QML to connect a signal by index to a slot implemented in JavaScript (wrapped in a custom QSlotObjectBase subclass).

This version of connect assumes that sender and receiver are the same object.

The signal_index is an index relative to the number of methods.

Definition at line 5445 of file qobject.cpp.

◆ connect() [3/3]

template<typename Func1 , typename Func2 >
QMetaObject::Connection QObjectPrivate::connect ( const typename QtPrivate::FunctionPointer< Func1 >::Object * sender,
Func1 signal,
const typename QtPrivate::FunctionPointer< Func2 >::Object * receiverPrivate,
Func2 slot,
Qt::ConnectionType type = Qt::AutoConnection )
inlinestatic

Definition at line 299 of file qobject_p.h.

◆ connectImpl()

QMetaObject::Connection QObjectPrivate::connectImpl ( const QObject * sender,
int signal_index,
const QObject * receiver,
void ** slot,
QtPrivate::QSlotObjectBase * slotObjRaw,
int type,
const int * types,
const QMetaObject * senderMetaObject )
static

Internal version of connect used by the template version of QObject::connect (called via connectImpl) and also used by the QObjectPrivate::connect version used by QML. The signal_index is expected to be relative to the number of signals.

Definition at line 5256 of file qobject.cpp.

◆ connectNotify()

void QObjectPrivate::connectNotify ( const QMetaMethod & signal)
inline

Definition at line 246 of file qobject_p.h.

◆ deleteChildren()

void QObjectPrivate::deleteChildren ( )

Definition at line 2202 of file qobject.cpp.

◆ disconnect() [1/3]

bool QObjectPrivate::disconnect ( const QObject * sender,
int signal_index,
const QObject * receiver,
void ** slot )
static

Used by QML to disconnect a signal by index that's connected to a slot implemented in JavaScript (wrapped in a custom QSlotObjectBase subclass) In the QML case the slot is not a pointer to a pointer to the function to disconnect, but instead it is a pointer to an array of internal values required for the disconnect.

This is an overload that should be used when sender and receiver are different objects.

Definition at line 5502 of file qobject.cpp.

◆ disconnect() [2/3]

bool QObjectPrivate::disconnect ( const QObject * sender,
int signal_index,
void ** slot )
static

Used by QML to disconnect a signal by index that's connected to a slot implemented in JavaScript (wrapped in a custom QSlotObjectBase subclass) In the QML case the slot is not a pointer to a pointer to the function to disconnect, but instead it is a pointer to an array of internal values required for the disconnect.

This version of disconnect assumes that sender and receiver are the same object.

Definition at line 5485 of file qobject.cpp.

◆ disconnect() [3/3]

template<typename Func1 , typename Func2 >
bool QObjectPrivate::disconnect ( const typename QtPrivate::FunctionPointer< Func1 >::Object * sender,
Func1 signal,
const typename QtPrivate::FunctionPointer< Func2 >::Object * receiverPrivate,
Func2 slot )
inlinestatic

Definition at line 328 of file qobject_p.h.

◆ disconnectNotify()

void QObjectPrivate::disconnectNotify ( const QMetaMethod & signal)
inline

Definition at line 251 of file qobject_p.h.

◆ ensureConnectionData()

void QObjectPrivate::ensureConnectionData ( )
inline

The signalSlotLock() of the sender must be locked while calling this function

Definition at line 255 of file qobject.cpp.

◆ ensureExtraData()

void QObjectPrivate::ensureExtraData ( )
inline

Definition at line 102 of file qobject_p.h.

◆ flagsForDumping()

std::string QObjectPrivate::flagsForDumping ( ) const
virtual

Reimplemented in QWidgetPrivate.

Definition at line 4378 of file qobject.cpp.

◆ get() [1/2]

static const QObjectPrivate * QObjectPrivate::get ( const QObject * o)
inlinestatic

Definition at line 151 of file qobject_p.h.

◆ get() [2/2]

static QObjectPrivate * QObjectPrivate::get ( QObject * o)
inlinestatic

Definition at line 150 of file qobject_p.h.

◆ getPropertyAdaptorSlotObject()

QtPrivate::QPropertyAdaptorSlotObject * QObjectPrivate::getPropertyAdaptorSlotObject ( const QMetaProperty & property)

Used by QPropertyAdaptorSlotObject to get an existing instance for a property, if available

Definition at line 5561 of file qobject.cpp.

◆ isDeclarativeSignalConnected()

bool QObjectPrivate::isDeclarativeSignalConnected ( uint signalIdx) const
inline

Definition at line 240 of file qobject_p.h.

◆ isSignalConnected()

bool QObjectPrivate::isSignalConnected ( uint signalIndex,
bool checkDeclarative = true ) const

Returns true if the signal with index signal_index from object sender is connected.

signal_index must be the index returned by QObjectPrivate::signalIndex;

Definition at line 421 of file qobject.cpp.

◆ maybeSignalConnected()

bool QObjectPrivate::maybeSignalConnected ( uint signalIndex) const

Definition at line 447 of file qobject.cpp.

◆ moveToThread_helper()

void QObjectPrivate::moveToThread_helper ( )

Definition at line 1720 of file qobject.cpp.

◆ receiverList()

QObjectList QObjectPrivate::receiverList ( const char * signal) const

Definition at line 231 of file qobject.cpp.

◆ reinitBindingStorageAfterThreadMove()

void QObjectPrivate::reinitBindingStorageAfterThreadMove ( )

Definition at line 466 of file qobject.cpp.

◆ removeConnection()

bool QObjectPrivate::removeConnection ( QObjectPrivate::Connection * c)
inlinestatic

\threadsafe

Definition at line 5516 of file qobject.cpp.

◆ setParent_helper()

void QObjectPrivate::setParent_helper ( QObject * o)

Definition at line 2219 of file qobject.cpp.

◆ setThreadData_helper()

void QObjectPrivate::setThreadData_helper ( QThreadData * currentData,
QThreadData * targetData,
QBindingStatus * status )

Definition at line 1732 of file qobject.cpp.

◆ signalIndex()

int QObjectPrivate::signalIndex ( const char * signalName,
const QMetaObject ** meta = nullptr ) const

Returns the signal index used in the internal connections->receivers vector.

It is different from QMetaObject::indexOfSignal(): indexOfSignal is the same as indexOfMethod while QObjectPrivate::signalIndex is smaller because it doesn't give index to slots.

If meta is not \nullptr, it is set to the meta-object where the signal was found.

Definition at line 4224 of file qobject.cpp.

◆ writeToDebugStream()

void QObjectPrivate::writeToDebugStream ( QDebug & dbg) const
virtual

Definition at line 4486 of file qobject.cpp.

Member Data Documentation

◆ [union]

union { ... } QObjectPrivate

◆ connections

QAtomicPointer<ConnectionData> QObjectPrivate::connections

Definition at line 206 of file qobject_p.h.

◆ currentChildBeingDeleted

QObject* QObjectPrivate::currentChildBeingDeleted

Definition at line 209 of file qobject_p.h.

◆ declarativeData

QAbstractDeclarativeData* QObjectPrivate::declarativeData

Definition at line 210 of file qobject_p.h.

◆ extraData

ExtraData* QObjectPrivate::extraData
mutable

Definition at line 197 of file qobject_p.h.

◆ sharedRefcount

QAtomicPointer<QtSharedPointer::ExternalRefCountData> QObjectPrivate::sharedRefcount

Definition at line 215 of file qobject_p.h.

◆ threadData

QAtomicPointer<QThreadData> QObjectPrivate::threadData

Definition at line 203 of file qobject_p.h.


The documentation for this class was generated from the following files: