[Qt-interest] Set a constraint on QComboBox [Make every item unique]
Aaron Lewis
aaron.lewis1989 at gmail.com
Sun Mar 14 07:54:45 CET 2010
Thank you , But i'm working on a Sql Front End , which parse Raw Sql
Queries.
So i ain't going to care for Sql Queries ..
I use ComoboBox to save user histories , so every entry need to be unique.
I've wrote a similar function to do this check , just wondering if
there's already some good ways to prevent same entries.
Robert Hairgrove wrote:
> Aaron Lewis wrote:
>
>> Hi,
>> How can i make a QComboBox has no same entries ? I mean to set an
>> restrict.
>>
>> If there's no such functions , i'd have to create one myself. (Before
>> inserting into it , check the constraint)
>>
>> Will appreciate your help ;-)
>>
>>
>
> From another thread, I noticed that you are working with a database --
> if you want to populate the combo box from a query result set, just
> write the query as "SELECT DISTINCT ... (whatever)...". Or if there is
> already a unique index on the column, then there will be no duplicates.
>
> Things like this are much easier to enforce in the database back end.
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
--
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
More information about the Qt-interest-old
mailing list