11-05-2012 02:26 PM
Is there an example on how to create a custom drawn control? I could not find anything.
The only thing I could find was on creating custom QML componenets wich are really just composit controls with no custom drawing. that's located here
What we need is a custom drawn control. I could not find any property of the "CustomControl" class that would allow me to draw directly on the surface of the control.
Normally - one can draw using various drawing functions, put pieces of images, fill areas etc...
Is this possible and if so - does anyone have more information?
Thanks.
Solved! Go to Solution.
11-06-2012 11:12 AM
I Looked everywhere for any kind of drawing functions that allow me to draw onto the CustoControl surface, but could not find anything.
Can anyone confirm if this is possible at all with casscades? It would definitely be a show stopper here.
11-06-2012 11:24 AM
Isn't this what you want?
11-06-2012 12:51 PM
No - that's not it. This is still using just ImageViews with rotations to create a custom control.
Is there a way to draw onto the control using a set of drawing functions to draw lines circles, then fill the etc?
11-07-2012 01:57 PM
It seems that there is a way to do this after all. It is a bit convoluted and not documented well, but it can be done.
In short - one can use QImage to paint anything using the QPainter and then use the QImage to create the Image that can be used in ImageView for example.
QImage is not on the list of classes in cascades Qt section, but I did find the following post that started me in the right direction.
You cannot use the above sample as is, however. The sample code has been removed from the GitHub. The reason is mostl ikely the PixelBufferData class which has been removed in the latest release.
You can use the new ImageData class though. I have tested this and could do anything I wanted using QPainter.
An example on how to get the ImageData from QImage is within the help for the ImageData class found here
Having the ability to use QImage and other Qt classes is GREAT - specially for people like me who are coming from the Qt world. I think cascades support for Qt should be as broad as possible. I would have prefered QtCreator instead of eclipse as the first class ide for cascades, but that's a topic for another day...
I hope this helps someone solve the similar issue.
If this post helped you - please like it. If it answered your question - please accept as a solution - Thanks.