maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   Qt input dialog list view (https://talk.maemo.org/showthread.php?t=52232)

zolakt 2010-05-09 12:11

Qt input dialog list view
 
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:
http://img59.imageshack.us/img59/226...0050913583.png

And this is what I would like it to look like:
http://img301.imageshack.us/img301/4...0050914013.png

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)


krk969 2010-05-09 12:28

Re: Qt input dialog list view
 
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.

zolakt 2010-05-09 12:32

Re: Qt input dialog list view
 
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.

krk969 2010-05-09 12:46

Re: Qt input dialog list view
 
Quote:

Originally Posted by zolakt (Post 650410)
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


All times are GMT. The time now is 01:09.

vBulletin® Version 3.8.8