Obsolete Members for QString

以下成员源于类 QString 已过时。 提供它们是为使旧源代码能继续工作。强烈建议不要在新代码中使用它们。

公共函数

(obsolete) QString & sprintf (const char * cformat , ... )
(obsolete) QByteArray toAscii () const
(obsolete) QString & vsprintf (const char * cformat , va_list ap )

静态公共成员

(obsolete) QString fromAscii (const char * str , int size = -1)
(obsolete) QString fromAscii (const QByteArray & str )

成员函数文档编制

[static] QString QString:: fromAscii (const char * str , int size = -1)

返回 QString initialized with the first size characters from the string str .

size is -1 (default), it is taken to be strlen( str ).

This function does the same as fromLatin1 ().

另请参阅 toAscii (), fromLatin1 (), fromUtf8 (),和 fromLocal8Bit ().

[static] QString QString:: fromAscii (const QByteArray & str )

这是重载函数。

返回 QString initialized with the string str .

该函数在 Qt 5.0 引入。

QString &QString:: sprintf (const char * cformat , ... )

使用 asprintf (), arg () 或 QTextStream 代替。

QByteArray QString:: toAscii () const

Returns an 8-bit representation of the string as a QByteArray .

This function does the same as toLatin1 ().

Note that, despite the name, this function does not necessarily return an US-ASCII (ANSI X3.4-1986) string and its result may not be US-ASCII compatible.

另请参阅 fromAscii (), toLatin1 (), toUtf8 (), toLocal8Bit (),和 QTextCodec .

QString &QString:: vsprintf (const char * cformat , va_list ap )

使用 vasprintf (), arg () 或 QTextStream 代替。