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 初始采用前 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 代替。