PDA

View Full Version : How to add multiple strings to a spinner



athulms
28th July 2011, 08:36
I use 2 spinner to select the theme and categories of a game.
I have 6themes(strings) for first spinner and 60categories(strings) for the second spinner.
It worked but the problem is i cant give more than two string to a spinner.
Is it possible to add more strings??
I have used the following code:

import Qt 4.7
import "content"

Rectangle {

id:myrect

width:330; height:125


Row {
y: 0; x:0; spacing: 20


Image {
id: image1
source: "content/spinner-bgc.png"

}

}


Row {
y: 0; x: 7; spacing: 10

Spinner {
id: spinner1
width:155; height: 125
focus: true
model: 6
itemHeight: 30



delegate: Text { font.pixelSize: 12; text:"Theme"; height: 30;font.bold:true;}

}




}
Row {
y: 0; x: 162; spacing: 20


Image {
id: image2
source: "content/spinner-bgc.png"

}

}


Row {
y: 0; x:169; spacing: 20

Spinner {
id: spinner2
width:155; height: 125
focus: true
model: 60
itemHeight: 30
delegate: Text { font.pixelSize:12; text: "Category"; height: 30;font.bold:true}

}




}
Row {
y: 0; x:324; spacing: 20


Image {
id: image3
source: "content/spinner-bgc.png"

}

}

}
Thanks in advance