qt4 类型转换

其他类型转换为QString,有好多类都支持.toString()函数,如

QString Q3HttpHeader::toString () const [virtual]

Returns a string representation of the HTTP header.

The string is suitable for use by the constructor that takes a QString. It consists of lines with the format: key, colon, space, value, "\r\n".


qt4 类型转换_第1张图片





QString Class Reference


QByteArray toAscii () const
QString toCaseFolded () const
double toDouble ( bool * ok = 0 ) const
float toFloat ( bool * ok = 0 ) const
int toInt ( bool * ok = 0, int base = 10 ) const
QByteArray toLatin1 () const
QByteArray toLocal8Bit () const
long toLong ( bool * ok = 0, int base = 10 ) const
qlonglong toLongLong ( bool * ok = 0, int base = 10 ) const
QString toLower () const
short toShort ( bool * ok = 0, int base = 10 ) const
std::string toStdString () const
std::wstring toStdWString () const
uint toUInt ( bool * ok = 0, int base = 10 ) const
ulong toULong ( bool * ok = 0, int base = 10 ) const
qulonglong toULongLong ( bool * ok = 0, int base = 10 ) const
ushort toUShort ( bool * ok = 0, int base = 10 ) const
QVector<uint> toUcs4 () const
QString toUpper () const
QByteArray toUtf8 () const
int toWCharArray ( wchar_t * array ) const

你可能感兴趣的:(String,Class,qt,Constructor)