Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QObject Class Reference

\inmodule QtCore More...

#include <qobject.h>

Inherited by AVFCameraRenderer, AVFCameraSession, AVFDisplayLink, AVFMediaEncoder, AVFMediaPlayer, AVFVideoRendererControl, Abstract_DBus_Interface, AdapterManager, AdvertisementWatcherWrapper, AndroidBroadcastReceiver, AndroidCamera, AndroidCameraPrivate, AndroidConnectivityManager, AndroidMediaPlayer, AndroidMediaRecorder, AndroidSurfaceHolder, AndroidSurfaceTexture, AndroidSurfaceView, ApplicationData, AudioDecodingExample, AudioInputExample, AudioOutputExample, AvatarExample, BluetoothManagement, Cache, CallbackRegistrationHelper, Controller, Coordinate, CoreAudioSessionManager, Counter, DBusConnection, DBus_PendingCall_Interface, DBus_PendingReply_Interface, DBus_Process_String_Interface, DarwinBluetooth::LECBManagerNotifier, Decoder, DocWrapper0::FruitBasket [private], DocWrapper1::FruitBasket [private], DocWrapper2::FruitBasket [private], DtlsServer, DynamicRoleModelNode, EVRCustomPresenter, FilterObject, Foo, Foo, GeoServiceProviderFactoryEsri, HaikuViewProxy, HaikuWindowProxy, HciManager, HelloWorld, InputStreamThread, KeyPressEater, LocalSocketSignalTranslator, LocationSingleton, LowEnergyNotificationHub, MFDecoderSourceReader, MFPlayerSession, MFStream, MFVideoRendererControl, ManagerEngine, MediaExample, MyApp, MyClass, MyClass, MyClass, MyClass, MyClass, MyClass, MyClass, MyClass, MyClass, MyColorPicker, MyFirstBenchmark, MyFirstTest, MyGame, MyInstance, MyObject, MyObject, MyObject, MyObject, MyObject, MyPrivateInitStuff, MySingleton, MyTestClass, MyVideoProducer, MyWidget [private], NeardHelper, Operation, OrgBluezProfile1ContextInterface, PresentationFeedback, PressDelayHandler, ProceduralMeshSubset, QAbstractAnimation, QAbstractAnimationTimer, QAbstractEventDispatcher, QAbstractGeoTileCache, QAbstractItemDelegate, QAbstractItemModel, QAbstractItemModelTester, QAbstractNetworkCache, QAbstractSocketEngine, QAbstractTextDocumentLayout, QAction, QActionGroup, QAmbientSound, QAmbientSoundPrivate, QAndroidAudioInput, QAndroidCameraSession, QAndroidCaptureSession, QAndroidMediaPlayer, QAndroidPlatformScreen, QAndroidPlatformServices, QAndroidServicePrivate, QAndroidVideoOutput, QAnimationDriver, QAudioDecoder, QAudioEngine, QAudioInput, QAudioListener, QAudioOutput, QAudioRoom, QAudioSink, QAudioSource, QAudioStateChangeNotifier, QBackingStoreRhiSupportWindowWatcher, QBasicDrag, QBluetoothDeviceDiscoveryAgent, QBluetoothDeviceWatcherWinRT, QBluetoothLocalDevice, QBluetoothLocalDevicePrivate, QBluetoothServer, QBluetoothServiceDiscoveryAgent, QBluetoothServiceInfoPrivate, QBluetoothSocketBasePrivate, QBsdKeyboardHandler, QBsdMouseHandler, QButtonGroup, QCALayerBackingStore, QCamera, QChronoTimer, QClipboard, QCocoaClipboard, QCocoaIntegration, QCocoaWindow, QCompleter, QCoreApplication, QCtfLib, QDBusAbstractAdaptor, QDBusAbstractInterfaceBase, QDBusAdaptorConnector, QDBusConnectionPrivate, QDBusMenuConnection, QDBusPendingCallWatcher, QDBusPendingCallWatcherHelper, QDBusServer, QDBusServiceWatcher, QDBusVirtualObject, QDarwinAudioSinkBuffer, QDarwinAudioSourceBuffer, QDataWidgetMapper, QDeclarativeCategory, QDeclarativeGeoAddress, QDeclarativeGeoJsonData, QDeclarativeGeoLocation, QDeclarativeGeoRouteQuery, QDeclarativeGeoServiceProvider, QDeclarativeGeoServiceProviderRequirements, QDeclarativeMapLineProperties, QDeclarativePlace, QDeclarativePluginParameter, QDeclarativePosition, QDeclarativePositionSource, QDeclarativeSatelliteSource, QDeviceClosedNotifier, QDeviceDiscovery, QDnsLookup, QDnsLookupRunnable, QDrag, QDragManager, QDtls, QDtlsClientVerifier, QEglFSCursorDeviceListener, QEglFSDeviceIntegrationPlugin, QEglFSKmsEventHost, QEglFSKmsGbmCursorDeviceListener, QEglFSKmsInterruptHandler, QEvdevKeyboardHandler, QEvdevKeyboardManager, QEvdevMouseHandler, QEvdevMouseManager, QEvdevTabletHandler, QEvdevTabletManager, QEvdevTouchManager, QEvdevTouchScreenHandler, QEventLoop, QFFmpeg::PlaybackEngine, QFFmpeg::PlaybackEngineObject, QFFmpeg::RecordingEngine, QFFmpegAudioInput, QFFmpegMediaPlayer, QFFmpegMediaRecorder, QFFmpegSurfaceCaptureGrabber, QFactoryLoader, QFbCursorDeviceListener, QFbScreen, QFbVtHandler, QFileSelector, QFileSystemWatcher, QFileSystemWatcherEngine, QFontCache, QFutureWatcherBase, QGenericPlugin, QGenericUnixThemeDBusListener, QGeoAreaMonitorPollingPrivate, QGeoAreaMonitorSource, QGeoCodeJsonParser, QGeoCodeReply, QGeoCodingManager, QGeoCodingManagerEngine, QGeoCoordinateObject, QGeoMap, QGeoMappingManager, QGeoMappingManagerEngine, QGeoNetworkAccessManager, QGeoPositionInfoSource, QGeoPositionInfoSourceFactoryAndroid, QGeoPositionInfoSourceFactoryCL, QGeoPositionInfoSourceFactoryGeoclue2, QGeoPositionInfoSourceFactoryGypsy, QGeoPositionInfoSourceFactoryNmea, QGeoPositionInfoSourceFactoryPoll, QGeoPositionInfoSourceFactoryWinRT, QGeoRouteParser, QGeoRouteReply, QGeoRouteXmlParser, QGeoRoutingManager, QGeoRoutingManagerEngine, QGeoSatelliteInfoSource, QGeoServiceProvider, QGeoServiceProviderFactoryItemsOverlay, QGeoServiceProviderFactoryMapbox, QGeoServiceProviderFactoryMapboxGL, QGeoServiceProviderFactoryNokia, QGeoServiceProviderFactoryOsm, QGeoTileFetcher, QGeoTileProviderOsm, QGeoTiledMapReply, QGeoTiledMapScene, QGeoUriProvider, QGesture, QGestureManager, QGraphicsAnchor, QGraphicsEffect, QGraphicsEffectSource, QGraphicsItemAnimation, QGraphicsObject, QGraphicsScene, QGraphicsSceneIndex, QGraphicsTransform, QGstAppSource, QGstPipelinePrivate, QGstVideoRenderer, QGstreamerAudioInput, QGstreamerAudioOutput, QGstreamerMediaPlayer, QGstreamerVideoOutput, QGstreamerVideoOverlay, QGtk3PortalInterface, QHaikuWindow, QHostInfoResult, QHttp2Connection, QHttp2ProtocolHandler, QHttp2Stream, QHttpMultiPart, QHttpNetworkConnection, QHttpNetworkConnectionChannel, QHttpNetworkReply, QHttpThreadDelegate, QIODevice, QIOSApplicationState, QIOSAssetData, QIOSContext, QIOSScreen, QIOSTextInputOverlay, QIOSWindow, QIconEnginePlugin, QImageCapture, QImageIOPlugin, QInputControl, QInputDevice, QInputDeviceManager, QInputMethod, QIosOptionalPlugin_NSPhotoLibrary, QItemSelectionModel, QItemSelectionModel, QJSEngine, QKeyMapper, QLanguageServer, QLanguageServerModule, QLayout, QLeAdvertiser, QLeDBusAdvertiser, QLibInputHandler, QLibInputKeyboard, QLibrary, QLocalServer, QLowEnergyController, QLowEnergyControllerPrivate, QLowEnergyService, QLowEnergyServicePrivate, QMacPanGestureRecognizer, QMdi::ControlContainer, QMediaCaptureSession, QMediaDevices, QMediaPlayer, QMediaRecorder, QMimeData, QMovie, QNearFieldManager, QNearFieldManagerPrivate, QNearFieldTarget, QNearFieldTargetPrivate, QNetworkAccessBackend, QNetworkAccessBackendFactory, QNetworkAccessCache, QNetworkAccessManager, QNetworkConnectionMonitor, QNetworkCookieJar, QNetworkInformation, QNetworkInformationBackend, QNetworkInformationBackendFactory, QNetworkListManagerEvents, QNfcNdefNotifier, QNmeaPositionInfoSourcePrivate, QNmeaSatelliteInfoSourcePrivate, QNmeaSimulatedReader, QNonContiguousByteDevice, QObjectCleanupHandler, QObjectContinuationWrapper, QOffscreenSurface, QOpenGLCompositor, QOpenGLContext, QOpenGLContextGroup, QOpenGLDebugLogger, QOpenGLEngineShaderManager, QOpenGLShader, QOpenGLShaderProgram, QOpenGLTimeMonitor, QOpenGLTimerQuery, QOpenGLVertexArrayObject, QOpenXRGamepadInput, QOpenXRHandInput, QOpenXRHandTrackerInput, QOpenXRInputManager, QOpenXRManager, QOpenXRRuntimeInfo, QOpenXRSpaceExtension, QOpenXRSpatialAnchor, QOpenXRVirtualMouse, QOpenXrInputAction, QPMCache, QPacketProtocol, QPcscCard, QPcscManager, QPcscSlot, QPdfDocument, QPdfPageNavigator, QPdfPageRenderer, QPdfWriter, QPermissionPlugin, QPhysicsMaterial, QPhysicsWorld, QPixmapFilter, QPlaceManager, QPlaceManagerEngine, QPlaceReply, QPlatformAudioDecoder, QPlatformCursor, QPlatformDialogHelper, QPlatformGraphicsBuffer, QPlatformImageCapture, QPlatformInputContext, QPlatformInputContextPlugin, QPlatformIntegrationPlugin, QPlatformMediaCaptureSession, QPlatformMediaDevices, QPlatformMediaIntegration, QPlatformMediaPlugin, QPlatformMenu, QPlatformMenuBar, QPlatformMenuItem, QPlatformNativeInterface, QPlatformPrinterSupportPlugin, QPlatformServiceColorPicker, QPlatformSharedGraphicsCache, QPlatformSystemTrayIcon, QPlatformTextureList, QPlatformTextureListWatcher, QPlatformThemePlugin, QPlatformVideoDevices, QPlatformVideoSink, QPlatformVideoSource, QPulseAudioEngine, QQC2::QStyle, QQmlAbstractProfilerAdapter, QQmlAbstractProfilerAdapterFactory, QQmlApplication, QQmlBind, QQmlBoundSignalDeleter, QQmlComponent, QQmlComponentAttached, QQmlConnections, QQmlContext, QQmlDataTest, QQmlDebugClient, QQmlDebugConnection, QQmlDebugServerConnection, QQmlDebugServerConnectionFactory, QQmlDebugService, QQmlDebugServiceFactory, QQmlDebugTranslationServicePrivate, QQmlDelayedCallQueue, QQmlDelegateChoice, QQmlDelegateModelAttached, QQmlDelegateModelGroup, QQmlDelegateModelItem, QQmlDelegateModelParts, QQmlEngineExtensionPlugin, QQmlExpression, QQmlExtensionPlugin, QQmlFileSelector, QQmlGadgetPtrWrapper, QQmlImageProviderBase, QQmlInstanceModel, QQmlInstantiator, QQmlLSQuickPlugin, QQmlListElement, QQmlListModelWorkerAgent, QQmlLocalStorage, QQmlLoggingCategory, QQmlObjectModelAttached, QQmlPlatform, QQmlPreviewFileLoader, QQmlPreviewHandler, QQmlProfilerEventReceiver, QQmlPropertyMap, QQmlSettings, QQmlSettings, QQmlStandardPaths, QQmlSystemInformation, QQmlTableModelColumn, QQmlThreadNotifierProxyObject, QQmlTimer, QQmlTypeLoaderNetworkReplyProxy, QQmlTypeNotAvailable, QQmlWatchProxy, QQmlWatcher, QQmlXMLHttpRequest, QQmlXmlListModelRole, QQnxAbstractNavigator, QQnxAbstractVirtualKeyboard, QQnxAudioRecorder, QQnxButtonEventNotifier, QQnxCamera, QQnxMediaPlayer, QQnxNavigatorEventHandler, QQnxNavigatorEventNotifier, QQnxScreen, QQnxScreenEventHandler, QQnxWindowGrabber, QQuick3DAmbientSound, QQuick3DAudioEngine, QQuick3DBakedLightmap, QQuick3DDebugSettings, QQuick3DFog, QQuick3DInfiniteGrid, QQuick3DLightmapBaker, QQuick3DLightmapper, QQuick3DObject, QQuick3DParticleAbstractShape, QQuick3DParticleDirection, QQuick3DParticleEmitBurst, QQuick3DParticleSpriteSequence, QQuick3DParticleSystemLogging, QQuick3DQuaternionUtils, QQuick3DRenderStats, QQuick3DSGDirectRenderer, QQuick3DSceneManager, QQuick3DShaderUtilsBuffer, QQuick3DShaderUtilsRenderCommand, QQuick3DShaderUtilsRenderPass, QQuick3DShaderUtilsShader, QQuick3DShaderUtilsTextureInput, QQuick3DWindowAttachment, QQuickAbstractAnimation, QQuickAbstractDialog, QQuickAction, QQuickActionGroup, QQuickActionGroupAttached, QQuickAnchorSet, QQuickAnchors, QQuickAnimatedNode, QQuickAnimationController, QQuickAnimatorController, QQuickAnimatorProxyJob, QQuickApplicationWindowAttached, QQuickAttachedPropertyPropagator, QQuickBasicStyle, QQuickBehavior, QQuickBoundaryRule, QQuickButtonGroup, QQuickButtonGroupAttached, QQuickCalendar, QQuickCanvasContext, QQuickCloseEvent, QQuickColor, QQuickColorDialogImplAttached, QQuickColorGroup, QQuickContext2DTexture, QQuickControlsTestUtils::ComponentCreator, QQuickControlsTestUtils::StyleInfo, QQuickDeliveryAgent, QQuickDesignerCustomParserObject, QQuickDialogButtonBoxAttached, QQuickDirection, QQuickDrag, QQuickDragAttached, QQuickDragAxis, QQuickDragEvent, QQuickDropAreaDrag, QQuickEnterKeyAttached, QQuickEyeDropperEventFilter, QQuickFileDialogImplAttached, QQuickFileNameFilter, QQuickFlickableVisibleArea, QQuickFocusFrame, QQuickFolderDialogImplAttached, QQuickFontDialogImplAttached, QQuickFontLoader, QQuickFontMetrics, QQuickFontObject, QQuickFrameAnimation, QQuickFusionStyle, QQuickGrabGestureEvent, QQuickGradient, QQuickGradientStop, QQuickGraphicsInfo, QQuickIOSCursorFlashTimer, QQuickIOSStyle, QQuickImageResponse, QQuickImageSelector, QQuickIndicatorButton, QQuickInputMethod, QQuickItem, QQuickItemGrabResult, QQuickItemParticleAttached, QQuickItemViewAttached, QQuickKeyEvent, QQuickKeyNavigationAttached, QQuickKeysAttached, QQuickLabsPlatformDialog, QQuickLabsPlatformFileNameFilter, QQuickLabsPlatformMenu, QQuickLabsPlatformMenuBar, QQuickLabsPlatformMenuItem, QQuickLabsPlatformMenuItemGroup, QQuickLabsPlatformSystemTrayIcon, QQuickLayoutAttached, QQuickLayoutItemProxyAttachedData, QQuickLayoutMirroringAttached, QQuickMessageDialogImplAttached, QQuickMouseEvent, QQuickOverlayAttached, QQuickPackage, QQuickPackageAttached, QQuickParticleExtruder, QQuickPath, QQuickPathElement, QQuickPathInterpolator, QQuickPathViewAttached, QQuickPdfDocument, QQuickPdfPageNavigator, QQuickPen, QQuickPinch, QQuickPinchEvent, QQuickPixmapCache, QQuickPixmapReply, QQuickPlatformTheme, QQuickPlaylistItem, QQuickPointerHandler, QQuickPopup, QQuickPopupAnchors, QQuickPositionerAttached, QQuickRangeSliderNode, QQuickRenderControl, QQuickScaleGrid, QQuickScreen, QQuickScreenInfo, QQuickScrollBarAttached, QQuickScrollIndicatorAttached, QQuickSelectionRectangleAttached, QQuickShaderEffectMesh, QQuickShaderSourceAttachedNode, QQuickShapeCurveRunnable, QQuickShapeFillRunnable, QQuickShapeStrokeRunnable, QQuickShortcut, QQuickSplitHandleAttached, QQuickSplitViewAttached, QQuickStackLayoutAttached, QQuickStackViewAttached, QQuickState, QQuickStateGroup, QQuickStateOperation, QQuickStochasticEngine, QQuickStochasticState, QQuickSwipe, QQuickSwipeDelegateAttached, QQuickSwipeViewAttached, QQuickSystemPalette, QQuickTabBarAttached, QQuickTableViewAttached, QQuickTextAreaAttached, QQuickTextDocument, QQuickTextImageHandler, QQuickTextLine, QQuickTextMetrics, QQuickTextSelection, QQuickTextUtil, QQuickTextureFactory, QQuickTimeLine, QQuickToolTipAttached, QQuickTouchEventSequence, QQuickTouchPoint, QQuickTransform, QQuickTransition, QQuickTumblerAttached, QQuickViewSection, QQuickViewTransitionAttached, QQuickVisualTestUtils::SignalMultiSpy, QQuickWindowAttached, QQuickWindowIncubationController, QQuickWorkerScript, QQuickWorkerScriptEnginePrivate, QRestAccessManager, QRhiWithThreadGuard, QSGAbstractRenderer, QSGBatchRenderer::ShaderManager, QSGContext, QSGContextPlugin, QSGGuiThreadShaderEffectManager, QSGRenderContext, QSGRenderLoop, QSGRhiAtlasTexture::AtlasBase, QSGRhiAtlasTexture::Manager, QSGShaderEffectNode, QSGTexture, QSGTextureProvider, QSGVivanteVideoNodeFactory, QSSGAssetImportManager, QSSGAssetImporter, QSSGAssetImporterPlugin, QSample, QSampleCache, QScreen, QScreenCapture, QScroller, QScrollerPrivate, QSessionManager, QSettings, QSharedImageLoader, QShortcut, QSignalMapper, QSignalSpyPrivate, QSingleShotTimer, QSizeChangeListener, QSmSocketReceiver, QSocketNotifier, QSocks5BindStore, QSoundEffect, QSpatialSound, QSpiAccessibleBridge, QSpiApplicationAdaptor, QSpiDBusCache, QSqlDriver, QSqlDriverPlugin, QStyle, QStyleHints, QStylePlugin, QStyleSheetStyleCaches, QSvgRenderer, QSvgWidgetListener, QSyntaxHighlighter, QSystemTrayIcon, QSystemTrayWatcher, QT_BEGIN_NAMESPACE::ProtocolHandlerDeleter, QTcpServer, QTest::WatchDog, QTestEventLoop, QTestRootObject, QTextDocument, QTextImageHandler, QTextObject, QThread, QThreadPool, QTimeLine, QTimer, QTlsBackend, QTranslator, QTsLibMouseHandler, QTuioHandler, QUndoGroup, QUnifiedTimer, QV4::MultiplyWrappedQObjectMap, QV4::Promise::ReactionHandler, QV4DebuggerAgent, QV4Include, QValidator, QVideoOutputOrientationHandler, QVideoSink, QVncClient, QVncServer, QWasmAudioInput, QWasmAudioOutput, QWasmClipboard, QWasmCompositor, QWasmIntegration, QWasmMediaPlayer, QWasmMediaRecorder, QWasmScreen, QWasmVideoOutput, QWaylandClient, QWaylandClientExtension, QWaylandDestroyListener, QWaylandDrag, QWaylandInputMethodControl, QWaylandKeymap, QWaylandObject, QWaylandQuickHardwareLayer, QWaylandQuickShellEventFilter, QWaylandQuickShellIntegration, QWaylandSurfaceGrabber, QWaylandView, QWaylandXdgOutputV1, QWaylandXdgPopup, QWaylandXdgToplevel, QWhatsThisPrivate, QWidget, QWidgetAnimator, QWidgetResizeHandler, QWinRTBluetoothDeviceDiscoveryWorker, QWinRTBluetoothServiceDiscoveryWorker, QWinRTLowEnergyConnectionHandler, QWinRTLowEnergyServiceHandler, QWindow, QWindowCapture, QWindowsCaRootFetcher, QWindowsMediaDeviceReader, QWindowsMediaDeviceSession, QWindowsMediaEncoder, QWindowsNativeDialogBase, QWindowsPipeReader, QWindowsPipeWriter, QWindowsRemovableDriveListener, QXcbBasicConnection, QXcbClipboardTransaction, QXcbGlIntegrationPlugin, QXcbSystemTrayTracker, QXcbWindow, QXdgDesktopPortalThemePrivate, QmlJSDebugger::GlobalInspector, QmlJSDebugger::InspectTool, QmlJSDebugger::ObjectCreator, QmlJSDebugger::QQuickWindowInspector, QmlLintQuickPlugin, QmlLsp::QQmlCodeModel, QtAndroidQuickViewEmbedding::SignalHelper, QtBluezDiscoveryManager, QtBluezPeripheralApplication, QtBluezPeripheralConnectionManager, QtBluezPeripheralGattObject, QtCocoaInterruptDispatcher, QtObject, QtPrivate::QCalendarTextNavigator, QtPrivate::QColorPickingEventFilter, QtWayland::BufferManager, QtWayland::ClientBufferIntegrationPlugin, QtWayland::DataDeviceManager, QtWayland::DataSource, QtWayland::HardwareLayerIntegration, QtWayland::HardwareLayerIntegrationPlugin, QtWayland::QWaylandTextureOrphanage, QtWayland::ServerBufferIntegrationPlugin, QtWaylandClient::QWaylandAbstractDecoration, QtWaylandClient::QWaylandClientBufferIntegrationPlugin, QtWaylandClient::QWaylandDataDevice, QtWaylandClient::QWaylandDataSource, QtWaylandClient::QWaylandDecorationPlugin, QtWaylandClient::QWaylandDisplay, QtWaylandClient::QWaylandFractionalScale, QtWaylandClient::QWaylandInputDevice, QtWaylandClient::QWaylandInputDeviceIntegrationPlugin, QtWaylandClient::QWaylandPrimarySelectionDeviceV1, QtWaylandClient::QWaylandPrimarySelectionSourceV1, QtWaylandClient::QWaylandServerBufferIntegrationPlugin, QtWaylandClient::QWaylandShellIntegrationPlugin, QtWaylandClient::QWaylandShellSurface, QtWaylandClient::QWaylandSurface, QtWaylandClient::QWaylandTabletPadV2, QtWaylandClient::QWaylandTabletSeatV2, QtWaylandClient::QWaylandTabletToolV2, QtWaylandClient::QWaylandTabletV2, QtWaylandClient::QWaylandWindowManagerIntegration, QtWaylandClient::QWaylandXdgActivationTokenV1, QuickTestEvent, QuickTestImageObject, QuickTestResult, QuickTestUtil, ReaderThreadExecutionEnforcer, RemoteDeviceManager, RenderWorker, RequestHandler, ResponseProvider, RetryFuture, RouteHandler, RunLoopDebugger, ScriptInterface, ServerAcceptanceThread, Setup, SharedTextureRegistry, SimpleReceiver, SimulationWorker, Singleton, SocketConnectWorker, SocketWorker, SourceResolver, SvgTextObject, TestBenchmark, TestGui, TestHTTPServer, TestQString, TileProvider, VideoExample, VideoExample, Vsp2Layer, Worker, src_gui_opengl_qopengldebug::LogHandler, src_gui_opengl_qopengldebug::SnippetWrapper, src_gui_util_qdesktopservices::MyHelpHandler, and tst_qmltc_examples.

+ Collaboration diagram for QObject:

Public Slots

void deleteLater ()
 \threadsafe
 

Signals

void destroyed (QObject *=nullptr)
 This signal is emitted immediately before the object obj is destroyed, after any instances of QPointer have been notified, and cannot be blocked.
 
void objectNameChanged (const QString &objectName, QPrivateSignal)
 This signal is emitted after the object's name has been changed.
 

Public Member Functions

Q_INVOKABLE QObject (QObject *parent=nullptr)
 Constructs an object with parent object parent.
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects.
 
virtual bool event (QEvent *event)
 This virtual function receives events to an object and should return true if the event e was recognized and processed.
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 Filters events if this object has been installed as an event filter for the watched object.
 
QString objectName () const
 
Q_WEAK_OVERLOAD void setObjectName (const QString &name)
 Sets the object's name to name.
 
void setObjectName (QAnyStringView name)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
QBindable< QStringbindableObjectName ()
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false.
 
bool isWindowType () const
 Returns true if the object is a window; otherwise returns false.
 
bool isQuickItemType () const
 Returns true if the object is a QQuickItem; otherwise returns false.
 
bool signalsBlocked () const noexcept
 Returns true if signals are blocked; otherwise returns false.
 
bool blockSignals (bool b) noexcept
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it).
 
QThreadthread () const
 Returns the thread in which the object lives.
 
bool moveToThread (QThread *thread QT6_DECL_NEW_OVERLOAD_TAIL)
 Changes the thread affinity for this object and its children and returns true on success.
 
int startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer)
 This is an overloaded function that will start a timer of type timerType and a timeout of interval milliseconds.
 
int startTimer (std::chrono::nanoseconds time, Qt::TimerType timerType=Qt::CoarseTimer)
 
void killTimer (int id)
 Kills the timer with timer identifier, id.
 
void killTimer (Qt::TimerId id)
 
template<typename T >
findChild (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 Returns the child of this object that can be cast into type T and that is called name, or \nullptr if there is no such object.
 
template<typename T >
QList< T > findChildren (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects.
 
template<typename T >
findChild (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T >
QList< T > findChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
const QObjectListchildren () const
 Returns a list of child objects.
 
void setParent (QObject *parent)
 Makes the object a child of parent.
 
void installEventFilter (QObject *filterObj)
 Installs an event filter filterObj on this object.
 
void removeEventFilter (QObject *obj)
 Removes an event filter object obj from this object.
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const
 
bool disconnect (const QObject *receiver, const char *member=nullptr) const
 
void dumpObjectTree () const
 Dumps a tree of children to the debug output.
 
void dumpObjectInfo () const
 Dumps information about signal connections, etc.
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value.
 
bool setProperty (const char *name, QVariant &&value)
 
QVariant property (const char *name) const
 Returns the value of the object's name property.
 
QList< QByteArraydynamicPropertyNames () const
 
QBindingStoragebindingStorage ()
 
const QBindingStoragebindingStorage () const
 
QObjectparent () const
 Returns a pointer to the parent object.
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false.
 

Static Public Member Functions

static QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 \threadsafe
 
static QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::ContextTypeForFunctor< Func2 >::ContextType *context, Func2 &&slot, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 &&slot)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 \threadsafe
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static bool disconnect (const QMetaObject::Connection &)
 Disconnect a connection.
 
template<typename Func1 , typename Func2 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot)
 
template<typename Func1 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero)
 

Protected Member Functions

QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns \nullptr.
 
int senderSignalIndex () const
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal.
 
bool isSignalConnected (const QMetaMethod &signal) const
 
virtual void timerEvent (QTimerEvent *event)
 This event handler can be reimplemented in a subclass to receive timer events for the object.
 
virtual void childEvent (QChildEvent *event)
 This event handler can be reimplemented in a subclass to receive child events.
 
