Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.5.3
-
None
-
9ec7bbcb96149b1ce8a2d62b55c824d71ff292a8
Description
Reading the documentation for QString::fromUtf16 [1]:
> This function is comparatively slow. Use QString(const ushort *, int) if possible.
So I did, and here is what I got:
> main.cpp:97: error: invalid conversion from 'const ushort*' to 'int'
> main.cpp:97: error: initializing argument 1 of 'QString::QString(int, QChar)'
Note that the documentation page for QString does not mention QString(const ushort *, int). The following constructors are documented:
QString ()
QString ( const QChar * unicode, int size )
QString ( QChar ch )
QString ( int size, QChar ch )
QString ( const QLatin1String & str )
QString ( const QString & other )
QString ( const char * str )
QString ( const QByteArray & ba )
The constructor QString ( const QChar * unicode, int size ) seems most appropriate; however, I think that having QString ( const ushort* unicode, int size ) would be a good thing.
[1] <URL:http://doc.trolltech.com/4.6/qstring.html#fromUtf16>