11-25-2012 04:27 PM
Hi,
I'm new to Cascaded with previous experience in MeeGo Qt/QML development. Currently I'm trying to port few apps to BlackBerry 10 platform with is great, but having lots of difficulties due to the fact that Cascades uses modified version of QML. Would it be possible to keep this thread for all of MeeGo developers who struggle as me with simple things in Cascades? Thank you in advance.
My first question is very simple, how do I pragmatically scroll to an item in ListView? I did read the documentation, and also used google, but got no answer. I know there is a method scrollToItem, but I cannot figure it out what should I pass to indexPath argument. Tried using simple index (int value that specifies the index of the item in the list) but without any success. Here is the code that misses arguments for scrollToItem method:
import bb.cascades 1.0
Container {
layout: StackLayout {}
ListView {
id: valueSelector;
verticalAlignment: VerticalAlignment.Fill;
horizontalAlignment: HorizontalAlignment.Fill;
dataModel: ArrayDataModel {
id: arrayModel;
}
}
onCreationCompleted: {
for (var i=0; i<100; i++)
arrayModel.append (i);
valueSelector.scrollToItem ();
}
}Thank you in advance for your help
12-18-2012 02:52 AM
let me connect this thread :
this could be adapted w/ meego components , what do you think ?
12-18-2012 04:34 AM
rzr, thank you for your reply. I already used Symbian components on PlayBook and they work perfectly (at least those I used). My problem was Cascades that are not very similar to QML/QML components at all, despite the fact that both use the same engine. On MeeGo/Symbian we use QML components that are designed for corresponding platform and standard QML objects like ListView. What would be beneficial for MeeGo/Symbian Qt developers is to have some sort of mapping scheme from "standard" QML elements to Cascades.
I know that one can use standard Qt/QML on BB10 but then we loose the beauty of the platform and its capabilities, since QtGui (that is used by standard QML viewer) and Cascades cannot be mixed in one project ![]()
12-18-2012 12:45 PM
12-19-2012 06:27 AM
afaik indexpath is just array (variant list)
you can try
ScrollToItem([0, n], ScrollAnimation.Default); // for scroll to item header 1 and item index nth
12-19-2012 07:27 AM
we use <your model name here>.scrollToItem(<your index path here>)
12-19-2012 08:11 AM
Model? Oh, I'll try this method.
Thank you all for your helpful replies
12-19-2012 08:16 AM
Sorry, I wrote model but meant list view
12-19-2012 08:24 AM
I see
12-20-2012 07:22 PM
any feedback on :
http://zwong.de/2012/06/using-meego-qt-components-
As suggested :