virtual void customEvent (QEvent *event)
 This event handler can be reimplemented in a subclass to receive custom events.
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
 QObject (QObjectPrivate &dd, QObject *parent=nullptr)
 

Protected Attributes

QScopedPointer< QObjectDatad_ptr
 

Properties

QString objectName
 the name of this object
 

Friends

struct QMetaObject
 
struct QMetaObjectPrivate
 
class QMetaCallEvent
 
class QApplication
 
class QApplicationPrivate
 
class QCoreApplication
 
class QCoreApplicationPrivate
 
class QWidget
 
class QAccessibleWidget
 
class QThreadData
 

Related Symbols

(Note that these are not member symbols.)

template< class T > T qobject_cast (const QObject *object)
 Returns the given object cast to type T if the object is of type T (or of a subclass); otherwise returns \nullptr.
 
template< typename T > T qFindChildqFindChildren (const QObject *obj, const QString &name)()
 
template< typename T > QList< T > qFindChildrenqFindChildren (const QObject *obj, const QString &name)()
 
 QObjectList
 \macro Q_CLASSINFO(Name, Value)
 

Detailed Description

\inmodule QtCore

The QObject class is the base class of all Qt objects.

\reentrant

QObject is the heart of the Qt \l{Object Model}. The central feature in this model is a very powerful mechanism for seamless object communication called \l{signals and slots}. You can connect a signal to a slot with connect() and destroy the connection with disconnect(). To avoid never ending notification loops you can temporarily block signals with blockSignals(). The protected functions connectNotify() and disconnectNotify() make it possible to track connections.

QObjects organize themselves in \l {Object Trees & Ownership} {object trees}. When you create a QObject with another object as parent, the object will automatically add itself to the parent's children() list. The parent takes ownership of the object; i.e., it will automatically delete its children in its destructor. You can look for an object by name and optionally type using findChild() or findChildren().

Every object has an objectName() and its class name can be found via the corresponding metaObject() (see QMetaObject::className()). You can determine whether the object's class inherits another class in the QObject inheritance hierarchy by using the inherits() function.

When an object is deleted, it emits a destroyed() signal. You can catch this signal to avoid dangling references to QObjects.

QObjects can receive events through event() and filter the events of other objects. See installEventFilter() and eventFilter() for details. A convenience handler, childEvent(), can be reimplemented to catch child events.

Last but not least, QObject provides the basic timer support in Qt; see QChronoTimer for high-level support for timers.

Notice that the Q_OBJECT macro is mandatory for any object that implements signals, slots or properties. You also need to run the \l{moc}{Meta Object Compiler} on the source file. We strongly recommend the use of this macro in all subclasses of QObject regardless of whether or not they actually use signals, slots and properties, since failure to do so may lead certain functions to exhibit strange behavior.

All Qt widgets inherit QObject. The convenience function isWidgetType() returns whether an object is actually a widget. It is much faster than \l{qobject_cast()}{qobject_cast}<QWidget *>({obj}) or {obj}->\l{inherits()}{inherits}("QWidget").

Some QObject functions, e.g. children(), return a QObjectList. QObjectList is a typedef for QList<QObject *>.

Definition at line 102 of file qobject.h.

Constructor & Destructor Documentation

◆ QObject() [1/2]

QObject::QObject ( QObject * parent = nullptr)
explicit

Constructs an object with parent object parent.

The parent of an object may be viewed as the object's owner. For instance, a \l{QDialog}{dialog box} is the parent of the \uicontrol{OK} and \uicontrol{Cancel} buttons it contains.

The destructor of a parent object destroys all child objects.

Setting parent to \nullptr constructs an object with no parent. If the object is a widget, it will become a top-level window.

See also
parent(), findChild(), findChildren()

Definition at line 936 of file qobject.cpp.

Referenced by QQuickContext2DRenderThread::QQuickContext2DRenderThread(), QQuickPixmapReader::QQuickPixmapReader(), and QDialogPrivate::close().

+ Here is the caller graph for this function:

◆ ~QObject()

QObject::~QObject ( )
virtual

Destroys the object, deleting all its child objects.

All signals to and from the object are automatically disconnected, and any pending posted events for the object are removed from the event queue. However, it is often safer to use deleteLater() rather than deleting a QObject subclass directly.

Warning
All child objects are deleted. If any of these objects are on the stack or global, sooner or later your program will crash. We do not recommend holding pointers to child objects from outside the parent. If you still do, the destroyed() signal gives you an opportunity to detect when an object is destroyed.
Deleting a QObject while it is handling an event delivered to it can cause a crash. You must not delete the QObject directly if it exists in a different thread than the one currently executing. Use deleteLater() instead, which will cause the event loop to delete the object after all pending events have been delivered to it.
See also
deleteLater()

Definition at line 1006 of file qobject.cpp.

References QObjectPrivate::ConnectionData::AlreadyLockedAndTemporarilyReleasingLock, QObjectPrivate::ConnectionData::connectionsForSignal(), QObjectPrivate::ConnectionData::currentConnectionId, QObjectPrivate::ConnectionData::currentSender, d, QBasicAtomicInteger< T >::deref(), destroyed(), QAbstractDeclarativeData::destroyed, QtPrivate::QSlotObjectBase::destroyIfLastRef(), disconnectNotify(), emit, QObjectPrivate::get(), QBasicAtomicInteger< T >::loadRelaxed(), Q_ASSERT, Q_TRACE, Q_UNLIKELY, qtHookData, qWarning, QObjectPrivate::Sender::receiverDeleted(), QObjectPrivate::ConnectionData::ref, QOrderedMutexLocker::relock(), QMutexLocker< Mutex >::relock(), QObjectPrivate::ConnectionData::removeConnection(), QThreadPrivate::removeObjectWithPendingBindingStatusChange(), QHooks::RemoveQObject, sender(), QObjectPrivate::ConnectionData::senders, QMetaObjectPrivate::signal(), signal, signalSlotLock(), QObjectPrivate::ConnectionData::signalVectorCount(), QBasicAtomicInteger< T >::storeRelaxed(), QtSharedPointer::ExternalRefCountData::strongref, thread(), QMutexLocker< Mutex >::unlock(), and QtSharedPointer::ExternalRefCountData::weakref.

+ Here is the call graph for this function:

◆ QObject() [2/2]

QObject::QObject ( QObjectPrivate & dd,
QObject * parent = nullptr )
protected

Definition at line 944 of file qobject.cpp.

References QHooks::AddQObject, QList< T >::append(), check_parent_thread(), children(), QThreadData::current(), d, d_ptr, parent(), Q_ASSERT_X, Q_FUNC_INFO, QObjectData::q_ptr, Q_TRACE, Q_UNLIKELY, QT_CATCH, QT_RETHROW, QT_TRY, qtHookData, setParent(), and thread().

+ Here is the call graph for this function:

Member Function Documentation

◆ bindableObjectName()

QBindable< QString > QObject::bindableObjectName ( )

Definition at line 1326 of file qobject.cpp.

References d.

◆ bindingStorage() [1/2]

QBindingStorage * QObject::bindingStorage ( )
inline

Definition at line 338 of file qobject.h.

◆ bindingStorage() [2/2]

const QBindingStorage * QObject::bindingStorage ( ) const
inline

Definition at line 339 of file qobject.h.

◆ blockSignals()

bool QObject::blockSignals ( bool block)
noexcept

If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it).

If block is false, no such blocking will occur.

The return value is the previous value of signalsBlocked().

Note that the destroyed() signal will be emitted even if the signals for this object have been blocked.

Signals emitted while being blocked are not buffered.

See also
signalsBlocked(), QSignalBlocker

Definition at line 1585 of file qobject.cpp.

References d.

Referenced by QDataStream::QDataStream(), QSignalBlocker::~QSignalBlocker(), QTextStreamPrivate::~QTextStreamPrivate(), QMenuPrivate::hideMenu(), QSignalBlocker::reblock(), stopAnimation(), and QSignalBlocker::unblock().

+ Here is the caller graph for this function:

◆ childEvent()

void QObject::childEvent ( QChildEvent * event)
protectedvirtual

This event handler can be reimplemented in a subclass to receive child events.

The event is passed in the event parameter.

QEvent::ChildAdded and QEvent::ChildRemoved events are sent to objects when children are added or removed. In both cases you can only rely on the child being a QObject, or if isWidgetType() returns true, a QWidget. (This is because, in the \l{QEvent::ChildAdded}{ChildAdded} case, the child is not yet fully constructed, and in the \l{QEvent::ChildRemoved}{ChildRemoved} case it might have been destructed already).

QEvent::ChildPolished events are sent to widgets when children are polished, or when polished children are added. If you receive a child polished event, the child's construction is usually completed. However, this is not guaranteed, and multiple polish events may be delivered during the execution of a widget's constructor.

For every child widget, you receive one \l{QEvent::ChildAdded}{ChildAdded} event, zero or more \l{QEvent::ChildPolished}{ChildPolished} events, and one \l{QEvent::ChildRemoved}{ChildRemoved} event.

The \l{QEvent::ChildPolished}{ChildPolished} event is omitted if a child is removed immediately after it is added. If a child is polished several times during construction and destruction, you may receive several child polished events for the same child, each time with a different virtual table.

See also
event()

Reimplemented in QSplitter, QMdiSubWindow, QLayout, and QGroupBox.

Definition at line 1508 of file qobject.cpp.

Referenced by QQuickWindow::event(), and QAnimationGroup::event().

+ Here is the caller graph for this function:

◆ children()

const QObjectList & QObject::children ( ) const
inline

Returns a list of child objects.

The QObjectList class is defined in the {<QObject>} header file as the following:

\quotefromfile kernel/qobject.h \skipto /typedef .*QObjectList/ \printuntil QObjectList

The first child added is the \l{QList::first()}{first} object in the list and the last child added is the \l{QList::last()}{last} object in the list, i.e. new children are appended at the end.

Note that the list order changes when QWidget children are \l{QWidget::raise()}{raised} or \l{QWidget::lower()}{lowered}. A widget that is raised becomes the last object in the list, and a widget that is lowered becomes the first object in the list.

See also
findChild(), findChildren(), parent(), setParent()

Definition at line 201 of file qobject.h.

Referenced by QObject(), QTreeWidgetItem::QTreeWidgetItem(), QTreeWidgetItemIterator::QTreeWidgetItemIterator(), QCocoaMenuBar::~QCocoaMenuBar(), QQuickItemGroup::~QQuickItemGroup(), QQuickMenu::~QQuickMenu(), QTreeWidgetItem::~QTreeWidgetItem(), QQuickItemGroup::calculateImplicitSize(), QQuickItem::childAt(), QCocoaWindow::childWindowAt(), childWindowAt(), QWidget::destroy(), QQmlTreeModelToTableModel::dump(), QWidget::ensurePolished(), QDockWidget::event(), QQuickItemGroup::geometryChange(), QMainWindowLayout::hover(), QTreeModel::insertColumns(), QMdiAreaPrivate::internalRaise(), QV4::markChildQObjectsRecursively(), QFileSystemModelPrivate::node(), QDBusAdaptorConnector::polish(), QQuickBasePositioner::prePositioning(), q_createNativeChildrenAndSetParent(), qt_qFindChild_helper(), qt_qFindChildren_helper(), qwindowcontainer_traverse(), QQuickParentChange::saveCurrentValues(), QWidget::scroll(), QWidget::scroll(), QWidget::setFocusProxy(), QObjectPrivate::setParent_helper(), QWidgetRepaintManager::staticContents(), and QWidgetPrivate::subtractOpaqueSiblings().

+ Here is the caller graph for this function:

◆ connect() [1/5]

QMetaObject::Connection QObject::connect ( const QObject * sender,
const char * signal,
const char * member,
Qt::ConnectionType type = Qt::AutoConnection ) const
inline

Definition at line 403 of file qobject.h.

References connect().

+ Here is the call graph for this function:

◆ connect() [2/5]

QMetaObject::Connection QObject::connect ( const QObject * sender,
const char * signal,
const QObject * receiver,
const char * method,
Qt::ConnectionType type = Qt::AutoConnection )
static

\threadsafe

Creates a connection of the given type from the signal in the sender object to the method in the receiver object. Returns a handle to the connection that can be used to disconnect it later.

You must use the SIGNAL() and SLOT() macros when specifying the signal and the method, for example:

QObject::connect(scrollBar, SIGNAL(valueChanged(int)),
label, SLOT(setNum(int)));

This example ensures that the label always displays the current scroll bar value. Note that the signal and slots parameters must not contain any variable names, only the type. E.g. the following would not work and return false:

// WRONG
QObject::connect(scrollBar, SIGNAL(valueChanged(int value)),
label, SLOT(setNum(int value)));

A signal can also be connected to another signal:

class MyWidget : public QWidget
{
public:
void buttonClicked();
private:
QPushButton *myButton;
};
{
myButton = new QPushButton(this);
connect(myButton, SIGNAL(clicked()),
this, SIGNAL(buttonClicked()));
}

In this example, the MyWidget constructor relays a signal from a private member variable, and makes it available under a name that relates to MyWidget.

A signal can be connected to many slots and signals. Many signals can be connected to one slot.

If a signal is connected to several slots, the slots are activated in the same order in which the connections were made, when the signal is emitted.

The function returns a QMetaObject::Connection that represents a handle to a connection if it successfully connects the signal to the slot. The connection handle will be invalid if it cannot create the connection, for example, if QObject is unable to verify the existence of either signal or method, or if their signatures aren't compatible. You can check if the handle is valid by casting it to a bool.

By default, a signal is emitted for every connection you make; two signals are emitted for duplicate connections. You can break all of these connections with a single disconnect() call. If you pass the Qt::UniqueConnection type, the connection will only be made if it is not a duplicate. If there is already a duplicate (exact same signal to the exact same slot on the same objects), the connection will fail and connect will return an invalid QMetaObject::Connection.

Note
Qt::UniqueConnections do not work for lambdas, non-member functions and functors; they only apply to connecting to member functions.

The optional type parameter describes the type of connection to establish. In particular, it determines whether a particular signal is delivered to a slot immediately or queued for delivery at a later time. If the signal is queued, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message

QObject::connect: Cannot queue arguments of type 'MyType'
(Make sure 'MyType' is registered using qRegisterMetaType().)

call qRegisterMetaType() to register the data type before you establish the connection.

See also
disconnect(), sender(), qRegisterMetaType(), Q_DECLARE_METATYPE(), {Differences between String-Based and Functor-Based Connections}

Definition at line 2960 of file qobject.cpp.

References check_and_warn_compat(), check_method_code(), check_signal_macro(), QMetaObjectPrivate::checkConnectArgs(), QMetaObjectPrivate::connect(), QMetaObject::Connection(), QMetaObjectPrivate::decodeMethodSignature(), err_info_about_objects(), err_method_notfound(), extract_code(), QMetaObjectPrivate::get(), QMetaObjectPrivate::indexOfSignalRelative(), QMetaObjectPrivate::indexOfSlotRelative(), method, methodName(), QMetaObject::normalizedSignature(), QMetaObjectPrivate::originalClone(), Q_ASSERT, qCWarning, QSIGNAL_CODE, QSLOT_CODE, Qt::QueuedConnection, queuedConnectionTypes(), QMetaObjectPrivate::signal(), signal, and QMetaObjectPrivate::signalOffset().

