05-10-2012 09:35 AM
Just joking about the alcoholism.... A couple questions regarding Cascades....
Is there a way to have a custom cascades view object where I use painting techniquest to render my view i.e. stroke, fill, drawPath etc..? So far it seems like all you can do is create a composite component of other prebuilt Cascades components.
Secondly is there away to have a view and all of its subviews render to a single in memory image? What i'd love to do is take some ui I created in QML and have some C++ code turn it into a texture for use with opengl so I can add some of my own 3d effects ala Core Animation.
All replies greatly appreciated.
05-10-2012 09:40 AM
05-10-2012 09:44 AM
From my research, it seems as if you don't really use most of Qt's UI classes, you use the ones in the bb:cascades namespace. The one notable exception would be the WebView. I guess you could always use ForeignWindow to create an OpenGL ES based window to draw contents into it that way. Not as easy as an actually 2D Graphics API/Facade.
05-10-2012 09:46 AM
05-10-2012 02:02 PM
Regarding your second question...
It's possible you could make your cascades window invisible by either changing transparency or just moving it behind some other window. There is a screen API to read-back the data from a window, so long as you have a handle to it:
Whether you can get a handle to the main cascades window or not, I am not sure. I would hope so ![]()
Cheers,
Sean
05-12-2012 08:32 AM
Interesting topics indeed. BTW Qt 5 comes with a 3D package included.
05-12-2012 08:42 AM
05-15-2012 10:27 AM
Getting back to the original question...
Check out the sample helloforeignwindow. This demonstrates using a foreign window to do your drawing. To share your drawing, your different views can have access to the same pixmaps or other objects.
Does this answer your question?
05-15-2012 11:16 AM
Hi,
At this point you don't have anything equivalent to a Canvas in Cascades. This means you can't perform operations like drawPath etc... Also, you can't use Qt UI and Cascades at the same time. If you want to draw an object, you could create your own custom Cascades component and scale/animate that. Alternatively, the WebView/Canvas will support drawing on top of Web Content - but that probably doesn't solve your problem. Of course, as was mentioned before, you can draw in the OpenGL window (though it looks like that wasn't your question either).
06-07-2012 10:24 AM
I agree with you. The presence of a custom painter library on view/scene easy framework in cascades is an important thing for many developers. QtGui have classes like QGraphicsView, QGraphicsScene and QGraphicsItem that make easier our life. OpenGl is like kill flyers with gunshots!!
A canvas and QPainter mechanism is required on Cascades, please.