Compatibility Members for QString

以下成员源于类 QString are part of the Qt compatibility layer. We advise against using them in new code.

公共函数

const char * ascii () const
QChar constref (uint i ) const
bool contains (QChar c , bool cs ) const
bool contains (const QString & s , bool cs ) const
QString copy () const
bool endsWith (const QString & s , bool cs ) const
int find (QChar c , int i = 0, bool cs = true) const
int find (const QString & s , int i = 0, bool cs = true) const
int find (const QRegExp & rx , int i = 0) const
int findRev (QChar c , int i = -1, bool cs = true) const
int findRev (const QString & s , int i = -1, bool cs = true) const
int findRev (const QRegExp & rx , int i = -1) const
const char * latin1 () const
QString leftJustify (int width , QChar fill = QLatin1Char( ' ' ), bool trunc = false) const
QByteArray local8Bit () const
QString lower () const
QChar & ref (uint i )
QString & remove (QChar c , bool cs )
QString & remove (const QString & s , bool cs )
QString & replace (QChar c , const QString & after , bool cs )
QString & replace (const QString & before , const QString & after , bool cs )
QString & replace (char c , const QString & after , bool cs )
QString & replace (char c , const QString & after , Qt::CaseSensitivity cs )
QString rightJustify (int width , QChar fill = QLatin1Char( ' ' ), bool trunc = false) const
QString & setAscii (const char * str , int len = -1)
QString & setLatin1 (const char * str , int len = -1)
void setLength (int nl )
QString & setUnicodeCodes (const ushort * unicode_as_ushorts , int size )
QString simplifyWhiteSpace () const
bool startsWith (const QString & s , bool cs ) const
QString stripWhiteSpace () const
const ushort * ucs2 () const
QString upper () const
QByteArray utf8 () const
operator const char * () const

静态公共成员

QString fromUcs2 (const ushort * unicode , int size = -1)

成员函数文档编制

const char * QString:: ascii () const

使用 toAscii () 代替。

警告: 此函数不 可重入 .

另请参阅 setAscii ().

QChar QString:: constref ( uint i ) const

使用 at () 代替。

bool QString:: contains ( QChar c , bool cs ) const

Use the contains( QChar , Qt::CaseSensitive ) overload instead.

bool QString:: contains (const QString & s , bool cs ) const

Use the contains( QString , Qt::CaseSensitive ) overload instead.

QString QString:: copy () const

Use simple assignment instead. QString is implicitly shared so if a copy is modified only the copy is changed.

bool QString:: endsWith (const QString & s , bool cs ) const

使用 endsWith ( QString , Qt::CaseSensitive ) overload instead.

int QString:: find ( QChar c , int i = 0, bool cs = true) const

使用 indexOf () 代替。

int QString:: find (const QString & s , int i = 0, bool cs = true) const

使用 indexOf () 代替。

int QString:: find (const QRegExp & rx , int i = 0) const

使用 indexOf () 代替。

int QString:: findRev ( QChar c , int i = -1, bool cs = true) const

使用 lastIndexOf () 代替。

int QString:: findRev (const QString & s , int i = -1, bool cs = true) const

使用 lastIndexOf () 代替。

int QString:: findRev (const QRegExp & rx , int i = -1) const

使用 lastIndexOf () 代替。

[static] QString QString:: fromUcs2 (const ushort * unicode , int size = -1)

使用 fromUtf16 () 代替。

const char * QString:: latin1 () const

使用 toLatin1 () 代替。

警告: 此函数不 可重入 .

另请参阅 setLatin1 ().

QString QString:: leftJustify ( int width , QChar fill = QLatin1Char( ' ' ), bool trunc = false) const

使用 leftJustified () 代替。

QByteArray QString:: local8Bit () const

使用 toLocal8Bit () 代替。

警告: 此函数不 可重入 .

QString QString:: lower () const

使用 toLower () 代替。

QChar & QString:: ref ( uint i )

Use operator[]() instead.

QString & QString:: remove ( QChar c , bool cs )

Use the remove( QChar , Qt::CaseSensitive ) overload instead.

QString & QString:: remove (const QString & s , bool cs )

Use the remove( QString , Qt::CaseSensitive ) overload instead.

QString & QString:: replace ( QChar c , const QString & after , bool cs )

Use the replace( QChar , QString , Qt::CaseSensitive ) overload instead.

QString & QString:: replace (const QString & before , const QString & after , bool cs )

Use the replace( QString , QString , Qt::CaseSensitive ) overload instead.

QString & QString:: replace ( char c , const QString & after , bool cs )

Use the replace( QChar , QString , Qt::CaseSensitive ) overload instead.

QString & QString:: replace ( char c , const QString & after , Qt::CaseSensitivity cs )

Use the replace( QChar , QString , Qt::CaseSensitive ) overload instead.

QString QString:: rightJustify ( int width , QChar fill = QLatin1Char( ' ' ), bool trunc = false) const

使用 rightJustified () 代替。

QString & QString:: setAscii (const char * str , int len = -1)

使用 fromAscii () 代替。

另请参阅 ascii ().

QString & QString:: setLatin1 (const char * str , int len = -1)

使用 fromLatin1 () 代替。

另请参阅 latin1 ().

void QString:: setLength ( int nl )

使用 resize () 代替。

另请参阅 length ().

QString & QString:: setUnicodeCodes (const ushort * unicode_as_ushorts , int size )

使用 setUtf16 () 代替。

QString QString:: simplifyWhiteSpace () const

使用 simplified () 代替。

bool QString:: startsWith (const QString & s , bool cs ) const

使用 startsWith ( QString , Qt::CaseSensitive ) overload instead.

QString QString:: stripWhiteSpace () const

使用 trimmed () 代替。

const ushort * QString:: ucs2 () const

使用 utf16 () 代替。

QString QString:: upper () const

使用 toUpper () 代替。

QByteArray QString:: utf8 () const

使用 toUtf8 () 代替。

警告: 此函数不 可重入 .

QString:: operator const char * () const

使用 toAscii (). constData () 代替。