From kde-core-devel Thu Mar 01 12:24:00 2007 From: Simon Hausmann Date: Thu, 01 Mar 2007 12:24:00 +0000 To: kde-core-devel Subject: Re: An Useful Model Proposal : KStringDataListModel Message-Id: <200703011324.00803.hausmann () kde ! org> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=117275192912783 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--nextPart1255112.rUBpYaBmIm" --nextPart1255112.rUBpYaBmIm Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline 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); Simon --nextPart1255112.rUBpYaBmIm Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQBF5sXgWXvMThJCpvIRAmyIAJoCWxEvUVGBuCuEMqdn2EEvdVOKPgCg0HwZ JxbJCGCa0RvT7v/mAUKZHsU= =FxMn -----END PGP SIGNATURE----- --nextPart1255112.rUBpYaBmIm--