PDA

View Full Version : QStringList or QList , which is faster



BalaQT
2nd April 2010, 12:03
hi , i am using qt4.5 in debian
im using QStringList for storing and retreiving strings.

i want to know which is faster , QList or QStringList

QStringlist itself inherited from QList.

so Using qlist (instead of qstringlist) will be faster??

pls guide me

Bala

toutarrive
2nd April 2010, 13:09
Have look at http://qt.nokia.com/doc/4.6/containers.html#algorithmic-complexity

wysota
2nd April 2010, 13:51
so Using qlist (instead of qstringlist) will be faster??

Why would it be faster if it shares almost 100% of the code with QStringList? QStringList just has some additional methods which make operating on strings easier.

BalaQT
3rd April 2010, 08:48
Thnks wysota/ toutarrive,
QList <QString> = QStringList
im using only basic functions on string like addto list, read from index only.
so i thought of using qlist<QString> rather than QStringList.

but more or less QStringList=QList <QString>
Thnks
Bala