PDA

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



athulms
27th July 2011, 11:57
How to add 6 strings to a spinner

athulms
28th July 2011, 06:29
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

high_flyer
28th July 2011, 11:21
What is a spinner?

FelixB
28th July 2011, 11:38
What is a spinner?

look into his other thread (http://www.qtcentre.org/threads/43472-How-to-add-multiple-strings-to-a-spinner) he created this morning. there is some code.

edit: but please don't ask me what he is doing there. I have no idea. it's not c++...

high_flyer
28th July 2011, 11:46
but please don't ask me what he is doing there. I have no idea. it's not c++...
Its QML.

.....................