Referenced by AndroidSurfaceView::AndroidSurfaceView(), QFFmpeg::AudioRenderer::AudioRenderer(), AVFCameraRenderer::AVFCameraRenderer(), AVFMediaPlayer::AVFMediaPlayer(), BluetoothManagement::BluetoothManagement(), ButtonWidget::ButtonWidget(), ClipWindow::ClipWindow(), QMdi::ControlContainer::ControlContainer(), Controller::Controller(), DBusConnection::DBusConnection(), GeoCodeReplyEsri::GeoCodeReplyEsri(), GeoRouteReplyEsri::GeoRouteReplyEsri(), GeoTiledMapReplyEsri::GeoTiledMapReplyEsri(), QCGWindowCapture::Grabber::Grabber(), QEglfsScreenCapture::Grabber::Grabber(), QFFmpegScreenCaptureDxgi::Grabber::Grabber(), QFFmpegWindowCaptureUwp::Grabber::Grabber(), QmlJSDebugger::InspectTool::InspectTool(), QtWayland::IviSurfaceIntegration::IviSurfaceIntegration(), LocalSocketSignalTranslator::LocalSocketSignalTranslator(), MainWindow::MainWindow(), MFAudioDecoderControl::MFAudioDecoderControl(), MFPlayerSession::MFPlayerSession(), MutableModelIterator::MutableModelIterator(), MyClass::MyClass(), MyGame::MyGame(), src_gui_kernel_qguiapplication::MyMainWidget::MyMainWidget(), QmlJSDebugger::ObjectCreator::ObjectCreator(), Operation::Operation(), PlaceSearchReplyEsri::PlaceSearchReplyEsri(), QAbstractCollisionShape::QAbstractCollisionShape(), QAbstractItemModelTester::QAbstractItemModelTester(), QAlsaAudioSource::QAlsaAudioSource(), QAndroidAudioDecoder::QAndroidAudioDecoder(), QAndroidCaptureSession::QAndroidCaptureSession(), QAndroidInputContext::QAndroidInputContext(), QAndroidMediaPlayer::QAndroidMediaPlayer(), QAndroidNetworkInformationBackend::QAndroidNetworkInformationBackend(), QAudioSink::QAudioSink(), QAudioSource::QAudioSource(), QBluetoothSocketPrivateWinRT::QBluetoothSocketPrivateWinRT(), QBsdKeyboardHandler::QBsdKeyboardHandler(), QBsdMouseHandler::QBsdMouseHandler(), QByteDeviceWrappingIoDevice::QByteDeviceWrappingIoDevice(), QCocoaClipboard::QCocoaClipboard(), QCocoaIntegration::QCocoaIntegration(), QtPrivate::QColorShower::QColorShower(), QComboBoxPrivateContainer::QComboBoxPrivateContainer(), QDarwinAudioSink::QDarwinAudioSink(), QDarwinAudioSinkBuffer::QDarwinAudioSinkBuffer(), QDarwinAudioSourceBuffer::QDarwinAudioSourceBuffer(), QDarwinAudioSourceDevice::QDarwinAudioSourceDevice(), QDBusConnectionPrivate::QDBusConnectionPrivate(), QDBusMenuBar::QDBusMenuBar(), QDBusTrayIcon::QDBusTrayIcon(), QDeclarativeCircleMapItem::QDeclarativeCircleMapItem(), QDeclarativeGeoMapItemBase::QDeclarativeGeoMapItemBase(), QDeclarativeGeoMapItemGroup::QDeclarativeGeoMapItemGroup(), QDeclarativePlace::QDeclarativePlace(), QDeclarativePlace::QDeclarativePlace(), QDeclarativePolygonMapItem::QDeclarativePolygonMapItem(), QDeclarativePolylineMapItem::QDeclarativePolylineMapItem(), QDeclarativeRectangleMapItem::QDeclarativeRectangleMapItem(), QDefaultAnimationDriver::QDefaultAnimationDriver(), QDeviceDiscoveryUDev::QDeviceDiscoveryUDev(), QErrorMessage::QErrorMessage(), QEvdevKeyboardHandler::QEvdevKeyboardHandler(), QEvdevTabletHandler::QEvdevTabletHandler(), QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(), QFbCursor::QFbCursor(), QFbVtHandler::QFbVtHandler(), QFFmpegMediaCaptureSession::QFFmpegMediaCaptureSession(), QFFmpegMediaPlayer::QFFmpegMediaPlayer(), QGeoAreaMonitorPollingPrivate::QGeoAreaMonitorPollingPrivate(), QGeoCodeReplyMapbox::QGeoCodeReplyMapbox(), QGeoCodeReplyNokia::QGeoCodeReplyNokia(), QGeoCodeReplyOsm::QGeoCodeReplyOsm(), QGeoFileTileCacheOsm::QGeoFileTileCacheOsm(), QGeoMapMapboxGL::QGeoMapMapboxGL(), QGeoMappingManager::QGeoMappingManager(), QGeoMapReplyMapbox::QGeoMapReplyMapbox(), QGeoMapReplyNokia::QGeoMapReplyNokia(), QGeoMapReplyOsm::QGeoMapReplyOsm(), QGeoPositionInfoSourceAndroid::QGeoPositionInfoSourceAndroid(), QGeoPositionInfoSourceGeoclue2::QGeoPositionInfoSourceGeoclue2(), QGeoRouteReplyMapbox::QGeoRouteReplyMapbox(), QGeoRouteReplyNokia::QGeoRouteReplyNokia(), QGeoRouteReplyOsm::QGeoRouteReplyOsm(), QGeoSatelliteInfoSourceAndroid::QGeoSatelliteInfoSourceAndroid(), QGeoSatelliteInfoSourceGypsy::QGeoSatelliteInfoSourceGypsy(), QGeoTiledMap::QGeoTiledMap(), QGeoTiledMap::QGeoTiledMap(), QGeoTiledMapOsm::QGeoTiledMapOsm(), QGeoTiledMappingManagerEngineOsm::QGeoTiledMappingManagerEngineOsm(), QGeoTileFetcherOsm::QGeoTileFetcherOsm(), QGeoTileProviderOsm::QGeoTileProviderOsm(), QGstPipelinePrivate::QGstPipelinePrivate(), QHaikuRasterWindow::QHaikuRasterWindow(), QHaikuWindow::QHaikuWindow(), QHostInfoLookupManager::QHostInfoLookupManager(), QHttpNetworkConnection::QHttpNetworkConnection(), QIBusPlatformInputContext::QIBusPlatformInputContext(), QImageCapture::QImageCapture(), QIOSTextInputOverlay::QIOSTextInputOverlay(), QIOSWindow::QIOSWindow(), QLeAdvertiserBluez::QLeAdvertiserBluez(), QLibInputHandler::QLibInputHandler(), QLowEnergyControllerPrivateWinRT::QLowEnergyControllerPrivateWinRT(), QMediaDevices::QMediaDevices(), QmlLsp::QmlLintSuggestions::QmlLintSuggestions(), QMovie::QMovie(), QMovie::QMovie(), QMovie::QMovie(), QNearFieldManager::QNearFieldManager(), QNearFieldManager::QNearFieldManager(), QNearFieldTarget::QNearFieldTarget(), QNearFieldTargetPrivateImpl::QNearFieldTargetPrivateImpl(), QNearFieldTargetPrivateImpl::QNearFieldTargetPrivateImpl(), QNetworkListManagerNetworkInformationBackend::QNetworkListManagerNetworkInformationBackend(), QNetworkReplyFileImpl::QNetworkReplyFileImpl(), QNmeaRealTimeReader::QNmeaRealTimeReader(), QNmeaSatelliteSimulationReader::QNmeaSatelliteSimulationReader(), QNonContiguousByteDeviceBufferImpl::QNonContiguousByteDeviceBufferImpl(), QNonContiguousByteDeviceIoDeviceImpl::QNonContiguousByteDeviceIoDeviceImpl(), QOffscreenSurface::QOffscreenSurface(), QOpenXRSpatialAnchorModel::QOpenXRSpatialAnchorModel(), QOpenXRView::QOpenXRView(), QPacketProtocol::QPacketProtocol(), QPageSetupWidget::QPageSetupWidget(), QPcscCard::QPcscCard(), QPdfPageRenderer::QPdfPageRenderer(), QPdfPageSelector::QPdfPageSelector(), QPlaceContentReplyImpl::QPlaceContentReplyImpl(), QPlaceDetailsReplyImpl::QPlaceDetailsReplyImpl(), QPlaceSearchReplyHere::QPlaceSearchReplyHere(), QPlaceSearchReplyMapbox::QPlaceSearchReplyMapbox(), QPlaceSearchReplyOsm::QPlaceSearchReplyOsm(), QPlaceSearchSuggestionReplyImpl::QPlaceSearchSuggestionReplyImpl(), QPlaceSearchSuggestionReplyMapbox::QPlaceSearchSuggestionReplyMapbox(), QPrintPropertiesDialog::QPrintPropertiesDialog(), QPulseAudioMediaDevices::QPulseAudioMediaDevices(), QQmlApplication::QQmlApplication(), QQmlBaseModule< RequestType >::QQmlBaseModule(), QQmlComponent::QQmlComponent(), QQmlDebugConnection::QQmlDebugConnection(), QQmlDebugServerImpl::QQmlDebugServerImpl(), QQmlDebugTranslationServicePrivate::QQmlDebugTranslationServicePrivate(), QQmlPreviewFileLoader::QQmlPreviewFileLoader(), QQmlPreviewHandler::QQmlPreviewHandler(), QQmlPreviewPosition::QQmlPreviewPosition(), QQmlPreviewServiceImpl::QQmlPreviewServiceImpl(), QQmlProfilerClient::QQmlProfilerClient(), QQmlProfilerClient::QQmlProfilerClient(), QQmlWatchProxy::QQmlWatchProxy(), QQnxAudioSink::QQnxAudioSink(), QQnxInputContext::QQnxInputContext(), QQnxIntegration::QQnxIntegration(), QQnxMediaPlayer::QQnxMediaPlayer(), QQnxWindowGrabber::QQnxWindowGrabber(), QQuick3DAmbientSound::QQuick3DAmbientSound(), QQuick3DAudioEngine::QQuick3DAudioEngine(), QQuick3DAudioListener::QQuick3DAudioListener(), QQuick3DAudioRoom::QQuick3DAudioRoom(), QQuick3DItem2D::QQuick3DItem2D(), QQuick3DParticleModelParticle::QQuick3DParticleModelParticle(), QQuick3DParticleSpriteParticle::QQuick3DParticleSpriteParticle(), QQuick3DParticleSystem::QQuick3DParticleSystem(), QQuick3DProfilerAdapter::QQuick3DProfilerAdapter(), QQuick3DReflectionProbe::QQuick3DReflectionProbe(), QQuick3DSceneEnvironment::QQuick3DSceneEnvironment(), QQuick3DSGDirectRenderer::QQuick3DSGDirectRenderer(), QQuick3DSpatialSound::QQuick3DSpatialSound(), QQuick3DViewport::QQuick3DViewport(), QQuick3DWindowAttachment::QQuick3DWindowAttachment(), QQuickAnimatedSprite::QQuickAnimatedSprite(), QQuickAnimatorProxyJob::QQuickAnimatorProxyJob(), QQuickApplication::QQuickApplication(), QQuickContext2DRenderThread::QQuickContext2DRenderThread(), QQuickDialog::QQuickDialog(), QQuickFocusFrame::QQuickFocusFrame(), QQuickFontLoader::QQuickFontLoader(), QQuickFusionKnob::QQuickFusionKnob(), QQuickGraphicsInfo::QQuickGraphicsInfo(), QQuickImageCapture::QQuickImageCapture(), QQuickInputMethod::QQuickInputMethod(), QQuickItemParticle::QQuickItemParticle(), QQuickMediaPlayer::QQuickMediaPlayer(), QQuickMenu::QQuickMenu(), QQuickMonthGrid::QQuickMonthGrid(), QQuickParticleEmitter::QQuickParticleEmitter(), QQuickPixmapReader::QQuickPixmapReader(), QQuickProfilerAdapter::QQuickProfilerAdapter(), QQuickRhiItemNode::QQuickRhiItemNode(), QQuickScreenCatpure::QQuickScreenCatpure(), QQuickSelectionRectangle::QQuickSelectionRectangle(), QQuickSelectionRectanglePrivate::QQuickSelectionRectanglePrivate(), QQuickShapePath::QQuickShapePath(), QQuickSpriteSequence::QQuickSpriteSequence(), QQuickStackViewAttached::QQuickStackViewAttached(), QQuickSystemPalette::QQuickSystemPalette(), QQuickTextControl::QQuickTextControl(), QQuickTextSelection::QQuickTextSelection(), QQuickTrailEmitter::QQuickTrailEmitter(), QQuickTreeView::QQuickTreeView(), QQuickTumbler::QQuickTumbler(), QQuickVideoOutput::QQuickVideoOutput(), QQuickWeekNumberColumn::QQuickWeekNumberColumn(), QQuickWindowAttached::QQuickWindowAttached(), QQuickWindowContainer::QQuickWindowContainer(), QQuickWindowIncubationController::QQuickWindowIncubationController(), QQuickWindowQmlImpl::QQuickWindowQmlImpl(), QQuickWorkerScriptEngine::QQuickWorkerScriptEngine(), QSCNetworkReachabilityNetworkInformationBackend::QSCNetworkReachabilityNetworkInformationBackend(), QScreenCapture::QScreenCapture(), QScrollerPrivate::QScrollerPrivate(), QSGMapboxGLRenderNode::QSGMapboxGLRenderNode(), QSGMapboxGLTextureNode::QSGMapboxGLTextureNode(), QSGSoftwareThreadedRenderLoop::QSGSoftwareThreadedRenderLoop(), QSGThreadedRenderLoop::QSGThreadedRenderLoop(), QShortcut::QShortcut(), QShortcut::QShortcut(), QSingleShotTimer::QSingleShotTimer(), QSizeChangeListener::QSizeChangeListener(), QSmoothedAnimationTimer::QSmoothedAnimationTimer(), QSmSocketReceiver::QSmSocketReceiver(), QStackedWidget::QStackedWidget(), QSystemTrayWatcher::QSystemTrayWatcher(), QtBluezPeripheralConnectionManager::QtBluezPeripheralConnectionManager(), QThreadPool::QThreadPool(), QTlsBackend::QTlsBackend(), QToolBarLayout::QToolBarLayout(), QtWayland::QtShellIntegration::QtShellIntegration(), QUndoModel::QUndoModel(), QV4DebugClient::QV4DebugClient(), QV4L2CameraDevices::QV4L2CameraDevices(), QV4ProfilerAdapter::QV4ProfilerAdapter(), QVideoOutputOrientationHandler::QVideoOutputOrientationHandler(), QVideoWindowPrivate::QVideoWindowPrivate(), QVncClient::QVncClient(), QWasmAudioSink::QWasmAudioSink(), QWasmAudioSource::QWasmAudioSource(), QWasmInputContext::QWasmInputContext(), QWavefrontMesh::QWavefrontMesh(), QtWaylandClient::QWaylandGLContext::QWaylandGLContext(), QWaylandInputMethodControl::QWaylandInputMethodControl(), QWaylandKeyboard::QWaylandKeyboard(), QWaylandPointer::QWaylandPointer(), QWaylandQuickItem::QWaylandQuickItem(), QWaylandSeat::QWaylandSeat(), QtWaylandClient::QWaylandShmBackingStore::QWaylandShmBackingStore(), QtWaylandClient::QWaylandSurface::QWaylandSurface(), QtWaylandClient::QWaylandXdgShellIntegration::QWaylandXdgShellIntegration(), QWidgetPlatformColorDialog::QWidgetPlatformColorDialog(), QWidgetPlatformFileDialog::QWidgetPlatformFileDialog(), QWidgetPlatformFontDialog::QWidgetPlatformFontDialog(), QWidgetPlatformMenu::QWidgetPlatformMenu(), QWidgetPlatformMenuItem::QWidgetPlatformMenuItem(), QWidgetPlatformMessageDialog::QWidgetPlatformMessageDialog(), QWidgetPlatformSystemTrayIcon::QWidgetPlatformSystemTrayIcon(), QWidgetWindow::QWidgetWindow(), QWindowCapture::QWindowCapture(), QWindowContainer::QWindowContainer(), QWindowsFileSystemWatcherEngine::QWindowsFileSystemWatcherEngine(), QWindowsInputContext::QWindowsInputContext(), QWindowsKeyMapper::QWindowsKeyMapper(), QWindowsMediaDeviceReader::QWindowsMediaDeviceReader(), QWindowsMediaDeviceSession::QWindowsMediaDeviceSession(), QWinRTBluetoothDeviceDiscoveryWorker::QWinRTBluetoothDeviceDiscoveryWorker(), QXdgDesktopPortalFileDialog::QXdgDesktopPortalFileDialog(), QXdgDesktopPortalTheme::QXdgDesktopPortalTheme(), QSGBatchRenderer::Renderer::Renderer(), RouteHandler::RouteHandler(), ScreenWidget::ScreenWidget(), SharedTextureImageResponse::SharedTextureImageResponse(), SharedTextureRegistry::SharedTextureRegistry(), QQuickViewTestUtils::StressTestModel::StressTestModel(), TestHTTPServer::TestHTTPServer(), Vsp2Layer::Vsp2Layer(), Window::Window(), QtWayland::WlShellIntegration::WlShellIntegration(), QtWayland::XdgPopupIntegration::XdgPopupIntegration(), QtWayland::XdgToplevelIntegration::XdgToplevelIntegration(), QNetworkReplyHttpImplPrivate::_q_bufferOutgoingData(), QNetworkReplyImplPrivate::_q_bufferOutgoingData(), QNetworkReplyWasmImplPrivate::_q_bufferOutgoingData(), QAbstractSocketPrivate::_q_connectToNextAddress(), QWidgetTextControlPrivate::_q_documentLayoutChanged(), QGraphicsScenePrivate::_q_emitUpdated(), QPdfDocumentPrivate::_q_tryLoadingWithSizeFromContentHeader(), QMenu::actionEvent(), QMenuBar::actionEvent(), QDBusPendingCallWatcherHelper::add(), QObjectCleanupHandler::add(), QWidget::addAction(), QWidget::addAction(), QActionGroup::addAction(), QQuick3DItem2D::addChildItem(), AdapterManager::addClient(), QV4DebuggerAgent::addDebugger(), QEvdevTouchManager::addDevice(), QWizardPrivate::addField(), QFFmpegSurfaceCaptureGrabber::addFrameCallback(), QQuickLabsPlatformMenuItemGroup::addItem(), QGeoMapMapboxGLPrivate::addMapItem(), QEvdevMouseManager::addMouse(), QWindowsFileSystemWatcherEngine::addPaths(), QQuickItemPrivate::addPointerHandler(), QtAndroidQuickViewEmbedding::addRootObjectSignalListener(), QtBluezPeripheralApplication::addService(), QOpenGLShaderProgram::addShader(), QWidgetAnimator::animate(), QMdiAreaPrivate::appendChild(), QNetworkReplyImplPrivate::appendDownstreamData(), QQuick3DParticleAffector::appendParticle(), QQuickItemViewPrivate::applyRemovalChange(), Abstract_DBus_Interface::asyncCall(), QQuickTextAreaPrivate::attachFlickable(), QQuick3DObjectPrivate::attachWatcherPriv(), QQuick3DLightmapBaker::bake(), GeoRoutingManagerEngineEsri::calculateRoute(), QGeoRoutingManagerEngineMapbox::calculateRoute(), QGeoRoutingManagerEngineNokia::calculateRoute(), QGeoRoutingManagerEngineOsm::calculateRoute(), DBus_PendingCall_Interface::callInterfaceMain(), QChronoTimer::callOnTimeout(), QTimer::callOnTimeout(), QQmlDelegateChooser::choices_append(), QQmlDelegateChooser::choices_replace(), QDeclarativeGeoMapItemView::classBegin(), QQuickPlaylist::classBegin(), QQuickPdfDocument::classBegin(), QGeoFileTileCacheOsm::clearObsoleteTiles(), QQuickWindowQmlImpl::componentComplete(), QQuickAbstractDialog::componentComplete(), QQuickShape::componentComplete(), QQuickPopup::componentComplete(), QDeclarativeGeoServiceProvider::componentComplete(), QDeclarativePositionSource::componentComplete(), QDeclarativeSatelliteSource::componentComplete(), QQuick3DParticleSystem::componentComplete(), AVFCameraRenderer::configureAVCaptureSession(), connect(), QtFuture::connect(), QWizardPrivate::connectButton(), QQuickPixmap::connectDownloadProgress(), QQuickPixmap::connectFinished(), QDeclarativeGeoMapCopyrightNotice::connectMap(), QQmlProperty::connectNotifySignal(), QQuickPath::connectPathElements(), QQmlDelegateModelPrivate::connectToAbstractItemModel(), QQuickStyleItem::connectToControl(), QQuickStyleItemButton::connectToControl(), QQuickStyleItemCheckBox::connectToControl(), QQuickStyleItemComboBox::connectToControl(), QQuickStyleItemDial::connectToControl(), QQuickStyleItemProgressBar::connectToControl(), QQuickStyleItemRadioButton::connectToControl(), QQuickStyleItemScrollBar::connectToControl(), QQuickStyleItemSlider::connectToControl(), QQuickStyleItemSpinBox::connectToControl(), QQuickStyleItemTextField::connectToControl(), QQuickStyleItemTreeIndicator::connectToControl(), QLowEnergyControllerPrivateBluez::connectToDevice(), QLowEnergyControllerPrivateBluezDBus::connectToDevice(), QLowEnergyControllerPrivateWinRT::connectToDevice(), QQmlDebugConnection::connectToHost(), QBluetoothSocketPrivateBluezDBus::connectToServiceHelper(), QBluetoothSocketPrivateBluez::connectToServiceHelper(), QQuickVisualTestUtils::SignalMultiSpy::connectToSignal(), QAnimationGroupPrivate::connectUncontrolledAnimation(), QQuickComboBox::contentItemChange(), QQuickSpinBox::contentItemChange(), QOpenGLVertexArrayObjectPrivate::create(), QQuickLabsPlatformDialog::create(), QQuickLabsPlatformMenu::create(), QQuickLabsPlatformMenuItem::create(), QQuickAbstractDialog::create(), QRestAccessManagerPrivate::createActiveRequest(), QDBusConnectionPrivate::createBusService(), createContext(), QQmlBindPrivate::createDelayedValues(), QQnxIntegration::createDisplay(), QQuickSelectionRectanglePrivate::createHandle(), QGeoTiledMappingManagerEngineOsm::createMap(), QWindowsFileDialogHelper::createNativeDialog(), QWindowsXpFileDialogHelper::createNativeDialog(), QCocoaTheme::createPlatformMenuBar(), QQmlDebugConnectionPrivate::createProtocol(), QtAndroidQuickViewEmbedding::createQuickView(), QUndoGroup::createRedoAction(), QQuick3DViewport::createRenderer(), QLineEdit::createStandardContextMenu(), AndroidTextureThread::createSurfaceTexture(), QUndoGroup::createUndoAction(), QNetworkAccessBackend::createUploadByteDevice(), QNetworkReplyHttpImplPrivate::createUploadByteDevice(), QFileDialogPrivate::createWidgets(), QDBusTrayIcon::dBusConnection(), AudioDecodingExample::decode(), QNetworkAccessManagerPrivate::destroyThread(), RequestHandler::details(), QQuickDeliveryAgentPrivate::deviceExtra(), QLowEnergyControllerPrivateBluezDBus::disconnectFromDevice(), QLowEnergyControllerPrivateBluezDBus::discoverServiceDetails(), QBluetoothSocket::doDeviceDiscovery(), SharedTextureImageResponse::doRequest(), QAbstractItemViewPrivate::editor(), MyClass::enableCharNotifications(), QQuickShapeGenericRenderer::endSync(), QQuickDeliveryAgentPrivate::ensureDeviceConnected(), QInputDialogPrivate::ensureDoubleSpinBox(), QInputDialogPrivate::ensureEnabledConnection(), QInputDialogPrivate::ensureIntSpinBox(), QInputDialogPrivate::ensureLayout(), QQmlApplicationEnginePrivate::ensureLoadingFinishes(), QBluetoothSocketPrivateBluez::ensureNativeSocket(), QLabelPrivate::ensureTextControl(), QFileInfoGatherer::event(), QGtk3Dialog::exec(), QQuickViewPrivate::execute(), QQuickWidgetPrivate::execute(), QQuickViewPrivate::execute(), QQuickMaterialRippleWaveNode::exit(), QQuickColorDialogImplPrivate::eyeDropperEnter(), QGeoTileFetcherNokia::fetchCopyrightsData(), QDeclarativePlaceContentModel::fetchMore(), QGeoTileFetcherNokia::fetchVersionData(), QIBusPlatformInputContext::filterEvent(), EditorWindow::find(), QQmlApplicationEnginePrivate::finishLoad(), QQuickParticleSystem::finishRegisteringParticleEmitter(), GeoCodingManagerEngineEsri::geocode(), QGeoCodingManagerEngineOsm::geocode(), QDeclarativePlace::getDetails(), QFileDialog::getOpenFileContent(), QPlaceManagerEngineNokiaV2::getPlaceContent(), QPlaceManagerEngineNokiaV2::getPlaceDetails(), QQuickItem::grabToImage(), Vsp2Layer::handleSurfaceChanged(), QQuickShaderEffectPrivate::handleUpdatePaintNode(), QQuickWidgetPrivate::handleWindowChange(), RequestHandler::images(), QSslServer::incomingConnection(), QStandardItemModelPrivate::init(), QHttpNetworkConnectionPrivate::init(), QHttpNetworkConnectionChannel::init(), QUnixPageSetupDialogPrivate::init(), QPrintDialogPrivate::init(), QPrintPreviewWidgetPrivate::init(), QFontDialogPrivate::init(), QGraphicsSceneIndexPrivate::init(), QAbstractItemViewPrivate::init(), QTableViewPrivate::init(), QDockWidgetPrivate::init(), QMenuPrivate::init(), QToolBarPrivate::init(), QQmlApplicationEnginePrivate::init(), QQuickItemViewPrivate::init(), QQuickTableViewPrivate::init(), QQuickTextEditPrivate::init(), QQuickContainerPrivate::init(), QQuickControlPrivate::init(), QQuickPopupPrivate::init(), QGeoPositionInfoSourceWinRT::init(), QWaylandCompositorPrivate::init(), QWaylandQuickItemPrivate::init(), QDBusTrayIcon::init(), QLowEnergyControllerPrivateAndroid::init(), QLowEnergyControllerPrivateBluez::init(), QLowEnergyControllerPrivateBluezDBus::init(), WatcherWrapper::init(), QLineEditPrivate::init(), QTextEditPrivate::init(), QProgressDialogPrivate::init(), QPlainTextEditPrivate::init(), QCompleterPrivate::init(), QGraphicsSvgItemPrivate::init(), QPrintPreviewDialogPrivate::init(), QQuickWidgetPrivate::init(), QQuickContext2D::init(), QQuickWindowPrivate::init(), QWindowPrivate::init(), QDateTimeEditPrivate::initCalendarPopup(), QtWaylandClient::QWaylandDisplay::initEventThread(), QErrorMessagePrivate::initHelper(), QFileDialogPrivate::initHelper(), QFontDialogPrivate::initHelper(), QMessageBoxPrivate::initHelper(), QColorDialogPrivate::initHelper(), QQuickScrollBarAttachedPrivate::initHorizontal(), QOpenGLDebugLogger::initialize(), QQuickMultiEffectPrivate::initialize(), QDeclarativeGeoMap::initialize(), QtWaylandClient::QWaylandIntegration::initialize(), QWaylandQuickOutput::initialize(), QHttpSocketEngine::initialize(), QSocks5SocketEngine::initialize(), QSocks5SocketEnginePrivate::initialize(), RequestHandler::initializeCategories(), PlaceManagerEngineEsri::initializeCategories(), QPlaceManagerEngineMapbox::initializeCategories(), QPlaceManagerEngineNokiaV2::initializeCategories(), QPlaceManagerEngineOsm::initializeCategories(), QSslServerPrivate::initializeHandshakeProcess(), QDeclarativeSearchModelBase::initializePlugin(), initializeRHI(), QItemSelectionModelPrivate::initModel(), QQuickWidgetPrivate::initOffscreenWindow(), QDBusAbstractInterfacePrivate::initOwnerTracking(), initProxy(), LinuxDmabufWlBuffer::initTexture(), QQuickScrollBarAttachedPrivate::initVertical(), QPlatformMediaDevices::initVideoDevicesConnection(), QColorDialogPrivate::initWidgets(), QMenuPrivate::insertActionInPlatformMenu(), QToolBox::insertItem(), QQuickVideoOutput::itemChange(), QQuickTumblerView::itemChange(), QQuickStyleItem::itemChange(), QQuick3DTexture::itemChange(), QQuickParticlePainter::itemChange(), QDeclarativeGeoMap::itemChange(), QQuickCanvasItem::itemChange(), QBluetoothServer::listen(), DtlsServer::listen(), QQuickLoaderPrivate::load(), QAmbientSoundPrivate::load(), QPdfDocumentPrivate::load(), QQuickStackElement::load(), QQuickPixmap::loadImageFromDevice(), QQmlPreviewHandler::loadUrl(), QDnsLookup::lookup(), main(), main(), QWaylandQuickShellSurfaceItemPrivate::maybeCreateAutoPopup(), QGstreamerImageCapture::onCameraChanged(), QNearFieldManagerPrivateImpl::onCardInserted(), QQuickLabsPlatformColorDialog::onCreate(), QQuickLabsPlatformFileDialog::onCreate(), QQuickLabsPlatformFolderDialog::onCreate(), QQuickLabsPlatformFontDialog::onCreate(), QQuickLabsPlatformMessageDialog::onCreate(), QQuickColorDialog::onCreate(), QQuickFileDialog::onCreate(), QQuickFolderDialog::onCreate(), QQuickFontDialog::onCreate(), QQuickMessageDialog::onCreate(), TileProvider::onNetworkReplyFinished(), QQuickLabsPlatformFileDialog::onShow(), QQuickFileDialog::onShow(), QNetworkAccessFileBackend::open(), AndroidCamera::open(), QWaveDecoder::open(), QPageSetupDialog::open(), QPrintPreviewDialog::open(), QColorDialog::open(), QFileDialog::open(), QFontDialog::open(), QInputDialog::open(), QMessageBox::open(), QProgressDialog::open(), QNmeaSatelliteInfoSourcePrivate::openSourceDevice(), QQuickPath::pathElements_append(), QDialogPrivate::platformHelper(), QDeclarativeGeocodeModel::pluginReady(), QtGlobalStatic::ApplicationHolder< QAS >::pointer(), QNetworkReplyHttpImplPrivate::postRequest(), QNmeaSatelliteInfoSourcePrivate::prepareSourceDevice(), QQuick3DItem2D::preSync(), QGuiApplicationPrivate::processFocusWindowEvent(), QQuickShaderEffectPrivate::propertyChanged(), Q_TRACE_INSTRUMENT(), QQuick3DEffect::qmlAppendPass(), QQuick3DShaderUtilsRenderPass::qmlAppendShader(), qmltcCreateDynamicMetaObject(), quick_test_main_with_setup(), QFFmpegMediaRecorder::record(), QQnxMediaRecorder::record(), QOpenXRActionMapper::registerAction(), QtBluezPeripheralApplication::registerApplication(), QGeoAreaMonitorPollingPrivate::registerClient(), QtBluezDiscoveryManager::registerDiscoveryInterest(), QmlLsp::QQmlLanguageServer::registerHandlers(), TextSynchronization::registerHandlers(), WorkspaceHandlers::registerHandlers(), QLanguageServer::registerHandlers(), QQuick3DParticleSystem::registerParticleAffector(), QQuickParticleSystem::registerParticlePainter(), QQuickStylePlugin::registerTypes(), QQmlXmlListModel::reload(), QDeclarativeCategory::remove(), QDeclarativePlace::remove(), RequestHandler::removeCategory(), RequestHandler::removePlace(), QQuick3DParticleAffector::replaceParticle(), QtWaylandClient::QWaylandXdgSurface::requestActivate(), QBluetoothLocalDevicePrivate::requestPairing(), QNmeaPositionInfoSourcePrivate::requestUpdate(), QNmeaSatelliteInfoSourcePrivate::requestUpdate(), QtWaylandClient::QWaylandXdgSurface::requestXdgActivationToken(), TileProvider::resolveProvider(), QGeoTileProviderOsm::resolveProvider(), GeoCodingManagerEngineEsri::reverseGeocode(), QGeoCodingManagerEngineOsm::reverseGeocode(), QEglFSKmsEventReaderThread::run(), QCtfServer::run(), QAlphaWidget::run(), QRollEffect::run(), QSoundEffectPrivate::sampleReady(), QDeclarativePlace::save(), QDeclarativeCategory::save(), RequestHandler::saveCategory(), QFileDialog::saveFileContent(), RequestHandler::savePlace(), RequestHandler::search(), QPlaceManagerEngineNokiaV2::search(), PlaceManagerEngineEsri::search(), QPlaceManagerEngineOsm::search(), QPlaceManagerEngineNokiaV2::searchSuggestions(), QHttp2Stream::sendDATA(), QHttp2Stream::sendDATA(), QHttpProtocolHandler::sendRequest(), QQuickAbstractButton::setAction(), QOpenXRController::setActionMapper(), QUndoGroup::setActiveStack(), QtWaylandClient::QWaylandXdgSurface::setAlertState(), QWindowsMediaDeviceSession::setAudioInput(), AVFCameraService::setAudioInput(), QAndroidCaptureSession::setAudioInput(), QFFmpegMediaCaptureSession::setAudioInput(), QWindowsMediaDeviceSession::setAudioOutput(), AVFCameraService::setAudioOutput(), QQnxMediaPlayer::setAudioOutput(), MFPlayerSession::setAudioOutput(), QAndroidCaptureSession::setAudioOutput(), QAndroidMediaPlayer::setAudioOutput(), AVFMediaPlayer::setAudioOutput(), QFFmpegMediaCaptureSession::setAudioOutput(), QDBusAbstractAdaptor::setAutoRelaySignals(), QQuickFlipable::setBack(), QWidgetLineControl::setBlinkingCursorEnabled(), QQuickColorInputs::setBlueInput(), QWaylandQtShellChrome::setBottomLeftResizeHandle(), QWaylandQtShellChrome::setBottomResizeHandle(), QWaylandQtShellChrome::setBottomRightResizeHandle(), QCalendarPopup::setCalendarWidget(), QQnxPlatformCamera::setCamera(), QOpenXROrigin::setCamera(), QGstreamerMediaCapture::setCamera(), QAndroidCaptureSession::setCameraSession(), QProgressDialog::setCancelButton(), QWindowsCamera::setCaptureSession(), QAndroidImageCapture::setCaptureSession(), AVFImageCapture::setCaptureSession(), AVFMediaEncoder::setCaptureSession(), QFFmpegImageCapture::setCaptureSession(), QGstreamerImageCapture::setCaptureSession(), QGstreamerMediaEncoder::setCaptureSession(), QWindowsImageCapture::setCaptureSession(), QWindowsMediaEncoder::setCaptureSession(), QAndroidCamera::setCaptureSession(), QQnxImageCapture::setCaptureSession(), QQuick3DRandomInstancing::setColor(), QQuickColorDialogImplAttached::setColorInputs(), QQuickColorDialogImplAttached::setColorPicker(), QQuickWindowContainer::setContainedWindow(), QWidgetTextControlPrivate::setContent(), QOpenXRItemPrivate::setContentItem(), QQmlContext::setContextProperty(), QOpenXRController::setController(), QQuick3DRandomInstancing::setCustomData(), QQmlDelegateModel::setDelegate(), QQmlDelegateChoice::setDelegate(), QQuickMessageDialogImplAttached::setDetailedTextButton(), QQmlDebugServerImpl::setDevice(), QPdfBookmarkModel::setDocument(), QPdfLinkModel::setDocument(), QPdfSearchModel::setDocument(), QQuickPdfSelection::setDocument(), QSyntaxHighlighter::setDocument(), QQuick3DParticleModelBlendParticle::setEndNode(), QOpenXRView::setEnvironment(), QQuickColorDialogImplAttached::setEyeDropperButton(), QQuickFontDialogImplAttached::setFamilyListView(), QUrlModel::setFileSystemModel(), QQuick3DModel::setGeometry(), QQuickColorInputs::setGreenInput(), QQuickColorInputs::setHexInput(), QQuickScrollIndicatorAttached::setHorizontal(), QQuickColorInputs::setHslAlphaInput(), QQuickColorInputs::setHslHueInput(), QQuickColorInputs::setHslSaturationInput(), QQuickColorInputs::setHsvAlphaInput(), QQuickColorInputs::setHsvHueInput(), QQuickColorInputs::setHsvSaturationInput(), QQuick3DViewport::setImportScene(), QGfxSourceProxy::setInput(), InstanceModel::setInstancing(), QQuick3DModel::setInstancing(), QmlJSDebugger::Highlight::setItem(), QComboBoxPrivateContainer::setItemView(), QWaylandQtShellChrome::setLeftResizeHandle(), QQuickColorInputs::setLightnessInput(), QAbstractSpinBox::setLineEdit(), QComboBox::setLineEdit(), QQuick3DCamera::setLookAtNode(), QDeclarativeGeoMapQuickItem::setMap(), QSignalMapper::setMapping(), QSignalMapper::setMapping(), QSignalMapper::setMapping(), QDeclarativeGeoMapCopyrightNotice::setMapSource(), QQuickParticleEmitter::setMaxParticleCount(), QQuickShaderEffectPrivate::setMesh(), QQuickItemView::setModel(), QQmlTableInstanceModel::setModel(), QQmlInstantiator::setModel(), QCompleter::setModel(), QAbstractItemView::setModel(), QHeaderView::setModel(), QTreeView::setModel(), QWaylandSeat::setMouseFocus(), QMenuPrivate::setOverrideMenuAction(), QWizard::setPage(), QDeclarativeGeoMapItemBase::setParentGroup(), QDeclarativeGeoMapItemGroup::setParentGroup(), QQuickMenuPrivate::setParentMenu(), QQuick3DParticleEmitter::setParticle(), QQuickPathInterpolator::setPath(), QMenuPrivate::setPlatformMenu(), QDeclarativeGeocodeModel::setPlugin(), QDeclarativeGeoRouteModel::setPlugin(), QDeclarativeCategory::setPlugin(), QDeclarativePlace::setPlugin(), QDeclarativeSupportedCategoriesModel::setPlugin(), QDeclarativeGeoMap::setPlugin(), QCompleter::setPopup(), QQuick3DRandomInstancing::setPosition(), QGeoAreaMonitorPollingPrivate::setPositionSource(), QDeclarativeGeocodeModel::setQuery(), QDeclarativeGeoRouteModel::setQuery(), QDeclarativeGeoMapItemGroup::setQuickMap(), QQuickColorInputs::setRedInput(), QQmlProfilerClient::setRequestedFeatures(), QQuickColorInputs::setRgbAlphaInput(), QWaylandQtShellChrome::setRightResizeHandle(), QQuick3DRandomInstancing::setRotation(), QQuick3DRandomInstancing::setScale(), QOffscreenSurface::setScreen(), QOpenGLContext::setScreen(), QQnxScreenEventHandler::setScreenEventThread(), QListWidget::setSelectionModel(), QtWaylandClient::QWaylandDataDevice::setSelectionSource(), QtWaylandClient::QWaylandPrimarySelectionDeviceV1::setSelectionSource(), QWaylandQuickShellSurfaceItem::setShellSurface(), QWaylandQtShellChrome::setShellSurfaceItem(), QQuickFontDialogImplAttached::setSizeEdit(), QQuickFontDialogImplAttached::setSizeListView(), QQuick3DJoint::setSkeletonRoot(), QBluetoothSocketPrivateAndroid::setSocketDescriptor(), QBluetoothSocketPrivateBluez::setSocketDescriptor(), QQuickFontLoader::setSource(), QSoundEffect::setSource(), QOpenXRVirtualMouse::setSource(), QQuickShaderEffectSource::setSourceItem(), QQuick3DTexture::setSourceItem(), QTransposeProxyModel::setSourceModel(), QAbstractProxyModel::setSourceModel(), QCompletionModel::setSourceModel(), QUndoModel::setStack(), QQmlDebugTranslationServicePrivate::setState(), QQuickFontDialogImplAttached::setStrikeoutCheckBox(), QQuickFontDialogImplAttached::setStyleListView(), QQuickMenuItemPrivate::setSubMenu(), PresentationFeedback::setSurface(), QTabWidget::setTabBar(), QTabWidget::setTabsClosable(), LookAtNode::setTarget(), QQuickLayoutItemProxy::setTarget(), QPropertyAnimation::setTargetObject(), QQuick3DTexture::setTextureData(), QGeoTiledMappingManagerEngine::setTileFetcher(), QGraphicsItemAnimation::setTimeLine(), QWaylandQtShellChrome::setTitleBar(), QWaylandQtShellChrome::setTopLeftResizeHandle(), QWaylandQtShellChrome::setTopResizeHandle(), QWaylandQtShellChrome::setTopRightResizeHandle(), QQuickFontDialogImplAttached::setUnderlineCheckBox(), QTableWidgetPrivate::setup(), AudioInputExample::setup(), AudioOutputExample::setup(), QPrintPreviewDialogPrivate::setupActions(), WaylandEglClientBufferIntegrationPrivate::setupBufferAndCleanup(), WaylandEglStreamClientBufferIntegrationPrivate::setupBufferAndCleanup(), QDeviceClosedNotifier::setupDevice(), QNearFieldTargetPrivateImpl::setupTargetCheckTimer(), QNetworkReplyHttpImplPrivate::setupTransferTimeout(), QFFmpegImageCapture::setupVideoSourceConnections(), QAndroidImageCapture::setupVideoSourceConnections(), QQuickTumblerPrivate::setupViewData(), WorkerThread::setupWorker(), QDesktopServices::setUrlHandler(), QToolBarLayout::setUsePopupMenu(), QQuickColorInputs::setValueInput(), QQuickScrollIndicatorAttached::setVertical(), QAndroidCameraSession::setVideoOutput(), QAndroidCameraSession::setVideoSink(), QAndroidMediaPlayer::setVideoSink(), QMdiAreaPrivate::setViewMode(), QGraphicsProxyWidgetPrivate::setWidget_helper(), QQuickOverlayAttachedPrivate::setWindow(), QQuick3DRenderStats::setWindow(), QQuickFontDialogImplAttached::setWritingSystemComboBox(), QAndroidInputContext::showInputPanel(), QStatusBar::showMessage(), QIOSMenu::showPopup(), RequestHandler::simpleSearch(), QBluetoothSocketPrivateAndroid::socketConnectSuccess(), QQnxButtonEventNotifier::start(), QQnxNavigatorEventNotifier::start(), QFFmpegAudioDecoder::start(), QQuickAnimatedNode::start(), QBluetoothDeviceDiscoveryAgentPrivate::start(), QAlsaAudioSink::start(), QAndroidAudioSink::start(), QPulseAudioSink::start(), QWindowsAudioSink::start(), QAndroidCaptureSession::start(), QLeDBusAdvertiser::startAdvertising(), QLowEnergyControllerPrivateBluez::startAdvertising(), QLowEnergyControllerPrivateBluezDBus::startAdvertising(), MyClass::startDeviceDiscovery(), QBluetoothServiceDiscoveryAgentPrivate::startDeviceDiscovery(), QQmlDebugConnection::startLocalServer(), QHttpThreadDelegate::startRequest(), MyClass::startServiceDiscovery(), QSingleShotTimer::startTimerForReceiver(), QPSQLDriver::subscribeToNotification(), RequestHandler::suggestion(), QSGSoftwareRenderThread::sync(), QSGRenderThread::sync(), QDBusPlatformMenu::syncSubMenu(), QXcbConnection::systemTrayTracker(), QGraphicsTextItemPrivate::textControl(), QSGRenderContext::textureForFactory(), QQuickShaderEffectSource::textureProvider(), QFFmpeg::PlaybackEngineObject::timer(), QSslSocketPrivate::tlsBackendInUse(), QDeclarativeGeoRouteModel::update(), QDeclarativeSearchModelBase::update(), QDeclarativeSupportedCategoriesModel::update(), QQuickTabBarAttachedPrivate::update(), QDBusTrayIcon::updateMenu(), QFFmpeg::AudioRenderer::updateOutput(), QQuickFramebufferObject::updatePaintNode(), QQuickShaderEffectSource::updatePaintNode(), QWaylandQuickItem::updatePaintNode(), QDeclarativeGeoMapQuickItem::updatePolish(), QGeoRoutingManagerEngineNokia::updateRoute(), QGeoMapMapboxGLPrivate::updateSceneGraph(), QQuick3DCustomMaterial::updateSpatialNode(), QQuick3DEffect::updateSpatialNode(), QQuick3DItem2D::updateSpatialNode(), QQuick3DTexture::updateSpatialNode(), QWaylandInputMethodControl::updateTextInput(), QSGRhiShaderEffectMaterial::updateTextureProviders(), AVFCameraSession::updateVideoInput(), vpe_append(), QDBusPendingCallPrivate::waitForFinishedWithGui(), QtPrivate::watchContinuationImpl(), QQuickWindowAttached::windowChange(), QQuickApplicationWindowAttachedPrivate::windowChange(), src_gui_opengl_qopengldebug::SnippetWrapper::wrapper1(), src_gui_itemviews_qstandarditemmodel::MyWidget::wrapper2(), QtWaylandClient::QWaylandTabletSeatV2::zwp_tablet_seat_v2_pad_added(), QtWaylandClient::QWaylandTabletSeatV2::zwp_tablet_seat_v2_tablet_added(), and QtWaylandClient::QWaylandTabletSeatV2::zwp_tablet_seat_v2_tool_added().

