Active Topics

 


Reply
Thread Tools
Posts: 58 | Thanked: 10 times | Joined on Dec 2009
#1
Hi,
I have a QInputDialog in which the user selects some options.
The thing I don't like is that it displays a combobox in the dialog.
Then you have to click on the combobox, and another dialog appears where you can select your value.

Is it possible to get rid of the combobox, and have only the selection list in the first dialog.

Maybe some screenshots will clarify:
This is what I have now:


And this is what I would like it to look like:


Btw. I'm using python
My current code:
Code:
items = QtCore.QStringList()
items << "Female" << "Male"
	
item, ok = QtGui.QInputDialog.getItem(self, 'Select voice type', "", items, 0, False)

Last edited by zolakt; 2010-05-09 at 12:28.
 
krk969's Avatar
Posts: 754 | Thanked: 630 times | Joined on Sep 2009 @ London
#2
try using a QDialog or subclassing it.

In a QDialog you could add whatever widget suits you, in this case it seems to me you would like something that could be checked.
Perhaps QRadioButton or QCheckbox might help.
__________________
Developer of :
Buddy - budget/expense manager ( website )
Showtime - a telly channel listing viewer/reminder ( website )
Travelapp - london underground status/planner ( website )
Batlevel - desktop widget for battery level ( website )

“I hear and I forget. I see and I remember. I do and I understand.”
 
Posts: 58 | Thanked: 10 times | Joined on Dec 2009
#3
Hmmm...I'd like to avoid creating another custom dialog.

But regardless, radio buttons are not the way.
They are poorly ported, for this use, anyway.
They look like "normal radio buttons", and I couldn't get them to expand horizontally, so you have to click on the (very) little circle, or the label to select.
Checkbox is also not the answer, because I don't need multiple selection

I was hopping I could just pass some flag to QInputDialog.

Last edited by zolakt; 2010-05-09 at 12:35.
 
krk969's Avatar
Posts: 754 | Thanked: 630 times | Joined on Sep 2009 @ London
#4
Originally Posted by zolakt View Post
Hmmm...I'd like to avoid creating another custom dialog.

But regardless, radio buttons are not the way.
They are poorly ported, for this use, anyway.
They look like "normal radio buttons", and I couldn't get them to expand horizontally, so you have to click on the (very) little circle, or the label to select.
Checkbox is also not the answer, because I don't need multiple selection

I was hopping I could just pass some flag to QInputDialog.
well radio buttons are properly implemented in maemo5 style(unless you have changed styles in your app) to be big and large with a default height of 70px I think just like a pushbutton.
You can change the width with setMaximumSize.

Even the checkbox is the same case albeit its a bit smaller.

You can switch off multiple selection in both setting the auto exclusive property
__________________
Developer of :
Buddy - budget/expense manager ( website )
Showtime - a telly channel listing viewer/reminder ( website )
Travelapp - london underground status/planner ( website )
Batlevel - desktop widget for battery level ( website )

“I hear and I forget. I see and I remember. I do and I understand.”

Last edited by krk969; 2010-05-09 at 12:48.
 

The Following User Says Thank You to krk969 For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 12:44.