QStringList in QT/Win32 port

David Tio deux at arklinux.org
Wed Sep 1 04:45:55 CEST 2004

Hi all, 

Is anyone using QStringList in QT/Win32 port? I am having a problem with the 
following code:

#include <qapplication.h>

int main(int argc, char* argv[])
        QApplication a(argc, argv);

        QString line = "Hello:this:is:just:a:test";
        QStringList list = QStringList::split(":", line);
        qWarning(list[1]); //<--- this is the problematic part... this line     
      //crash on me

        return a.exec();

Now the funny part is the following line works
QString newline = line.join("-");

So I hunt to qstringlist.cpp in the src/tools/qstringlist.cpp and notice that 
the function join is using QStringList::ConstIterator... so I create the 
following line:
QStringList::ConstIterator it = line.begin(); // crash on me as well
then I tried....
QStringList::Iterator it = line.begin(); //also crash on me

It doesn't seems to make sense to me because QStringList::ConstIterator is 
used by QStringList::join(); 

Can someone enlighten me?

Warmest Regards, 

David Tio aka DeuX

More information about the kde-cygwin mailing list