+ Here is the call graph for this function:

◆ connect() [3/5]

QMetaObject::Connection QObject::connect ( const QObject * sender,
const QMetaMethod & signal,
const QObject * receiver,
const QMetaMethod & method,
Qt::ConnectionType type = Qt::AutoConnection )
static
Since
4.8

Creates a connection of the given type from the signal in the sender object to the method in the receiver object. Returns a handle to the connection that can be used to disconnect it later.

The Connection handle will be invalid if it cannot create the connection, for example, the parameters were invalid. You can check if the QMetaObject::Connection is valid by casting it to a bool.

This function works in the same way as {connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)} but it uses QMetaMethod to specify signal and method.

See also
connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)

Definition at line 3099 of file qobject.cpp.

References check_and_warn_compat(), QMetaObject::checkConnectArgs(), QMetaObjectPrivate::connect(), QMetaObject::Connection(), QMetaMethod::Constructor, QMetaObjectPrivate::memberIndexes(), method, qCWarning, Qt::QueuedConnection, queuedConnectionTypes(), QMetaMethod::Signal, and signal.

+ Here is the call graph for this function:

◆ connect() [4/5]

template<typename Func1 , typename Func2 >
static QMetaObject::Connection QObject::connect ( const typename QtPrivate::FunctionPointer< Func1 >::Object * sender,
Func1 signal,
const typename QtPrivate::ContextTypeForFunctor< Func2 >::ContextType * context,
Func2 && slot,
Qt::ConnectionType type = Qt::AutoConnection )
inlinestatic

Definition at line 228 of file qobject.h.

References Qt::BlockingQueuedConnection, context, Q_ASSERT_X, Qt::QueuedConnection, signal, QtPrivate::ConnectionTypes< ArgList, Declared >::types(), and Qt::UniqueConnection.

+ Here is the call graph for this function:

◆ connect() [5/5]

template<typename Func1 , typename Func2 >
static QMetaObject::Connection QObject::connect ( const typename QtPrivate::FunctionPointer< Func1 >::Object * sender,
Func1 signal,
Func2 && slot )
inlinestatic

Definition at line 277 of file qobject.h.

References connect(), Qt::DirectConnection, and signal.

+ Here is the call graph for this function:

◆ connectNotify()

void QObject::connectNotify ( const QMetaMethod & signal)
protectedvirtual
Since
5.0

This virtual function is called when something has been connected to signal in this object.

If you want to compare signal with a specific signal, you can use QMetaMethod::fromSignal() as follows:

if (signal == QMetaMethod::fromSignal(&MyObject::valueChanged)) {
// signal is valueChanged
}
Warning
This function violates the object-oriented principle of modularity. However, it might be useful when you need to perform expensive initialization only if something is connected to a signal.
This function is called from the thread which performs the connection, which may be a different thread from the thread in which this object lives. This function may also be called with a QObject internal mutex locked. It is therefore not allowed to re-enter any QObject functions, including isSignalConnected(), from your reimplementation. If you lock a mutex in your reimplementation, make sure that you don't call QObject functions with that mutex held in other places or it will result in a deadlock.
See also
connect(), disconnectNotify()

Reimplemented in QBuffer, QDBusConnectionInterface, QFutureWatcherBase, QDBusAbstractInterface, QMediaDevices, QGeoAreaMonitorPolling, and QQuick3DNode.

Definition at line 3484 of file qobject.cpp.

References Q_UNUSED, and signal.

Referenced by QObjectPrivate::connectNotify(), and QMediaDevices::connectNotify().

+ Here is the caller graph for this function:

◆ customEvent()

void QObject::customEvent ( QEvent * event)
protectedvirtual

This event handler can be reimplemented in a subclass to receive custom events.

Custom events are user-defined events with a type value at least as large as the QEvent::User item of the QEvent::Type enum, and is typically a QEvent subclass. The event is passed in the event parameter.

See also
event(), QEvent

Reimplemented in QAndroidPlatformNativeInterface, QV4::Promise::ReactionHandler, and MFStream.

Definition at line 1522 of file qobject.cpp.

Referenced by MFStream::customEvent().

+ Here is the caller graph for this function:

◆ deleteLater

void QObject::deleteLater ( )
slot

\threadsafe

Schedules this object for deletion.

The object will be deleted when control returns to the event loop. If the event loop is not running when this function is called (e.g. deleteLater() is called on an object before QCoreApplication::exec()), the object will be deleted once the event loop is started. If deleteLater() is called after the main event loop has stopped, the object will not be deleted. If deleteLater() is called on an object that lives in a thread with no running event loop, the object will be destroyed when the thread finishes.

Note that entering and leaving a new event loop (e.g., by opening a modal dialog) will not perform the deferred deletion; for the object to be deleted, the control must return to the event loop from which deleteLater() was called. This does not apply to objects deleted while a previous, nested event loop was still running: the Qt event loop will delete those objects as soon as the new nested event loop starts.

In situations where Qt is not driving the event dispatcher via e.g. QCoreApplication::exec() or QEventLoop::exec(), deferred deletes will not be processed automatically. To ensure deferred deletion in this scenario, the following workaround can be used:

const auto *eventDispatcher = QThread::currentThread()->eventDispatcher();
if (QThread::currentThread()->loopLevel() == 0)
}
);
void aboutToBlock()
This signal is emitted before the event loop calls a function that could block.
static void sendPostedEvents(QObject *receiver=nullptr, int event_type=0)
Immediately dispatches all events which have been previously queued with QCoreApplication::postEvent(...
@ DeferredDelete
Definition qcoreevent.h:100
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Definition qobject.cpp:2960
static QThread * currentThread()
Definition qthread.cpp:1031
See also
destroyed(), QPointer

Definition at line 2435 of file qobject.cpp.

References QThreadData::current(), d, QCoreApplicationPrivate::lockThreadPostEventList(), QCoreApplication::postEvent(), qApp, qCDebug, and qWarning.

Referenced by Controller::Controller(), GeoCodeReplyEsri::GeoCodeReplyEsri(), GeoRouteReplyEsri::GeoRouteReplyEsri(), GeoTiledMapReplyEsri::GeoTiledMapReplyEsri(), PlaceSearchReplyEsri::PlaceSearchReplyEsri(), QGeoCodeReplyMapbox::QGeoCodeReplyMapbox(), QGeoCodeReplyNokia::QGeoCodeReplyNokia(), QGeoCodeReplyOsm::QGeoCodeReplyOsm(), QGeoMapReplyMapbox::QGeoMapReplyMapbox(), QGeoMapReplyNokia::QGeoMapReplyNokia(), QGeoMapReplyOsm::QGeoMapReplyOsm(), QGeoRouteReplyMapbox::QGeoRouteReplyMapbox(), QGeoRouteReplyNokia::QGeoRouteReplyNokia(), QGeoRouteReplyOsm::QGeoRouteReplyOsm(), QPlaceContentReplyImpl::QPlaceContentReplyImpl(), QPlaceDetailsReplyImpl::QPlaceDetailsReplyImpl(), QPlaceSearchReplyHere::QPlaceSearchReplyHere(), QPlaceSearchReplyMapbox::QPlaceSearchReplyMapbox(), QPlaceSearchReplyOsm::QPlaceSearchReplyOsm(), QPlaceSearchSuggestionReplyImpl::QPlaceSearchSuggestionReplyImpl(), QPlaceSearchSuggestionReplyMapbox::QPlaceSearchSuggestionReplyMapbox(), QQuick3DWindowAttachment::QQuick3DWindowAttachment(), MFStream::~MFStream(), QDBusConnection::~QDBusConnection(), QDBusServer::~QDBusServer(), QFFmpegAudioInput::~QFFmpegAudioInput(), QQuick3DItem2D::~QQuick3DItem2D(), QQuick3DTexture::~QQuick3DTexture(), QQuick3DViewport::~QQuick3DViewport(), QQuickContext2D::~QQuickContext2D(), QQuickContext2DRenderThread::~QQuickContext2DRenderThread(), QQuickItemViewFxItem::~QQuickItemViewFxItem(), QQuickStackElement::~QQuickStackElement(), QNetworkReplyHttpImplPrivate::_q_cacheLoadReadyRead(), QQuick3DObjectPrivate::_q_cleanupContentItem2D(), QNetworkAccessManagerPrivate::_q_replyFinished(), QBluetoothSocketPrivateWinRT::abort(), QHttpThreadDelegate::abortRequest(), DBus_PendingCall_Interface::callFinishedSlot(), QDeclarativeSearchModelBase::cancel(), QXcbDrag::cancel(), QSslServerPrivate::checkClientHelloAndContinue(), QQmlIncubator::clear(), QQuickLoaderPrivate::clear(), QDeclarativePlaceContentModel::clearData(), QGraphicsWidget::close(), QQmlDebugConnection::close(), QIOSFileEngineAssetsLibrary::close(), QLowEnergyControllerPrivateBluezDBus::connectToDevice(), QLowEnergyControllerPrivateWinRT::connectToDevice(), QGeoTileFetcherNokia::copyrightsFetched(), createContext(), QQuickPathViewPrivate::createHighlight(), QWidgetAction::deleteWidget(), QQuickPopupPrivate::destroyDimmer(), QVncServer::discardClient(), QLocalClientConnection::disconnect(), QTcpServerConnection::disconnect(), QLowEnergyControllerPrivateBluezDBus::disconnectFromDevice(), QDragManager::drag(), QPcscCard::enableAutodelete(), QQuickItemGrabResult::event(), QQuickMaterialRippleWaveNode::exit(), QGeoTileFetcherNokia::fetchCopyrightsData(), QGeoTileFetcherNokia::fetchVersionData(), QIBusPlatformInputContext::filterEventFinished(), QDeclarativeGeocodeModel::geocodeError(), QDeclarativeGeocodeModel::geocodeFinished(), RequestHandler::handleDetailsReply(), QXcbDrag::handleFinished(), QSslServerPrivate::handleHandshakeTimedOut(), RequestHandler::handleImagesReply(), RequestHandler::handleInitCatReply(), RequestHandler::handleRemoveCategoryReply(), RequestHandler::handleRemovePlaceReply(), QGeoTileFetcher::handleReply(), RequestHandler::handleSaveCategoryReply(), RequestHandler::handleSavePlaceReply(), RequestHandler::handleSearchReply(), RequestHandler::handleSuggestionReply(), QTipLabel::hideTipImmediately(), QDeclarativeSearchModelBase::initializePlugin(), QBluetoothSocketPrivateAndroid::inputThreadError(), QPcscCard::invalidate(), QSGRhiAtlasTexture::Manager::invalidate(), QSGDefaultRenderContext::invalidate(), QFFmpeg::PlaybackEngineObject::kill(), QQuickVectorImagePrivate::loadSvg(), RequestHandler::matchHandler(), QWaylandQuickShellSurfaceItemPrivate::maybeCreateAutoPopup(), TileProvider::onNetworkReplyError(), TileProvider::onNetworkReplyFinished(), AndroidCamera::open(), QDBusConnection::operator=(), RequestHandler::processSearchReply(), QDeclarativeSearchResultModel::queryFinished(), QDeclarativeSearchSuggestionModel::queryFinished(), QQmlListModelWorkerAgent::release(), QQuickLayoutItemProxyAttachedData::releaseProxy(), QQuickMenuBar::removeMenu(), QQuickDialogButtonBoxPrivate::removeStandardButtons(), QAlphaWidget::render(), QHttp2Stream::sendDATA(), QQuick3DLoader::setActive(), QDeclarativeSearchResultModel::setFavoritesPlugin(), QQmlTableInstanceModelIncubationTask::setInitialState(), QAbstractItemView::setModel(), QQuickAnimatedImagePrivate::setMovie(), QBluetoothSocketPrivateAndroid::setSocketDescriptor(), QQuickPdfDocument::setSource(), QQmlConnections::setTarget(), WorkerThread::setupWorker(), QBluetoothSocketPrivateAndroid::socketConnectSuccess(), QWindowsCaRootFetcher::start(), QQuickDragAttachedPrivate::startDrag(), QSingleShotTimer::startTimerForReceiver(), QQDMIncubationTask::statusChanged(), QWasmAudioSink::stop(), QWasmAudioSource::stop(), QmlJSDebugger::ObjectCreator::tryCreateObject(), QQuickShapeCurveRenderer::updateNode(), QGeoTileFetcherNokia::versionFetched(), and QtPrivate::watchContinuationImpl().

+ Here is the call graph for this function:

◆ destroyed

void QObject::destroyed ( QObject * obj = nullptr)
signal

This signal is emitted immediately before the object obj is destroyed, after any instances of QPointer have been notified, and cannot be blocked.

All the objects's children are destroyed immediately after this signal is emitted.

See also
deleteLater(), QPointer

Referenced by GeoCodeReplyEsri::GeoCodeReplyEsri(), GeoRouteReplyEsri::GeoRouteReplyEsri(), GeoTiledMapReplyEsri::GeoTiledMapReplyEsri(), QtWayland::IviSurfaceIntegration::IviSurfaceIntegration(), PlaceSearchReplyEsri::PlaceSearchReplyEsri(), QGeoCodeReplyMapbox::QGeoCodeReplyMapbox(), QGeoCodeReplyNokia::QGeoCodeReplyNokia(), QGeoCodeReplyOsm::QGeoCodeReplyOsm(), QGeoMapReplyMapbox::QGeoMapReplyMapbox(), QGeoMapReplyNokia::QGeoMapReplyNokia(), QGeoMapReplyOsm::QGeoMapReplyOsm(), QGeoRouteReplyMapbox::QGeoRouteReplyMapbox(), QGeoRouteReplyNokia::QGeoRouteReplyNokia(), QGeoRouteReplyOsm::QGeoRouteReplyOsm(), QHostInfoLookupManager::QHostInfoLookupManager(), QOffscreenSurface::QOffscreenSurface(), QPlaceContentReplyImpl::QPlaceContentReplyImpl(), QPlaceDetailsReplyImpl::QPlaceDetailsReplyImpl(), QPlaceSearchReplyHere::QPlaceSearchReplyHere(), QPlaceSearchReplyMapbox::QPlaceSearchReplyMapbox(), QPlaceSearchReplyOsm::QPlaceSearchReplyOsm(), QPlaceSearchSuggestionReplyImpl::QPlaceSearchSuggestionReplyImpl(), QPlaceSearchSuggestionReplyMapbox::QPlaceSearchSuggestionReplyMapbox(), QQmlComponent::QQmlComponent(), QQuick3DSceneEnvironment::QQuick3DSceneEnvironment(), QQuick3DWindowAttachment::QQuick3DWindowAttachment(), QQuickContext2DRenderThread::QQuickContext2DRenderThread(), QQuickPixmapReader::QQuickPixmapReader(), QScrollerPrivate::QScrollerPrivate(), QTlsBackend::QTlsBackend(), QtWayland::QtShellIntegration::QtShellIntegration(), QtWayland::WlShellIntegration::WlShellIntegration(), QtWayland::XdgToplevelIntegration::XdgToplevelIntegration(), QGraphicsProxyWidget::~QGraphicsProxyWidget(), ~QObject(), QWidget::~QWidget(), QWidgetAction::~QWidgetAction(), QObjectCleanupHandler::add(), QDialogButtonBoxPrivate::addButton(), QV4DebuggerAgent::addDebugger(), QQuickItemPrivate::addPointerHandler(), QOpenGLShaderProgram::addShader(), QQuick3DParticleAffector::appendParticle(), QQuick3DObjectPrivate::attachWatcherPriv(), QQmlDebugServerImpl::cleanup(), QDialogButtonBox::clear(), QtFuture::connect(), QComboBoxPrivate::connectModel(), QDBusAbstractInterface::connectNotify(), QLowEnergyControllerPrivateWinRT::connectToDevice(), QRestAccessManagerPrivate::createActiveRequest(), QQuickDeliveryAgentPrivate::deviceExtra(), QAbstractItemViewPrivate::editor(), QQuickDeliveryAgentPrivate::ensureDeviceConnected(), QV4::MultiplyWrappedQObjectMap::erase(), QQmlApplicationEnginePrivate::finishLoad(), QQmlDebugTranslationServiceImpl::foundTranslationBinding(), QQmlDebugService::idForObject(), QWaylandOutput::initialize(), QSslServerPrivate::initializeHandshakeProcess(), QItemSelectionModelPrivate::initModel(), initProxy(), QToolBox::insertItem(), QQuickPixmap::loadImageFromDevice(), QNearFieldManagerPrivateImpl::onCardInserted(), TileProvider::onNetworkReplyFinished(), QNmeaSatelliteInfoSourcePrivate::openSourceDevice(), QTipLabel::placeTip(), QtGlobalStatic::ApplicationHolder< QAS >::pointer(), QNetworkReplyHttpImplPrivate::postRequest(), QQuick3DItem2D::preSync(), QQuickShaderEffectPrivate::propertyChanged(), qmltcCreateDynamicMetaObject(), QOpenXRActionMapper::registerAction(), QAbstractTextDocumentLayout::registerHandler(), QAbstractItemViewPrivate::releaseEditor(), QWidgetAction::releaseWidget(), QObjectCleanupHandler::remove(), QDialogButtonBoxPrivate::removeButton(), QV4DebuggerAgent::removeDebugger(), QAbstractItemViewPrivate::removeEditor(), QToolBox::removeItem(), QQuickItemPrivate::removePointerHandler(), QOpenGLShaderProgram::removeShader(), QQuick3DParticleAffector::replaceParticle(), QWidgetAction::requestWidget(), QTipLabel::reuseTip(), QHttp2Stream::sendDATA(), QOpenXRController::setActionMapper(), AVFCameraService::setAudioInput(), AVFCameraService::setAudioOutput(), QLabel::setBuddy(), QQuick3DRandomInstancing::setColor(), QQuickWindowContainer::setContainedWindow(), QOpenXRItemPrivate::setContentItem(), QQmlContext::setContextProperty(), QQuick3DRandomInstancing::setCustomData(), QSignalMapper::setMapping(), QSignalMapper::setMapping(), QSignalMapper::setMapping(), QAbstractItemView::setModel(), QDataWidgetMapper::setModel(), QWaylandSeat::setMouseFocus(), QMenuPrivate::setOverrideMenuAction(), QQuickComboBox::setPopup(), QQuick3DRandomInstancing::setPosition(), QQuick3DRandomInstancing::setRotation(), QQuick3DRandomInstancing::setScale(), QOffscreenSurface::setScreen(), QOpenGLContext::setScreen(), QQuickShaderEffectSource::setSourceItem(), QQuick3DTexture::setSourceItem(), QAbstractProxyModel::setSourceModel(), QCompletionModel::setSourceModel(), QUndoModel::setStack(), PresentationFeedback::setSurface(), QPropertyAnimation::setTargetObject(), QDesktopServices::setUrlHandler(), QSGRenderContext::textureForFactory(), QSslSocketPrivate::tlsBackendInUse(), QAbstractTextDocumentLayout::unregisterHandler(), QWaylandQuickItem::updatePaintNode(), QQuick3DItem2D::updateSpatialNode(), QQuick3DTexture::updateSpatialNode(), QtPrivate::watchContinuationImpl(), wrapInFunction(), QtWaylandClient::QWaylandTabletSeatV2::zwp_tablet_seat_v2_pad_added(), QtWaylandClient::QWaylandTabletSeatV2::zwp_tablet_seat_v2_tablet_added(), and QtWaylandClient::QWaylandTabletSeatV2::zwp_tablet_seat_v2_tool_added().

◆ disconnect() [1/7]

bool QObject::disconnect ( const char * signal = nullptr,
const QObject * receiver = nullptr,
const char * member = nullptr ) const
inline

Definition at line 288 of file qobject.h.

References disconnect(), and signal.

+ Here is the call graph for this function:

◆ disconnect() [2/7]

bool QObject::disconnect ( const QMetaObject::Connection & connection)
static

Disconnect a connection.

If the connection is invalid or has already been disconnected, do nothing and return false.

See also
connect()

Definition at line 5319 of file qobject.cpp.

References connection, d_ptr, and QObjectPrivate::removeConnection().

+ Here is the call graph for this function:

◆ disconnect() [3/7]

bool QObject::disconnect ( const QObject * receiver,
const char * member = nullptr ) const
inline

Definition at line 291 of file qobject.h.

References disconnect().

+ Here is the call graph for this function:

◆ disconnect() [4/7]

bool QObject::disconnect ( const QObject * sender,
const char * signal,
const QObject * receiver,
const char * method )
static

\threadsafe

Disconnects signal in object sender from method in object receiver. Returns true if the connection is successfully broken; otherwise returns false.

A signal-slot connection is removed when either of the objects involved are destroyed.

disconnect() is typically used in three ways, as the following examples demonstrate. \list 1

  • Disconnect everything connected to an object's signals:

equivalent to the non-static overloaded function

  • Disconnect everything connected to a specific signal:

equivalent to the non-static overloaded function

  • Disconnect a specific receiver:

equivalent to the non-static overloaded function

\endlist

\nullptr may be used as a wildcard, meaning "any signal", "any receiving object", or "any slot in the receiving object", respectively.

The sender may never be \nullptr. (You cannot disconnect signals from more than one object in a single call.)

If signal is \nullptr, it disconnects receiver and method from any signal. If not, only the specified signal is disconnected.

If receiver is \nullptr, it disconnects anything connected to signal. If not, slots in objects other than receiver are not disconnected.

If method is \nullptr, it disconnects anything that is connected to receiver. If not, only slots named method will be disconnected, and all other slots are left alone. The method must be \nullptr if receiver is left out, so you cannot disconnect a specifically-named slot on all objects.

disconnect-all

See also
connect()

Definition at line 3236 of file qobject.cpp.

References check_method_code(), check_signal_macro(), QByteArray::constData(), QMetaObjectPrivate::decodeMethodSignature(), QMetaObjectPrivate::disconnect(), QObjectPrivate::disconnectNotify(), err_info_about_objects(), err_method_notfound(), extract_code(), QMetaObjectPrivate::get(), QMetaObjectPrivate::indexOfMethod(), QMetaObjectPrivate::indexOfSignalRelative(), method, methodName(), QMetaObject::normalizedSignature(), QMetaObjectPrivate::originalClone(), Q_ASSERT, qCWarning, QT_CATCH, QT_RETHROW, QT_TRY, signal, and QMetaObjectPrivate::signalOffset().

Referenced by QAndroidMediaPlayer::~QAndroidMediaPlayer(), QFontComboBox::~QFontComboBox(), QGraphicsProxyWidget::~QGraphicsProxyWidget(), QHttpNetworkConnectionPrivate::~QHttpNetworkConnectionPrivate(), QmlLsp::QQmlCodeModel::~QQmlCodeModel(), QQuick3DParticleAffector::~QQuick3DParticleAffector(), QQuick3DParticleSpriteParticle::~QQuick3DParticleSpriteParticle(), QQuick3DParticleSystem::~QQuick3DParticleSystem(), QQuickDialog::~QQuickDialog(), QTextBrowserPrivate::~QTextBrowserPrivate(), QTextEditPrivate::~QTextEditPrivate(), QVideoWindowPrivate::~QVideoWindowPrivate(), QtWaylandClient::QWaylandGLContext::~QWaylandGLContext(), WaylandEglClientBuffer::~WaylandEglClientBuffer(), WaylandEglStreamClientBuffer::~WaylandEglStreamClientBuffer(), QNetworkReplyHttpImplPrivate::_q_bufferOutgoingDataFinished(), QNetworkReplyImplPrivate::_q_bufferOutgoingDataFinished(), QNetworkReplyWasmImplPrivate::_q_bufferOutgoingDataFinished(), QOpenGLDebugLoggerPrivate::_q_contextAboutToBeDestroyed(), QBluetoothServiceDiscoveryAgentPrivate::_q_deviceDiscoveryError(), QProgressDialogPrivate::_q_disconnectOnClose(), QQuick3DParticleAffector::appendParticle(), QQuick3DObjectPrivate::attachWatcherPriv(), LinuxDmabufWlBuffer::buffer_destroy(), QMessageBoxPrivate::buttonClicked(), QSslServerPrivate::checkClientHelloAndContinue(), QQuickContainerPrivate::cleanup(), QQuickScrollBarAttachedPrivate::cleanupHorizontal(), QQuickScrollBarAttachedPrivate::cleanupVertical(), QQuickLoaderPrivate::clear(), QPdfDocumentPrivate::clear(), QQuickPixmap::clear(), QListWidgetPrivate::clearConnections(), QTableViewPrivate::clearConnections(), QTableWidgetPrivate::clearConnections(), QTreeViewPrivate::clearConnections(), QTreeWidgetPrivate::clearConnections(), QLabelPrivate::clearContents(), QtFuture::connect(), QOpenGLVertexArrayObjectPrivate::destroy(), QQuickItemView::destroyRemoved(), QQuickTextAreaPrivate::detachFlickable(), QmlLsp::QQmlCodeModel::disableCMakeCalls(), MutableModelIterator::disconnect(), QDialogButtonBoxPrivate::disconnectAll(), QDataWidgetMapperPrivate::disconnectDelegate(), QQmlDelegateModelPrivate::disconnectFromAbstractItemModel(), QQuickTumblerPrivate::disconnectFromView(), QItemSelectionModelPrivate::disconnectModel(), QDataWidgetMapperPrivate::disconnectModel(), QHeaderViewPrivate::disconnectModel(), QComboBoxPrivate::disconnectModel(), QSslServerPrivate::SocketData::disconnectSignals(), QMdiAreaPrivate::disconnectSubWindow(), QAnimationGroupPrivate::disconnectUncontrolledAnimation(), QQuickWindowQmlImpl::event(), QNetworkReplyHttpImplPrivate::followRedirect(), LinuxDmabufWlBuffer::initTexture(), QNearFieldTargetPrivateImpl::invalidate(), QQuickTumblerView::itemChange(), TileProvider::onNetworkReplyFinished(), QNetworkReplyHttpImplPrivate::onRedirected(), QFFmpegImageCapture::onVideoSourceChanged(), QNetworkReplyHttpImplPrivate::postRequest(), QGuiApplicationPrivate::processFocusWindowEvent(), QQuickShaderEffectPrivate::propertyChanged(), QQnxMediaRecorder::record(), QAbstractItemViewPrivate::releaseEditor(), QActionGroup::removeAction(), QAbstractItemViewPrivate::removeEditor(), QWizardPrivate::removeFieldAt(), QQuick3DParticleAffector::removeLastParticle(), QQuickItemPrivate::removePointerHandler(), QtAndroidQuickViewEmbedding::removeRootObjectSignalListener(), QQuick3DParticleAffector::replaceParticle(), QAbstractSocketPrivate::resetSocketLayer(), QHttpProtocolHandler::sendRequest(), QOpenXRController::setActionMapper(), QWindowsMediaDeviceSession::setAudioInput(), AVFCameraService::setAudioInput(), QFFmpegMediaCaptureSession::setAudioInput(), QWindowsMediaDeviceSession::setAudioOutput(), AVFCameraService::setAudioOutput(), MFPlayerSession::setAudioOutput(), QAndroidMediaPlayer::setAudioOutput(), AVFMediaPlayer::setAudioOutput(), QFFmpegMediaCaptureSession::setAudioOutput(), QWasmMediaPlayer::setAudioOutput(), QDBusAbstractAdaptor::setAutoRelaySignals(), AVFCameraService::setCamera(), QGstreamerMediaCapture::setCamera(), AVFCamera::setCaptureSession(), QWindowsCamera::setCaptureSession(), AVFImageCapture::setCaptureSession(), QFFmpegImageCapture::setCaptureSession(), QQnxImageCapture::setCaptureSession(), QQuickColorDialogImplAttached::setColorInputs(), QQuickColorDialogImplAttached::setColorPicker(), QOpenXRItemPrivate::setContentItem(), QQmlDelegateModel::setDelegate(), QQuickTextDocumentPrivate::setDocument(), QQuick3DParticleModelBlendParticle::setEndNode(), QQuick3DModel::setGeometry(), QInputDialogPrivate::setInputWidget(), InstanceModel::setInstancing(), QQuick3DModel::setInstancing(), QmlJSDebugger::Highlight::setItem(), QQuickItemView::setKeyNavigationEnabled(), QDeclarativeGeoMapCopyrightNotice::setMapSource(), QQuickShaderEffectPrivate::setMesh(), QQmlTreeModelToTableModel::setModel(), QTreeView::setModel(), QQuickAnimatedImagePrivate::setMovie(), QMenuPrivate::setOverrideMenuAction(), QQuickMenuPrivate::setParentMenu(), QCompleter::setPopup(), QDeclarativeGeocodeModel::setQuery(), QDeclarativeGeoRouteModel::setQuery(), QDeclarativeGeoMapItemGroup::setQuickMap(), QTreeView::setSelectionModel(), QQuick3DJoint::setSkeletonRoot(), QTreeView::setSortingEnabled(), QIdentityProxyModel::setSourceModel(), QCompletionModel::setSourceModel(), QQuickMenuItemPrivate::setSubMenu(), QQmlConnections::setTarget(), QQmlBindEntry::setTarget(), QPropertyAnimation::setTargetObject(), QQuick3DTexture::setTextureData(), QToolBarLayout::setUsePopupMenu(), QGraphicsProxyWidgetPrivate::setWidget_helper(), QQuickOverlayAttachedPrivate::setWindow(), QQuickScreenInfo::setWrappedScreen(), QWindowsAudioSink::start(), QWindowsAudioSink::start(), QBluetoothServiceDiscoveryAgentPrivate::stopDeviceDiscovery(), QHttpThreadDelegate::synchronousAuthenticationRequiredSlot(), QHttpThreadDelegate::synchronousProxyAuthenticationRequiredSlot(), QQuick3DParticleSystem::unRegisterParticleAffector(), QQuickTabBarAttachedPrivate::update(), QSGRhiShaderEffectMaterial::updateTextureProviders(), vpe_clear(), QQuickWindowAttached::windowChange(), and QQuickApplicationWindowAttachedPrivate::windowChange().

+ Here is the call graph for this function:

◆ disconnect() [5/7]

bool QObject::disconnect ( const QObject * sender,
const QMetaMethod & signal,
const QObject * receiver,
const QMetaMethod & method )
static
Since
4.8

Disconnects signal in object sender from method in object receiver. Returns true if the connection is successfully broken; otherwise returns false.

This function provides the same possibilities like {disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method) } but uses QMetaMethod to represent the signal and the method to be disconnected.

