PDA

View Full Version : ComboBox into String



Nefastious
14th October 2009, 11:19
Hey guys,

I was wondering how I can obtain what a user selected in a ComboBox and put into a QString? (By the way there are two combo Boxes, one for the day of the month, the other for the month itself, and they display the currently selected day/month as a number, unless nothing is selected as in that case the comboBox displays a hyphen "-").

Code samples would be greatly appreciated.

Thanks in advance,

Nefastious

nish
14th October 2009, 11:24
what about QComboBox::currentText()

Nefastious
14th October 2009, 16:07
Well,...

the problem is currentText() returns and int and I'm not sure how to turn that into a QString...

Code samples are appriciated as usual

Thanks

spirit
14th October 2009, 16:14
currentText returns QString. what is the problem? can you elaborate it?

jano_alex_es
14th October 2009, 16:27
maybe he's thinking in itemIndex :P

Nefastious
14th October 2009, 18:25
Ooops, sorry, after all I really was using currentIndex instead of currentText (this is what happens when you try to work when you haven't slept that much...)

I'd like to thank you all for your support :)

axeljaeger
15th October 2009, 12:50
You should seriously considering not using the string. If you translate your application, the string will be different and you have to adopt the logic.