[KDE-India] Setting Value-Label pair for Combo box

Rajeev J Sebastian rajeev_jsv at dinamis.com
Fri Mar 24 12:45:38 CET 2006


On Friday 24 March 2006 17:12, Aditya Mooley wrote:
> On 3/24/06, Rajeev J Sebastian <rajeev_jsv at dinamis.com> wrote:
> > On Friday 24 March 2006 16:24, Aditya Mooley wrote:
> > > Is it possible to have Value-Label pair in KComboBox like we have in
> >
> > HTML
> >
> > > SELECT Element?
> > >
> > > I searched the KDE docs for the same but didn't found anything.
> >
> > Subclass the Combobox and use a dictionary (QMap). Labels (combo items)
> > are
> > unique in a combobox, and can be mapped to values.
>
> It is not possible to keep labels unique in my case. Looks like I have to
> drop the idea of using Combo box and start using ListView instead.
If the label is not unique, then the user is going to find it difficult to use 
the application. So, you would have to add another disambiguating element, 
perhaps another column of text or an icon. The combination of the 2 has to be 
unique, in which case you can use a QMap.

Regards,
Rajeev J Sebastian


More information about the KDE-india mailing list