summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qobject.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2024-11-12 09:15:26 -0800
committerThiago Macieira <thiago.macieira@intel.com>2024-11-14 16:55:44 -0800
commit43a27888b47e1199c9f12a1c2ce7ab9b073e8a46 (patch)
treeb34fef674088064986a8b24aa0417075af134336 /src/corelib/kernel/qobject.cpp
parentf2b5c779cdee1afabca300b04187955c0009fe1c (diff)
QAdoptedThread: bypass signal notification on an un-observable QObject
We've just created the object (we're still inside the constructor). No one can have connected to the signals yet. Change-Id: I1f499b3fc6d2089665bdfffda709e1efaa2c4865 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'src/corelib/kernel/qobject.cpp')
-rw-r--r--src/corelib/kernel/qobject.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 36505fae62f..42d2abbb982 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -1289,6 +1289,17 @@ QString QObject::objectName() const
}
/*!
+ \internal
+ Only use if you know nothing can be bound yet. Usually used for
+ internal objects that do get names.
+*/
+void QObjectPrivate::setObjectNameWithoutBindings(const QString &name)
+{
+ ensureExtraData();
+ extraData->objectName.setValueBypassingBindings(name);
+}
+
+/*!
\fn void QObject::setObjectName(const QString &name)
Sets the object's name to \a name.
*/