Scroll through listItem
-
I want to scroll to next item in list on the button click event and not through navigation keys.
In short, following functionality must processed:
focus moves to next item in the list (onDownButtonPressed)
focus moves to previous item in the list (onUpButtonPressed)
If page support max five entries, how to update the list with six item and 1st element in the list must be removed
please do share your suggestions.
-
Hi,
This is basic, Generate two slots (or the automatic slot from Designer) and then use the currentRow() + 1 to set the currentRow ;-)
So something like this:
@
// Will only do down, up is your thing to do ;-)
void MainWindow::on_downButtonPressed(void)
{
// Check if you already selected the last item
if (ui->myList.count() > ui->myList.currentRow())
{
ui->myList.setCurrentRow(ui->myList.currentRow() + 1);
}
}
@ -
Thanks Jeroentje@home..
Is it possible to do within QMLs without using C++ code.say,
I have 2 QMLs, SettingsList.qml (displays list data in the parent region) and a Navigation.qml (containing navigation pad which mouse area defined in it)
Now using these two QMLs in main.qml as:
@import QtQuick 2.0
Rectangle{
Width:200
Height:380
Loader{
id:qmlLoader
Width:200
height:280
source:"SettingsList.qml"
}//Navigation defines upKey, downKey, rightKey, leftKey and selectKey
Navigation{
id:navigate
x:300
width:200
height:75
}
}@Whenever downKey is Clicked, then next item must be highlighted in the list view and also it must be set to current list item.
How can i achieve above functionality.