aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmltc/qmltccompilerpieces.h
diff options
context:
space:
mode:
authorAndrei Golubev <andrei.golubev@qt.io>2022-07-26 14:32:23 +0200
committerAndrei Golubev <andrei.golubev@qt.io>2022-07-29 15:23:07 +0200
commitfe11a7dcc71adf017553d430a96a77020ca4c4d8 (patch)
tree055f7b280fb2f9652c5dba2484af65acc481cade /tools/qmltc/qmltccompilerpieces.h
parentddd50b9f2eb211f6a8d58bf3a2aac345c61a4ab0 (diff)
qmltc: Make explicit component ids accessible during object creation
Explicit components could be accessed by id like regular objects. Make this work in qmltc by revisiting the object creation procedure - store explicit components along with pure QML types in QQmltcObjectCreationBase: xxxxxxxx x'x'x'x'x'|yyyyy... ^ ^ ^ pure explicit types from base class types components As a drive by, fix unset required property in one test file and add a bunch of other test files to the initTestCase() check Change-Id: Ibdaa430d692c81101853f51dae1da462a57a9980 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 12ce72825995529e203c98adbe636a01b995ff13)
Diffstat (limited to 'tools/qmltc/qmltccompilerpieces.h')
-rw-r--r--tools/qmltc/qmltccompilerpieces.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/qmltc/qmltccompilerpieces.h b/tools/qmltc/qmltccompilerpieces.h
index 140a30745d..37eb82d577 100644
--- a/tools/qmltc/qmltccompilerpieces.h
+++ b/tools/qmltc/qmltccompilerpieces.h
@@ -618,7 +618,8 @@ inline QString QmltcCodeGenerator::generate_typeCount(Predicate p) const
// add this document's type counts minus document root
Q_ASSERT(visitor->pureQmlTypes().size() > 0);
- components << QString::number(visitor->pureQmlTypes().size() - 1);
+ Q_ASSERT(visitor->typeCount() >= visitor->pureQmlTypes().size());
+ components << QString::number(visitor->typeCount() - 1);
// traverse types with QML base classes
for (const QQmlJSScope::ConstPtr &t : typesWithBaseTypeCount) {