Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.5.1
-
None
-
dw@dw-Parallels-ARM-Virtual-Machine:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy
dw@dw-Parallels-ARM-Virtual-Machine:~$ uname -r
5.19.0-42-generic
Description
maby it's the function which names "qt_qFindChild_helper" changing causes that you can't find Text(using in QML) which is as the child of Node(QtQuick3D qml type) by the fucntion naming findChild(using in cpp)
Qt5.15.9
QObject *qt_qFindChild_helper(const QObject *parent, const QString &name, const QMetaObject &mo, Qt::FindChildOptions options) { if (!parent) return nullptr; const QObjectList &children = parent->children(); QObject *obj; int i; for (i = 0; i < children.size(); ++i) { obj = children.at(i); if (mo.cast(obj) && (name.isNull() || obj->objectName() == name)) return obj; } if (options & Qt::FindChildrenRecursively) { for (i = 0; i < children.size(); ++i) { obj = qt_qFindChild_helper(children.at(i), name, mo, options); if (obj) return obj; } } return nullptr; }
qt6.5.1
QObject *qt_qFindChild_helper(const QObject *parent, const QString &name, const QMetaObject &mo, Qt::FindChildOptions options) { Q_ASSERT(parent); for (QObject *obj : parent->children()) { if (mo.cast(obj) && (name.isNull() || obj->objectName() == name)) return obj; } if (options & Qt::FindChildrenRecursively) { for (QObject *child : parent->children()) { if (QObject *obj = qt_qFindChild_helper(child, name, mo, options)) return obj; } } return nullptr; }
if you want to access qml Text from cpp ,follow the example below:
https://github.com/liurunjieDW/qt6_issue.git
you can't find the Text in qt6.5.1,but you can find the Text in qt5.15.9