comboboxes - sorted lists in KDE4 - idea

Thomas Zander zander at kde.org
Thu Feb 22 12:58:33 GMT 2007


On Thursday 22 February 2007 13:35, you wrote:
> On Thursday 22 February 2007, Thomas Zander wrote:
> > More importantly; there is no generic method in KDE to store items that
> > can be translated in a combobox and get the untranslated 'key' back when
> > a user selects something. This is the main reason people insert items in
> > a static ordering.
>
> There is in Qt4.
>   void QComboBox::insertItem ( int index, const QString & text, const
> QVariant & userData = QVariant() ); QVariant QComboBox::itemData ( int
> index, int role = Qt::UserRole ) const;

so, it would be possible to have a;
  void KComboBox::addItems(QList<KLocalizedString>, Sorting sorting=Unsorted);
and a signal:
  void KComboBox::activatedKey(const QString &key);
assuming we add a key() method on the KLocalizedString which returns a 
QString...

I'm not sure the sorting will be used a lot, but the rest would certainly be 
useful :)
-- 
Thomas Zander
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070222/0b732cc5/attachment.sig>


More information about the kde-core-devel mailing list