blob: fd0b43312e5e60125f6bc5c2ac39ea64205fb4f2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
|
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
set(cpp_sources
ambiguous.h
birthdayparty.cpp birthdayparty.h
cppbaseclass.h
druggeljug.h
dummyobjekt.h
dynamicmeta.h
enumproblems.h
enumProperty.h
gadgetwithenum.h
invisible.h
multiforeign.h
objectwithmethod.h
person.cpp person.h
sequenceToIterable.h
sequencetypeexample.cpp sequencetypeexample.h
state.h
theme.cpp theme.h
timelinetheme.cpp timelinetheme.h
variantMapLookup.h
variantreturn.h
weathermoduleurl.h
wrapwithvariant.h
withlength.h
)
set(qml_files
AccessModelMethodsFromOutside.qml
ArraySequenceLengthInterop.qml
B.qml
BadType.qml
BaseMember.qml
BindingExpression.qml
CxxTypeFromDir.qml
CxxTypeFromImplicit.qml
Cycle1.qml
Cycle2.qml
Cycle3.qml
Dummy.qml
Dummy2.qml
Enums.qml
Foozle.qml
Loopy.qml
OkType.qml
Panel.qml
Planner.qml
ProgressBar/Keyframe.qml
ProgressBar/KeyframeGroup.qml
ProgressBar/ProgressBar.ui.qml
ProgressBar/Root.qml
ProgressBar/Timeline.qml
ProgressBar/TimelineAnimation.qml
RootWithoutId.qml
SelectionRectangle.qml
Test.qml
TestCase.qml
WindowDerived.qml
aliasLookup.qml
ambiguous1/Ambiguous.qml
ambiguous2/Ambiguous.qml
ambiguousAs.qml
ambiguousSignals.qml
anchorsFill.qml
argumentConversion.qml
array.qml
arrayCtor.qml
asCast.qml
attachedBaseEnum.qml
badSequence.qml
basicBlocksWithBackJump.qml
basicBlocksWithBackJump_infinite.qml
basicDTZ.qml
bindToValueType.qml
blockComments.qml
boolCoercions.qml
boolPointerMerge.qml
boundComponents.qml
callContextPropertyLookupResult.qml
callWithSpread.qml
childobject.qml
colorAsVariant.qml
colorString.qml
componentReturnType.qml
compositeTypeMethod.qml
compositesingleton.qml
consoleObject.qml
construct.qml
contextParam.qml
conversionDecrement.qml
conversionInDeadCode.qml
conversions.qml
conversions2.qml
convertToOriginalReadAcumulatorForUnaryOperators.qml
curlygrouped.qml
cycleHead.qml
dateConstruction.qml
dateConversions.qml
deadShoeSize.qml
deadStoreLoop.qml
dialog.qml
dialogButtonBox.qml
dynamicscene.qml
enumConversion.qml
enumFromBadSingleton.qml
enumInvalid.qml
enumLookup.qml
enumMarkedAsFlag.qml
enumProblems.qml
enumScope.qml
enumsInOtherObject.qml
enumsUser.qml
equalityQObjects.qml
equalityQUrl.qml
equalityTestsWithNullOrUndefined.qml
equalityVarAndNonStorable.qml
equalsUndefined.qml
exceptionFromInner.qml
excessiveParameters.qml
extendedTypes.qml
failures.qml
fallbacklookups.qml
fileDialog.qml
flagEnum.qml
fromBoolValue.qml
funcWithParams.qml
functionLookup.qml
functionReturningVoid.qml
functionTakingVar.qml
globals.qml
hidden/Main.qml
hidden/Style.qml
idAccess.qml
immediateQuit.qml
imports/QmlBench/Globals.qml
importsFromImportPath.qml
infinities.qml
infinitiesToInt.qml
intEnumCompare.qml
intOverflow.qml
intToEnum.qml
interactive.qml
interceptor.qml
invisibleBase.qml
invisibleListElementType.qml
invisibleTypes.qml
isnan.qml
iteration.qml
javaScriptArgument.qml
jsArrayMethods.qml
jsArrayMethodsUntyped.qml
jsArrayMethodsWithParams.qml
jsArrayMethodsWithParamsUntyped.qml
jsMathObject.qml
jsimport.qml
jsmoduleimport.qml
layouts.qml
letAndConst.qml
library.js
listAsArgument.qml
listConversion.qml
listIndices.qml
listOfInvisible.qml
listPropertyAsModel.qml
listlength.qml
math.qml
mathMinMax.qml
mathOperations.qml
mergedObjectRead.qml
mergedObjectWrite.qml
methodOnListLookup.qml
methods.qml
modulePrefix.qml
moveRegVoid.qml
multiforeign.qml
multipleCtors.qml
namespaceWithEnum.qml
noBindingLoop.qml
noQQmlData.qml
nonNotifyable.qml
noscope.qml
notEqualsInt.qml
notNotString.qml
nullAccess.qml
nullAccessInsideSignalHandler.qml
nullComparison.qml
numbersInJsPrimitive.qml
objectInVar.qml
objectLookupOnListElement.qml
objectWithStringListMethod.qml
outOfBounds.qml
overriddenMember.qml
ownProperty.qml
page.qml
parentProp.qml
popContextAfterRet.qml
prefixedMetaType.qml
pressAndHoldButton.qml
readEnumFromInstance.qml
registerPropagation.qml
registerelimination.qml
revisions.qml
scopeVsObject.qml
script.js
script.mjs
sequenceToIterable.qml
setLookupConversion.qml
shadowedMethod.qml
shared/Slider.qml
shifts.qml
signal.qml
signalHandler.qml
signalIndexMismatch.qml
signalsWithLists.qml
signatureIgnored.qml
specificParent.qml
storeElementSideEffects.qml
stringArg.qml
stringLength.qml
stringToByteArray.qml
structuredValueType.qml
testlogger.js
text.qml
themerbad.qml
themergood.qml
thisObject.qml
throwObjectName.qml
toString.qml
topLevelComponent.qml
translation.qml
trivialSignalHandler.qml
typePropagationLoop.qml
typePropertyClash.qml
typedArray.qml
undefinedResets.qml
undefinedToDouble.qml
unknownAttached.qml
unknownParameter.qml
unstoredUndefined.qml
unusedAttached.qml
urlString.qml
usingCxxTypesFromFileImports.qml
valueTypeCast.qml
valueTypeCopy.qml
valueTypeDefault.qml
valueTypeLists.qml
valueTypeProperty.qml
valueTypeReference.qml
variantMap.qml
variantMapLookup.qml
variantReturn.qml
variantlist.qml
versionmismatch.qml
voidConversion.qml
voidfunction.qml
writeback.qml
dummy_imports.qml
)
set(resource_files
ProgressBar/built-with-Qt_Large.png
imports/QmlBench/qmldir
)
set_source_files_properties("shared/Slider.qml"
PROPERTIES QT_RESOURCE_ALIAS "Slider.qml"
)
set_source_files_properties("hidden/Style.qml"
PROPERTIES QT_QML_SINGLETON_TYPE TRUE)
qt_add_library(codegen_test_module STATIC)
qt_autogen_tools_initial_setup(codegen_test_module)
set_target_properties(codegen_test_module PROPERTIES
# We really want qmlcachegen here, even if qmlsc is available
QT_QMLCACHEGEN_EXECUTABLE qmlcachegen
QT_QMLCACHEGEN_ARGUMENTS --validate-basic-blocks
)
qt_policy(SET QTP0001 NEW)
target_compile_definitions(codegen_test_module PUBLIC
-DGENERATED_CPP_FOLDER="${CMAKE_CURRENT_BINARY_DIR}/.rcc/qmlcache"
)
qt6_add_qml_module(codegen_test_module
VERSION 1.5
URI TestTypes
IMPORT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/imports/"
DEPENDENCIES
QtQuick
QtQuick.Templates
QtQuick.Shapes
SOURCES
${cpp_sources}
QML_FILES
${qml_files}
RESOURCES
${resource_files}
OUTPUT_DIRECTORY TestTypes # Make sure tst_qmlcachegen doesn't see our output
)
add_dependencies(codegen_test_module Qt::Quick Qt::QuickTemplates2 Qt::QuickShapesPrivate)
qt_autogen_tools_initial_setup(codegen_test_moduleplugin)
qt_add_library(codegen_test_module_verify STATIC)
qt_autogen_tools_initial_setup(codegen_test_module_verify)
set_target_properties(codegen_test_module_verify PROPERTIES
# We really want qmlcachegen here, even if qmlsc is available
QT_QMLCACHEGEN_EXECUTABLE qmlcachegen
QT_QMLCACHEGEN_ARGUMENTS --validate-basic-blocks
)
qt6_add_qml_module(codegen_test_module_verify
VERSION 1.5
URI TestTypes
IMPORT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/imports/"
DEPENDENCIES
QtQuick
QtQuick.Templates
QtQuick.Shapes
SOURCES
${cpp_sources}
QML_FILES
${qml_files}
RESOURCES
${resource_files}
OUTPUT_DIRECTORY verify/TestTypes # Make sure tst_qmlcachegen doesn't see our output
TARGET_PATH verify/TestTypes # Different target path to avoid resource file name clashes
)
add_dependencies(codegen_test_module_verify Qt::Quick Qt::QuickTemplates2 Qt::QuickShapesPrivate)
qt_autogen_tools_initial_setup(codegen_test_module_verifyplugin)
qt_internal_add_test(tst_qmlcppcodegen_verify
SOURCES
tst_qmlcppcodegen_verify.cpp
)
add_dependencies(tst_qmlcppcodegen_verify codegen_test_module codegen_test_module_verify)
set(a_files "")
set(b_files "")
foreach(qml_file IN LISTS qml_files)
string(REGEX REPLACE "\\.(js|mjs|qml)$" "_\\1" compiled_file ${qml_file})
string(REGEX REPLACE "[$#?]+" "_" compiled_file ${compiled_file})
list(APPEND
a_files
"${CMAKE_CURRENT_BINARY_DIR}/.rcc/qmlcache/codegen_test_module_${compiled_file}.cpp")
list(APPEND
b_files
"${CMAKE_CURRENT_BINARY_DIR}/.rcc/qmlcache/codegen_test_module_verify_${compiled_file}.cpp")
endforeach()
qt_add_resources(tst_qmlcppcodegen_verify "a"
PREFIX
"/a"
FILES
${a_files}
BASE
"${CMAKE_CURRENT_BINARY_DIR}/.rcc/qmlcache/"
)
qt_add_resources(tst_qmlcppcodegen_verify "b"
PREFIX
"/b"
FILES
${b_files}
BASE
"${CMAKE_CURRENT_BINARY_DIR}/.rcc/qmlcache/"
)
|