Additionally this function returns false and no signals and slots disconnected if: \list 1

\li \a signal is not a member of sender class or one of its parent classes.

\li \a method is not a member of receiver class or one of its parent classes.

\li \a signal instance represents not a signal.

\endlist

QMetaMethod() may be used as wildcard in the meaning "any signal" or "any slot in receiving object". In the same way \nullptr can be used for receiver in the meaning "any receiving object". In this case method should also be QMetaMethod(). sender parameter should be never \nullptr.

disconnect-all

See also
disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)

Definition at line 3373 of file qobject.cpp.

References QMetaMethod::Constructor, QMetaObjectPrivate::disconnect(), QObjectPrivate::disconnectNotify(), QMetaObjectPrivate::memberIndexes(), method, qCWarning, QMetaMethod::Signal, and signal.

+ Here is the call graph for this function:

◆ disconnect() [6/7]

template<typename Func1 >
static bool QObject::disconnect ( const typename QtPrivate::FunctionPointer< Func1 >::Object * sender,
Func1 signal,
const QObject * receiver,
void ** zero )
inlinestatic

Definition at line 317 of file qobject.h.

References Q_ASSERT, signal, and zero.

◆ disconnect() [7/7]

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

Definition at line 300 of file qobject.h.

References signal.

◆ disconnectNotify()

void QObject::disconnectNotify ( const QMetaMethod & signal)
protectedvirtual
Since
5.0

This virtual function is called when something has been disconnected from signal in this object.

See connectNotify() for an example of how to compare signal with a specific signal.

If all signals were disconnected from this object (e.g., the signal argument to disconnect() was \nullptr), disconnectNotify() is only called once, and the signal will be an invalid QMetaMethod (QMetaMethod::isValid() returns false).

Warning
This function violates the object-oriented principle of modularity. However, it might be useful for optimizing access to expensive resources.
This function is called from the thread which performs the disconnection, which may be a different thread from the thread in which this object lives. This function may also be called with a QObject internal mutex locked. It is therefore not allowed to re-enter any QObject functions, including isSignalConnected(), from your reimplementation. If you lock a mutex in your reimplementation, make sure that you don't call QObject functions with that mutex held in other places or it will result in a deadlock.
See also
disconnect(), connectNotify()

Reimplemented in QBuffer, QDBusConnectionInterface, QFutureWatcherBase, QDBusAbstractInterface, QGeoAreaMonitorPolling, and QQuick3DNode.

Definition at line 3519 of file qobject.cpp.

References Q_UNUSED, and signal.

Referenced by ~QObject(), and QObjectPrivate::disconnectNotify().

+ Here is the caller graph for this function:

◆ dumpObjectInfo()

void QObject::dumpObjectInfo ( ) const

Dumps information about signal connections, etc.

for this object to the debug output.

Note
Before Qt 5.9, this function was not const.
See also
dumpObjectTree()

Definition at line 4404 of file qobject.cpp.

References QObjectPrivate::SignalVector::at(), className, QByteArray::constData(), QObjectPrivate::SignalVector::count(), d, QObjectPrivate::ConnectionList::first, QObjectData::metaObject, method, QMetaMethod::methodSignature(), QByteArrayLiteral, qDebug, qPrintable, QObjectPrivate::ConnectionData::senders, QMetaObjectPrivate::signal(), signal, signalSlotLock(), QObjectPrivate::ConnectionData::signalVector, and QObjectPrivate::ConnectionData::signalVectorCount().

+ Here is the call graph for this function:

◆ dumpObjectTree()

void QObject::dumpObjectTree ( ) const

Dumps a tree of children to the debug output.

Note
Before Qt 5.9, this function was not const.
See also
dumpObjectInfo()

Definition at line 4390 of file qobject.cpp.

References dumpRecursive().

+ Here is the call graph for this function:

◆ dynamicPropertyNames()

QList< QByteArray > QObject::dynamicPropertyNames ( ) const
Since
4.2

Returns the names of all properties that were dynamically added to the object using setProperty().

Definition at line 4352 of file qobject.cpp.

References d.

Referenced by QXcbWindow::create(), QWidgetPrivate::create(), QXcbWindow::setWindowFlags(), QQuick3DCustomMaterial::updateSpatialNode(), and QQuick3DEffect::updateSpatialNode().

+ Here is the caller graph for this function:

◆ event()

bool QObject::event ( QEvent * e)
virtual

This virtual function receives events to an object and should return true if the event e was recognized and processed.

The event() function can be reimplemented to customize the behavior of an object.

Make sure you call the parent event class implementation for all the events you did not handle.

Example:

class MyClass : public QWidget
{
public:
MyClass(QWidget *parent = nullptr);
bool event(QEvent* ev) override
{
if (ev->type() == QEvent::PolishRequest) {
// overwrite handling of PolishRequest if any
doThings();
return true;
} else if (ev->type() == QEvent::Show) {
// complement handling of Show if any
doThings2();
return true;
}
// Make sure the rest of events are handled
return QWidget::event(ev);
}
};
See also
installEventFilter(), timerEvent(), QCoreApplication::sendEvent(), QCoreApplication::postEvent()

Reimplemented in QCoreApplication, QSocketNotifier, QAction, QGuiApplication, QWindow, QNetworkReplyImpl, QReadNotifier, QWriteNotifier, QExceptionNotifier, QApplication, QWidgetAction, QWidgetWindow, QCompleter, QSystemTrayIconSys, QKeySequenceEdit, QLineEdit, QMenu, QMenuBar, QSizeGrip, QSplitter, QSplitterHandle, QStatusBar, QTabBar, QTabWidget, QQmlThreadPrivate, QQmlEngine, QQmlTimer, QQmlDelegateModel, QQmlListModelWorkerAgent, QQuickWorkerScriptEnginePrivate, QQuickWorkerScript, QQuickHoverHandler, QQuickPointerHandler, QQuickItem, QQuickItemGrabResult, QQuickPinchArea, QQuickRhiItem, QQuickTextEdit, QQuickWindow, QQuickWindowQmlImpl, QSGRenderThread, QSGThreadedRenderLoop, QQuickWidget, AVFDisplayLink, EVRCustomPresenter, QQuick3DViewport, src_gui_vulkan_qvulkaninstance2::VulkanWindow, QMacStyle, QPauseAnimation, QWindowsPipeReader, QWindowsPipeWriter, QEventDispatcherWin32, QShortcut, QOpenGLWidget, QXcbConnection, QMessageBox, QRhiWidget, QProxyStyle, QAbstractButton, QAbstractSlider, QCheckBox, QCommandLinkButton, QCalendarPopup, QDial, QFocusFrame, QFontComboBox, QFrame, QLabel, QLCDNumber, QProgressBar, QPushButton, QRadioButton, QRubberBand, QSplashScreen, QStackedWidget, QToolBarExtension, QToolBox, QToolButton, QWidgetTextControl, QQuickLabsPlatformMenuItem, QQuickContext2DTexture, QQuickShaderEffect, QQuickTextControl, QQuickTextInput, QSGSoftwareRenderThread, QSGSoftwareThreadedRenderLoop, ReaderThreadExecutionEnforcer, QQuickComboBox, QQuickDialogButtonBox, QVideoWindow, QOpenXRManager, MyClass, QGraphicsObject, QWindowContainer, QQuickDeliveryAgent, QAbstractAnimation, QAnimationGroup, QParallelAnimationGroup, QPropertyAnimation, QSequentialAnimationGroup, QVariantAnimation, MyWidget, QSettings, QEventLoop, QFutureWatcherBase, QThread, MyApplication, QFileInfoGatherer, QFileSystemModel, QPaintDeviceWindow, QFbScreen, QNetworkListManagerNetworkInformationBackend, QEglFSKmsEventHost, QVncClient, QWizard, Window, QGraphicsProxyWidget, QGraphicsScene, QGraphicsSceneBspTreeIndex, QGraphicsWidget, QWidget, QSystemTrayIcon, QAbstractSpinBox, QCalendarWidget, QComboBox, QDateTimeEdit, QDialogButtonBox, QDockWidgetTitleButton, QDockWidget, QGroupBox, QMainWindow, QMdi::ControlLabel, QMdi::ControllerWidget, QMdiSubWindow, QScrollBar, QSlider, QSpinBox, QToolBar, QQuickCanvasItem, QQuickDragAttached, QQuickPixmapReply, QQuickShortcut, QQuickFolderBreadcrumbBar, QQuickStyleItem, QQuickAbstractButton, QQuickAction, QQuickMenuBarItem, QVideoWidget, QGstVideoRenderer, QWaylandOutput, and QWaylandCompositorExtension.

Definition at line 1389 of file qobject.cpp.

References QEvent::ChildAdded, QEvent::ChildPolished, QEvent::ChildRemoved, QObjectPrivate::connections, d, QEvent::DeferredDelete, QMetaObject::invokeMethod(), QBasicAtomicPointer< X >::loadRelaxed(), QEvent::MetaCall, Q_ASSERT_X, Q_FUNC_INFO, qCDebug, Qt::QueuedConnection, QAbstractEventDispatcher::registerTimer(), signalSlotLock(), QEvent::ThreadChange, QObjectPrivate::threadData, QEvent::Timer, QAbstractEventDispatcher::timersForObject(), QEvent::type(), QAbstractEventDispatcher::unregisterTimers(), and QEvent::User.

Referenced by QThreadData::~QThreadData(), QCoreApplication::compressEvent(), QApplication::compressEvent(), QCoreApplication::event(), QSocketNotifier::event(), QAction::event(), QWindow::event(), QNetworkReplyImpl::event(), QCompleter::event(), QQmlEngine::event(), QQmlTimer::event(), QQmlDelegateModel::event(), QQmlListModelWorkerAgent::event(), QQuickWorkerScriptEnginePrivate::event(), QQuickWorkerScript::event(), QQuickHoverHandler::event(), QQuickPointerHandler::event(), QQuickItem::event(), QQuickItemGrabResult::event(), QQuickTextEdit::event(), QSGThreadedRenderLoop::event(), AVFDisplayLink::event(), EVRCustomPresenter::event(), QWindowsPipeReader::event(), QWindowsPipeWriter::event(), QEventDispatcherWin32::event(), QShortcut::event(), QXcbConnection::event(), QMessageBox::event(), QProxyStyle::event(), QWidgetTextControl::event(), QQuickLabsPlatformMenuItem::event(), QQuickContext2DTexture::event(), QQuickTextControl::event(), QQuickTextInput::event(), QSGSoftwareThreadedRenderLoop::event(), ReaderThreadExecutionEnforcer::event(), QQuickComboBox::event(), QQuickDialogButtonBox::event(), QOpenXRManager::event(), QGraphicsObject::event(), QAbstractAnimation::event(), QSettings::event(), QEventLoop::event(), QFutureWatcherBase::event(), QThread::event(), QFileSystemModel::event(), QFbScreen::event(), QNetworkListManagerNetworkInformationBackend::event(), QEglFSKmsEventHost::event(), QVncClient::event(), QWizard::event(), QGraphicsScene::event(), QGraphicsSceneBspTreeIndex::event(), QGraphicsWidget::event(), QWidget::event(), QSystemTrayIcon::event(), QQuickDragAttached::event(), QQuickPixmapReply::event(), QQuickAbstractButton::event(), QQuickAction::event(), QQuickMenuBarItem::event(), QGstVideoRenderer::event(), QWaylandOutput::event(), QWaylandCompositorExtension::event(), QCoreApplicationPrivate::notify_helper(), QApplicationPrivate::notify_helper(), and QCoreApplication::removePostedEvents().

+ Here is the call graph for this function:

◆ eventFilter()

bool QObject::eventFilter ( QObject * watched,
QEvent * event )
virtual

Filters events if this object has been installed as an event filter for the watched object.

In your reimplementation of this function, if you want to filter the event out, i.e. stop it being handled further, return true; otherwise return false.

Example:

class MainWindow : public QMainWindow
{
public:
protected:
bool eventFilter(QObject *obj, QEvent *ev) override;
private:
QTextEdit *textEdit;
};
{
textEdit = new QTextEdit;
setCentralWidget(textEdit);
textEdit->installEventFilter(this);
}
{
if (obj == textEdit) {
if (event->type() == QEvent::KeyPress) {
QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
qDebug() << "Ate key press" << keyEvent->key();
return true;
} else {
return false;
}
} else {
// pass the event on to the parent class
}
}

Notice in the example above that unhandled events are passed to the base class's eventFilter() function, since the base class might have reimplemented eventFilter() for its own internal purposes.

Some events, such as \l QEvent::ShortcutOverride must be explicitly accepted (by calling \l {QEvent::}{accept()} on them) in order to prevent propagation.

Warning
If you delete the receiver object in this function, be sure to return true. Otherwise, Qt will forward the event to the deleted object and the program might crash.
See also
installEventFilter()

Reimplemented in QDialog, QTipLabel, QWhatsThisPrivate, QWidgetAction, QAlphaWidget, QFocusFrame, QMenuBar, QSizeGrip, QmlJSDebugger::QQuickWindowInspector, QWaylandQuickShellEventFilter, QWindowContainer, QtPrivate::QColorPickingEventFilter, QBasicDrag, QXcbDrag, QCompleter, QtPrivate::QCalendarTextNavigator, QComboBoxPrivateContainer, QWidgetResizeHandler, MainWindow, QBackingStoreRhiSupportWindowWatcher, KeyPressEater, QSpiApplicationAdaptor, QIOSMenu, QQmlPreviewHandler, QQuickTableView, QQuickEyeDropperEventFilter, QSvgWidgetListener, FilterObject, QFontDialog, QGraphicsProxyWidget, QItemDelegate, QStyledItemDelegate, QMdiSubWindow, QQuickWindowContainer, QQuickAction, QQuickComboBox, QQuickMenuBar, QQuickOverlay, QQuickScrollView, QtWayland::WlShellIntegration, QtWayland::XdgToplevelIntegration, QCALayerBackingStore, QGraphicsScene, QPixmapStyle, QCalendarWidget, QSGGuiThreadRenderLoop, and QSGThreadedRenderLoop.

Definition at line 1555 of file qobject.cpp.

Referenced by QDialogPrivate::close(), QDialog::eventFilter(), QWidgetAction::eventFilter(), QAlphaWidget::eventFilter(), QSizeGrip::eventFilter(), QmlJSDebugger::QQuickWindowInspector::eventFilter(), QCompleter::eventFilter(), QtPrivate::QCalendarTextNavigator::eventFilter(), QComboBoxPrivateContainer::eventFilter(), MainWindow::eventFilter(), KeyPressEater::eventFilter(), QIOSMenu::eventFilter(), QQmlPreviewHandler::eventFilter(), QQuickTableView::eventFilter(), QQuickEyeDropperEventFilter::eventFilter(), QSvgWidgetListener::eventFilter(), QGraphicsProxyWidget::eventFilter(), QMdiSubWindow::eventFilter(), QQuickWindowContainer::eventFilter(), QQuickComboBox::eventFilter(), QQuickMenuBar::eventFilter(), QQuickScrollView::eventFilter(), QtWayland::WlShellIntegration::eventFilter(), QtWayland::XdgToplevelIntegration::eventFilter(), QPixmapStyle::eventFilter(), QCalendarWidget::eventFilter(), QSGGuiThreadRenderLoop::eventFilter(), QSGThreadedRenderLoop::eventFilter(), and QMenuPrivate::hideMenu().

+ Here is the caller graph for this function:

◆ findChild() [1/2]

template<typename T >
template< typename T > T * QObject::findChild ( QAnyStringView name,
Qt::FindChildOptions options = Qt::FindChildrenRecursively ) const
inline

Returns the child of this object that can be cast into type T and that is called name, or \nullptr if there is no such object.

A null name argument causes all objects to be matched. An empty, non-null name matches only objects whose \l objectName is empty. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

If there is more than one child matching the search, the most-direct ancestor is returned. If there are several most-direct ancestors, the first child in children() will be returned. In that case, it's better to use findChildren() to get the complete list of all children.

This example returns a child {QPushButton} of {parentWidget} named {"button1"}, even if the button isn't a direct child of the parent:

This example returns a {QListWidget} child of {parentWidget}:

This example returns a child {QPushButton} of {parentWidget} (its direct parent) named {"button1"}:

This example returns a {QListWidget} child of {parentWidget}, its direct parent:

Note
In Qt versions prior to 6.7, this function took name as {QString}, not {QAnyStringView}.
See also
findChildren()

Definition at line 155 of file qobject.h.

References qt_qFindChild_helper().

Referenced by QSGBatchRenderer::Renderer::Renderer(), QtAndroidQuickViewEmbedding::addRootObjectSignalListener(), QQuick3DLightmapBaker::bake(), QWindows11Style::drawPrimitive(), QWindowsVistaStyle::drawPrimitive(), QQuickComboBoxPrivate::itemHovered(), main(), QQuickDialogTestUtils::DialogTestHelper< DialogType, QuickDialogType >::openDialog(), QWindowsVistaStyle::polish(), QQuickComboBoxPrivate::popupVisibleChanged(), QtAndroidQuickViewEmbedding::removeRootObjectSignalListener(), QQuickComboBox::setPopup(), QMdiSubWindow::setWidget(), showNewMessageBox(), QQC2::QWindowsStyle::styleHint(), QMacStyle::unpolish(), and QWindowsVistaStyle::unpolish().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findChild() [2/2]

template<typename T >
template< typename T > T * QObject::findChild ( Qt::FindChildOptions options = Qt::FindChildrenRecursively) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Since
6.7

Returns the child of this object that can be cast into type T, or \nullptr if there is no such object. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

If there is more than one child matching the search, the most-direct ancestor is returned. If there are several most-direct ancestors, the first child in children() will be returned. In that case, it's better to use findChildren() to get the complete list of all children.

See also
findChildren()

Definition at line 176 of file qobject.h.

◆ findChildren() [1/2]

template<typename T >
template< typename T > QList< T > QObject::findChildren ( QAnyStringView name,
Qt::FindChildOptions options = Qt::FindChildrenRecursively ) const
inline

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects.

A null name argument causes all objects to be matched, an empty one only those whose objectName is empty. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

The following example shows how to find a list of child {QWidget}s of the specified {parentWidget} named {widgetname}:

This example returns all {QPushButton}s that are children of {parentWidget}:

This example returns all {QPushButton}s that are immediate children of {parentWidget}:

Note
In Qt versions prior to 6.7, this function took name as {QString}, not {QAnyStringView}.
See also
findChild()

Definition at line 164 of file qobject.h.

References list, and qt_qFindChildren_helper().

Referenced by QMainWindowLayout::applyState(), QDialogButtonBoxPrivate::ensureFirstAcceptIsDefault(), QQuickVisualTestUtils::findVisibleChild(), QAbstractButtonPrivate::queryButtonList(), QDockAreaLayout::removePlaceHolder(), QDockAreaLayout::restoreDockWidget(), and QMainWindowLayoutState::saveState().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findChildren() [2/2]

template<typename T >
template< typename T > QList< T > QObject::findChildren ( Qt::FindChildOptions options = Qt::FindChildrenRecursively) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Since
6.3

Returns all children of this object that can be cast to type T, or an empty list if there are no such objects. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

See also
findChild()

Definition at line 182 of file qobject.h.

◆ inherits()

bool QObject::inherits ( const char * className) const
inline

Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false.

A class is considered to inherit itself.

Example:

QTimer *timer = new QTimer; // QTimer inherits QObject
timer->inherits("QTimer"); // returns true
timer->inherits("QObject"); // returns true
timer->inherits("QAbstractButton"); // returns false
// QVBoxLayout inherits QObject and QLayoutItem
layout->inherits("QObject"); // returns true
layout->inherits("QLayoutItem"); // returns true (even though QLayoutItem is not a QObject)

If you need to determine whether an object is an instance of a particular class for the purpose of casting it, consider using qobject_cast<Type *>(object) instead.

See also
metaObject(), qobject_cast()

Definition at line 348 of file qobject.h.

Referenced by QGstPipelinePrivate::QGstPipelinePrivate(), QSyntaxHighlighter::QSyntaxHighlighter(), QQuickTumblerPrivate::determineViewType(), QWindows11Style::drawPrimitive(), QWindowsVistaStyle::drawPrimitive(), QApplicationPrivate::handlePaletteChanged(), QAbstractItemDelegate::helpEvent(), QWindowsVistaStylePrivate::isItemViewDelegateLineEdit(), isMacStyle(), QApplicationPrivate::notifyActiveWindowChange(), QQuickPointerHandler::parentContains(), QWindows11Style::polish(), QWindowsVistaStyle::polish(), QWidget::setAttribute(), QQuickItem::setClip(), QIOSWindow::setGeometry(), QGraphicsView::setupViewport(), and QWindows11Style::subElementRect().

+ Here is the caller graph for this function:

◆ installEventFilter()

void QObject::installEventFilter ( QObject * filterObj)

Installs an event filter filterObj on this object.

For example:

An event filter is an object that receives all events that are sent to this object. The filter can either stop the event or forward it to this object. The event filter filterObj receives events via its eventFilter() function. The eventFilter() function must return true if the event should be filtered, (i.e. stopped); otherwise it must return false.

If multiple event filters are installed on a single object, the filter that was installed last is activated first.

If filterObj has already been installed for this object, this function moves it so it acts as if it was installed last.

Here's a KeyPressEater class that eats the key presses of its monitored objects:

class KeyPressEater : public QObject
{
...
protected:
bool eventFilter(QObject *obj, QEvent *event) override;
};
{
if (event->type() == QEvent::KeyPress) {
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
qDebug("Ate key press %d", keyEvent->key());
return true;
} else {
// standard event processing
}
}

And here's how to install it on two widgets:

The QShortcut class, for example, uses this technique to intercept shortcut key presses.

Warning
If you delete the receiver object in your eventFilter() function, be sure to return true. If you return false, Qt sends the event to the deleted object and the program will crash.

Note that the filtering object must be in the same thread as this object. If filterObj is in a different thread, this function does nothing. If either filterObj or this object are moved to a different thread after calling this function, the event filter will not be called until both objects have the same thread affinity again (it is not removed).

See also
removeEventFilter(), eventFilter(), event()

Definition at line 2339 of file qobject.cpp.

References d, and qWarning.

