Remove QString::from/toAscii()
These methods have been deprecated since 5.0 Change-Id: I3ceed57a364ea59a63ccc51452ab3b4da7140ce4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>bb10
parent
ea7cc7f6f9
commit
83f5c3c26a
|
|
@ -5170,19 +5170,6 @@ QByteArray QString::toLatin1_helper_inplace(QString &s)
|
|||
\sa fromLatin1(), toUtf8(), toLocal8Bit(), QTextCodec
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn QByteArray QString::toAscii() const
|
||||
\deprecated
|
||||
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.
|
||||
|
||||
\sa fromAscii(), toLatin1(), toUtf8(), toLocal8Bit(), QTextCodec
|
||||
*/
|
||||
|
||||
static QByteArray qt_convert_to_local_8bit(QStringView string);
|
||||
|
||||
/*!
|
||||
|
|
@ -5412,29 +5399,6 @@ QString QString::fromLocal8Bit_helper(const char *str, int size)
|
|||
return fromLatin1(str, size);
|
||||
}
|
||||
|
||||
/*! \fn QString QString::fromAscii(const char *, int size);
|
||||
\deprecated
|
||||
|
||||
Returns a QString initialized with the first \a size characters
|
||||
from the string \a str.
|
||||
|
||||
If \a size is -1 (default), it is taken to be strlen(\a
|
||||
str).
|
||||
|
||||
This function does the same as fromLatin1().
|
||||
|
||||
\sa toAscii(), fromLatin1(), fromUtf8(), fromLocal8Bit()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn QString QString::fromAscii(const QByteArray &str)
|
||||
\deprecated
|
||||
\overload
|
||||
\since 5.0
|
||||
|
||||
Returns a QString initialized with the string \a str.
|
||||
*/
|
||||
|
||||
/*! \fn QString QString::fromUtf8(const char *str, int size)
|
||||
Returns a QString initialized with the first \a size bytes
|
||||
of the UTF-8 string \a str.
|
||||
|
|
@ -12239,21 +12203,6 @@ QByteArray QStringRef::toLatin1() const
|
|||
return qt_convert_to_latin1(*this);
|
||||
}
|
||||
|
||||
/*!
|
||||
\fn QByteArray QStringRef::toAscii() const
|
||||
\since 4.8
|
||||
\deprecated
|
||||
|
||||
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.
|
||||
|
||||
\sa toLatin1(), toUtf8(), toLocal8Bit(), QTextCodec
|
||||
*/
|
||||
|
||||
/*!
|
||||
\since 4.8
|
||||
|
||||
|
|
|
|||
|
|
@ -718,15 +718,6 @@ public:
|
|||
{ return fromUcs4(reinterpret_cast<const uint *>(str), size); }
|
||||
#endif
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 0)
|
||||
QT_DEPRECATED static inline QString fromAscii(const char *str, int size = -1)
|
||||
{ return fromLatin1(str, size); }
|
||||
QT_DEPRECATED static inline QString fromAscii(const QByteArray &str)
|
||||
{ return fromLatin1(str); }
|
||||
Q_REQUIRED_RESULT QByteArray toAscii() const
|
||||
{ return toLatin1(); }
|
||||
#endif
|
||||
|
||||
inline int toWCharArray(wchar_t *array) const;
|
||||
Q_REQUIRED_RESULT static inline QString fromWCharArray(const wchar_t *string, int size = -1);
|
||||
|
||||
|
|
@ -1594,10 +1585,6 @@ public:
|
|||
inline const_reverse_iterator rend() const { return const_reverse_iterator(begin()); }
|
||||
inline const_reverse_iterator crend() const { return rend(); }
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 0)
|
||||
Q_REQUIRED_RESULT QT_DEPRECATED QByteArray toAscii() const
|
||||
{ return toLatin1(); }
|
||||
#endif
|
||||
Q_REQUIRED_RESULT QByteArray toLatin1() const;
|
||||
Q_REQUIRED_RESULT QByteArray toUtf8() const;
|
||||
Q_REQUIRED_RESULT QByteArray toLocal8Bit() const;
|
||||
|
|
|
|||
|
|
@ -522,9 +522,6 @@ private slots:
|
|||
void stringRef_local8Bit_data();
|
||||
void stringRef_local8Bit();
|
||||
void fromLatin1();
|
||||
#if QT_DEPRECATED_SINCE(5, 0)
|
||||
void fromAscii();
|
||||
#endif
|
||||
void fromUcs4();
|
||||
void toUcs4();
|
||||
void arg();
|
||||
|
|
@ -4612,32 +4609,6 @@ void tst_QString::fromLatin1()
|
|||
QVERIFY(a.size() == 5);
|
||||
}
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 0)
|
||||
QT_WARNING_PUSH
|
||||
QT_WARNING_DISABLE_DEPRECATED
|
||||
void tst_QString::fromAscii()
|
||||
{
|
||||
QString a;
|
||||
a = QString::fromAscii( 0 );
|
||||
QVERIFY( a.isNull() );
|
||||
QVERIFY( a.isEmpty() );
|
||||
a = QString::fromAscii( "" );
|
||||
QVERIFY( !a.isNull() );
|
||||
QVERIFY( a.isEmpty() );
|
||||
|
||||
a = QString::fromAscii(0, 0);
|
||||
QVERIFY(a.isNull());
|
||||
a = QString::fromAscii(0, 5);
|
||||
QVERIFY(a.isNull());
|
||||
a = QString::fromAscii("\0abcd", 0);
|
||||
QVERIFY(!a.isNull());
|
||||
QVERIFY(a.isEmpty());
|
||||
a = QString::fromAscii("\0abcd", 5);
|
||||
QVERIFY(a.size() == 5);
|
||||
}
|
||||
QT_WARNING_POP
|
||||
#endif
|
||||
|
||||
void tst_QString::fromUcs4()
|
||||
{
|
||||
const uint *null = 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue