QML String List
-
I need to implement an imaegViever, there will be like 100 images and with next and previous buttons the image that is on the display changes. I thought some ways to do it but they don't look possible with QML:
- Having an integer counter that holds the current chosen image index value and then by using something like this:
image.source=Qt.binding("Images/userGuide" + QString::number(counter);)
However it seems like in QML integer cannot be converted to string.
- Using an array of strings that holds the sources of all images. And then comparing the index with counter, using the string value at that index:
image.source= ImageList[counter];
But, QML lists doesn't support basic types such as strings.. So that way also did not work.
Then the only option that is left for me is to use switch case but I really don't want to go with that way. What kind of path should I follow for this issue? -
@Gunkut said in QML String List:
QString::number(counter)
String(counter)
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String
-
@Gunkut said in QML String List:
QString::number(counter)
String(counter)
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String