Referenced by QCALayerBackingStore::QCALayerBackingStore(), QQuickOverlay::QQuickOverlay(), QmlJSDebugger::QQuickWindowInspector::QQuickWindowInspector(), QWidgetResizeHandler::QWidgetResizeHandler(), QDialogButtonBoxPrivate::addButton(), QDataWidgetMapper::addMapping(), QDataWidgetMapper::addMapping(), QQuickColorDialogImplPrivate::eyeDropperEnter(), QMenuBarPrivate::handleReparent(), QFontDialogPrivate::init(), QKeySequenceEditPrivate::init(), QWindowContainer::parentWasChanged(), QPixmapStyle::polish(), QEvdevTouchScreenHandlerThread::scheduleTouchPointUpdate(), QQuickScrollViewPrivate::setFlickable(), QAbstractItemView::setIndexWidget(), QWaylandQuickShellSurfaceItem::setShellSurface(), QCompleter::setWidget(), QFocusFrame::setWidget(), QMdiSubWindow::setWidget(), QScrollArea::setWidget(), and QSizeGripPrivate::updateTopLevelWidget().

+ Here is the caller graph for this function:

◆ isQuickItemType()

bool QObject::isQuickItemType ( ) const
inline

Returns true if the object is a QQuickItem; otherwise returns false.

Calling this function is equivalent to calling {inherits("QQuickItem")}, except that it is much faster.

Since
6.4

Definition at line 133 of file qobject.h.

◆ isSignalConnected()

bool QObject::isSignalConnected ( const QMetaMethod & signal) const
protected
Since
5.0 Returns true if the signal is connected to at least one receiver, otherwise returns false.

signal must be a signal member of this object, otherwise the behaviour is undefined.

static const QMetaMethod valueChangedSignal = QMetaMethod::fromSignal(&MyObject::valueChanged);
if (isSignalConnected(valueChangedSignal)) {
data = get_the_value(); // expensive operation
emit valueChanged(data);
}

As the code snippet above illustrates, you can use this function to avoid expensive initialization or emitting a signal that nobody listens to. However, in a multithreaded application, connections might change after this function returns and before the signal gets emitted.

Warning
This function violates the object-oriented principle of modularity. In particular, this function must not be called from an override of connectNotify() or disconnectNotify(), as those might get called from any thread.

Definition at line 2801 of file qobject.cpp.

References d, MethodCloned, QMetaObjectPrivate::originalClone(), Q_ASSERT_X, QMetaMethod::Signal, signal, signalIndex, QMetaObjectPrivate::signalOffset(), and signalSlotLock().

+ Here is the call graph for this function:

◆ isWidgetType()

bool QObject::isWidgetType ( ) const
inline

Returns true if the object is a widget; otherwise returns false.

Calling this function is equivalent to calling {inherits("QWidget")}, except that it is much faster.

Definition at line 131 of file qobject.h.

Referenced by QLayout::~QLayout(), doNotify(), QApplication::notify(), QApplicationPrivate::notify_helper(), QLayout::parentWidget(), q_createNativeChildrenAndSetParent(), qSmartSpacing(), sendResizeEvents(), QWidgetPrivate::setWidgetParentHelper(), and QLayout::update().

+ Here is the caller graph for this function:

◆ isWindowType()

bool QObject::isWindowType ( ) const
inline

Returns true if the object is a window; otherwise returns false.

Calling this function is equivalent to calling {inherits("QWindow")}, except that it is much faster.

Definition at line 132 of file qobject.h.

Referenced by QApplication::notify().

+ Here is the caller graph for this function:

◆ killTimer() [1/2]

void QObject::killTimer ( int id)

Kills the timer with timer identifier, id.

The timer identifier is returned by startTimer() when a timer event is started.

See also
timerEvent(), startTimer()

Definition at line 1912 of file qobject.cpp.

Referenced by QNmeaSimulatedReader::~QNmeaSimulatedReader(), QSingleShotTimer::~QSingleShotTimer(), QXcbClipboardTransaction::~QXcbClipboardTransaction(), QPMCache::clear(), QQuickMaterialRipple::enterWave(), QTabBar::event(), QScrollBar::event(), QTestEventLoop::exitLoop(), QQuickMaterialRipple::exitWave(), PressDelayHandler::released(), QWidgetLineControl::resetCursorBlinkTimer(), QMdiSubWindow::resizeEvent(), QSocks5BindStore::retrieve(), PressDelayHandler::scrollerBecameActive(), PressDelayHandler::scrollerWasIntercepted(), QTimer::setInterval(), QChronoTimer::setInterval(), QTimeLine::setPaused(), QChronoTimer::stop(), QTimer::stop(), QTimeLine::stop(), QQuickIOSCursorFlashTimer::stop(), QSingleShotTimer::timerEvent(), QPMCache::timerEvent(), QQuickWindowIncubationController::timerEvent(), QQuickPixmapCache::timerEvent(), QCocoaMenu::timerEvent(), QXcbDrag::timerEvent(), PressDelayHandler::timerEvent(), QBalloonTip::timerEvent(), QFontCache::timerEvent(), QQnxScreenEventHandler::timerEvent(), QAbstractSpinBox::timerEvent(), QTabBar::timerEvent(), QWidgetLineControl::timerEvent(), QQmlSettings::timerEvent(), QQuickMonthGrid::timerEvent(), QNmeaSimulatedReader::timerEvent(), QPdfSearchModel::timerEvent(), QMdiSubWindow::timerEvent(), QWidgetLineControl::updateCursorBlinking(), and QXcbClipboardTransaction::updateIncrementalProperty().

+ Here is the caller graph for this function:

◆ killTimer() [2/2]

void QObject::killTimer ( Qt::TimerId id)
Since
6.8 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1921 of file qobject.cpp.

References at, className, QThread::currentThread(), d, Qt::Invalid, QObjectData::metaObject, Q_UNLIKELY, qToUnderlying(), qUtf16Printable, qWarning, and QAbstractEventDispatcherPrivate::releaseTimerId().

+ Here is the call graph for this function:

◆ moveToThread()

bool QObject::moveToThread ( QThread *thread QT6_DECL_NEW_OVERLOAD_TAIL)

Changes the thread affinity for this object and its children and returns true on success.

The object cannot be moved if it has a parent. Event processing will continue in the targetThread.

To move an object to the main thread, use QApplication::instance() to retrieve a pointer to the current application, and then use QApplication::thread() to retrieve the thread in which the application lives. For example:

If targetThread is \nullptr, all event processing for this object and its children stops, as they are no longer associated with any thread.

Note that all active timers for the object will be reset. The timers are first stopped in the current thread and restarted (with the same interval) in the targetThread. As a result, constantly moving an object between threads can postpone timer events indefinitely.

A QEvent::ThreadChange event is sent to this object just before the thread affinity is changed. You can handle this event to perform any special processing. Note that any new events that are posted to this object will be handled in the targetThread, provided it is not \nullptr: when it is \nullptr, no event processing for this object or its children can happen, as they are no longer associated with any thread.

Warning
This function is not thread-safe; the current thread must be same as the current thread affinity. In other words, this function can only "push" an object from the current thread to another thread, it cannot "pull" an object from any arbitrary thread to the current thread. There is one exception to this rule however: objects with no thread affinity can be "pulled" to the current thread.
See also
thread()

Definition at line 1643 of file qobject.cpp.

References bindingStatus, QThreadData::current(), d, QThreadData::deref(), QObjectPrivate::get(), QThreadData::get2(), QBasicAtomicPointer< X >::loadRelaxed(), QPostEventList::mutex, QThreadData::postEventList, qWarning, QThreadData::ref(), signalSlotLock(), QThreadData::thread, and QOrderedMutexLocker::unlock().

Referenced by Controller::Controller(), MFStream::MFStream(), QFactoryLoader::QFactoryLoader(), QFFmpegAudioInput::QFFmpegAudioInput(), QHostInfoResult::QHostInfoResult(), QQmlPreviewFileLoader::QQmlPreviewFileLoader(), QQuickContext2DRenderThread::QQuickContext2DRenderThread(), QQuickWorkerScriptEngine::QQuickWorkerScriptEngine(), QWindowsCaRootFetcher::QWindowsCaRootFetcher(), QLowEnergyControllerPrivateWinRT::connectToDevice(), QEglFSKmsEventReader::create(), QV4DebugServiceImpl::engineAdded(), QQuickContext2D::init(), QSqlDatabase::moveToThread(), QNetworkReplyHttpImplPrivate::postRequest(), QSampleCache::requestSample(), QEglFSKmsEventReaderThread::run(), QSGSoftwareRenderThread::run(), QSGRenderThread::run(), QThread::setEventDispatcher(), QPdfPageRenderer::setRenderMode(), WorkerThread::setupWorker(), QQmlData::signalEmitted(), AndroidTextureThread::start(), QAndroidAudioDecoder::start(), QSingleShotTimer::startTimerForReceiver(), and QQmlThread::startup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ objectName()

QString QObject::objectName ( ) const

Definition at line 1275 of file qobject.cpp.

References QThread::currentThreadId(), d, QObjectPrivate::extraData, and QtPrivate::isAnyBindingEvaluating().

+ Here is the call graph for this function:

◆ objectNameChanged

void QObject::objectNameChanged ( const QString & objectName,
QPrivateSignal  )
signal

This signal is emitted after the object's name has been changed.

The new object name is passed as objectName.

See also
QObject::objectName

Referenced by QThreadPool::QThreadPool(), and QWidgetWindow::QWidgetWindow().

+ Here is the caller graph for this function:

◆ parent()

QObject * QObject::parent ( ) const
inline

Returns a pointer to the parent object.

See also
children()

Definition at line 346 of file qobject.h.

References parent().

Referenced by LocalSocketSignalTranslator::LocalSocketSignalTranslator(), PlaceSearchReplyEsri::PlaceSearchReplyEsri(), QAbstractAnimation::QAbstractAnimation(), QAbstractAnimation::QAbstractAnimation(), QAbstractItemModelTester::QAbstractItemModelTester(), QAbstractSocket::QAbstractSocket(), QAction::QAction(), QAudioSink::QAudioSink(), QAudioSource::QAudioSource(), QtPrivate::QColorShower::QColorShower(), QComboBoxPrivateContainer::QComboBoxPrivateContainer(), QErrorMessage::QErrorMessage(), QExceptionNotifier::QExceptionNotifier(), QGeoCodeReplyMapbox::QGeoCodeReplyMapbox(), QGeoTileFetcher::QGeoTileFetcher(), QGeoTileFetcher::QGeoTileFetcher(), QIODevice::QIODevice(), QIOPipe::QIOPipe(), QObject(), QPlaceSearchReplyMapbox::QPlaceSearchReplyMapbox(), QPlaceSearchReplyOsm::QPlaceSearchReplyOsm(), QPlaceSearchSuggestionReplyMapbox::QPlaceSearchSuggestionReplyMapbox(), QQmlDelegateModelAttached::QQmlDelegateModelAttached(), QQmlDelegateModelAttached::QQmlDelegateModelAttached(), QQnxPlatformCamera::QQnxPlatformCamera(), QQuick3DParticleEmitBurst::QQuick3DParticleEmitBurst(), QQuickApplicationWindowAttached::QQuickApplicationWindowAttached(), QQuickAttachedPropertyPropagator::QQuickAttachedPropertyPropagator(), QQuickColorDialogImplAttached::QQuickColorDialogImplAttached(), QQuickDialogButtonBoxAttached::QQuickDialogButtonBoxAttached(), QQuickDragAttached::QQuickDragAttached(), QQuickEnterKeyAttached::QQuickEnterKeyAttached(), QQuickFileDialogImplAttached::QQuickFileDialogImplAttached(), QQuickFolderDialogImplAttached::QQuickFolderDialogImplAttached(), QQuickFontDialogImplAttached::QQuickFontDialogImplAttached(), QQuickKeysAttached::QQuickKeysAttached(), QQuickLayoutMirroringAttached::QQuickLayoutMirroringAttached(), QQuickMessageDialogImplAttached::QQuickMessageDialogImplAttached(), QQuickOverlayAttached::QQuickOverlayAttached(), QQuickPackageAttached::QQuickPackageAttached(), QQuickPositionerAttached::QQuickPositionerAttached(), QQuickScrollBarAttached::QQuickScrollBarAttached(), QQuickScrollIndicatorAttached::QQuickScrollIndicatorAttached(), QQuickSplitViewAttached::QQuickSplitViewAttached(), QQuickStackViewAttached::QQuickStackViewAttached(), QQuickSwipeViewAttached::QQuickSwipeViewAttached(), QQuickTextSelection::QQuickTextSelection(), QQuickTumblerAttached::QQuickTumblerAttached(), QReadNotifier::QReadNotifier(), QSGOpenVGContext::QSGOpenVGContext(), QShortcut::QShortcut(), QShortcut::QShortcut(), QShortcut::QShortcut(), QSyntaxHighlighter::QSyntaxHighlighter(), QSyntaxHighlighter::QSyntaxHighlighter(), QTcpServer::QTcpServer(), QTcpServer::QTcpServer(), QToolBarLayout::QToolBarLayout(), QWhatsThat::QWhatsThat(), QWidget::QWidget(), QWidget::QWidget(), QWidgetPlatformColorDialog::QWidgetPlatformColorDialog(), QWidgetPlatformFileDialog::QWidgetPlatformFileDialog(), QWidgetPlatformFontDialog::QWidgetPlatformFontDialog(), QWidgetPlatformMenu::QWidgetPlatformMenu(), QWidgetPlatformMenuItem::QWidgetPlatformMenuItem(), QWidgetPlatformMessageDialog::QWidgetPlatformMessageDialog(), QWidgetPlatformSystemTrayIcon::QWidgetPlatformSystemTrayIcon(), QWindow::QWindow(), QWindowsFileSystemWatcherEngine::QWindowsFileSystemWatcherEngine(), QWriteNotifier::QWriteNotifier(), QMenuPrivate::ScrollerTearOffItem::ScrollerTearOffItem(), QLayout::~QLayout(), QMenuPrivate::~QMenuPrivate(), QQuickAttachedPropertyPropagator::~QQuickAttachedPropertyPropagator(), QQuickIndicatorButton::~QQuickIndicatorButton(), QQuickPackageAttached::~QQuickPackageAttached(), QQuickStackViewAttached::~QQuickStackViewAttached(), QMenuPrivate::_q_platformMenuAboutToShow(), QSortFilterProxyModelPrivate::_q_sourceRowsAboutToBeInserted(), QMessageBox::about(), QMessageBox::aboutQt(), QLayout::activate(), QPollingFileSystemWatcherEngine::addPaths(), QLowEnergyController::addService(), QLayout::adoptLayout(), QLayout::alignmentRect(), QMainWindowLayout::applyState(), QGeoPositionInfoSourceFactoryAndroid::areaMonitor(), QGeoPositionInfoSourceFactoryCL::areaMonitor(), QGeoPositionInfoSourceFactoryGeoclue2::areaMonitor(), QGeoPositionInfoSourceFactoryGypsy::areaMonitor(), QGeoPositionInfoSourceFactoryNmea::areaMonitor(), QGeoPositionInfoSourceFactoryPoll::areaMonitor(), QGeoPositionInfoSourceFactoryWinRT::areaMonitor(), QPlatformMediaDevices::audioInputDevice(), QPlatformMediaDevices::audioOutputDevice(), QStyleHelper::backgroundColor(), QPlainTextEditControl::canInsertFromMimeData(), QTextEditControl::canInsertFromMimeData(), QRubberBand::changeEvent(), QMdiSubWindow::changeEvent(), OrgBluezGattDescriptor1Adaptor::characteristic(), QNativeSocketEnginePrivate::checkProxy(), QToolBarLayout::checkUsePopupMenu(), childWindowAt(), QWaylandQuickHardwareLayer::classBegin(), QMenu::clear(), QTextDocument::clone(), QItemSelectionModel::columnIntersectsSelection(), QQuickParticleGroup::componentComplete(), QQuick3DInfiniteGrid::componentComplete(), QQuick3DParticleEmitBurst::componentComplete(), QQuick3DParticleSpriteSequence::componentComplete(), QOpenXrInputAction::componentComplete(), QWaylandQuickOutput::componentComplete(), QWaylandQuickXdgOutputV1::componentComplete(), QGStreamerAudioSink::create(), QGstreamerAudioDecoder::create(), QDeviceDiscovery::create(), QGstreamerMediaPlayer::create(), QFseventsFileSystemWatcherEngine::create(), QInotifyFileSystemWatcherEngine::create(), QKqueueFileSystemWatcherEngine::create(), QWidget::create(), QSGContext::createAnimationDriver(), QAlsaMediaDevices::createAudioSink(), QAndroidMediaDevices::createAudioSink(), QPulseAudioMediaDevices::createAudioSink(), QQnxMediaDevices::createAudioSink(), QWasmMediaDevices::createAudioSink(), QWindowsMediaDevices::createAudioSink(), QDarwinMediaDevices::createAudioSink(), QAlsaMediaDevices::createAudioSource(), QAndroidMediaDevices::createAudioSource(), QPulseAudioMediaDevices::createAudioSource(), QQnxMediaDevices::createAudioSource(), QWasmMediaDevices::createAudioSource(), QWindowsMediaDevices::createAudioSource(), QDarwinMediaDevices::createAudioSource(), QQnxMediaIntegration::createCamera(), QLowEnergyController::createCentral(), QLowEnergyController::createCentral(), QtObject::createComponent(), QtObject::createComponent(), QtObject::createComponent(), QtObject::createComponent(), QQuickTextUtil::createCursor(), QGeoPositionInfoSource::createDefaultSource(), QGeoSatelliteInfoSource::createDefaultSource(), QGeoAreaMonitorSource::createDefaultSource(), QGeoPositionInfoSource::createDefaultSource(), QGeoSatelliteInfoSource::createDefaultSource(), SpinBoxDelegate::createEditor(), QItemDelegate::createEditor(), QStyledItemDelegate::createEditor(), QQnxMediaIntegration::createImageCapture(), QGraphicsScene::createItemGroup(), QGeoMappingManager::createMap(), QPlainTextEditControl::createMimeDataFromSelection(), QTextEditControl::createMimeDataFromSelection(), QQmlComponent::createObject(), QLowEnergyController::createPeripheral(), QLowEnergyController::createPeripheral(), QQnxMediaIntegration::createPlayer(), QWindowsMediaIntegration::createPlayer(), QtObject::createQmlObject(), QQnxMediaIntegration::createRecorder(), QUndoGroup::createRedoAction(), QLowEnergyController::createServiceObject(), QtWaylandClient::QWaylandIviShellIntegration::createShellSurface(), QAbstractSocketEngine::createSocketEngine(), QAbstractSocketEngine::createSocketEngine(), QGeoPositionInfoSource::createSource(), QGeoSatelliteInfoSource::createSource(), QGeoAreaMonitorSource::createSource(), QGeoPositionInfoSource::createSource(), QGeoSatelliteInfoSource::createSource(), QWidgetTextControl::createStandardContextMenu(), QtWaylandClient::QWaylandDisplay::createSubSurface(), QUndoGroup::createUndoAction(), QWidgetAction::createWidget(), QWidget::createWindowContainer(), QQuickColorGroup::createWithParent(), QMessageBox::critical(), QTextHtmlParser::depth(), OrgBluezGattService1Adaptor::device(), OrgBluezLEAdvertisement1Adaptor::discoverable(), QTextObject::document(), QTableModel::dropMimeData(), QQuickDesignerSupport::emitComponentCompleteSignalForAttachedProperty(), QQmlDebugTranslationServiceImpl::engineAboutToBeAdded(), QGraphicsScene::event(), QMdiSubWindow::event(), QMdiSubWindow::eventFilter(), QMenu::exec(), QQuickAbstractDialog::findParentItem(), QQuickLabsPlatformDialog::findParentWindow(), QQuickLabsPlatformMenuBar::findWindow(), QQuickLabsPlatformMenu::findWindow(), OrgBluezGattCharacteristic1Adaptor::flags(), QQuickItemPrivate::focusNextPrev(), QAbstractTextDocumentLayout::format(), QAbstractTextDocumentLayout::formatAt(), QAbstractTextDocumentLayout::formatIndex(), QXcbWindow::frameMargins(), QWaylandClient::fromWlClient(), OrgFreedesktopDBusPropertiesAdaptor::Get(), OrgFreedesktopDBusPropertiesAdaptor::GetAll(), QColorDialog::getColor(), QInputDialog::getDouble(), QFileDialog::getExistingDirectory(), QFileDialog::getExistingDirectoryUrl(), QFontDialog::getFont(), QFontDialog::getFont(), QInputDialog::getInt(), QInputDialog::getItem(), OrgFreedesktopDBusObjectManagerAdaptor::GetManagedObjects(), QInputDialog::getMultiLineText(), QFileDialog::getOpenFileContent(), QFileDialog::getOpenFileName(), QFileDialog::getOpenFileNames(), QFileDialog::getOpenFileUrl(), QFileDialog::getOpenFileUrls(), getParentWidget(), QQuick3DParticleCustomShape::getPosition(), QFileDialog::getSaveFileName(), QFileDialog::getSaveFileUrl(), QInputDialog::getText(), GeoTileFetcherEsri::getTileImage(), QAndroidInputContext::handleLocationChanged(), QQuickToolTipAttached::hide(), OrgBluezGattService1Adaptor::includes(), OrgBluezLEAdvertisement1Adaptor::includes(), QQmlComponent::incubateObject(), QMessageBox::information(), QQuickAttachedPropertyPropagator::initialize(), QWaylandCompositorExtension::initialize(), QPlaceManagerEngineNokiaV2::initializeCategories(), MyPrivateInitStuff::initStuff(), QDockWidget::initStyleOption(), QListModel::insert(), QListModel::insert(), QPlainTextEditControl::insertFromMimeData(), QTextEditControl::insertFromMimeData(), QListModel::insertRows(), QItemSelectionModel::isColumnSelected(), QCocoaWindow::isEmbedded(), QItemSelectionModel::isRowSelected(), QQuickStackViewAttached::isVisible(), QQuickToolTipAttached::isVisible(), QAbstractItemModelPrivate::itemsAboutToBeMoved(), QQuickKeyNavigationAttached::keyPressed(), QMdiSubWindow::keyPressEvent(), QQuickKeyNavigationAttached::keyReleased(), QShortcutMap::keySequences(), QItemSelectionModelPrivate::layoutAboutToBeChanged(), QTextDocument::loadResource(), QTextEditControl::loadResource(), OrgBluezLEAdvertisement1Adaptor::localName(), OrgBluezLEAdvertisement1Adaptor::manufacturerData(), QWidget::mapFrom(), QWidget::mapFrom(), QWidget::mapTo(), QWidget::mapTo(), OrgBluezLEAdvertisement1Adaptor::maxInterval(), QMdiSubWindow::mdiArea(), QListModel::mimeData(), QTableModel::mimeData(), QListModel::mimeTypes(), QTableModel::mimeTypes(), QMdiSubWindow::minimumSizeHint(), OrgBluezLEAdvertisement1Adaptor::minInterval(), QColumnViewGrip::mouseDoubleClickEvent(), QMdiSubWindow::mouseDoubleClickEvent(), QMdiSubWindow::mouseMoveEvent(), QMdiSubWindow::mousePressEvent(), QMdiSubWindow::mouseReleaseEvent(), QMdiSubWindow::moveEvent(), QColumnViewGrip::moveGrip(), QWidget::nativeParentWidget(), QTextHtmlParser::newNode(), QSGBatchRenderer::Renderer::nodeChanged(), QTextHtmlParser::nodeIsChildOf(), OrgBluezGattCharacteristic1Adaptor::notifying(), QQuickDragAxis::onActiveChanged(), QWasmScreen::onSubtreeChanged(), QDBusMarshaller::open(), operator<<(), QMdiSubWindow::paintEvent(), parent(), QQmlContext::parentContext(), QQuickPointerHandler::parentItem(), QQuick3DParticleAbstractShape::parentNode(), QWindowContainer::parentWasChanged(), QWindowContainer::parentWasLowered(), QWindowContainer::parentWasMoved(), QWindowContainer::parentWasRaised(), QLayout::parentWidget(), QWidget::parentWidget(), QTextHtmlParser::parseCloseTag(), QTextHtmlParser::parseTag(), QCompleter::pathFromIndex(), QDBusAdaptorConnector::polish(), QQuickPopupPrivate::prepareEnterTransition(), OrgBluezGattService1Adaptor::primary(), QWidgetLineControl::processKeyEvent(), QmlJSDebugger::GlobalInspector::processMessage(), QPcscSlot::processStateChange(), qDBusFindAdaptorConnector(), qSmartSpacing(), QMessageBox::question(), OrgBluezGattCharacteristic1Adaptor::ReadValue(), OrgBluezGattDescriptor1Adaptor::ReadValue(), QDBusAdaptorConnector::relay(), QDBusAdaptorConnector::relaySlot(), OrgBluezLEAdvertisement1Adaptor::Release(), QQuickLayoutItemProxyAttachedData::releaseControl(), QWidgetAction::requestWidget(), QQuickStackViewAttached::resetVisible(), QMdiSubWindow::resizeEvent(), QTextHtmlParser::resolveParent(), QItemSelectionModel::rowIntersectsSelection(), QQuickTargetDirection::sample(), QGeoPositionInfoSourceFactoryAndroid::satelliteInfoSource(), QGeoPositionInfoSourceFactoryCL::satelliteInfoSource(), QGeoPositionInfoSourceFactoryGeoclue2::satelliteInfoSource(), QGeoPositionInfoSourceFactoryGypsy::satelliteInfoSource(), QGeoPositionInfoSourceFactoryNmea::satelliteInfoSource(), QGeoPositionInfoSourceFactoryPoll::satelliteInfoSource(), QGeoPositionInfoSourceFactoryWinRT::satelliteInfoSource(), QFileDialog::saveFileContent(), QWasmCompositor::screen(), QItemSelectionModel::selectedColumns(), OrgBluezGattCharacteristic1Adaptor::service(), OrgBluezLEAdvertisement1Adaptor::serviceUUIDs(), OrgFreedesktopDBusPropertiesAdaptor::Set(), QGraphicsScene::setActiveWindow(), QQuickColorDialogImplAttached::setAlphaSlider(), QDBusAbstractAdaptor::setAutoRelaySignals(), QQuickKeyNavigationAttached::setBacktab(), QQuickColorDialogImplAttached::setButtonBox(), QQuickFileDialogImplAttached::setButtonBox(), QQuickFontDialogImplAttached::setButtonBox(), QQuickMessageDialogImplAttached::setButtonBox(), QQuickPen::setColor(), QQuickColorDialogImplAttached::setColorInputs(), QQuickColorDialogImplAttached::setColorPicker(), QStackedLayout::setCurrentIndex(), QQuickTextUtil::setCursorDelegate(), QWidgetTextControl::setCursorWidth(), QTableModel::setData(), QQuickMessageDialogImplAttached::setDetailedTextButton(), OrgBluezLEAdvertisement1Adaptor::setDiscoverable(), QQuickKeyNavigationAttached::setDown(), QQuickColorDialogImplAttached::setEyeDropperButton(), QDeclarativePlace::setFavorite(), QDockWidget::setFeatures(), QQuickTextAreaAttached::setFlickable(), QBoxLayout::setGeometry(), QXcbWindow::setGeometry(), QQuickActionGroupAttached::setGroup(), QQuickButtonGroupAttached::setGroup(), QQuickScrollBarAttached::setHorizontal(), QTableModel::setHorizontalHeaderItem(), OrgBluezLEAdvertisement1Adaptor::setIncludes(), QQuickIndicatorButton::setIndicator(), QTableModel::setItem(), QTableModel::setItemData(), QWidget::setLayout(), QQuickKeyNavigationAttached::setLeft(), OrgBluezLEAdvertisement1Adaptor::setLocalName(), QDeclarativePlace::setLocation(), OrgBluezLEAdvertisement1Adaptor::setManufacturerData(), OrgBluezLEAdvertisement1Adaptor::setMaxInterval(), OrgBluezLEAdvertisement1Adaptor::setMinInterval(), QWaylandXdgOutputV1Private::setOutput(), QQuickFileDialogImplAttached::setOverwriteConfirmationDialog(), QXcbWindow::setParent(), QWidget::setParent(), QWidget::setParent(), QQuickPointerHandler::setParentItem(), QQuickPen::setPixelAligned(), QDeclarativePlace::setPlace(), QMenuPrivate::setPlatformMenu(), QQuickKeyNavigationAttached::setRight(), OrgBluezLEAdvertisement1Adaptor::setServiceUUIDs(), QLocalSocket::setSocketDescriptor(), QApplication::setStyle(), QQuickKeyNavigationAttached::setTab(), QQuick3DShaderUtilsTextureInput::setTexture(), OrgBluezLEAdvertisement1Adaptor::setType(), QQuickKeyNavigationAttached::setUp(), QQuickScrollBarAttached::setVertical(), QTableModel::setVerticalHeaderItem(), QQuickStackViewAttached::setVisible(), QWindowsWindow::setVisible(), QQuickPen::setWidth(), QWindow::show(), QQuickToolTipAttached::show(), QGtk3ColorDialogHelper::show(), QGtk3FileDialogHelper::show(), QGtk3FontDialogHelper::show(), QWidgetPlatformColorDialog::show(), QWidgetPlatformFileDialog::show(), QWidgetPlatformMessageDialog::show(), QQuickPlatformColorDialog::show(), QQuickPlatformFileDialog::show(), QQuickPlatformFolderDialog::show(), QQuickPlatformFontDialog::show(), QQuickPlatformMessageDialog::show(), QtAndroidDialogHelpers::QAndroidPlatformMessageDialogHelper::show(), QtAndroidFileDialogHelper::QAndroidPlatformFileDialogHelper::show(), QCocoaColorDialogHelper::show(), QCocoaFontDialogHelper::show(), QCocoaMessageDialog::show(), QIOSColorDialog::show(), QIOSFileDialog::show(), QIOSFontDialog::show(), QIOSMessageDialog::show(), QXdgDesktopPortalFileDialog::show(), QWidgetPlatformFontDialog::show(), QMdiSubWindow::showEvent(), QComboBox::showPopup(), QMdiSubWindow::showShaded(), OrgBluezGattCharacteristic1Adaptor::StartNotify(), OrgBluezGattCharacteristic1Adaptor::StopNotify(), QTableModel::supportedDropActions(), QQuickLayoutItemProxyAttachedData::takeControl(), QStyleAnimation::target(), QQmlConnections::target(), QWindowContainer::toplevelAboutToBeDestroyed(), QLayout::totalHeightForWidth(), QLayout::totalMinimumHeightForWidth(), QMenuPrivate::transientParentWindow(), QmlJSDebugger::ObjectCreator::tryCreateObject(), OrgBluezLEAdvertisement1Adaptor::type(), QLayout::update(), QQuickFileNameFilter::update(), QQuickFontDialogImplAttached::updateFamilies(), QQuickDragAxis::updateValue(), OrgBluezGattCharacteristic1Adaptor::uUID(), OrgBluezGattDescriptor1Adaptor::uUID(), OrgBluezGattService1Adaptor::uUID(), OrgBluezGattCharacteristic1Adaptor::value(), OrgBluezGattDescriptor1Adaptor::value(), QTreeModel::view(), QMessageBox::warning(), QLayout::widgetEvent(), OrgBluezGattCharacteristic1Adaptor::WriteValue(), and OrgBluezGattDescriptor1Adaptor::WriteValue().

