[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: An Useful Model Proposal : KStringDataListModel
From:       David Faure <faure () kde ! org>
Date:       2007-03-01 16:14:04
Message-ID: 200703011714.04489.faure () kde ! org
[Download RAW message or body]

On Thursday 01 March 2007, Simon Hausmann wrote:
> On Wednesday 28 February 2007 19:04:07 Bruno Virlet wrote:
> > Hello,
> >
> > Willing to rewrite the tooltip editor of Kopete, I have been lacking a
> > model managing pairs of strings : one to be displayed (the label) and
> > another to be kept for internal use.
> >
> > David Faure suggested that it could be useful in many places, so I
> > wrote a model managing a pair with a QString and a QVariant, in a more
> > general design.
> >
> > Please find attached the files. I am awaiting your critics ;-)
> 
> At the risk of asking the obvious: Why not simply use a QStandardItemModel?
> 
> It seems just as simple to me:
> 
> QStandardItem *item = new QStandardItem(label);
> item->setData(yourExtraVariant);
> 
> model->appendRow(item);

Hmpf. I admit that I didn't think of doing it that way.

-- 
David Faure, faure@kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic