I am currently dynamically creating a Scale object with Qt.createQmlObject.
Is it possible to do with createObject?
If so, what URL would I give to get the component?
I am currently dynamically creating a Scale object with Qt.createQmlObject.
Is it possible to do with createObject?
If so, what URL would I give to get the component?
Component.createObject() doesn't take an URL, did you mean Qt.createComponent()?
If so, the URL is the location of the QML file that defines the component.
Cheers,
_
Yes, sorry, I meant Qt.createComponent.
The problem is that "Scale" is a built-in element. I don't see a QML file.
How does one dynamically instantiate a built-in element?
Instead of creating the Component from a file, you create it directly in code.
Cheers,
_
And here was my complete lack of understanding.
Qt Code:
var scaleTransform = Scale scaleTransform.xScale = 2 scaleTransform.yScale = 2To copy to clipboard, switch view to plain text mode
So much simpler than I thought. I'm getting this, slowly.
Thanks!
Added after 1 12 minutes:
So, that didn't work.
How does one create a native QML object (I don't have a QML file for it) dynamically without using createQmlObject?
Last edited by Mookie; 28th March 2016 at 16:26.
Bookmarks