Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 6

Qt-interest Archive, May 2008
QComboBox initial value from QDataWidgetMapper


Message 1 in thread

Greetings,

I have some simple forms with controls mapped to models by QDataWidgetMapper. 
Everything works fine except comboboxes, which display a blank value or a â1â 
instead of the actual value.

It looks like this (also see attached):

+------+-+
| 1    |v|
+------+-+
| Item 1 |
| Item 2 |
| Item 3 |
+--------+

When I choose an item, the â1â disappears. However, that leaves no way to see 
the original value of the field.

Do I have to call setCurrentIndex manually? How can I ensure the QComboBox 
shows the correct value from the very beginning? This happens irrespective of 
whether there are delegates.

-- 
 [ signature omitted ] 

PNG image

Attachment: smime.p7s
Description: S/MIME cryptographic signature


Message 2 in thread

OK, Iâve found out a way to âfixâ this. If QComboBox::{setModel,setModelColumn} come before QDataWidgetMapper::setCurrentIndex, then the box works properly.

-- 
 [ signature omitted ] 

Attachment: smime.p7s
Description: S/MIME cryptographic signature