Issue with QStringList
Espen Riskedal
espenr at trolltech.com
Tue Oct 30 14:55:07 CET 2007
Pierre-Nicolas Rigal wrote:
> Hello,
> In our « normal » code, we’ve the following construction :
> enum myEnum { foo = 0, bar = 1, team = 2};
> QStringList myList;
> myList[foo] = “value1”;
> myList[bar] = “value2”;
>
> On Windows/Linux/OSX it works without problem ; under CE, I get an
> assertion failed, in QList::operator[int i]. (i is not smaller than count).
>
> If I change my code to use the << operator, it works.
> Is this expected ?
My guess is that since Windows and X11 have Qt3Support there are some
implicit casts which happen, which are not enabled when you compile
without Qt3Support.
Try wrapping them in QLatin1String like this:
myList[foo] = QLatin1String(“value1”);
and see if that helps? I haven't had time to really look into it though,
so it's just a guess.
espen
More information about the Qtce-preview-feedback
mailing list