Home > Mobile >  How to use the name access to import the c + + object in the QML
How to use the name access to import the c + + object in the QML

Time:10-06

C + + objects embedded in QML is very simple, use setContextProperty () function, in the QML file, if I will store these c + + the name of the object as an array, and then according to the need, take out an element is a string name of a c + + objects, then according to the string name to access the object interface?

CodePudding user response:

I check the Internet for a long time, may use the eval function, can put the name of c + + object into the object

CodePudding user response:

Not registered type can also be used?
  •  Tags:  
  • Qt
  • Related