Construct dynamically a QML element
Hi everyone,
I'm wondering how I can define a new QML element that need some "treatments" to be constructed.
For example I want draw a compass, so it's not a basic Rectangle.. Obviously, I'm not going to define each line manually, I need kind of a loop which deals with an incremented angle value and so on...
What would be the syntax ? Thank you for your help :) I just begin QML language so I have none experience...
http://www.fondation-lamap.org/sites...seq4sea8_3.gif
Bye ;)
Re: Construct dynamically a QML element
To be honest this kind of compass should be drawn in QtQuick using an image. I'm not saying you can't do that in pure QML but I think it's not worth the effort.
Re: Construct dynamically a QML element
Thank you for your answer :)
After some search i've seen that it's indeed not appropriate in pure classic QML. But what about redefining a custom QQuickItem, i've seen that i can use pure OpenGL code in it. At the end I would obtain a QML component ready to use.
Is that a good approach?
Re: Construct dynamically a QML element
Quote:
Originally Posted by
keyga
After some search i've seen that it's indeed not appropriate in pure classic QML. But what about redefining a custom QQuickItem, i've seen that i can use pure OpenGL code in it. At the end I would obtain a QML component ready to use.
Is that a good approach?
As I said, it is not impossible to obtain but it is much more work than drawing such compass in a graphics editor and rendering it as an image.