[Interest] Issues with QML registration of C++ types (only in Visual Studio Solution)
Schimkowitsch Robert
Robert.Schimkowitsch at andritz.com
Fri Mar 21 14:22:13 CET 2025
Seems to be a bug in Qt Visual Studio Tools – works when I revert to an older version.
I’ll report it.
Kind regards
Robert
From: Interest <interest-bounces at qt-project.org> On Behalf Of Schimkowitsch Robert
Sent: Friday, 21 March 2025 13:52
To: interest at qt-project.org
Subject: [Interest] Issues with QML registration of C++ types (only in Visual Studio Solution)
CAUTION: External email. Do not click on links or open attachments unless you know the sender and that the content is safe.
My project contains QML files that will refer to C++ types by name. The QML module and type are registered on startup, the QML file does the right import(s), then I can use C++ classes (QObjects with QML_ELEMENT) as typed entities in QML.
Everything works as expected….when using cmake.
The same project can be built and run using Visual Studio Solution and msbuild.
There, the exact same code fails to register the C++ types properly.
Inside QQmlPrivate::qmlregister, I get into a ‘warning’ branch for all types:
qWarning().nospace() << "Missing QML.Element class info for "
<< type.classInfoMetaObject->className();
I get there because “metaObject->classInfoCount() + offset” returns -1. However, I can verify that I register the C++ class as metatype before I get there (qRegisterMetaType gets called, and a valid id is returned)
Why should classInfo be invalid although the type is registered?
How can I find out what’s wrong (and how to fix it)?
Kind regards
Robert
________________________________
This message and any attachments are solely for the use of the intended recipients. They may contain privileged and/or confidential information or other information protected from disclosure. If you are not an intended recipient, you are hereby notified that you received this email in error and that any review, dissemination, distribution or copying of this email and any attachment is strictly prohibited. If you have received this email in error, please contact the sender and delete the message and any attachment from your system.
ANDRITZ HYDRO GmbH
Rechtsform/ Legal form: Gesellschaft mit beschränkter Haftung / Corporation
Firmensitz/ Registered seat: Wien
Firmenbuchgericht/ Court of registry: Handelsgericht Wien
Firmenbuchnummer/ Company registration: FN 61833 g
DVR: 0605077
UID-Nr.: ATU14756806
Thank You
________________________________
________________________________
This message and any attachments are solely for the use of the intended recipients. They may contain privileged and/or confidential information or other information protected from disclosure. If you are not an intended recipient, you are hereby notified that you received this email in error and that any review, dissemination, distribution or copying of this email and any attachment is strictly prohibited. If you have received this email in error, please contact the sender and delete the message and any attachment from your system.
ANDRITZ HYDRO GmbH
Rechtsform/ Legal form: Gesellschaft mit beschränkter Haftung / Corporation
Firmensitz/ Registered seat: Wien
Firmenbuchgericht/ Court of registry: Handelsgericht Wien
Firmenbuchnummer/ Company registration: FN 61833 g
DVR: 0605077
UID-Nr.: ATU14756806
Thank You
________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20250321/79d11c8f/attachment.htm>
More information about the Interest
mailing list