There is a diagram which I have drawn with QPainter.
How do I diaplay it in QML's Rectangle?
That diagram will get updated on the runtime.
There is a diagram which I have drawn with QPainter.
How do I diaplay it in QML's Rectangle?
That diagram will get updated on the runtime.
You have two options:
1) Draw into an image/pixmap and use a QtQuick Image element to display it. You will need your own QDeclarativeImageProvider subclass for that.
2) Create your own QDeclarativeItem subclass, implement paint() and register your class as a new element.
Cheers,
_
TheIndependentAquarius (19th October 2013)
Thanks for the helpful post.
Side note, don't forget to call setFlag(ItemHasNoContents, false); in order to show an item's content.
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
Bookmarks