+ Here is the call graph for this function:

◆ property()

QVariant QObject::property ( const char * name) const

Returns the value of the object's name property.

If no such property exists, the returned variant is invalid.

Information about all available properties is provided through the metaObject() and dynamicPropertyNames().

See also
setProperty(), QVariant::isValid(), metaObject(), dynamicPropertyNames()

Definition at line 4323 of file qobject.cpp.

References className, d, i, QMetaObject::indexOfProperty(), QObjectData::metaObject, QMetaObject::property(), and qWarning.

Referenced by QQnxWindow::QQnxWindow(), QQnxWindow::QQnxWindow(), QSyntaxHighlighter::QSyntaxHighlighter(), QQuickContainerPrivate::_q_currentIndexChanged(), QQuickTumblerPrivate::_q_onViewContentYChanged(), QQuickTumblerPrivate::_q_onViewCountChanged(), QQuickTumblerPrivate::_q_onViewCurrentIndexChanged(), QQuickTumblerPrivate::_q_onViewOffsetChanged(), QQuickAnimatorPrivate::apply(), canAnimate(), QQuickScrollBarAttachedPrivate::cleanupHorizontal(), QQuickScrollBarAttachedPrivate::cleanupVertical(), QQmlProperty::connectNotifySignal(), QQmlProperty::connectNotifySignal(), cppQmlInterface(), QXcbWindow::create(), QQuickPropertyAnimation::createTransitionActions(), QQuickFolderBreadcrumbBarPrivate::dialogFolder(), QPixmapStyle::drawComboBox(), QQC2_NAMESPACE::QMacStyle::drawComplexControl(), QMacStyle::drawComplexControl(), QWindows11Style::drawComplexControl(), QWindowsVistaStyle::drawComplexControl(), QWindowsVistaStyle::drawControl(), QPixmapStyle::drawControl(), QPixmapStyle::drawPanelItemViewItem(), QWindows11Style::drawPrimitive(), QWindowsVistaStyle::drawPrimitive(), QQuickLayoutItemProxy::effectiveTarget(), QMacStyle::event(), findAttachedParent(), QQuick3DSceneManager::getOrSetWindowAttachment(), getPrimaryDevice(), QAndroidInputContext::handleLocationChanged(), QQmlProperty::hasNotifySignal(), OrgBluezGattService1Adaptor::includes(), QQuickScrollBarAttachedPrivate::initHorizontal(), QQuickScrollBarAttachedPrivate::initVertical(), QUnifiedTimer::installAnimationDriver(), QQuickToolTipAttachedPrivate::instance(), QQmlProperty::isDesignable(), QPixmapStyle::itemViewSizeFromContents(), keywords(), QWasmWindowTreeNode::onSubtreeChanged(), QQuickOverlay::overlay(), QQmlProperty::property(), QQmlProperty::propertyTypeName(), qDBusPropertyGet(), QWidgetTextControlPrivate::rectForPosition(), QTextEditPrivate::relayoutDocument(), QtWaylandClient::QWaylandXdgSurface::requestActivateOnShow(), QTextEdit::resizeEvent(), QQmlDebugTranslationServicePrivate::sendTranslatableTextOccurrences(), QQuickTumblerPrivate::setCurrentIndex(), QQuickTableViewPrivate::setRequiredProperty(), QQuickLayoutItemProxy::setTarget(), QQmlDebugTranslationServicePrivate::setWatchTextElides(), QCocoaWindow::shouldRefuseKeyWindowAndFirstResponder(), QXcbWindow::show(), QQC2::QWindowsStyle::styleHint(), QQuickTumblerPrivate::syncCurrentIndex(), QQuickPropertyAction::transition(), QPropertyAnimationPrivate::updateMetaProperty(), QQuickSpinBoxPrivate::updateValue(), QV4::QQmlValueTypeWrapper::virtualPut(), and QQuickControlPrivate::warnIfCustomizationNotSupported().

+ Here is the call graph for this function:

◆ receivers()

int QObject::receivers ( const char * signal) const
protected

Returns the number of receivers connected to the signal.

Since both slots and signals can be used as receivers for signals, and the same connections can be made many times, the number of receivers is the same as the number of connections made from this signal.

When calling this function, you can use the SIGNAL() macro to pass a specific signal:

if (receivers(SIGNAL(valueChanged(QByteArray))) > 0) {
get_the_value(&data); // expensive operation
emit valueChanged(data);
}
Warning
This function violates the object-oriented principle of modularity. However, it might be useful when you need to perform expensive initialization only if something is connected to a signal.
See also
isSignalConnected()

Definition at line 2740 of file qobject.cpp.

References check_signal_macro(), d, err_method_notfound(), QMetaObject::normalizedSignature(), QAbstractDeclarativeData::receivers, signal, signalSlotLock(), and QObjectPrivate::ConnectionData::signalVector.

+ Here is the call graph for this function:

◆ removeEventFilter()

void QObject::removeEventFilter ( QObject * obj)

Removes an event filter object obj from this object.

The request is ignored if such an event filter has not been installed.

All event filters for this object are automatically removed when this object is destroyed.

It is always safe to remove an event filter, even during event filter activation (i.e. from the eventFilter() function).

See also
installEventFilter(), eventFilter(), event()

Definition at line 2370 of file qobject.cpp.

References d.

Referenced by QWaylandQuickShellSurfaceItem::~QWaylandQuickShellSurfaceItem(), QQuickColorDialogImplPrivate::eyeDropperLeave(), QDataWidgetMapperPrivate::flipEventFilters(), QMenuBarPrivate::handleReparent(), QMdiSubWindowPrivate::removeBaseWidget(), QDialogButtonBoxPrivate::removeButton(), QDataWidgetMapper::removeMapping(), QEvdevTouchScreenHandlerThread::scheduleTouchPointUpdate(), QQuickScrollViewPrivate::setFlickable(), QWaylandQuickShellSurfaceItem::setShellSurface(), QFocusFrame::setWidget(), QGraphicsProxyWidgetPrivate::setWidget_helper(), QPixmapStyle::unpolish(), and QSizeGripPrivate::updateTopLevelWidget().

+ Here is the caller graph for this function:

◆ sender()

QObject * QObject::sender ( ) const
protected

Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns \nullptr.

The pointer is valid only during the execution of the slot that calls this function from this object's thread context.

The pointer returned by this function becomes invalid if the sender is destroyed, or if the slot is disconnected from the sender's signal.

Warning
This function violates the object-oriented principle of modularity. However, getting access to the sender might be useful when many signals are connected to a single slot.
As mentioned above, the return value of this function is not valid when the slot is called via a Qt::DirectConnection from a thread different from this object's thread. Do not use this function in this type of scenario.
See also
senderSignalIndex()

Definition at line 2658 of file qobject.cpp.

References QObjectPrivate::ConnectionData::currentSender, d, QObjectPrivate::Sender::sender, QObjectPrivate::ConnectionData::senders, and signalSlotLock().

Referenced by ~QObject(), QWizardPrivate::_q_emitCustomButtonClicked(), QCocoaWindow::applyWindowState(), ReaderThreadExecutionEnforcer::asyncResponseFinished(), QTabBarPrivate::closeTab(), QQmlTypeLoaderNetworkReplyProxy::downloadProgress(), QQmlTypeLoaderNetworkReplyProxy::finished(), QtAndroidQuickViewEmbedding::SignalHelper::forwardSignal(), QtAndroidQuickViewEmbedding::SignalHelper::forwardSignal(), QtAndroidQuickViewEmbedding::SignalHelper::forwardSignal(), QtAndroidQuickViewEmbedding::SignalHelper::forwardSignal(), QtAndroidQuickViewEmbedding::SignalHelper::forwardSignal(), QtAndroidQuickViewEmbedding::SignalHelper::forwardSignal(), QDialogButtonBoxPrivate::handleButtonDestroyed(), QBluetoothSocketPrivateAndroid::inputThreadError(), QQuickLayout::invalidateSenderItem(), QtAndroidQuickViewEmbedding::SignalHelper::invokeListener(), QDnsLookup::lookup(), QSignalMapper::map(), QSignalMapper::map(), TileProvider::onNetworkReplyError(), TileProvider::onNetworkReplyFinished(), QQuickVisualTestUtils::SignalMultiSpy::receive(), QPhysicsWorld::registerContact(), QDBusAdaptorConnector::relaySlot(), QSignalMapper::removeMappings(), QTabBarPrivate::scrollTabs(), QQmlDebugTranslationServicePrivate::sendStateChanged(), QSignalMapper::setMapping(), QSignalMapper::setMapping(), QSignalMapper::setMapping(), QNetworkListManagerEvents::start(), QCocoaWindow::toggleFullScreen(), and QCocoaWindow::toggleMaximized().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ senderSignalIndex()

int QObject::senderSignalIndex ( ) const
protected
Since
4.8

Returns the meta-method index of the signal that called the currently executing slot, which is a member of the class returned by sender(). If called outside of a slot activated by a signal, -1 is returned.

For signals with default parameters, this function will always return the index with all parameters, regardless of which was used with connect(). For example, the signal {destroyed(QObject *obj = \nullptr)} will have two different indexes (with and without the parameter), but this function will always return the index with a parameter. This does not apply when overloading signals with different parameters.

Warning
This function violates the object-oriented principle of modularity. However, getting access to the signal index might be useful when many signals are connected to a single slot.
The return value of this function is not valid when the slot is called via a Qt::DirectConnection from a thread different from this object's thread. Do not use this function in this type of scenario.
See also
sender(), QMetaObject::indexOfSignal(), QMetaObject::method()

Definition at line 2700 of file qobject.cpp.

References QObjectPrivate::ConnectionData::currentSender, d, QObjectPrivate::Sender::sender, QObjectPrivate::ConnectionData::senders, QMetaObjectPrivate::signal(), QObjectPrivate::Sender::signal, and signalSlotLock().

Referenced by QtAndroidQuickViewEmbedding::SignalHelper::forwardSignal(), QtAndroidQuickViewEmbedding::SignalHelper::forwardSignal(), QtAndroidQuickViewEmbedding::SignalHelper::forwardSignal(), QtAndroidQuickViewEmbedding::SignalHelper::forwardSignal(), QtAndroidQuickViewEmbedding::SignalHelper::forwardSignal(), QtAndroidQuickViewEmbedding::SignalHelper::forwardSignal(), QtAndroidQuickViewEmbedding::SignalHelper::invokeListener(), QQuickVisualTestUtils::SignalMultiSpy::receive(), and QDBusAdaptorConnector::relaySlot().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setObjectName() [1/2]

void QObject::setObjectName ( const QString & name)
inline

Sets the object's name to name.

Definition at line 127 of file qobject.h.

Referenced by QFFmpeg::AudioEncoder::AudioEncoder(), QtWaylandClient::EventThread::EventThread(), QFFmpeg::Muxer::Muxer(), QBsdKeyboardHandler::QBsdKeyboardHandler(), QBsdMouseHandler::QBsdMouseHandler(), QtPrivate::QColorShower::QColorShower(), QDeclarativeCircleMapItemPrivateCPU::QDeclarativeCircleMapItemPrivateCPU(), QDeclarativePolygonMapItemPrivateCPU::QDeclarativePolygonMapItemPrivateCPU(), QDeclarativePolylineMapItemPrivateCPU::QDeclarativePolylineMapItemPrivateCPU(), QDeclarativeRectangleMapItemPrivateCPU::QDeclarativeRectangleMapItemPrivateCPU(), QEvdevKeyboardHandler::QEvdevKeyboardHandler(), QEvdevTabletHandler::QEvdevTabletHandler(), QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(), QMainWindowLayout::QMainWindowLayout(), QMenuBarExtension::QMenuBarExtension(), QQmlDebugServerImpl::QQmlDebugServerImpl(), QQmlThreadPrivate::QQmlThreadPrivate(), QQuick3DItem2D::QQuick3DItem2D(), QQuickContentItem::QQuickContentItem(), QQuickContentItem::QQuickContentItem(), QQuickStyleItemScrollBar::QQuickStyleItemScrollBar(), QQuickTableViewResizeHandler::QQuickTableViewResizeHandler(), QQuickWidgetOffscreenWindow::QQuickWidgetOffscreenWindow(), QSpinBoxValidator::QSpinBoxValidator(), QSystemTrayIconSys::QSystemTrayIconSys(), QToolBarExtension::QToolBarExtension(), QWindowsCaRootFetcherThread::QWindowsCaRootFetcherThread(), QWindowsDragCursorWindow::QWindowsDragCursorWindow(), QWindowsGuiEventDispatcher::QWindowsGuiEventDispatcher(), QSGBatchRenderer::Renderer::Renderer(), QFFmpeg::VideoEncoder::VideoEncoder(), QFileDialogPrivate::createMenuActions(), QCalendarWidgetPrivate::createNavigationBar(), QLineEdit::createStandardContextMenu(), QNetworkAccessManagerPrivate::createThread(), QFileDialogPrivate::createWidgets(), QWizardPrivate::ensureButton(), QFontDialogPrivate::init(), QAbstractSpinBoxPrivate::init(), QDockWidgetPrivate::init(), QKeySequenceEditPrivate::init(), QTabBarPrivate::init(), QTabWidgetPrivate::init(), QMessageBoxPrivate::init(), QQuickWindowPrivate::init(), QDateTimeEditPrivate::initCalendarPopup(), QSplitterPrivate::insertWidget(), QNetworkReplyHttpImplPrivate::postRequest(), quick_test_main_with_setup(), QMessageBox::setInformativeText(), and QPrintPreviewDialogPrivate::setupActions().

◆ setObjectName() [2/2]

void QObject::setObjectName ( QAnyStringView name)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Since
6.4

Definition at line 1312 of file qobject.cpp.

References d.

◆ setParent()

void QObject::setParent ( QObject * parent)

Makes the object a child of parent.

See also
parent(), children()

Definition at line 2195 of file qobject.cpp.

References d, QObjectData::parent, and Q_ASSERT.

Referenced by QAbstractAnimation::QAbstractAnimation(), QAbstractAnimation::QAbstractAnimation(), QGeoCodingManagerEngineNokia::QGeoCodingManagerEngineNokia(), QGeoRoutingManagerEngineNokia::QGeoRoutingManagerEngineNokia(), QGeoTileFetcherNokia::QGeoTileFetcherNokia(), QGeoTileFetcherOsm::QGeoTileFetcherOsm(), QLayout::QLayout(), QMainWindowLayout::QMainWindowLayout(), QNonContiguousByteDeviceBufferImpl::QNonContiguousByteDeviceBufferImpl(), QObject(), QOpenXROrigin::QOpenXROrigin(), QPlaceManagerEngineNokiaV2::QPlaceManagerEngineNokiaV2(), QProxyStyle::QProxyStyle(), QWidgetPlatformColorDialog::QWidgetPlatformColorDialog(), QWidgetPlatformFileDialog::QWidgetPlatformFileDialog(), QWidgetPlatformFontDialog::QWidgetPlatformFontDialog(), QWidgetPlatformMenu::QWidgetPlatformMenu(), QWidgetPlatformMenuItem::QWidgetPlatformMenuItem(), QWidgetPlatformMessageDialog::QWidgetPlatformMessageDialog(), QWidgetPlatformSystemTrayIcon::QWidgetPlatformSystemTrayIcon(), QSGBatchRenderer::Renderer::Renderer(), QQuickWindow::~QQuickWindow(), QGeoTileProviderOsm::addProvider(), QLowEnergyController::addService(), QAnimationGroupPrivate::clear(), QProxyStylePrivate::ensureBaseStyle(), QQuickItemGenerator::generateNodeBase(), QQuickStackElement::incubate(), QLineEditPrivate::init(), QSocks5SocketEngine::initialize(), QOpenXRItemPrivate::initParentItem(), QAnimationGroup::insertAnimation(), QQmlComponent_setQmlParent(), QNetworkAccessManager::setCache(), QOpenXRItemPrivate::setContentItem(), QNetworkAccessManager::setCookieJar(), QWidget::setLayout(), QQuickPointerHandler::setParentItem(), QQuickPlatformColorDialog::show(), QQuickPlatformFileDialog::show(), QQuickPlatformFolderDialog::show(), QQuickPlatformFontDialog::show(), QQuickPlatformMessageDialog::show(), QHttpThreadDelegate::startRequest(), QSingleShotTimer::startTimerForReceiver(), QAnimationGroup::takeAnimation(), QMainWindow::takeCentralWidget(), and QDeclarativeSearchModelBase::update().

+ Here is the caller graph for this function:

◆ setProperty() [1/2]

bool QObject::setProperty ( const char * name,
const QVariant & value )

Sets the value of the object's name property to value.

If the property is defined in the class using Q_PROPERTY then true is returned on success and false otherwise. If the property is not defined using Q_PROPERTY, and therefore not listed in the meta-object, it is added as a dynamic property and false is returned.

Information about all available properties is provided through the metaObject() and dynamicPropertyNames().

Dynamic properties can be queried again using property() and can be removed by setting the property value to an invalid QVariant. Changing the value of a dynamic property causes a QDynamicPropertyChangeEvent to be sent to the object.

{Note:} Dynamic properties starting with "_q_" are reserved for internal purposes.

See also
property(), metaObject(), dynamicPropertyNames(), QMetaProperty::write()

Referenced by QQuickTextControl::QQuickTextControl(), QWindowsFileSystemWatcherEngine::QWindowsFileSystemWatcherEngine(), QQuick3DWindowAttachment::~QQuick3DWindowAttachment(), QQuick3DLightmapBaker::bake(), QV4::Runtime::StoreNameStrict::call(), QV4::Runtime::StoreNameSloppy::call(), cppQmlInterface(), QWidgetPrivate::create(), createDimmer(), QQuickMacFocusFrame::createFocusFrame(), QQuickPopupPrivate::destroyDimmer(), QQC2_NAMESPACE::QMacStyle::drawComplexControl(), QMacStyle::drawComplexControl(), QWindows11Style::drawComplexControl(), QWindowsVistaStyle::drawComplexControl(), QWindowsVistaStyle::drawControl(), QWindows11Style::drawPrimitive(), QWindowsVistaStyle::drawPrimitive(), QWidget::event(), QPixmapStyle::eventFilter(), findAttachedParent(), QQuick3DSceneManager::getOrSetWindowAttachment(), QQuickMultiEffectPrivate::initialize(), QQuickToolTipAttachedPrivate::instance(), main(), QQuickOverlay::overlay(), QWindows11Style::polish(), QWindowsVistaStyle::polish(), QQuickMultiEffectPrivate::proxyOutputChanged(), QQuickMultiEffectPrivate::setBrightness(), QQuickMultiEffectPrivate::setContrast(), QQuickTumblerPrivate::setCurrentIndex(), QQuickFolderBreadcrumbBarPrivate::setDialogFolder(), OrgBluezLEAdvertisement1Adaptor::setDiscoverable(), QWindowsWindow::setHasBorderInFullScreenStatic(), OrgBluezLEAdvertisement1Adaptor::setIncludes(), OrgBluezLEAdvertisement1Adaptor::setLocalName(), OrgBluezLEAdvertisement1Adaptor::setManufacturerData(), QQuickMultiEffectPrivate::setMaskInverted(), QQuickMultiEffectPrivate::setMaskSource(), OrgBluezLEAdvertisement1Adaptor::setMaxInterval(), OrgBluezLEAdvertisement1Adaptor::setMinInterval(), QQuickMultiEffectPrivate::setSaturation(), QHighDpiScaling::setScreenFactor(), OrgBluezLEAdvertisement1Adaptor::setServiceUUIDs(), QQuickMultiEffectPrivate::setShadowScale(), QQuickLayoutItemProxy::setTarget(), OrgBluezLEAdvertisement1Adaptor::setType(), QQuickTumblerPrivate::syncCurrentIndex(), QQuickMultiEffectPrivate::updateBlurItemsAmount(), QQuickMultiEffectPrivate::updateBlurWeights(), QQuickMultiEffectPrivate::updateCenterOffset(), QQuickMultiEffectPrivate::updateColorizationColor(), QScrollbarStyleAnimation::updateCurrentTime(), QQuickMultiEffectPrivate::updateMaskThresholdSpread(), QQuickMultiEffectPrivate::updateShadowBlurWeights(), QQuickMultiEffectPrivate::updateShadowColor(), and QQuickMultiEffectPrivate::updateShadowOffset().

◆ setProperty() [2/2]

bool QObject::setProperty ( const char * name,
QVariant && value )
inline

Definition at line 413 of file qobject.h.

◆ signalsBlocked()

bool QObject::signalsBlocked ( ) const
inlinenoexcept

Returns true if signals are blocked; otherwise returns false.

Signals are not blocked by default.

See also
blockSignals(), QSignalBlocker

Definition at line 135 of file qobject.h.

Referenced by QTreeModel::emitDataChanged(), QMenuPrivate::hideMenu(), and QBuffer::writeData().

+ Here is the caller graph for this function:

◆ startTimer() [1/2]

int QObject::startTimer ( int interval,
Qt::TimerType timerType = Qt::CoarseTimer )

This is an overloaded function that will start a timer of type timerType and a timeout of interval milliseconds.

This is equivalent to calling:

startTimer(std::chrono::milliseconds{interval}, timerType);
int startTimer(int interval, Qt::TimerType timerType=Qt::CoarseTimer)
This is an overloaded function that will start a timer of type timerType and a timeout of interval mi...
Definition qobject.cpp:1817
See also
timerEvent(), killTimer(), QChronoTimer::singleShot()

Definition at line 1817 of file qobject.cpp.

Referenced by MyObject::MyObject(), QXcbClipboardTransaction::QXcbClipboardTransaction(), QSocks5BindStore::add(), QXcbDrag::drop(), QComboBoxPrivateScroller::enterEvent(), QTestEventLoop::enterLoop(), QTabBar::event(), QQuickWindowIncubationController::incubateAgain(), QPMCache::insert(), QKeySequenceEdit::keyReleaseEvent(), QQuickMaterialRipple::prepareWave(), PressDelayHandler::pressed(), QWidgetLineControl::processKeyEvent(), QWidgetLineControl::resetCursorBlinkTimer(), QMdiSubWindow::resizeEvent(), QTimeLine::resume(), QTimer::setInterval(), QChronoTimer::setInterval(), QTimeLine::setPaused(), QComboBox::showPopup(), QChronoTimer::start(), QTimer::start(), QTimeLine::start(), QQuickIOSCursorFlashTimer::start(), QSingleShotTimer::startTimerForReceiver(), QPMCache::timerEvent(), QAbstractSpinBox::timerEvent(), QQuickPixmapCache::unreferencePixmap(), QWidgetLineControl::updateCursorBlinking(), and QXcbClipboardTransaction::updateIncrementalProperty().

+ Here is the caller graph for this function:

◆ startTimer() [2/2]

int QObject::startTimer ( std::chrono::nanoseconds interval,
Qt::TimerType timerType = Qt::CoarseTimer )
Since
5.9 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Starts a timer and returns a timer identifier, or returns zero if it could not start a timer.

A timer event will occur every interval until killTimer() is called. If interval is equal to {std::chrono::duration::zero()}, then the timer event occurs once every time there are no more window system events to process.

The virtual timerEvent() function is called with the QTimerEvent event parameter class when a timer event occurs. Reimplement this function to get timer events.

If multiple timers are running, the QTimerEvent::timerId() can be used to find out which timer was activated.

Example:

class MyObject : public QObject
{
public:
MyObject(QObject *parent = nullptr);
protected:
void timerEvent(QTimerEvent *event) override;
};
: QObject(parent)
{
startTimer(50); // 50-millisecond timer
startTimer(1000); // 1-second timer
startTimer(60000); // 1-minute timer
using namespace std::chrono;
startTimer(milliseconds(50));
startTimer(seconds(1));
startTimer(minutes(1));
// since C++14 we can use std::chrono::duration literals, e.g.:
startTimer(100ms);
startTimer(5s);
startTimer(2min);
startTimer(1h);
}
{
qDebug() << "Timer ID:" << event->timerId();
}

Note that the accuracy of QChronoTimer depends on the underlying operating system and hardware.

The timerType argument allows you to customize the accuracy of the timer. See Qt::TimerType for information on the different timer types. Most platforms support an accuracy of 20 milliseconds; some provide more. If Qt is unable to deliver the requested number of timer events, it will silently discard some.

The QTimer and QChronoTimer classes provide a high-level programming interface with single-shot timers and timer signals instead of events. There is also a QBasicTimer class that is more lightweight than QChronoTimer but less clumsy than using timer IDs directly.

See also
timerEvent(), killTimer(), QChronoTimer::singleShot()
Note
Starting from Qt 6.8 the type of interval is std::chrono::nanoseconds, prior to that it was std::chrono::milliseconds. This change is backwards compatible with older releases of Qt.
In Qt 6.8, QObject was changed to use Qt::TimerId to represent timer IDs. This method converts the TimerId to int for backwards compatibility reasons, however you can use Qt::TimerId to check the value returned by this method, for example:
...
int id = obj->startTimer(100ms);
// The timer has been started successfully
if (id > 0) // Equivalent, albeit less readable
// The timer has been started successfully

Definition at line 1875 of file qobject.cpp.

References QThread::currentThread(), d, Q_UNLIKELY, and qWarning.

+ Here is the call graph for this function:

◆ thread()

QThread * QObject::thread ( ) const

Returns the thread in which the object lives.

See also
moveToThread()

Definition at line 1598 of file qobject.cpp.

References thread().

