[Qt-interest] Defining large QMap

yogesh upreti yogesh.upreti at gmail.com
Tue Nov 2 08:27:33 CET 2010


Hello Andre,
Thanks for reply. I am using a similier approach, but I don't want to give
that ASCII file to user of software. Is there a way to have it as a Binary
file?
How is the method you say about using resourse file? I use that for images
and icons but never for Maps.

Thanks
Yogesh Upreti


> Message: 4
> Date: Mon, 01 Nov 2010 07:37:09 +0100
> From: Andre Somers <andre at familiesomers.nl>
> Subject: Re: [Qt-interest] Defining large QMap
> To: qt-interest at trolltech.com
> Message-ID: <4CCE6015.9000900 at familiesomers.nl>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Op 31-10-2010 23:50, yogesh upreti schreef:
> > Hello Group,
> > I need a bit help. What is a good method of defining a big Map.
> > I have around 150 key pair value. Do I have to declare the map and
> > define each element one by one or there is a elegant way of doing this??
> >
> Basically, yes, you have to do it one by one. However, you don't need to
> put a huge hardcoded list of QMap::insert statements in your code, of
> course. I usually use a file with the data, either compiled in as a
> resource or externally, and load that in. You could even use a
> QDataStream to load the whole map in one go, but that means making sure
> that your input data is in the right format.
>
> Andr?
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101102/9e8dd572/attachment.html 


More information about the Qt-interest-old mailing list