06-19-2013 11:41 AM
I want to have a container containing images in qml but the number of images is variable.
What would I need to do to acheive this? Is it possible to do or do I need to know the exact amount of all elements before compiling the app?
Thanks for any advice - still learning.
Solved! Go to Solution.
06-19-2013 11:51 AM
06-19-2013 12:28 PM
Thanks for both replies, I actually spent the last 2 days trying to accomplish what im trying with a listview but because the container I am adding the listview to is also contained within a list (listitemcomponent) I get problems (missing/out of place rows) so now I am going for the less pretty way which is a scrollview of images. It's not nearly as neat as a litview though.
I will look at createObject and using C++ to create variable amount of elements but if anybody has the time to have a look at my first post on here which was earlier today then maybe I could revert back to ListViews within a ListView with a little expert knowledge.
06-19-2013 01:14 PM
I am trying to use createObject and nearly have it working but I need to be able to pass a string to the new qml page for it to work.
how do I initialise an object using createObject with a string?
06-19-2013 05:21 PM
don't know if I understood it right
if you create objects and want to send string to them,
then you can have a property inside your component,
initialize with myNewComponent.theString = "abc"
and inside the component have your code reacting on signal that theString changed
06-19-2013 05:51 PM
Thanks for your reply Ekke,
I was doing that but I thought it wasn't working up until recently, I'm starting to understand more now about qml, thanks for your help .
I know the answer to this question now and have implemented createObject it for myself.
06-20-2013 12:23 AM
great to hear
creating objects dynamically is very powerful and fast
(you can download Conference2Go EclipseCon from BB World - it's a free conference app for Eclipse dev conferences, go to sessions or tracks and action 'Overview': the complete Page is created dynamically into a zoomable ScrollView.
each Sessions is a Container created dynmically. each Container has properties like sessionId to be 'unique'. the height depends on duration, the X-Position on Room, the Y-position on starting time.
perhaps gives you an idea)