Referenced by MFStream::MFStream(), QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(), QHostInfoResult::QHostInfoResult(), QObject(), QSocks5BindStore::QSocks5BindStore(), QFFmpeg::PlaybackEngineObject::~PlaybackEngineObject(), QAndroidAudioDecoder::~QAndroidAudioDecoder(), QDBusConnectionPrivate::~QDBusConnectionPrivate(), ~QObject(), QPcscManager::~QPcscManager(), QQuick3DViewport::~QQuick3DViewport(), QWindowsFileSystemWatcherEngine::~QWindowsFileSystemWatcherEngine(), QWindowsFileSystemWatcherEngine::addPaths(), QDBusAbstractInterface::callWithArgumentList(), check_parent_thread(), QCoreApplicationPrivate::checkReceiverThread(), checkSingletonInstance(), QNetworkReplyFileImpl::close(), QLowEnergyControllerPrivateWinRT::connectToDevice(), QThreadPool::contains(), QSqlDatabase::currentThread(), doInitializeEngine(), QCtfLibImpl::doTracepoint(), QTextImageHandler::drawObject(), QQmlProfilerServiceImpl::engineAboutToBeAdded(), QQmlProfilerServiceImpl::engineAboutToBeRemoved(), QV4DebugServiceImpl::engineAdded(), QQmlProfilerServiceImpl::engineAdded(), QQmlProfilerServiceImpl::engineRemoved(), QEventLoop::exec(), QTestEventLoop::exitLoop(), QQuickContext2D::flush(), QDBusConnectionPrivate::handleMessage(), QQuickContext2DRenderThread::instance(), QAbstractEventDispatcher::instance(), QTextImageHandler::intrinsicSize(), QOpenGLContext::makeCurrent(), QQnxScreen::newWindowCreated(), QBluetoothServer::nextPendingConnection(), QCoreApplication::notify(), QCoreApplicationPrivate::notify_helper(), QApplicationPrivate::notify_helper(), QQuickContext2D::prepare(), EVRCustomPresenter::presentSample(), qDBusIntrospectObject(), qDBusPropertyGet(), qDBusPropertyGetAll(), qDBusPropertySet(), QCFSocketNotifier::registerSocketNotifier(), QEventDispatcherUNIX::registerSocketNotifier(), QEventDispatcherWin32::registerSocketNotifier(), QEventDispatcherGlib::registerSocketNotifier(), QEventDispatcherWin32::registerTimer(), QCocoaEventDispatcher::registerTimer(), QEventDispatcherGlib::registerTimer(), QEventDispatcherUNIX::registerTimer(), QEventDispatcherWasm::registerTimer(), QDBusAdaptorConnector::relaySlot(), QWindowsFileSystemWatcherEngine::removePaths(), QWaylandTextureSharingExtension::requestBuffer(), QSocks5BindStore::retrieve(), QEglFSKmsEventReaderThread::run(), QSGSoftwareRenderThread::run(), QSGRenderThread::run(), QCoreApplicationPrivate::sendThroughApplicationEventFilters(), QCoreApplicationPrivate::sendThroughObjectEventFilters(), QNetworkAccessManager::setCookieJar(), QSocketNotifier::setEnabled(), QThread::setEventDispatcher(), QFFmpeg::Renderer::setOutputInternal(), QGeoAreaMonitorPollingPrivate::setPositionSource(), QPdfPageRenderer::setRenderMode(), QBasicTimer::start(), EVRCustomPresenter::startSurface(), QSingleShotTimer::startTimerForReceiver(), EVRCustomPresenter::stopSurface(), thread(), QQuickContext2D::toImage(), QCFSocketNotifier::unregisterSocketNotifier(), QEventDispatcherUNIX::unregisterSocketNotifier(), QEventDispatcherWin32::unregisterSocketNotifier(), QEventDispatcherGlib::unregisterSocketNotifier(), QEventDispatcherWin32::unregisterTimer(), QCocoaEventDispatcher::unregisterTimer(), QEventDispatcherGlib::unregisterTimer(), QEventDispatcherUNIX::unregisterTimer(), QEventDispatcherWasm::unregisterTimer(), QCocoaEventDispatcher::unregisterTimers(), QEventDispatcherWin32::unregisterTimers(), QEventDispatcherGlib::unregisterTimers(), QEventDispatcherUNIX::unregisterTimers(), QEventDispatcherWasm::unregisterTimers(), QQuick3DTexture::updateSpatialNode(), QRestAccessManagerPrivate::verifyThreadAffinity(), QQnxScreen::windowClosed(), QSGSoftwareThreadedRenderLoop::windowDestroyed(), and QSGThreadedRenderLoop::windowDestroyed().

+ Here is the call graph for this function:

◆ timerEvent()

void QObject::timerEvent ( QTimerEvent * event)
protectedvirtual

This event handler can be reimplemented in a subclass to receive timer events for the object.

QChronoTimer provides higher-level interfaces to the timer functionality, and also more general information about timers. The timer event is passed in the event parameter.

See also
startTimer(), killTimer(), event()

Reimplemented in QPollingFileSystemWatcherEngine, QUnifiedTimer, QChronoTimer, QSingleShotTimer, QTimer, QPMCache, QNetworkAccessCache, QWindowsDialogHelperBase< QPlatformFileDialogHelper >, QTreeModel, QAbstractSlider, QKeySequenceEdit, QLineEdit, QMenu, QMenuBar, QToolButton, QQuickView, QQuickWindowIncubationController, QQuickPixmapCache, QQuickWidget, QDefaultAnimationDriver, QDBusConnectionPrivate, QTextDocumentLayout, QCocoaMenu, QXcbDrag, QTestEventLoop, QTipLabel, PressDelayHandler, QBalloonTip, QAbstractButton, QtPrivate::QCalendarTextNavigator, QComboBoxPrivateScroller, QMainWindowLayout, QWidgetTextControl, QQuickTextControl, QXcbClipboardTransaction, QMacPanGestureRecognizer, MyObject, QTimeLine, QFileSystemModel, QFontCache, QSocks5BindStore, QQnxScreenEventHandler, QAbstractSpinBox, QTabBar, QWidgetLineControl, QQmlSettings, QQmlSettings, QQuickTapHandler, QQuickWheelHandler, QQuickFlickable, QQuickMouseArea, QQuickTextInput, QQuickIOSCursorFlashTimer, QQuickMaterialRipple, QQC2::QWindowsStyle, QQuickAbstractButton, QQuickMenu, QQuickMonthGrid, QQuickSpinBox, QQuickTextArea, QQuickTextField, QQuickToolTip, QGeoTileFetcher, QPulseAudioSink, QPulseAudioSource, QGeoPositionInfoSourceCL, QNmeaPositionInfoSourcePrivate, QNmeaSimulatedReader, QNmeaSatelliteInfoSourcePrivate, QWaylandQuickShellEventFilter, QPdfSearchModel, QComboBoxPrivateContainer, and QMdiSubWindow.

Definition at line 1470 of file qobject.cpp.

Referenced by QPollingFileSystemWatcherEngine::timerEvent(), QTreeModel::timerEvent(), QKeySequenceEdit::timerEvent(), QMenuBar::timerEvent(), QTextDocumentLayout::timerEvent(), QBalloonTip::timerEvent(), QMainWindowLayout::timerEvent(), QQnxScreenEventHandler::timerEvent(), QAbstractSpinBox::timerEvent(), QTabBar::timerEvent(), QQmlSettings::timerEvent(), QQuickMaterialRipple::timerEvent(), QQuickAbstractButton::timerEvent(), QQuickMenu::timerEvent(), QQuickSpinBox::timerEvent(), QQuickTextArea::timerEvent(), QQuickToolTip::timerEvent(), QGeoTileFetcher::timerEvent(), QPulseAudioSink::timerEvent(), and QPulseAudioSource::timerEvent().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ QAccessibleWidget

friend class QAccessibleWidget
friend

Definition at line 383 of file qobject.h.

◆ QApplication

friend class QApplication
friend

Definition at line 378 of file qobject.h.

◆ QApplicationPrivate

friend class QApplicationPrivate
friend

Definition at line 379 of file qobject.h.

◆ QCoreApplication

friend class QCoreApplication
friend

Definition at line 380 of file qobject.h.

◆ QCoreApplicationPrivate

friend class QCoreApplicationPrivate
friend

Definition at line 381 of file qobject.h.

◆ qFindChildqFindChildren()

template< typename T > T qFindChildqFindChildren ( const QObject * obj,
const QString & name )
related
Deprecated

This function is equivalent to {obj}->\l{QObject::findChild()}{findChild}<T>(name).

Note
This function was provided as a workaround for MSVC 6 which did not support member template functions. It is advised to use the other form in new code.
See also
QObject::findChild()

◆ qFindChildrenqFindChildren()

template< typename T > QList< T > qFindChildrenqFindChildren ( const QObject * obj,
const QString & name )
related
Deprecated

This function is equivalent to {obj}->\l{QObject::findChildren()}{findChildren}<T>(name).

Note
This function was provided as a workaround for MSVC 6 which did not support member template functions. It is advised to use the other form in new code.
See also
QObject::findChildren()

◆ QMetaCallEvent

friend class QMetaCallEvent
friend

Definition at line 377 of file qobject.h.

◆ QMetaObject

friend struct QMetaObject
friend

Definition at line 375 of file qobject.h.

◆ QMetaObjectPrivate

friend struct QMetaObjectPrivate
friend

Definition at line 376 of file qobject.h.

◆ qobject_cast()

template< class T > T qobject_cast ( const QObject * object)
related

Returns the given object cast to type T if the object is of type T (or of a subclass); otherwise returns \nullptr.

If object is \nullptr then it will also return \nullptr.

The class T must inherit (directly or indirectly) QObject and be declared with the \l Q_OBJECT macro.

A class is considered to inherit itself.

Example:

QObject *obj = new QTimer; // QTimer inherits QObject
QTimer *timer = qobject_cast<QTimer *>(obj);
// timer == (QObject *)obj
QAbstractButton *button = qobject_cast<QAbstractButton *>(obj);
// button == nullptr

The qobject_cast() function behaves similarly to the standard C++ dynamic_cast(), with the advantages that it doesn't require RTTI support and it works across dynamic library boundaries.

qobject_cast() can also be used in conjunction with interfaces.

Warning
If T isn't declared with the Q_OBJECT macro, this function's return value is undefined.
See also
QObject::inherits()

Definition at line 430 of file qobject.h.

◆ QObjectList()

QObjectList
related

\macro Q_CLASSINFO(Name, Value)

This macro associates extra information to the class, which is available using QObject::metaObject(). The extra information takes the form of a Name string and a Value literal string.

Example:

class MyClass : public QObject
{
Q_CLASSINFO("Author", "Pierre Gendron")
Q_CLASSINFO("URL", "http://www.my-organization.qc.ca")
public:
...
};

Qt makes use of the macro in \l{Qt D-Bus} and \l{Qt Qml} modules. For instance, when defining \l{QML Object Types} in C++, you can designate a property as the default one:

See also
QMetaObject::classInfo()
{Using Qt D-Bus Adaptors}
{Defining QML Types from C++}

\macro Q_INTERFACES(...)

This macro tells Qt which interfaces the class implements. This is used when implementing plugins.

See also
Q_DECLARE_INTERFACE(), Q_PLUGIN_METADATA(), {How to Create Qt Plugins}

\macro Q_PROPERTY(...)

This macro is used for declaring properties in classes that inherit QObject. Properties behave like class data members, but they have additional features accessible through the \l {Meta-Object System}.

(READ getFunction [WRITE setFunction] |
MEMBER memberName [(READ getFunction | WRITE setFunction)])
[RESET resetFunction]
[NOTIFY notifySignal]
[REVISION int | REVISION(int[, int])]
[DESIGNABLE bool]
[SCRIPTABLE bool]
[STORED bool]
[USER bool]
[BINDABLE bindableProperty]
[CONSTANT]
[FINAL]
[REQUIRED])

The property name and type and the READ function are required. The type can be any type supported by QVariant, or it can be a user-defined type. The other items are optional, but a WRITE function is common. The attributes default to true except USER, which defaults to false.

For example:

For more details about how to use this macro, and a more detailed example of its use, see the discussion on \l {Qt's Property System}.

See also
{Qt's Property System}

\macro Q_ENUMS(...)

Deprecated

In new code, you should prefer the use of the Q_ENUM() macro, which makes the type available also to the meta type system. For instance, QMetaEnum::fromType() will not work with types declared with Q_ENUMS().

This macro registers one or several enum types to the meta-object system.

If you want to register an enum that is declared in another class, the enum must be fully qualified with the name of the class defining it. In addition, the class defining the enum has to inherit QObject as well as declare the enum using Q_ENUMS().

See also
{Qt's Property System}

\macro Q_FLAGS(...)

Deprecated

This macro registers one or several \l{QFlags}{flags types} with the meta-object system. It is typically used in a class definition to declare that values of a given enum can be used as flags and combined using the bitwise OR operator.

Note
This macro takes care of registering individual flag values with the meta-object system, so it is unnecessary to use Q_ENUMS() in addition to this macro.

In new code, you should prefer the use of the Q_FLAG() macro, which makes the type available also to the meta type system.

See also
{Qt's Property System}

\macro Q_ENUM(...)

Since
5.5

This macro registers an enum type with the meta-object system. It must be placed after the enum declaration in a class that has the Q_OBJECT, Q_GADGET or Q_GADGET_EXPORT macro. For namespaces use \l Q_ENUM_NS() instead.

For example:

class MyClass : public QObject
{
public:
MyClass(QObject *parent = nullptr);
enum Priority { High, Low, VeryHigh, VeryLow };
Q_ENUM(Priority)
void setPriority(Priority priority);
Priority priority() const;
};

Enumerations that are declared with Q_ENUM have their QMetaEnum registered in the enclosing QMetaObject. You can also use QMetaEnum::fromType() to get the QMetaEnum.

Registered enumerations are automatically registered also to the Qt meta type system, making them known to QMetaType without the need to use Q_DECLARE_METATYPE(). This will enable useful features; for example, if used in a QVariant, you can convert them to strings. Likewise, passing them to QDebug will print out their names.

Mind that the enum values are stored as signed int in the meta object system. Registering enumerations with values outside the range of values valid for int will lead to overflows and potentially undefined behavior when accessing them through the meta object system. QML, for example, does access registered enumerations through the meta object system.

See also
{Qt's Property System}

\macro Q_FLAG(...)

Since
5.5

This macro registers a single \l{QFlags}{flags type} with the meta-object system. It is typically used in a class definition to declare that values of a given enum can be used as flags and combined using the bitwise OR operator. For namespaces use \l Q_FLAG_NS() instead.

The macro must be placed after the enum declaration. The declaration of the flags type is done using the \l Q_DECLARE_FLAGS() macro.

For example, in QItemSelectionModel, the \l{QItemSelectionModel::SelectionFlags}{SelectionFlags} flag is declared in the following way:

{
public:
...
enum SelectionFlag {
NoUpdate = 0x0000,
Clear = 0x0001,
Select = 0x0002,
Deselect = 0x0004,
Toggle = 0x0008,
Current = 0x0010,
Rows = 0x0020,
Columns = 0x0040,
SelectCurrent = Select | Current,
ToggleCurrent = Toggle | Current,
ClearAndSelect = Clear | Select
};
Q_DECLARE_FLAGS(SelectionFlags, SelectionFlag)
Q_FLAG(SelectionFlags)
...
}
Note
The Q_FLAG macro takes care of registering individual flag values with the meta-object system, so it is unnecessary to use Q_ENUM() in addition to this macro.
See also
{Qt's Property System}

\macro Q_ENUM_NS(...)

Since
5.8

This macro registers an enum type with the meta-object system. It must be placed after the enum declaration in a namespace that has the Q_NAMESPACE macro. It is the same as \l Q_ENUM but in a namespace.

Enumerations that are declared with Q_ENUM_NS have their QMetaEnum registered in the enclosing QMetaObject. You can also use QMetaEnum::fromType() to get the QMetaEnum.

Registered enumerations are automatically registered also to the Qt meta type system, making them known to QMetaType without the need to use Q_DECLARE_METATYPE(). This will enable useful features; for example, if used in a QVariant, you can convert them to strings. Likewise, passing them to QDebug will print out their names.

Mind that the enum values are stored as signed int in the meta object system. Registering enumerations with values outside the range of values valid for int will lead to overflows and potentially undefined behavior when accessing them through the meta object system. QML, for example, does access registered enumerations through the meta object system.

See also
{Qt's Property System}

\macro Q_FLAG_NS(...)

Since
5.8

This macro registers a single \l{QFlags}{flags type} with the meta-object system. It is used in a namespace that has the Q_NAMESPACE macro, to declare that values of a given enum can be used as flags and combined using the bitwise OR operator. It is the same as \l Q_FLAG but in a namespace.

The macro must be placed after the enum declaration.

Note
The Q_FLAG_NS macro takes care of registering individual flag values with the meta-object system, so it is unnecessary to use Q_ENUM_NS() in addition to this macro.
See also
{Qt's Property System}
\macro Q_OBJECT
\relates QObject

The Q_OBJECT macro must appear in the private section of a class
definition that declares its own signals and slots or that uses
other services provided by Qt's meta-object system.

For example:

\snippet signalsandslots/signalsandslots.h 1
\codeline
\snippet signalsandslots/signalsandslots.h 2
\snippet signalsandslots/signalsandslots.h 3

\note This macro requires the class to be a subclass of QObject. Use
Q_GADGET or Q_GADGET_EXPORT instead of Q_OBJECT to enable the meta object system's support
for enums in a class that is not a QObject subclass.

! [qobject-macros-private-access-specifier]

Note
This macro expansion ends with a private: access specifier, which makes member declarations immediately after the macro private, too. If you want add public (or protected) members immediately after the macro, you need to use a public: (or protected:) access specifier. ! [qobject-macros-private-access-specifier]
\sa {Meta-Object System}, {Signals and Slots}, {Qt's Property System}

\macro Q_GADGET

The Q_GADGET macro is a lighter version of the Q_OBJECT macro for classes that do not inherit from QObject but still want to use some of the reflection capabilities offered by QMetaObject. Just like the Q_OBJECT macro, it must appear in the private section of a class definition.

Q_GADGETs can have Q_ENUM, Q_PROPERTY and Q_INVOKABLE, but they cannot have signals or slots.

Q_GADGET makes a class member, {staticMetaObject}, available. {staticMetaObject} is of type QMetaObject and provides access to the enums declared with Q_ENUM.

qobject-macros-private-access-specifier

See also
Q_GADGET_EXPORT

\macro Q_GADGET_EXPORT(EXPORT_MACRO)

Since
6.3

The Q_GADGET_EXPORT macro works exactly like the Q_GADGET macro. However, the {staticMetaObject} variable that is made available (see Q_GADGET) is declared with the supplied EXPORT_MACRO qualifier. This is useful if the object needs to be exported from a dynamic library, but the enclosing class as a whole should not be (e.g. because it consists of mostly inline functions).

For example:

class Point {
Q_GADGET_EXPORT(EXPORT_MACRO)
Q_PROPERTY(int x MEMBER x)
Q_PROPERTY(int y MEMBER y)
~~~
GLint GLint GLint GLint GLint x
[0]
GLint y
#define Q_PROPERTY(...)
#define Q_GADGET_EXPORT(...)
Definition parser.h:19

qobject-macros-private-access-specifier

See also
Q_GADGET, {Creating Shared Libraries}

\macro Q_NAMESPACE

Since
5.8

The Q_NAMESPACE macro can be used to add QMetaObject capabilities to a namespace.

Q_NAMESPACEs can have Q_CLASSINFO, Q_ENUM_NS, Q_FLAG_NS, but they cannot have Q_ENUM, Q_FLAG, Q_PROPERTY, Q_INVOKABLE, signals nor slots.

Q_NAMESPACE makes an external variable, {staticMetaObject}, available. {staticMetaObject} is of type QMetaObject and provides access to the enums declared with Q_ENUM_NS/Q_FLAG_NS.

For example:

namespace test {
...
#define Q_NAMESPACE
See also
Q_NAMESPACE_EXPORT

\macro Q_NAMESPACE_EXPORT(EXPORT_MACRO)

Since
5.14

The Q_NAMESPACE_EXPORT macro can be used to add QMetaObject capabilities to a namespace.

It works exactly like the Q_NAMESPACE macro. However, the external {staticMetaObject} variable that gets defined in the namespace is declared with the supplied EXPORT_MACRO qualifier. This is useful if the object needs to be exported from a dynamic library.

For example:

namespace test {
Q_NAMESPACE_EXPORT(EXPORT_MACRO)
...
#define Q_NAMESPACE_EXPORT(...)
See also
Q_NAMESPACE, {Creating Shared Libraries}

\macro Q_MOC_INCLUDE

Since
6.0

The Q_MOC_INCLUDE macro can be used within or outside a class, and tell the \l{moc}{Meta Object Compiler} to add an include.

// Put this in your code and the generated code will include this header.
Q_MOC_INCLUDE("myheader.h")
#define Q_MOC_INCLUDE(...)

This is useful if the types you use as properties or signal/slots arguments are forward declared.

\macro Q_SIGNALS

Use this macro to replace the signals keyword in class declarations, when you want to use Qt Signals and Slots with a \l{3rd Party Signals and Slots} {3rd party signal/slot mechanism}.

The macro is normally used when no_keywords is specified with the CONFIG variable in the .pro file, but it can be used even when no_keywords is not specified.

\macro Q_SIGNAL

This is an additional macro that allows you to mark a single function as a signal. It can be quite useful, especially when you use a 3rd-party source code parser which doesn't understand a signals or Q_SIGNALS groups.

Use this macro to replace the signals keyword in class declarations, when you want to use Qt Signals and Slots with a \l{3rd Party Signals and Slots} {3rd party signal/slot mechanism}.

The macro is normally used when no_keywords is specified with the CONFIG variable in the .pro file, but it can be used even when no_keywords is not specified.

\macro Q_SLOTS

Use this macro to replace the slots keyword in class declarations, when you want to use Qt Signals and Slots with a \l{3rd Party Signals and Slots} {3rd party signal/slot mechanism}.

The macro is normally used when no_keywords is specified with the CONFIG variable in the .pro file, but it can be used even when no_keywords is not specified.

\macro Q_SLOT

This is an additional macro that allows you to mark a single function as a slot. It can be quite useful, especially when you use a 3rd-party source code parser which doesn't understand a slots or Q_SLOTS groups.

Use this macro to replace the slots keyword in class declarations, when you want to use Qt Signals and Slots with a \l{3rd Party Signals and Slots} {3rd party signal/slot mechanism}.

The macro is normally used when no_keywords is specified with the CONFIG variable in the .pro file, but it can be used even when no_keywords is not specified.

\macro Q_EMIT

Use this macro to replace the emit keyword for emitting signals, when you want to use Qt Signals and Slots with a \l{3rd Party Signals and Slots} {3rd party signal/slot mechanism}.

The macro is normally used when no_keywords is specified with the CONFIG variable in the .pro file, but it can be used even when no_keywords is not specified.

\macro Q_INVOKABLE

Apply this macro to declarations of member functions to allow them to be invoked via the meta-object system. The macro is written before the return type, as shown in the following example:

class Window : public QWidget
{
public:
Window();
void normalMethod();
};

The invokableMethod() function is marked up using Q_INVOKABLE, causing it to be registered with the meta-object system and enabling it to be invoked using QMetaObject::invokeMethod(). Since normalMethod() function is not registered in this way, it cannot be invoked using QMetaObject::invokeMethod().

If an invokable member function returns a pointer to a QObject or a subclass of QObject and it is invoked from QML, special ownership rules apply. See \l{qtqml-cppintegration-data.html}{Data Type Conversion Between QML and C++} for more information.

\macro Q_REVISION

Apply this macro to declarations of member functions to tag them with a revision number in the meta-object system. The macro is written before the return type, as shown in the following example:

class Window : public QWidget
{
Q_PROPERTY(int newProperty READ newProperty REVISION(2, 1))
public:
Window();
int newProperty();
public slots:
void normalMethod();
Q_REVISION(2, 1) void newMethod();
};

This is useful when using the meta-object system to dynamically expose objects to another API, as you can match the version expected by multiple versions of the other API. Consider the following simplified example:

int expectedRevision = 0;
const QMetaObject *windowMetaObject = window.metaObject();
for (int i=0; i < windowMetaObject->methodCount(); i++)
if (windowMetaObject->method(i).revision() <= expectedRevision)
exposeMethod(windowMetaObject->method(i));
for (int i=0; i < windowMetaObject->propertyCount(); i++)
if (windowMetaObject->property(i).revision() <= expectedRevision)
exposeProperty(windowMetaObject->property(i));

Using the same Window class as the previous example, the newProperty and newMethod would only be exposed in this code when the expected version is {2.1} or greater.

Since all methods are considered to be in revision {0} if untagged, a tag of {Q_REVISION(0)} or {Q_REVISION(0, 0)} is invalid and ignored.

You can pass one or two integer parameters to {Q_REVISION}. If you pass one parameter, it denotes the minor version only. This means that the major version is unspecified. If you pass two, the first parameter is the major version and the second parameter is the minor version.

This tag is not used by the meta-object system itself. Currently this is only used by the QtQml module.

For a more generic string tag, see \l QMetaMethod::tag()

See also
QMetaMethod::revision()

\macro Q_SET_OBJECT_NAME(Object)

Since
5.0

This macro assigns Object the objectName "Object".

It doesn't matter whether Object is a pointer or not, the macro figures that out by itself.

See also
QObject::objectName()

\macro QT_NO_NARROWING_CONVERSIONS_IN_CONNECT

Since
5.8

Defining this macro will disable narrowing and floating-point-to-integral conversions between the arguments carried by a signal and the arguments accepted by a slot, when the signal and the slot are connected using the PMF-based syntax.

See also
QObject::connect

\macro QT_NO_CONTEXTLESS_CONNECT

Since
6.7

Defining this macro will disable the overload of QObject::connect() that connects a signal to a functor, without also specifying a QObject as a receiver/context object (that is, the 3-arguments overload of QObject::connect()).

Using the context-less overload is error prone, because it is easy to connect to functors that depend on some local state of the receiving end. If such local state gets destroyed, the connection does not get automatically disconnected.

Moreover, such connections are always direct connections, which may cause issues in multithreaded scenarios (for instance, if the signal is emitted from another thread).

See also
QObject::connect, Qt::ConnectionType

Synonym for QList<QObject *>.

Definition at line 45 of file qobject.h.

◆ QThreadData

friend class QThreadData
friend

Definition at line 384 of file qobject.h.

◆ QWidget

friend class QWidget
friend

Member Data Documentation

◆ d_ptr

Property Documentation

◆ objectName

QObject::objectName
readwrite

the name of this object

You can find an object by name (and type) using findChild(). You can find a set of objects with findChildren().

qDebug("MyClass::setPrecision(): (%s) invalid precision %f",
qPrintable(objectName()), newPrecision);

By default, this property contains an empty string.

See also
metaObject(), QMetaObject::className()

Definition at line 106 of file qobject.h.

Referenced by QLayout::QLayout(), QLayout::activate(), QDockAreaLayout::addDockWidget(), QFileSystemWatcher::addPaths(), QPollingFileSystemWatcherEngine::addPaths(), QGridLayout::addWidget(), QQuickContext2DImageTexture::beginPainting(), QCoreApplicationPrivate::checkReceiverThread(), QLayoutPrivate::checkWidget(), QQuickFlickable::componentComplete(), QCtfLibImpl::doTracepoint(), QWindows11Style::drawPrimitive(), err_info_about_objects(), QQuickFlickable::filterPointerEvent(), QQuickWheelHandler::handleEventPoint(), QQuickPointerHandler::handlePointerEvent(), QOpenGLShaderProgram::link(), msgConnect(), operator<<(), operator<<(), quick_test_main_with_setup(), QQuickGridLayoutBase::rearrange(), QDBusAdaptorConnector::relaySlot(), QDockAreaLayout::restoreDockWidget(), QDockAreaLayoutInfo::restoreState(), QToolBarAreaLayout::saveState(), QQuickContext2DTexture::setCanvasWindow(), QQuickFolderBreadcrumbBarPrivate::setDialogFolder(), QLCDNumber::setDigitCount(), QWidget::setFocusProxy(), QGraphicsWidget::setLayout(), QWidget::setLayout(), QWidget::setParent(), QXkbCommon::setXkbContext(), QDockAreaLayout::splitDockWidget(), QQuickTapHandler::timerEvent(), QQuickWheelHandler::timerEvent(), QQuickMaterialRipple::updatePaintNode(), QQuickPointerHandler::wantsEventPoint(), QQuickTapHandler::wantsEventPoint(), and QQuickPointerDeviceHandler::wantsPointerEvent().


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